typescript-language-server 3.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +10 -0
- package/lib/cli.mjs +1 -1
- package/lib/cli.mjs.map +1 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import e,{statSync as t,existsSync as n,readFileSync as r}from"node:fs";import i from"events";import o from"child_process";import s from"path";import a from"fs";import c from"process";import u,{promisify as l}from"util";import h from"os";import d from"crypto";import p from"net";import f from"url";import*as m from"node:path";import g,{resolve as y}from"node:path";import v from"constants";import b from"stream";import S from"assert";import"node:fs/promises";import w from"node:stream";import{promisify as R}from"node:util";import _ from"node:child_process";import{createRequire as E}from"node:module";import{fileURLToPath as C}from"node:url";import D from"node:process";var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function k(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function x(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];n.push.apply(n,arguments);var r=Function.bind.apply(t,n);return new r}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var P={},O={get exports(){return P},set exports(e){P=e}},N={},q={};let I=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}};q.CommanderError=I,q.InvalidArgumentError=class extends I{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:A}=q;N.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new A(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},N.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"};var M={},F={};const{humanReadableArgName:L}=N;F.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));if(e._hasImplicitHelpCommand()){const[,n,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),i=e.createCommand(n).helpOption(!1);i.description(e._helpCommandDescription),r&&i.arguments(r),t.push(i)}return this.sortSubcommands&&t.sort(((e,t)=>e.name().localeCompare(t.name()))),t}compareOptions(e,t){const n=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){const t=e.options.filter((e=>!e.hidden)),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||r){let i;i=n?r?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let n=e.parent;n;n=n.parent){const e=n.options.filter((e=>!e.hidden));t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e._args.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""})),e._args.find((e=>e.description))?e._args:[]}subcommandTerm(e){const t=e._args.map((e=>L(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce(((e,n)=>Math.max(e,t.subcommandTerm(n).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,n)=>Math.max(e,t.argumentTerm(n).length)),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let t=e.parent;t;t=t.parent)n=t.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth||80;function i(e,i){if(i){const o=`${e.padEnd(n+2)}${i}`;return t.wrap(o,r-2,n+2)}return e}function o(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);a.length>0&&(s=s.concat([t.wrap(a,r,0),""]));const c=t.visibleArguments(e).map((e=>i(t.argumentTerm(e),t.argumentDescription(e))));c.length>0&&(s=s.concat(["Arguments:",o(c),""]));const u=t.visibleOptions(e).map((e=>i(t.optionTerm(e),t.optionDescription(e))));if(u.length>0&&(s=s.concat(["Options:",o(u),""])),this.showGlobalOptions){const n=t.visibleGlobalOptions(e).map((e=>i(t.optionTerm(e),t.optionDescription(e))));n.length>0&&(s=s.concat(["Global Options:",o(n),""]))}const l=t.visibleCommands(e).map((e=>i(t.subcommandTerm(e),t.subcommandDescription(e))));return l.length>0&&(s=s.concat(["Commands:",o(l),""])),s.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){const i=new RegExp("[\\n][ \\f\\t\\v - \ufeff]+");if(e.match(i))return e;const o=t-n;if(o<r)return e;const s=e.slice(0,n),a=e.slice(n).replace("\r\n","\n"),c=" ".repeat(n),u="\\s",l=new RegExp(`\n|.{1,${o-1}}([${u}]|$)|[^${u}]+?([${u}]|$)`,"g");return s+(a.match(l)||[]).map(((e,t)=>"\n"===e?"":(t>0?c:"")+e.trimEnd())).join("\n")}};var j={};const{InvalidArgumentError:$}=q;function H(e){let t,n;const r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0),{shortFlag:t,longFlag:n}}j.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=H(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){return this.implied=Object.assign(this.implied||{},e),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new $(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},j.splitOptionFlags=H,j.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)})),this.negativeOptions.forEach(((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)}))}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,i=void 0!==r&&r;return t.negate===(i===e)}};var W={};W.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const n=e.startsWith("--");n&&(e=e.slice(2),t=t.map((e=>e.slice(2))));let r=[],i=3;return t.forEach((t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let o=1;o=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+o),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}(e,t),o=Math.max(e.length,t.length);(o-n)/o>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))})),r.sort(((e,t)=>e.localeCompare(t))),n&&(r=r.map((e=>`--${e}`))),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""};const V=i.EventEmitter,U=o,K=s,G=a,z=c,{Argument:B,humanReadableArgName:J}=N,{CommanderError:X}=q,{Help:Y}=F,{Option:Q,splitOptionFlags:Z,DualOptions:ee}=j,{suggestSimilar:te}=W;let ne=class extends V{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>z.stdout.write(e),writeErr:e=>z.stderr.write(e),getOutHelpWidth:()=>z.stdout.isTTY?z.stdout.columns:void 0,getErrHelpWidth:()=>z.stderr.isTTY?z.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,t,n){let r=t,i=n;"object"==typeof r&&null!==r&&(i=r,r=null),i=i||{};const[,o,s]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(o);return r&&(a.description(r),a._executableHandler=!0),i.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!i.noHelp&&!i.hidden),a._executableFile=i.executableFile||null,s&&a.arguments(s),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(e){return new ne(e)}createHelp(){return Object.assign(new Y,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new B(e,t)}argument(e,t,n,r){const i=this.createArgument(e,t);return"function"==typeof n?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.split(/ +/).forEach((e=>{this.argument(e)})),this}addArgument(e){const t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new X(e,t,n)),z.exit(e)}action(e){return this._actionHandler=t=>{const n=this._args.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new Q(e,t)}addOption(e){const t=e.name(),n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(n,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(n,e.defaultValue,"default");this.options.push(e);const r=(t,r,i)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const o=this.getOptionValue(n);if(null!==t&&e.parseArg)try{t=e.parseArg(t,o)}catch(e){if("commander.invalidArgument"===e.code){const t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,o));null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(n,t,i)};return this.on("option:"+t,(t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,"cli")})),e.envVar&&this.on("optionEnv:"+t,(t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,"env")})),this}_optionEx(e,t,n,r,i){if("object"==typeof t&&t instanceof Q)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const o=this.createOption(t,n);if(o.makeOptionMandatory(!!e.mandatory),"function"==typeof r)o.default(i).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},o.default(i).argParser(r)}else o.default(r);return this.addOption(o)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return oe(this).forEach((n=>{void 0!==n.getOptionValueSource(e)&&(t=n.getOptionValueSource(e))})),t}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let n;switch(t=t||{},void 0===e&&(e=z.argv,z.versions&&z.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":z.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function i(e,t){const n=K.resolve(e,t);if(G.existsSync(n))return n;if(r.includes(K.extname(t)))return;const i=r.find((e=>G.existsSync(`${n}${e}`)));return i?`${n}${i}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o,s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let e;try{e=G.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}a=K.resolve(K.dirname(e),a)}if(a){let t=i(a,s);if(!t&&!e._executableFile&&this._scriptPath){const n=K.basename(this._scriptPath,K.extname(this._scriptPath));n!==this._name&&(t=i(a,`${n}-${e._name}`))}s=t||s}if(n=r.includes(K.extname(s)),"win32"!==z.platform?n?(t.unshift(s),t=ie(z.execArgv).concat(t),o=U.spawn(z.argv[0],t,{stdio:"inherit"})):o=U.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=ie(z.execArgv).concat(t),o=U.spawn(z.execPath,t,{stdio:"inherit"})),!o.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{z.on(e,(()=>{!1===o.killed&&null===o.exitCode&&o.kill(e)}))}))}const c=this._exitCallback;c?o.on("close",(()=>{c(new X(z.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):o.on("close",z.exit.bind(z)),o.on("error",(t=>{if("ENOENT"===t.code){const t=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${s}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(n)}if("EACCES"===t.code)throw new Error(`'${s}' not executable`);if(c){const e=new X(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,c(e)}else z.exit(1)})),this.runningCommand=o}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);let i;return r||this.help({error:!0}),i=this._chainOrCallSubCommandHook(i,r,"preSubcommand"),i=this._chainOrCall(i,(()=>{if(!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))})),i}_checkNumberOfArguments(){this._args.forEach(((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg)try{r=e.parseArg(t,n)}catch(n){if("commander.invalidArgument"===n.code){const r=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${n.message}`;this.error(r,{exitCode:n.exitCode,code:n.code})}throw n}return r};this._checkNumberOfArguments();const t=[];this._args.forEach(((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce(((t,r)=>e(n,r,t)),n.defaultValue))):void 0===i&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i})),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then((()=>t())):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return oe(this).reverse().filter((e=>void 0!==e._lifeCycleHooks[t])).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{r.push({hookedCommand:e,callback:t})}))})),"postAction"===t&&r.reverse(),r.forEach((e=>{n=this._chainOrCall(n,(()=>e.callback(e.hookedCommand,this)))})),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach((e=>{r=this._chainOrCall(r,(()=>e(this,t)))})),r}_parseCommand(e,t){const n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return re(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),re(this,n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs))),this.parent&&(n=this._chainOrCall(n,(()=>{this.parent.emit(i,e,t)}))),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find((t=>t._name===e||t._aliases.includes(e)))}_findOption(e){return this.options.find((t=>t.is(e)))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach((t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)})),t=e.filter((e=>e.conflictsWith.length>0));t.forEach((t=>{const n=e.find((e=>t.conflictsWith.includes(e.attributeName())));n&&this._conflictingOption(t,n)}))}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){const t=[],n=[];let r=t;const i=e.slice();function o(e){return e.length>1&&"-"===e[0]}let s=null;for(;i.length;){const e=i.shift();if("--"===e){r===n&&r.push(e),r.push(...i);break}if(!s||o(e)){if(s=null,o(e)){const t=this._findOption(e);if(t){if(t.required){const e=i.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;i.length>0&&!o(i[0])&&(e=i.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);s=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),i.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(o(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(e)){t.push(e),i.length>0&&n.push(...i);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),i.length>0&&t.push(...i);break}if(this._defaultCommandName){n.push(e),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}else this.emit(`option:${s.name()}`,e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return oe(this).reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=t||{},r=n.exitCode||1,i=n.code||"commander.error";this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in z.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,z.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}}))}_parseOptionsImplied(){const e=new ee(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((n=>void 0!==n.implied&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n))).forEach((e=>{Object.keys(e.implied).filter((e=>!t(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const n=e=>{const t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find((e=>e.negate&&t===e.attributeName())),i=this.options.find((e=>!e.negate&&t===e.attributeName()));return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:i||e},r=e=>{const t=n(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const e=r.createHelp().visibleOptions(r).filter((e=>e.long)).map((e=>e.long));n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=te(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this._args.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach((e=>{n.push(e.name()),e.alias()&&n.push(e.alias())})),t=te(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)})),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach((e=>this.alias(e))),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this._args.map((e=>J(e)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=K.basename(e,K.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getHelpContext(e);oe(this).reverse().forEach((e=>e.emit("beforeAllHelp",n))),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t&&(r=t(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",n),oe(this).forEach((e=>e.emit("afterAllHelp",n)))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const n=Z(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let t=z.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${e}Help`;return this.on(r,(e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)})),this}};function re(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function ie(e){return e.map((e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",i="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],i=n[4]),t&&"0"!==i?`${t}=${r}:${parseInt(i)+1}`:e}))}function oe(e){const t=[];for(let n=e;n;n=n.parent)t.push(n);return t}M.Command=ne,function(e,t){const{Argument:n}=N,{Command:r}=M,{CommanderError:i,InvalidArgumentError:o}=q,{Help:s}=F,{Option:a}=j;(t=e.exports=new r).program=t,t.Argument=n,t.Command=r,t.CommanderError=i,t.Help=s,t.InvalidArgumentError=o,t.InvalidOptionArgumentError=o,t.Option=a}(O,P);const se=P,{program:ae,createCommand:ce,createArgument:ue,createOption:le,CommanderError:he,InvalidArgumentError:de,InvalidOptionArgumentError:pe,Command:fe,Argument:me,Option:ge,Help:ye}=se;var ve={},be={};function Se(e){return"string"==typeof e||e instanceof String}function we(e){return"function"==typeof e}function Re(e){return Array.isArray(e)}Object.defineProperty(be,"__esModule",{value:!0}),be.thenable=be.typedArray=be.stringArray=be.array=be.func=be.error=be.number=be.string=be.boolean=void 0,be.boolean=function(e){return!0===e||!1===e},be.string=Se,be.number=function(e){return"number"==typeof e||e instanceof Number},be.error=function(e){return e instanceof Error},be.func=we,be.array=Re,be.stringArray=function(e){return Re(e)&&e.every((e=>Se(e)))},be.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},be.thenable=function(e){return e&&we(e.then)};var _e={},Ee={},Ce={},De={get exports(){return Ce},set exports(e){Ce=e}},Te={},ke={},xe={};let Pe;function Oe(){if(void 0===Pe)throw new Error("No runtime abstraction layer installed");return Pe}Object.defineProperty(xe,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");Pe=e}}(Oe||(Oe={})),xe.default=Oe;var Ne,qe={};Ne=qe,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.Disposable=void 0,(Ne.Disposable||(Ne.Disposable={})).create=function(e){return{dispose:e}};var Ie={};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.AbstractMessageBuffer=void 0;Ie.AbstractMessageBuffer=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t="string"==typeof e?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(){if(0===this._chunks.length)return;let e=0,t=0,n=0,r=0;e:for(;t<this._chunks.length;){const i=this._chunks[t];for(n=0;n<i.length;){switch(i[n]){case 13:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case 10:switch(e){case 1:e=2;break;case 3:e=4,n++;break e;default:e=0}break;default:e=0}n++}r+=i.byteLength,t++}if(4!==e)return;const i=this._read(r+n),o=new Map,s=this.toString(i,"ascii").split("\r\n");if(s.length<2)return o;for(let e=0;e<s.length-2;e++){const t=s[e],n=t.indexOf(":");if(-1===n)throw new Error("Message header must separate key and value using :");const r=t.substr(0,n),i=t.substr(n+1).trim();o.set(r,i)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(0===e)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){const t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}const t=this.allocNative(e);let n=0;for(;e>0;){const r=this._chunks[0];if(r.byteLength>e){const i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}},Object.defineProperty(ke,"__esModule",{value:!0});const Ae=xe,Me=u,Fe=qe,Le=Ie;class je extends Le.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return je.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new Me.TextDecoder(t).decode(e)}asNative(e,t){return void 0===t?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}}je.emptyBuffer=Buffer.allocUnsafe(0);class $e{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Fe.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),Fe.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),Fe.Disposable.create((()=>this.stream.off("end",e)))}onData(e){return this.stream.on("data",e),Fe.Disposable.create((()=>this.stream.off("data",e)))}}class He{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Fe.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),Fe.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),Fe.Disposable.create((()=>this.stream.off("end",e)))}write(e,t){return new Promise(((n,r)=>{const i=e=>{null==e?n():r(e)};"string"==typeof e?this.stream.write(e,t,i):this.stream.write(e,i)}))}end(){this.stream.end()}}const We=Object.freeze({messageBuffer:Object.freeze({create:e=>new je(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(e){return Promise.reject(e)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new Me.TextDecoder(t.charset).decode(e)))}catch(e){return Promise.reject(e)}}})}),stream:Object.freeze({asReadableStream:e=>new $e(e),asWritableStream:e=>new He(e)}),console:console,timer:Object.freeze({setTimeout(e,t,...n){const r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){const n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){const r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function Ve(){return We}!function(e){e.install=function(){Ae.default.install(We)}}(Ve||(Ve={})),ke.default=Ve;var Ue,Ke,Ge={},ze={},Be={};function Je(){if(Ue)return Be;function e(e){return"string"==typeof e||e instanceof String}function t(e){return Array.isArray(e)}return Ue=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.stringArray=Be.array=Be.func=Be.error=Be.number=Be.string=Be.boolean=void 0,Be.boolean=function(e){return!0===e||!1===e},Be.string=e,Be.number=function(e){return"number"==typeof e||e instanceof Number},Be.error=function(e){return e instanceof Error},Be.func=function(e){return"function"==typeof e},Be.array=t,Be.stringArray=function(n){return t(n)&&n.every((t=>e(t)))},Be}function Xe(){return Ke||(Ke=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;const t=Je();var n,r;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3}(n=e.ErrorCodes||(e.ErrorCodes={}));class i extends Error{constructor(e,r,o){super(r),this.code=t.number(e)?e:n.UnknownErrorCode,this.data=o,Object.setPrototypeOf(this,i.prototype)}toJson(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}}e.ResponseError=i;class o{constructor(e){this.kind=e}static is(e){return e===o.auto||e===o.byName||e===o.byPosition}toString(){return this.kind}}e.ParameterStructures=o,o.auto=new o("auto"),o.byPosition=new o("byPosition"),o.byName=new o("byName");class s{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return o.auto}}e.AbstractMessageSignature=s;e.RequestType0=class extends s{constructor(e){super(e,0)}};e.RequestType=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.RequestType1=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.RequestType2=class extends s{constructor(e){super(e,2)}};e.RequestType3=class extends s{constructor(e){super(e,3)}};e.RequestType4=class extends s{constructor(e){super(e,4)}};e.RequestType5=class extends s{constructor(e){super(e,5)}};e.RequestType6=class extends s{constructor(e){super(e,6)}};e.RequestType7=class extends s{constructor(e){super(e,7)}};e.RequestType8=class extends s{constructor(e){super(e,8)}};e.RequestType9=class extends s{constructor(e){super(e,9)}};e.NotificationType=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.NotificationType0=class extends s{constructor(e){super(e,0)}};e.NotificationType1=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.NotificationType2=class extends s{constructor(e){super(e,2)}};e.NotificationType3=class extends s{constructor(e){super(e,3)}};e.NotificationType4=class extends s{constructor(e){super(e,4)}};e.NotificationType5=class extends s{constructor(e){super(e,5)}};e.NotificationType6=class extends s{constructor(e){super(e,6)}};e.NotificationType7=class extends s{constructor(e){super(e,7)}};e.NotificationType8=class extends s{constructor(e){super(e,8)}};e.NotificationType9=class extends s{constructor(e){super(e,9)}},(r=e.Message||(e.Message={})).isRequest=function(e){const n=e;return n&&t.string(n.method)&&(t.string(n.id)||t.number(n.id))},r.isNotification=function(e){const n=e;return n&&t.string(n.method)&&void 0===e.id},r.isResponse=function(e){const n=e;return n&&(void 0!==n.result||!!n.error)&&(t.string(n.id)||t.number(n.id)||null===n.id)}}(ze)),ze}var Ye,Qe={};function Ze(){return Ye||(Ye=1,function(e){var t,n;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0,function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last}(n=e.Touch||(e.Touch={}));class r{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){const r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===n.First||t===n.Last)if(t===n.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}e.LinkedMap=r;e.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}}(Qe)),Qe}var et,tt={};function nt(){return et||(et=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;const t=xe;!function(e){const t={dispose(){}};e.None=function(){return t}}(e.Event||(e.Event={}));class n{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t)return this._callbacks.splice(r,1),void this._contexts.splice(r,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],e))}catch(e){(0,t.default)().console.error(e)}return n}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const o={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),o.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}e.Emitter=r,r._noop=function(){}}(tt)),tt}var rt,it={};function ot(){return rt||(rt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;const t=xe,n=Je(),r=nt();var i;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None}),e.is=function(t){const r=t;return r&&(r===e.None||r===e.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}}(i=e.CancellationToken||(e.CancellationToken={}));const o=Object.freeze((function(e,n){const r=(0,t.default)().timer.setTimeout(e.bind(n),0);return{dispose(){r.dispose()}}}));class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?o:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}e.CancellationTokenSource=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}}}(it)),it}var st,at={};var ct,ut,lt={},ht={};function dt(){return ut||(ut=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;const t=xe,n=Je(),r=function(){if(ct)return ht;ct=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.Semaphore=void 0;const e=xe;return ht.Semaphore=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise(((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()}))}get active(){return this._active}runNext(){0!==this._waiting.length&&this._active!==this._capacity&&(0,e.default)().timer.setImmediate((()=>this.doRunNext()))}doRunNext(){if(0===this._waiting.length||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then((t=>{this._active--,e.resolve(t),this.runNext()}),(t=>{this._active--,e.reject(t),this.runNext()})):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}},ht}(),i=nt();var o;(e.MessageWriter||(e.MessageWriter={})).is=function(e){let t=e;return t&&n.func(t.dispose)&&n.func(t.onClose)&&n.func(t.onError)&&n.func(t.write)};class s{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${n.string(e.message)?e.message:"unknown"}`)}}e.AbstractMessageWriter=s,function(e){e.fromOptions=function(e){return void 0===e||"string"==typeof e?{charset:e??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:e.charset??"utf-8",contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}}(o||(o={}));e.WriteableStreamMessageWriter=class extends s{constructor(e,t){super(),this.writable=e,this.options=o.fromOptions(t),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError((e=>this.fireError(e))),this.writable.onClose((()=>this.fireClose()))}async write(e){return this.writeSemaphore.lock((async()=>this.options.contentTypeEncoder.encode(e,this.options).then((e=>void 0!==this.options.contentEncoder?this.options.contentEncoder.encode(e):e)).then((t=>{const n=[];return n.push("Content-Length: ",t.byteLength.toString(),"\r\n"),n.push("\r\n"),this.doWrite(e,n,t)}),(e=>{throw this.fireError(e),e}))))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}}(lt)),lt}var pt,ft,mt={};function gt(){return pt||(pt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;const t=xe,n=Je(),r=Xe(),i=Ze(),o=nt(),s=ot();var a,c,u,l,h,d,p,f,m,g,y,v,b,S,w;!function(e){e.type=new r.NotificationType("$/cancelRequest")}(a||(a={})),function(e){e.is=function(e){return"string"==typeof e||"number"==typeof e}}(c=e.ProgressToken||(e.ProgressToken={})),function(e){e.type=new r.NotificationType("$/progress")}(u||(u={}));e.ProgressType=class{constructor(){}},function(e){e.is=function(e){return n.func(e)}}(l||(l={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"}(h=e.Trace||(e.Trace={})),(d=e.TraceValues||(e.TraceValues={})).Off="off",d.Messages="messages",d.Compact="compact",d.Verbose="verbose",function(e){e.fromString=function(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}}(h=e.Trace||(e.Trace={})),function(e){e.Text="text",e.JSON="json"}(e.TraceFormat||(e.TraceFormat={})),function(e){e.fromString=function(t){return n.string(t)&&"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(p=e.TraceFormat||(e.TraceFormat={})),function(e){e.type=new r.NotificationType("$/setTrace")}(f=e.SetTraceNotification||(e.SetTraceNotification={})),function(e){e.type=new r.NotificationType("$/logTrace")}(m=e.LogTraceNotification||(e.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(g=e.ConnectionErrors||(e.ConnectionErrors={}));class R extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,R.prototype)}}e.ConnectionError=R,function(e){e.is=function(e){const t=e;return t&&n.func(t.cancelUndispatched)}}(y=e.ConnectionStrategy||(e.ConnectionStrategy={})),function(e){e.Message=Object.freeze({createCancellationTokenSource:e=>new s.CancellationTokenSource}),e.is=function(e){const t=e;return t&&n.func(t.createCancellationTokenSource)}}(v=e.CancellationReceiverStrategy||(e.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation:(e,t)=>e.sendNotification(a.type,{id:t}),cleanup(e){}}),e.is=function(e){const t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)}}(b=e.CancellationSenderStrategy||(e.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:v.Message,sender:b.Message}),e.is=function(e){const t=e;return t&&v.is(t.receiver)&&b.is(t.sender)}}(S=e.CancellationStrategy||(e.CancellationStrategy={})),(e.ConnectionOptions||(e.ConnectionOptions={})).is=function(e){const t=e;return t&&(S.is(t.cancellationStrategy)||y.is(t.connectionStrategy))},function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(w||(w={})),e.createMessageConnection=function(d,y,v,b){const _=void 0!==v?v:e.NullLogger;let E=0,C=0,D=0;const T="2.0";let k;const x=new Map;let P;const O=new Map,N=new Map;let q,I,A=new i.LinkedMap,M=new Map,F=new Set,L=new Map,j=h.Off,$=p.Text,H=w.New;const W=new o.Emitter,V=new o.Emitter,U=new o.Emitter,K=new o.Emitter,G=new o.Emitter,z=b&&b.cancellationStrategy?b.cancellationStrategy:S.Message;function B(e){if(null===e)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+e.toString()}function J(e,t){var n;r.Message.isRequest(t)?e.set(B(t.id),t):r.Message.isResponse(t)?e.set(null===(n=t.id)?"res-unknown-"+(++D).toString():"res-"+n.toString(),t):e.set("not-"+(++C).toString(),t)}function X(e){}function Y(){return H===w.Listening}function Q(){return H===w.Closed}function Z(){return H===w.Disposed}function ee(){H!==w.New&&H!==w.Listening||(H=w.Closed,V.fire(void 0))}function te(){q||0===A.size||(q=(0,t.default)().timer.setImmediate((()=>{q=void 0,function(){if(0===A.size)return;const e=A.shift();try{r.Message.isRequest(e)?function(e){if(Z())return;function t(t,n,i){const o={jsonrpc:T,id:e.id};t instanceof r.ResponseError?o.error=t.toJson():o.result=void 0===t?null:t,ie(o,n,i),y.write(o).catch((()=>_.error("Sending response failed.")))}function i(t,n,r){const i={jsonrpc:T,id:e.id,error:t.toJson()};ie(i,n,r),y.write(i).catch((()=>_.error("Sending response failed.")))}function o(t,n,r){void 0===t&&(t=null);const i={jsonrpc:T,id:e.id,result:t};ie(i,n,r),y.write(i).catch((()=>_.error("Sending response failed.")))}!function(e){if(j===h.Off||!I)return;if($===p.Text){let t;j!==h.Verbose&&j!==h.Compact||!e.params||(t=`Params: ${re(e.params)}\n\n`),I.log(`Received request '${e.method} - (${e.id})'.`,t)}else se("receive-request",e)}(e);const s=x.get(e.method);let a,c;s&&(a=s.type,c=s.handler);const u=Date.now();if(c||k){const s=e.id??String(Date.now()),l=z.receiver.createCancellationTokenSource(s);null!==e.id&&F.has(e.id)&&l.cancel(),null!==e.id&&L.set(s,l);try{let h;if(c)if(void 0===e.params){if(void 0!==a&&0!==a.numberOfParams)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but received none.`),e.method,u);h=c(l.token)}else if(Array.isArray(e.params)){if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byName)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,u);h=c(...e.params,l.token)}else{if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byPosition)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,u);h=c(e.params,l.token)}else k&&(h=k(e.method,e.params,l.token));const d=h;h?d.then?d.then((n=>{L.delete(s),t(n,e.method,u)}),(t=>{L.delete(s),t instanceof r.ResponseError?i(t,e.method,u):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)})):(L.delete(s),t(h,e.method,u)):(L.delete(s),o(h,e.method,u))}catch(o){L.delete(s),o instanceof r.ResponseError?t(o,e.method,u):o&&n.string(o.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${o.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):r.Message.isNotification(e)?function(e){if(Z())return;let t,n;if(e.method===a.type.method){const t=e.params.id;return F.delete(t),void oe(e)}{const r=O.get(e.method);r&&(n=r.handler,t=r.type)}if(n||P)try{if(oe(e),n)if(void 0===e.params)void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==r.ParameterStructures.byName&&_.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){const i=e.params;e.method===u.type.method&&2===i.length&&c.is(i[0])?n({token:i[0],value:i[1]}):(void 0!==t&&(t.parameterStructures===r.ParameterStructures.byName&&_.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&_.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else void 0!==t&&t.parameterStructures===r.ParameterStructures.byPosition&&_.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else P&&P(e.method,e.params)}catch(t){t.message?_.error(`Notification handler '${e.method}' failed with message: ${t.message}`):_.error(`Notification handler '${e.method}' failed unexpectedly.`)}else U.fire(e)}(e):r.Message.isResponse(e)?function(e){if(Z())return;if(null===e.id)e.error?_.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):_.error("Received response message without id. No further error information provided.");else{const t=e.id,n=M.get(t);if(function(e,t){if(j===h.Off||!I)return;if($===p.Text){let n;if(j!==h.Verbose&&j!==h.Compact||(e.error&&e.error.data?n=`Error data: ${re(e.error.data)}\n\n`:e.result?n=`Result: ${re(e.result)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){const r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";I.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else I.log(`Received response ${e.id} without active response promise.`,n)}else se("receive-response",e)}(e,n),void 0!==n){M.delete(t);try{if(e.error){const t=e.error;n.reject(new r.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");n.resolve(e.result)}}catch(e){e.message?_.error(`Response handler '${n.method}' failed with message: ${e.message}`):_.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void _.error("Received empty message.");_.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);const t=e;if(n.string(t.id)||n.number(t.id)){const e=t.id,n=M.get(e);n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{te()}}()})))}d.onClose(ee),d.onError((function(e){W.fire([e,void 0,void 0])})),y.onClose(ee),y.onError((function(e){W.fire(e)}));const ne=e=>{try{if(r.Message.isNotification(e)&&e.method===a.type.method){const t=e.params.id,n=B(t),i=A.get(n);if(r.Message.isRequest(i)){const r=b?.connectionStrategy,o=r&&r.cancelUndispatched?r.cancelUndispatched(i,X):void 0;if(o&&(void 0!==o.error||void 0!==o.result))return A.delete(n),L.delete(t),o.id=i.id,ie(o,e.method,Date.now()),void y.write(o).catch((()=>_.error("Sending response for canceled message failed.")))}const o=L.get(t);if(void 0!==o)return o.cancel(),void oe(e);F.add(t)}J(A,e)}finally{te()}};function re(e){if(null!=e)switch(j){case h.Verbose:return JSON.stringify(e,null,4);case h.Compact:return JSON.stringify(e);default:return}}function ie(e,t,n){if(j!==h.Off&&I)if($===p.Text){let r;j!==h.Verbose&&j!==h.Compact||(e.error&&e.error.data?r=`Error data: ${re(e.error.data)}\n\n`:e.result?r=`Result: ${re(e.result)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),I.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else se("send-response",e)}function oe(e){if(j!==h.Off&&I&&e.method!==m.type.method)if($===p.Text){let t;j!==h.Verbose&&j!==h.Compact||(t=e.params?`Params: ${re(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Received notification '${e.method}'.`,t)}else se("receive-notification",e)}function se(e,t){if(!I||j===h.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};I.log(n)}function ae(){if(Q())throw new R(g.Closed,"Connection is closed.");if(Z())throw new R(g.Disposed,"Connection is disposed.")}function ce(e){return void 0===e?null:e}function ue(e){return null===e?void 0:e}function le(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function he(e,t){switch(e){case r.ParameterStructures.auto:return le(t)?ue(t):[ce(t)];case r.ParameterStructures.byName:if(!le(t))throw new Error("Received parameters by name but param is not an object literal.");return ue(t);case r.ParameterStructures.byPosition:return[ce(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function de(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=he(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(ce(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}const pe={sendNotification:(e,...t)=>{let i,o;if(ae(),n.string(e)){i=e;const n=t[0];let s=0,a=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(s=1,a=n);let c=t.length;const u=c-s;switch(u){case 0:o=void 0;break;case 1:o=he(a,t[s]);break;default:if(a===r.ParameterStructures.byName)throw new Error(`Received ${u} parameters for 'by Name' notification parameter structure.`);o=t.slice(s,c).map((e=>ce(e)))}}else{const n=t;i=e.method,o=de(e,n)}const s={jsonrpc:T,method:i,params:o};return function(e){if(j!==h.Off&&I)if($===p.Text){let t;j!==h.Verbose&&j!==h.Compact||(t=e.params?`Params: ${re(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Sending notification '${e.method}'.`,t)}else se("send-notification",e)}(s),y.write(s).catch((()=>_.error("Sending notification failed.")))},onNotification:(e,t)=>{let r;return ae(),n.func(e)?P=e:t&&(n.string(e)?(r=e,O.set(e,{type:void 0,handler:t})):(r=e.method,O.set(e.method,{type:e,handler:t}))),{dispose:()=>{void 0!==r?O.delete(r):P=void 0}}},onProgress:(e,t,n)=>{if(N.has(t))throw new Error(`Progress handler for token ${t} already registered`);return N.set(t,n),{dispose:()=>{N.delete(t)}}},sendProgress:(e,t,n)=>pe.sendNotification(u.type,{token:t,value:n}),onUnhandledProgress:K.event,sendRequest:(e,...t)=>{let i,o,a;if(ae(),function(){if(!Y())throw new Error("Call listen() first.")}(),n.string(e)){i=e;const n=t[0],c=t[t.length-1];let u=0,l=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(u=1,l=n);let h=t.length;s.CancellationToken.is(c)&&(h-=1,a=c);const d=h-u;switch(d){case 0:o=void 0;break;case 1:o=he(l,t[u]);break;default:if(l===r.ParameterStructures.byName)throw new Error(`Received ${d} parameters for 'by Name' request parameter structure.`);o=t.slice(u,h).map((e=>ce(e)))}}else{const n=t;i=e.method,o=de(e,n);const r=e.numberOfParams;a=s.CancellationToken.is(n[r])?n[r]:void 0}const c=E++;let u;a&&(u=a.onCancellationRequested((()=>{const e=z.sender.sendCancellation(pe,c);return void 0===e?(_.log(`Received no promise from cancellation strategy when cancelling id ${c}`),Promise.resolve()):e.catch((()=>{_.log(`Sending cancellation messages for id ${c} failed`)}))})));const l=new Promise(((e,t)=>{const n={jsonrpc:T,id:c,method:i,params:o};let s={method:i,timerStart:Date.now(),resolve:t=>{e(t),z.sender.cleanup(c),u?.dispose()},reject:e=>{t(e),z.sender.cleanup(c),u?.dispose()}};!function(e){if(j!==h.Off&&I)if($===p.Text){let t;j!==h.Verbose&&j!==h.Compact||!e.params||(t=`Params: ${re(e.params)}\n\n`),I.log(`Sending request '${e.method} - (${e.id})'.`,t)}else se("send-request",e)}(n);try{y.write(n).catch((()=>_.error("Sending request failed.")))}catch(e){s.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),s=null}s&&M.set(c,s)}));return l},onRequest:(e,t)=>{ae();let r=null;return l.is(e)?(r=void 0,k=e):n.string(e)?(r=null,void 0!==t&&(r=e,x.set(e,{handler:t,type:void 0}))):void 0!==t&&(r=e.method,x.set(e.method,{type:e,handler:t})),{dispose:()=>{null!==r&&(void 0!==r?x.delete(r):k=void 0)}}},hasPendingResponse:()=>M.size>0,trace:async(e,t,r)=>{let i=!1,o=p.Text;void 0!==r&&(n.boolean(r)?i=r:(i=r.sendNotification||!1,o=r.traceFormat||p.Text)),j=e,$=o,I=j===h.Off?void 0:t,!i||Q()||Z()||await pe.sendNotification(f.type,{value:h.toString(e)})},onError:W.event,onClose:V.event,onUnhandledNotification:U.event,onDispose:G.event,end:()=>{y.end()},dispose:()=>{if(Z())return;H=w.Disposed,G.fire(void 0);const e=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const t of M.values())t.reject(e);M=new Map,L=new Map,F=new Set,A=new i.LinkedMap,n.func(y.dispose)&&y.dispose(),n.func(d.dispose)&&d.dispose()},listen:()=>{ae(),function(){if(Y())throw new R(g.AlreadyListening,"Connection is already listening")}(),H=w.Listening,d.listen(ne)},inspect:()=>{(0,t.default)().console.log("inspect")}};return pe.onNotification(m.type,(e=>{if(j===h.Off||!I)return;const t=j===h.Verbose||j===h.Compact;I.log(e.message,t?e.verbose:void 0)})),pe.onNotification(u.type,(e=>{const t=N.get(e.token);t?t(e.value):K.fire(e)})),pe}}(mt)),mt}function yt(){return ft||(ft=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TraceFormat=e.TraceValues=e.Trace=e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=void 0;const t=Xe();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});const n=Ze();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=qe;Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=nt();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const o=ot();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const s=(st||(st=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;const t=xe,n=Je(),r=nt();var i;(e.MessageReader||(e.MessageReader={})).is=function(e){let t=e;return t&&n.func(t.listen)&&n.func(t.dispose)&&n.func(t.onError)&&n.func(t.onClose)&&n.func(t.onPartialMessage)};class o{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${n.string(e.message)?e.message:"unknown"}`)}}e.AbstractMessageReader=o,function(e){e.fromOptions=function(e){let n,r;const i=new Map;let o;const s=new Map;if(void 0===e||"string"==typeof e)n=e??"utf-8";else{if(n=e.charset??"utf-8",void 0!==e.contentDecoder&&(r=e.contentDecoder,i.set(r.name,r)),void 0!==e.contentDecoders)for(const t of e.contentDecoders)i.set(t.name,t);if(void 0!==e.contentTypeDecoder&&(o=e.contentTypeDecoder,s.set(o.name,o)),void 0!==e.contentTypeDecoders)for(const t of e.contentTypeDecoders)s.set(t.name,t)}return void 0===o&&(o=(0,t.default)().applicationJson.decoder,s.set(o.name,o)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:o,contentTypeDecoders:s}}}(i||(i={})),e.ReadableStreamMessageReader=class extends o{constructor(e,n){super(),this.readable=e,this.options=i.fromOptions(n),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const t=this.readable.onData((e=>{this.onData(e)}));return this.readable.onError((e=>this.fireError(e))),this.readable.onClose((()=>this.fireClose())),t}onData(e){for(this.buffer.append(e);;){if(-1===this.nextMessageLength){const e=this.buffer.tryReadHeaders();if(!e)return;const t=e.get("Content-Length");if(!t)throw new Error("Header must provide a Content-Length property.");const n=parseInt(t);if(isNaN(n))throw new Error("Content-Length value must be a number.");this.nextMessageLength=n}const e=this.buffer.tryReadBody(this.nextMessageLength);if(void 0===e)return void this.setPartialMessageTimer();let t;this.clearPartialMessageTimer(),this.nextMessageLength=-1,t=void 0!==this.options.contentDecoder?this.options.contentDecoder.decode(e):Promise.resolve(e),t.then((e=>{this.options.contentTypeDecoder.decode(e,this.options).then((e=>{this.callback(e)}),(e=>{this.fireError(e)}))}),(e=>{this.fireError(e)}))}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,t.default)().timer.setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}}(at)),at);Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return s.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return s.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return s.ReadableStreamMessageReader}});const a=dt();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return a.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return a.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return a.WriteableStreamMessageWriter}});const c=gt();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return c.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return c.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return c.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return c.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return c.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return c.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return c.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return c.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return c.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return c.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return c.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return c.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return c.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return c.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return c.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return c.CancellationStrategy}});const u=xe;e.RAL=u.default}(Ge)),Ge}!function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.createServerSocketTransport=e.createClientSocketTransport=e.createServerPipeTransport=e.createClientPipeTransport=e.generateRandomPipeName=e.StreamMessageWriter=e.StreamMessageReader=e.SocketMessageWriter=e.SocketMessageReader=e.IPCMessageWriter=e.IPCMessageReader=void 0;const r=ke;r.default.install();const i=yt(),o=s,a=h,c=d,u=p;n(yt(),e);class l extends i.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose()))}listen(e){return this.process.on("message",e),i.Disposable.create((()=>this.process.off("message",e)))}}e.IPCMessageReader=l;class f extends i.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose))}write(e){try{return"function"==typeof this.process.send&&this.process.send(e,void 0,void 0,(t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0})),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}e.IPCMessageWriter=f;class m extends i.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,r.default)().stream.asReadableStream(e),t)}}e.SocketMessageReader=m;class g extends i.WriteableStreamMessageWriter{constructor(e,t){super((0,r.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}}e.SocketMessageWriter=g;class y extends i.ReadableStreamMessageReader{constructor(e,t){super((0,r.default)().stream.asReadableStream(e),t)}}e.StreamMessageReader=y;class v extends i.WriteableStreamMessageWriter{constructor(e,t){super((0,r.default)().stream.asWritableStream(e),t)}}e.StreamMessageWriter=v;const b=process.env.XDG_RUNTIME_DIR,S=new Map([["linux",107],["darwin",103]]);e.generateRandomPipeName=function(){const e=(0,c.randomBytes)(21).toString("hex");if("win32"===process.platform)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=b?o.join(b,`vscode-ipc-${e}.sock`):o.join(a.tmpdir(),`vscode-${e}.sock`);const n=S.get(process.platform);return void 0!==n&&t.length>=n&&(0,r.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t},e.createClientPipeTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((i,o)=>{let s=(0,u.createServer)((e=>{s.close(),n([new m(e,t),new g(e,t)])}));s.on("error",o),s.listen(e,(()=>{s.removeListener("error",o),i({onConnected:()=>r})}))}))},e.createServerPipeTransport=function(e,t="utf-8"){const n=(0,u.createConnection)(e);return[new m(n,t),new g(n,t)]},e.createClientSocketTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((i,o)=>{const s=(0,u.createServer)((e=>{s.close(),n([new m(e,t),new g(e,t)])}));s.on("error",o),s.listen(e,"127.0.0.1",(()=>{s.removeListener("error",o),i({onConnected:()=>r})}))}))},e.createServerSocketTransport=function(e,t="utf-8"){const n=(0,u.createConnection)(e,"127.0.0.1");return[new m(n,t),new g(n,t)]},e.createMessageConnection=function(e,t,n,r){n||(n=i.NullLogger);const o=function(e){const t=e;return void 0!==t.read&&void 0!==t.addListener}(e)?new y(e):e,s=function(e){const t=e;return void 0!==t.write&&void 0!==t.addListener}(t)?new v(t):t;return i.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,i.createMessageConnection)(o,s,n,r)}}(Te),De.exports=Te;var vt,bt,St,wt,Rt,_t,Et,Ct,Dt,Tt,kt,xt,Pt,Ot,Nt,qt,It,At,Mt,Ft,Lt,jt,$t,Ht,Wt,Vt,Ut,Kt,Gt={};!function(e){e.is=function(e){return"string"==typeof e}}(vt||(vt={})),(bt||(bt={})).is=function(e){return"string"==typeof e},function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(St||(St={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(wt||(wt={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=wt.MAX_VALUE),t===Number.MAX_VALUE&&(t=wt.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.uinteger(t.line)&&Wn.uinteger(t.character)}}(Rt||(Rt={})),function(e){e.create=function(e,t,n,r){if(Wn.uinteger(e)&&Wn.uinteger(t)&&Wn.uinteger(n)&&Wn.uinteger(r))return{start:Rt.create(e,t),end:Rt.create(n,r)};if(Rt.is(e)&&Rt.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Rt.is(t.start)&&Rt.is(t.end)}}(_t||(_t={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&_t.is(t.range)&&(Wn.string(t.uri)||Wn.undefined(t.uri))}}(Et||(Et={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&_t.is(t.targetRange)&&Wn.string(t.targetUri)&&_t.is(t.targetSelectionRange)&&(_t.is(t.originSelectionRange)||Wn.undefined(t.originSelectionRange))}}(Ct||(Ct={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.numberRange(t.red,0,1)&&Wn.numberRange(t.green,0,1)&&Wn.numberRange(t.blue,0,1)&&Wn.numberRange(t.alpha,0,1)}}(Dt||(Dt={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&_t.is(t.range)&&Dt.is(t.color)}}(Tt||(Tt={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.label)&&(Wn.undefined(t.textEdit)||Ft.is(t))&&(Wn.undefined(t.additionalTextEdits)||Wn.typedArray(t.additionalTextEdits,Ft.is))}}(kt||(kt={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(xt||(xt={})),function(e){e.create=function(e,t,n,r,i,o){var s={startLine:e,endLine:t};return Wn.defined(n)&&(s.startCharacter=n),Wn.defined(r)&&(s.endCharacter=r),Wn.defined(i)&&(s.kind=i),Wn.defined(o)&&(s.collapsedText=o),s},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.uinteger(t.startLine)&&Wn.uinteger(t.startLine)&&(Wn.undefined(t.startCharacter)||Wn.uinteger(t.startCharacter))&&(Wn.undefined(t.endCharacter)||Wn.uinteger(t.endCharacter))&&(Wn.undefined(t.kind)||Wn.string(t.kind))}}(Pt||(Pt={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Et.is(t.location)&&Wn.string(t.message)}}(Ot||(Ot={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(Nt||(Nt={})),function(e){e.Unnecessary=1,e.Deprecated=2}(qt||(qt={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.href)}}(It||(It={})),function(e){e.create=function(e,t,n,r,i,o){var s={range:e,message:t};return Wn.defined(n)&&(s.severity=n),Wn.defined(r)&&(s.code=r),Wn.defined(i)&&(s.source=i),Wn.defined(o)&&(s.relatedInformation=o),s},e.is=function(e){var t,n=e;return Wn.defined(n)&&_t.is(n.range)&&Wn.string(n.message)&&(Wn.number(n.severity)||Wn.undefined(n.severity))&&(Wn.integer(n.code)||Wn.string(n.code)||Wn.undefined(n.code))&&(Wn.undefined(n.codeDescription)||Wn.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Wn.string(n.source)||Wn.undefined(n.source))&&(Wn.undefined(n.relatedInformation)||Wn.typedArray(n.relatedInformation,Ot.is))}}(At||(At={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={title:e,command:t};return Wn.defined(n)&&n.length>0&&(i.arguments=n),i},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.title)&&Wn.string(t.command)}}(Mt||(Mt={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.newText)&&_t.is(t.range)}}(Ft||(Ft={})),function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.label)&&(Wn.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Wn.string(t.description)||void 0===t.description)}}(Lt||(Lt={})),function(e){e.is=function(e){var t=e;return Wn.string(t)}}(jt||(jt={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return Ft.is(t)&&(Lt.is(t.annotationId)||jt.is(t.annotationId))}}($t||($t={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Jt.is(t.textDocument)&&Array.isArray(t.edits)}}(Ht||(Ht={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"create"===t.kind&&Wn.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Wn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Wn.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||jt.is(t.annotationId))}}(Wt||(Wt={})),function(e){e.create=function(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){var t=e;return t&&"rename"===t.kind&&Wn.string(t.oldUri)&&Wn.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Wn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Wn.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||jt.is(t.annotationId))}}(Vt||(Vt={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"delete"===t.kind&&Wn.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Wn.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Wn.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||jt.is(t.annotationId))}}(Ut||(Ut={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return Wn.string(e.kind)?Wt.is(e)||Vt.is(e)||Ut.is(e):Ht.is(e)})))}}(Kt||(Kt={}));var zt,Bt,Jt,Xt,Yt,Qt,Zt,en,tn,nn,rn,on,sn,an,cn,un,ln,hn,dn,pn,fn,mn,gn,yn,vn,bn,Sn,wn,Rn,_n,En,Cn,Dn,Tn,kn,xn,Pn,On,Nn,qn,In,An,Mn,Fn,Ln=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=Ft.insert(e,t):jt.is(n)?(i=n,r=$t.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=$t.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=Ft.replace(e,t):jt.is(n)?(i=n,r=$t.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=$t.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=Ft.del(e):jt.is(t)?(r=t,n=$t.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=$t.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),jn=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(jt.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),$n=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new jn(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(Ht.is(e)){var n=new Ln(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Ln(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(Jt.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new Ln(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new Ln(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new jn,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(Lt.is(t)||jt.is(t)?r=t:n=t,void 0===r?i=Wt.create(e,n):(o=jt.is(r)?r:this._changeAnnotations.manage(r),i=Wt.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,s;if(Lt.is(n)||jt.is(n)?i=n:r=n,void 0===i?o=Vt.create(e,t,r):(s=jt.is(i)?i:this._changeAnnotations.manage(i),o=Vt.create(e,t,r,s)),this._workspaceEdit.documentChanges.push(o),void 0!==s)return s},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(Lt.is(t)||jt.is(t)?r=t:n=t,void 0===r?i=Ut.create(e,n):(o=jt.is(r)?r:this._changeAnnotations.manage(r),i=Ut.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)}}(zt||(zt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&Wn.integer(t.version)}}(Bt||(Bt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&(null===t.version||Wn.integer(t.version))}}(Jt||(Jt={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&Wn.string(t.languageId)&&Wn.integer(t.version)&&Wn.string(t.text)}}(Xt||(Xt={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(Yt||(Yt={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(e)&&Yt.is(t.kind)&&Wn.string(t.value)}}(Qt||(Qt={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(Zt||(Zt={})),function(e){e.PlainText=1,e.Snippet=2}(en||(en={})),function(e){e.Deprecated=1}(tn||(tn={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&Wn.string(t.newText)&&_t.is(t.insert)&&_t.is(t.replace)}}(nn||(nn={})),function(e){e.asIs=1,e.adjustIndentation=2}(rn||(rn={})),function(e){e.is=function(e){var t=e;return t&&(Wn.string(t.detail)||void 0===t.detail)&&(Wn.string(t.description)||void 0===t.description)}}(on||(on={})),function(e){e.create=function(e){return{label:e}}}(sn||(sn={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(an||(an={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return Wn.string(t)||Wn.objectLiteral(t)&&Wn.string(t.language)&&Wn.string(t.value)}}(cn||(cn={})),function(e){e.is=function(e){var t=e;return!!t&&Wn.objectLiteral(t)&&(Qt.is(t.contents)||cn.is(t.contents)||Wn.typedArray(t.contents,cn.is))&&(void 0===e.range||_t.is(e.range))}}(un||(un={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(ln||(ln={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={label:e};return Wn.defined(t)&&(i.documentation=t),Wn.defined(n)?i.parameters=n:i.parameters=[],i}}(hn||(hn={})),function(e){e.Text=1,e.Read=2,e.Write=3}(dn||(dn={})),function(e){e.create=function(e,t){var n={range:e};return Wn.number(t)&&(n.kind=t),n}}(pn||(pn={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(fn||(fn={})),function(e){e.Deprecated=1}(mn||(mn={})),function(e){e.create=function(e,t,n,r,i){var o={name:e,kind:t,location:{uri:r,range:n}};return i&&(o.containerName=i),o}}(gn||(gn={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(yn||(yn={})),function(e){e.create=function(e,t,n,r,i,o){var s={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==o&&(s.children=o),s},e.is=function(e){var t=e;return t&&Wn.string(t.name)&&Wn.number(t.kind)&&_t.is(t.range)&&_t.is(t.selectionRange)&&(void 0===t.detail||Wn.string(t.detail))&&(void 0===t.deprecated||Wn.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(vn||(vn={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(bn||(bn={})),function(e){e.Invoked=1,e.Automatic=2}(Sn||(Sn={})),function(e){e.create=function(e,t,n){var r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.typedArray(t.diagnostics,At.is)&&(void 0===t.only||Wn.typedArray(t.only,Wn.string))&&(void 0===t.triggerKind||t.triggerKind===Sn.Invoked||t.triggerKind===Sn.Automatic)}}(wn||(wn={})),function(e){e.create=function(e,t,n){var r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):Mt.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return t&&Wn.string(t.title)&&(void 0===t.diagnostics||Wn.typedArray(t.diagnostics,At.is))&&(void 0===t.kind||Wn.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||Mt.is(t.command))&&(void 0===t.isPreferred||Wn.boolean(t.isPreferred))&&(void 0===t.edit||Kt.is(t.edit))}}(Rn||(Rn={})),function(e){e.create=function(e,t){var n={range:e};return Wn.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return Wn.defined(t)&&_t.is(t.range)&&(Wn.undefined(t.command)||Mt.is(t.command))}}(_n||(_n={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.uinteger(t.tabSize)&&Wn.boolean(t.insertSpaces)}}(En||(En={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return Wn.defined(t)&&_t.is(t.range)&&(Wn.undefined(t.target)||Wn.string(t.target))}}(Cn||(Cn={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return Wn.objectLiteral(n)&&_t.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(Dn||(Dn={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(Tn||(Tn={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(kn||(kn={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(xn||(xn={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){var t=e;return null!=t&&_t.is(t.range)&&Wn.string(t.text)}}(Pn||(Pn={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){var t=e;return null!=t&&_t.is(t.range)&&Wn.boolean(t.caseSensitiveLookup)&&(Wn.string(t.variableName)||void 0===t.variableName)}}(On||(On={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){var t=e;return null!=t&&_t.is(t.range)&&(Wn.string(t.expression)||void 0===t.expression)}}(Nn||(Nn={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){var t=e;return Wn.defined(t)&&_t.is(e.stoppedLocation)}}(qn||(qn={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(In||(In={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&(void 0===t.tooltip||Wn.string(t.tooltip)||Qt.is(t.tooltip))&&(void 0===t.location||Et.is(t.location))&&(void 0===t.command||Mt.is(t.command))}}(An||(An={})),function(e){e.create=function(e,t,n){var r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Rt.is(t.position)&&(Wn.string(t.label)||Wn.typedArray(t.label,An.is))&&(void 0===t.kind||In.is(t.kind))&&void 0===t.textEdits||Wn.typedArray(t.textEdits,Ft.is)&&(void 0===t.tooltip||Wn.string(t.tooltip)||Qt.is(t.tooltip))&&(void 0===t.paddingLeft||Wn.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Wn.boolean(t.paddingRight))}}(Mn||(Mn={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(t)&&bt.is(t.uri)&&Wn.string(t.name)}}(Fn||(Fn={}));var Hn;!function(e){function t(e,n){if(e.length<=1)return e;var r=e.length/2|0,i=e.slice(0,r),o=e.slice(r);t(i,n),t(o,n);for(var s=0,a=0,c=0;s<i.length&&a<o.length;){var u=n(i[s],o[a]);e[c++]=u<=0?i[s++]:o[a++]}for(;s<i.length;)e[c++]=i[s++];for(;a<o.length;)e[c++]=o[a++];return e}e.create=function(e,t,n,r){return new Vn(e,t,n,r)},e.is=function(e){var t=e;return!!(Wn.defined(t)&&Wn.string(t.uri)&&(Wn.undefined(t.languageId)||Wn.string(t.languageId))&&Wn.uinteger(t.lineCount)&&Wn.func(t.getText)&&Wn.func(t.positionAt)&&Wn.func(t.offsetAt))},e.applyEdits=function(e,n){for(var r=e.getText(),i=t(n,(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),o=r.length,s=i.length-1;s>=0;s--){var a=i[s],c=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=o))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(u,r.length),o=c}return r}}(Hn||(Hn={}));var Wn,Vn=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var i=t.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return Rt.create(0,e);for(;n<r;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return Rt.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.numberRange=function(e,n,r){return"[object Number]"===t.call(e)&&n<=e&&e<=r},e.integer=function(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647},e.uinteger=function(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(Wn||(Wn={}));const Un=x(Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return $t},get ChangeAnnotation(){return Lt},get ChangeAnnotationIdentifier(){return jt},get CodeAction(){return Rn},get CodeActionContext(){return wn},get CodeActionKind(){return bn},get CodeActionTriggerKind(){return Sn},get CodeDescription(){return It},get CodeLens(){return _n},get Color(){return Dt},get ColorInformation(){return Tt},get ColorPresentation(){return kt},get Command(){return Mt},get CompletionItem(){return sn},get CompletionItemKind(){return Zt},get CompletionItemLabelDetails(){return on},get CompletionItemTag(){return tn},get CompletionList(){return an},get CreateFile(){return Wt},get DeleteFile(){return Ut},get Diagnostic(){return At},get DiagnosticRelatedInformation(){return Ot},get DiagnosticSeverity(){return Nt},get DiagnosticTag(){return qt},get DocumentHighlight(){return pn},get DocumentHighlightKind(){return dn},get DocumentLink(){return Cn},get DocumentSymbol(){return vn},get DocumentUri(){return vt},EOL:["\n","\r\n","\r"],get FoldingRange(){return Pt},get FoldingRangeKind(){return xt},get FormattingOptions(){return En},get Hover(){return un},get InlayHint(){return Mn},get InlayHintKind(){return In},get InlayHintLabelPart(){return An},get InlineValueContext(){return qn},get InlineValueEvaluatableExpression(){return Nn},get InlineValueText(){return Pn},get InlineValueVariableLookup(){return On},get InsertReplaceEdit(){return nn},get InsertTextFormat(){return en},get InsertTextMode(){return rn},get Location(){return Et},get LocationLink(){return Ct},get MarkedString(){return cn},get MarkupContent(){return Qt},get MarkupKind(){return Yt},get OptionalVersionedTextDocumentIdentifier(){return Jt},get ParameterInformation(){return ln},get Position(){return Rt},get Range(){return _t},get RenameFile(){return Vt},get SelectionRange(){return Dn},get SemanticTokenModifiers(){return kn},get SemanticTokenTypes(){return Tn},get SemanticTokens(){return xn},get SignatureInformation(){return hn},get SymbolInformation(){return gn},get SymbolKind(){return fn},get SymbolTag(){return mn},get TextDocument(){return Hn},get TextDocumentEdit(){return Ht},get TextDocumentIdentifier(){return zt},get TextDocumentItem(){return Xt},get TextEdit(){return Ft},get URI(){return bt},get VersionedTextDocumentIdentifier(){return Bt},WorkspaceChange:$n,get WorkspaceEdit(){return Kt},get WorkspaceFolder(){return Fn},get WorkspaceSymbol(){return yn},get integer(){return St},get uinteger(){return wt}},Symbol.toStringTag,{value:"Module"})));var Kn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;const t=Te;var n;(n=e.MessageDirection||(e.MessageDirection={})).clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both";e.RegistrationType=class{constructor(e){this.method=e}};e.ProtocolRequestType0=class extends t.RequestType0{constructor(e){super(e)}};e.ProtocolRequestType=class extends t.RequestType{constructor(e){super(e,t.ParameterStructures.byName)}};e.ProtocolNotificationType0=class extends t.NotificationType0{constructor(e){super(e)}};e.ProtocolNotificationType=class extends t.NotificationType{constructor(e){super(e,t.ParameterStructures.byName)}}}(Kn);var Gn={},zn={};function Bn(e){return"string"==typeof e||e instanceof String}function Jn(e){return Array.isArray(e)}Object.defineProperty(zn,"__esModule",{value:!0}),zn.objectLiteral=zn.typedArray=zn.stringArray=zn.array=zn.func=zn.error=zn.number=zn.string=zn.boolean=void 0,zn.boolean=function(e){return!0===e||!1===e},zn.string=Bn,zn.number=function(e){return"number"==typeof e||e instanceof Number},zn.error=function(e){return e instanceof Error},zn.func=function(e){return"function"==typeof e},zn.array=Jn,zn.stringArray=function(e){return Jn(e)&&e.every((e=>Bn(e)))},zn.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},zn.objectLiteral=function(e){return null!==e&&"object"==typeof e};var Xn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;const t=Kn;var n;(n=e.ImplementationRequest||(e.ImplementationRequest={})).method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(Xn);var Yn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;const t=Kn;var n;(n=e.TypeDefinitionRequest||(e.TypeDefinitionRequest={})).method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(Yn);var Qn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;const t=Kn;var n,r;(n=e.WorkspaceFoldersRequest||(e.WorkspaceFoldersRequest={})).method="workspace/workspaceFolders",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method),(r=e.DidChangeWorkspaceFoldersNotification||(e.DidChangeWorkspaceFoldersNotification={})).method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(Qn);var Zn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;const t=Kn;var n;(n=e.ConfigurationRequest||(e.ConfigurationRequest={})).method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(Zn);var er={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;const t=Kn;var n,r;(n=e.DocumentColorRequest||(e.DocumentColorRequest={})).method="textDocument/documentColor",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.ColorPresentationRequest||(e.ColorPresentationRequest={})).method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(er);var tr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRequest=void 0;const t=Kn;var n;(n=e.FoldingRangeRequest||(e.FoldingRangeRequest={})).method="textDocument/foldingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(tr);var nr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;const t=Kn;var n;(n=e.DeclarationRequest||(e.DeclarationRequest={})).method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(nr);var rr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;const t=Kn;var n;(n=e.SelectionRangeRequest||(e.SelectionRangeRequest={})).method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(rr);var ir={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;const t=Te,n=Kn;var r,i,o;(r=e.WorkDoneProgress||(e.WorkDoneProgress={})).type=new t.ProgressType,r.is=function(e){return e===r.type},(i=e.WorkDoneProgressCreateRequest||(e.WorkDoneProgressCreateRequest={})).method="window/workDoneProgress/create",i.messageDirection=n.MessageDirection.serverToClient,i.type=new n.ProtocolRequestType(i.method),(o=e.WorkDoneProgressCancelNotification||(e.WorkDoneProgressCancelNotification={})).method="window/workDoneProgress/cancel",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolNotificationType(o.method)}(ir);var or={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;const t=Kn;var n,r,i;(n=e.CallHierarchyPrepareRequest||(e.CallHierarchyPrepareRequest={})).method="textDocument/prepareCallHierarchy",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.CallHierarchyIncomingCallsRequest||(e.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.CallHierarchyOutgoingCallsRequest||(e.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(or);var sr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;const t=Kn;var n,r,i,o,s;(e.TokenFormat||(e.TokenFormat={})).Relative="relative",function(e){e.method="textDocument/semanticTokens",e.type=new t.RegistrationType(e.method)}(n=e.SemanticTokensRegistrationType||(e.SemanticTokensRegistrationType={})),(r=e.SemanticTokensRequest||(e.SemanticTokensRequest={})).method="textDocument/semanticTokens/full",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),r.registrationMethod=n.method,(i=e.SemanticTokensDeltaRequest||(e.SemanticTokensDeltaRequest={})).method="textDocument/semanticTokens/full/delta",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method),i.registrationMethod=n.method,(o=e.SemanticTokensRangeRequest||(e.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method,(s=e.SemanticTokensRefreshRequest||(e.SemanticTokensRefreshRequest={})).method="workspace/semanticTokens/refresh",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType0(s.method)}(sr);var ar={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;const t=Kn;var n;(n=e.ShowDocumentRequest||(e.ShowDocumentRequest={})).method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(ar);var cr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;const t=Kn;var n;(n=e.LinkedEditingRangeRequest||(e.LinkedEditingRangeRequest={})).method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(cr);var ur={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;const t=Kn;var n,r,i,o,s,a,c;(n=e.FileOperationPatternKind||(e.FileOperationPatternKind={})).file="file",n.folder="folder",(r=e.WillCreateFilesRequest||(e.WillCreateFilesRequest={})).method="workspace/willCreateFiles",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.DidCreateFilesNotification||(e.DidCreateFilesNotification={})).method="workspace/didCreateFiles",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolNotificationType(i.method),(o=e.WillRenameFilesRequest||(e.WillRenameFilesRequest={})).method="workspace/willRenameFiles",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),(s=e.DidRenameFilesNotification||(e.DidRenameFilesNotification={})).method="workspace/didRenameFiles",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolNotificationType(s.method),(a=e.DidDeleteFilesNotification||(e.DidDeleteFilesNotification={})).method="workspace/didDeleteFiles",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolNotificationType(a.method),(c=e.WillDeleteFilesRequest||(e.WillDeleteFilesRequest={})).method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)}(ur);var lr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;const t=Kn;var n,r,i;(n=e.UniquenessLevel||(e.UniquenessLevel={})).document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global",(r=e.MonikerKind||(e.MonikerKind={})).$import="import",r.$export="export",r.local="local",(i=e.MonikerRequest||(e.MonikerRequest={})).method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(lr);var hr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;const t=Kn;var n,r,i;(n=e.TypeHierarchyPrepareRequest||(e.TypeHierarchyPrepareRequest={})).method="textDocument/prepareTypeHierarchy",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.TypeHierarchySupertypesRequest||(e.TypeHierarchySupertypesRequest={})).method="typeHierarchy/supertypes",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.TypeHierarchySubtypesRequest||(e.TypeHierarchySubtypesRequest={})).method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(hr);var dr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;const t=Kn;var n,r;(n=e.InlineValueRequest||(e.InlineValueRequest={})).method="textDocument/inlineValue",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.InlineValueRefreshRequest||(e.InlineValueRefreshRequest={})).method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType0(r.method)}(dr);var pr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;const t=Kn;var n,r,i;(n=e.InlayHintRequest||(e.InlayHintRequest={})).method="textDocument/inlayHint",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.InlayHintResolveRequest||(e.InlayHintResolveRequest={})).method="inlayHint/resolve",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.InlayHintRefreshRequest||(e.InlayHintRefreshRequest={})).method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType0(i.method)}(pr);var fr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;const t=Te,n=zn,r=Kn;var i,o,s,a;(e.DiagnosticServerCancellationData||(e.DiagnosticServerCancellationData={})).is=function(e){const t=e;return t&&n.boolean(t.retriggerRequest)},(i=e.DocumentDiagnosticReportKind||(e.DocumentDiagnosticReportKind={})).Full="full",i.Unchanged="unchanged",(o=e.DocumentDiagnosticRequest||(e.DocumentDiagnosticRequest={})).method="textDocument/diagnostic",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method),o.partialResult=new t.ProgressType,(s=e.WorkspaceDiagnosticRequest||(e.WorkspaceDiagnosticRequest={})).method="workspace/diagnostic",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),s.partialResult=new t.ProgressType,(a=e.DiagnosticRefreshRequest||(e.DiagnosticRefreshRequest={})).method="workspace/diagnostic/refresh",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolRequestType0(a.method)}(fr);var mr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;const t=Un,n=zn,r=Kn;var i,o,s,a,c,u,l,h,d,p;!function(e){e.Markup=1,e.Code=2,e.is=function(e){return 1===e||2===e}}(i=e.NotebookCellKind||(e.NotebookCellKind={})),function(e){e.create=function(e,t){const n={executionOrder:e};return!0!==t&&!1!==t||(n.success=t),n},e.is=function(e){const r=e;return n.objectLiteral(r)&&t.uinteger.is(r.executionOrder)&&(void 0===r.success||n.boolean(r.success))},e.equals=function(e,t){return e===t||null!=e&&null!=t&&(e.executionOrder===t.executionOrder&&e.success===t.success)}}(o=e.ExecutionSummary||(e.ExecutionSummary={})),function(e){function r(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;const i=Array.isArray(e),o=Array.isArray(t);if(i!==o)return!1;if(i&&o){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}if(n.objectLiteral(e)&&n.objectLiteral(t)){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(n.sort(),i.sort(),!r(n,i))return!1;for(let i=0;i<n.length;i++){const o=n[i];if(!r(e[o],t[o]))return!1}}return!0}e.create=function(e,t){return{kind:e,document:t}},e.is=function(e){const r=e;return n.objectLiteral(r)&&i.is(r.kind)&&t.DocumentUri.is(r.document)&&(void 0===r.metadata||n.objectLiteral(r.metadata))},e.diff=function(e,t){const n=new Set;return e.document!==t.document&&n.add("document"),e.kind!==t.kind&&n.add("kind"),e.executionSummary!==t.executionSummary&&n.add("executionSummary"),void 0===e.metadata&&void 0===t.metadata||r(e.metadata,t.metadata)||n.add("metadata"),void 0===e.executionSummary&&void 0===t.executionSummary||o.equals(e.executionSummary,t.executionSummary)||n.add("executionSummary"),n}}(s=e.NotebookCell||(e.NotebookCell={})),(a=e.NotebookDocument||(e.NotebookDocument={})).create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},a.is=function(e){const r=e;return n.objectLiteral(r)&&n.string(r.uri)&&t.integer.is(r.version)&&n.typedArray(r.cells,s.is)},function(e){e.method="notebookDocument/sync",e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.RegistrationType(e.method)}(c=e.NotebookDocumentSyncRegistrationType||(e.NotebookDocumentSyncRegistrationType={})),(u=e.DidOpenNotebookDocumentNotification||(e.DidOpenNotebookDocumentNotification={})).method="notebookDocument/didOpen",u.messageDirection=r.MessageDirection.clientToServer,u.type=new r.ProtocolNotificationType(u.method),u.registrationMethod=c.method,(l=e.NotebookCellArrayChange||(e.NotebookCellArrayChange={})).is=function(e){const r=e;return n.objectLiteral(r)&&t.uinteger.is(r.start)&&t.uinteger.is(r.deleteCount)&&(void 0===r.cells||n.typedArray(r.cells,s.is))},l.create=function(e,t,n){const r={start:e,deleteCount:t};return void 0!==n&&(r.cells=n),r},(h=e.DidChangeNotebookDocumentNotification||(e.DidChangeNotebookDocumentNotification={})).method="notebookDocument/didChange",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=c.method,(d=e.DidSaveNotebookDocumentNotification||(e.DidSaveNotebookDocumentNotification={})).method="notebookDocument/didSave",d.messageDirection=r.MessageDirection.clientToServer,d.type=new r.ProtocolNotificationType(d.method),d.registrationMethod=c.method,(p=e.DidCloseNotebookDocumentNotification||(e.DidCloseNotebookDocumentNotification={})).method="notebookDocument/didClose",p.messageDirection=r.MessageDirection.clientToServer,p.type=new r.ProtocolNotificationType(p.method),p.registrationMethod=c.method}(mr),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=void 0;const t=Kn,n=Un,r=zn,i=Xn;Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const o=Yn;Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return o.TypeDefinitionRequest}});const s=Qn;Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const a=Zn;Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=er;Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=tr;Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}});const l=nr;Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const h=rr;Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const d=ir;Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const p=or;Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const f=sr;Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return f.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return f.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return f.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return f.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return f.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return f.SemanticTokensRegistrationType}});const m=ar;Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return m.ShowDocumentRequest}});const g=cr;Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return g.LinkedEditingRangeRequest}});const y=ur;Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return y.WillDeleteFilesRequest}});const v=lr;Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return v.MonikerRequest}});const b=hr;Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return b.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySupertypesRequest}});const S=dr;Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return S.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return S.InlineValueRefreshRequest}});const w=pr;Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return w.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return w.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return w.InlayHintRefreshRequest}});const R=fr;Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return R.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return R.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return R.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return R.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return R.DiagnosticRefreshRequest}});const _=mr;var E,C,D,T,k,x,P,O,N,q,I,A,M,F,L,j,$,H,W,V,U,K,G,z,B,J,X,Y,Q,Z,ee,te,ne,re,ie,oe,se,ae,ce,ue,le,he,de,pe,fe,me,ge,ye,ve,be,Se,we,Re,_e,Ee,Ce,De,Te,ke;Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return _.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return _.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return _.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return _.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return _.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return _.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidCloseNotebookDocumentNotification}}),function(e){e.is=function(e){const t=e;return r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(E=e.TextDocumentFilter||(e.TextDocumentFilter={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))}}(C=e.NotebookDocumentFilter||(e.NotebookDocumentFilter={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||C.is(t.notebook))&&(void 0===t.language||r.string(t.language))}}(D=e.NotebookCellTextDocumentFilter||(e.NotebookCellTextDocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!E.is(t)&&!D.is(t))return!1;return!0}}(T=e.DocumentSelector||(e.DocumentSelector={})),(k=e.RegistrationRequest||(e.RegistrationRequest={})).method="client/registerCapability",k.messageDirection=t.MessageDirection.serverToClient,k.type=new t.ProtocolRequestType(k.method),(x=e.UnregistrationRequest||(e.UnregistrationRequest={})).method="client/unregisterCapability",x.messageDirection=t.MessageDirection.serverToClient,x.type=new t.ProtocolRequestType(x.method),(P=e.ResourceOperationKind||(e.ResourceOperationKind={})).Create="create",P.Rename="rename",P.Delete="delete",(O=e.FailureHandlingKind||(e.FailureHandlingKind={})).Abort="abort",O.Transactional="transactional",O.TextOnlyTransactional="textOnlyTransactional",O.Undo="undo",(N=e.PositionEncodingKind||(e.PositionEncodingKind={})).UTF8="utf-8",N.UTF16="utf-16",N.UTF32="utf-32",(e.StaticRegistrationOptions||(e.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0},(e.TextDocumentRegistrationOptions||(e.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||T.is(t.documentSelector))},(q=e.WorkDoneProgressOptions||(e.WorkDoneProgressOptions={})).is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},q.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)},(I=e.InitializeRequest||(e.InitializeRequest={})).method="initialize",I.messageDirection=t.MessageDirection.clientToServer,I.type=new t.ProtocolRequestType(I.method),(e.InitializeErrorCodes||(e.InitializeErrorCodes={})).unknownProtocolVersion=1,(A=e.InitializedNotification||(e.InitializedNotification={})).method="initialized",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method),(M=e.ShutdownRequest||(e.ShutdownRequest={})).method="shutdown",M.messageDirection=t.MessageDirection.clientToServer,M.type=new t.ProtocolRequestType0(M.method),(F=e.ExitNotification||(e.ExitNotification={})).method="exit",F.messageDirection=t.MessageDirection.clientToServer,F.type=new t.ProtocolNotificationType0(F.method),(L=e.DidChangeConfigurationNotification||(e.DidChangeConfigurationNotification={})).method="workspace/didChangeConfiguration",L.messageDirection=t.MessageDirection.clientToServer,L.type=new t.ProtocolNotificationType(L.method),(j=e.MessageType||(e.MessageType={})).Error=1,j.Warning=2,j.Info=3,j.Log=4,($=e.ShowMessageNotification||(e.ShowMessageNotification={})).method="window/showMessage",$.messageDirection=t.MessageDirection.serverToClient,$.type=new t.ProtocolNotificationType($.method),(H=e.ShowMessageRequest||(e.ShowMessageRequest={})).method="window/showMessageRequest",H.messageDirection=t.MessageDirection.serverToClient,H.type=new t.ProtocolRequestType(H.method),(W=e.LogMessageNotification||(e.LogMessageNotification={})).method="window/logMessage",W.messageDirection=t.MessageDirection.serverToClient,W.type=new t.ProtocolNotificationType(W.method),(V=e.TelemetryEventNotification||(e.TelemetryEventNotification={})).method="telemetry/event",V.messageDirection=t.MessageDirection.serverToClient,V.type=new t.ProtocolNotificationType(V.method),(U=e.TextDocumentSyncKind||(e.TextDocumentSyncKind={})).None=0,U.Full=1,U.Incremental=2,(K=e.DidOpenTextDocumentNotification||(e.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",K.messageDirection=t.MessageDirection.clientToServer,K.type=new t.ProtocolNotificationType(K.method),(G=e.TextDocumentContentChangeEvent||(e.TextDocumentContentChangeEvent={})).isIncremental=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},G.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(z=e.DidChangeTextDocumentNotification||(e.DidChangeTextDocumentNotification={})).method="textDocument/didChange",z.messageDirection=t.MessageDirection.clientToServer,z.type=new t.ProtocolNotificationType(z.method),(B=e.DidCloseTextDocumentNotification||(e.DidCloseTextDocumentNotification={})).method="textDocument/didClose",B.messageDirection=t.MessageDirection.clientToServer,B.type=new t.ProtocolNotificationType(B.method),(J=e.DidSaveTextDocumentNotification||(e.DidSaveTextDocumentNotification={})).method="textDocument/didSave",J.messageDirection=t.MessageDirection.clientToServer,J.type=new t.ProtocolNotificationType(J.method),(X=e.TextDocumentSaveReason||(e.TextDocumentSaveReason={})).Manual=1,X.AfterDelay=2,X.FocusOut=3,(Y=e.WillSaveTextDocumentNotification||(e.WillSaveTextDocumentNotification={})).method="textDocument/willSave",Y.messageDirection=t.MessageDirection.clientToServer,Y.type=new t.ProtocolNotificationType(Y.method),(Q=e.WillSaveTextDocumentWaitUntilRequest||(e.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",Q.messageDirection=t.MessageDirection.clientToServer,Q.type=new t.ProtocolRequestType(Q.method),(Z=e.DidChangeWatchedFilesNotification||(e.DidChangeWatchedFilesNotification={})).method="workspace/didChangeWatchedFiles",Z.messageDirection=t.MessageDirection.clientToServer,Z.type=new t.ProtocolNotificationType(Z.method),(ee=e.FileChangeType||(e.FileChangeType={})).Created=1,ee.Changed=2,ee.Deleted=3,(e.RelativePattern||(e.RelativePattern={})).is=function(e){const t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)},(te=e.WatchKind||(e.WatchKind={})).Create=1,te.Change=2,te.Delete=4,(ne=e.PublishDiagnosticsNotification||(e.PublishDiagnosticsNotification={})).method="textDocument/publishDiagnostics",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolNotificationType(ne.method),(re=e.CompletionTriggerKind||(e.CompletionTriggerKind={})).Invoked=1,re.TriggerCharacter=2,re.TriggerForIncompleteCompletions=3,(ie=e.CompletionRequest||(e.CompletionRequest={})).method="textDocument/completion",ie.messageDirection=t.MessageDirection.clientToServer,ie.type=new t.ProtocolRequestType(ie.method),(oe=e.CompletionResolveRequest||(e.CompletionResolveRequest={})).method="completionItem/resolve",oe.messageDirection=t.MessageDirection.clientToServer,oe.type=new t.ProtocolRequestType(oe.method),(se=e.HoverRequest||(e.HoverRequest={})).method="textDocument/hover",se.messageDirection=t.MessageDirection.clientToServer,se.type=new t.ProtocolRequestType(se.method),(ae=e.SignatureHelpTriggerKind||(e.SignatureHelpTriggerKind={})).Invoked=1,ae.TriggerCharacter=2,ae.ContentChange=3,(ce=e.SignatureHelpRequest||(e.SignatureHelpRequest={})).method="textDocument/signatureHelp",ce.messageDirection=t.MessageDirection.clientToServer,ce.type=new t.ProtocolRequestType(ce.method),(ue=e.DefinitionRequest||(e.DefinitionRequest={})).method="textDocument/definition",ue.messageDirection=t.MessageDirection.clientToServer,ue.type=new t.ProtocolRequestType(ue.method),(le=e.ReferencesRequest||(e.ReferencesRequest={})).method="textDocument/references",le.messageDirection=t.MessageDirection.clientToServer,le.type=new t.ProtocolRequestType(le.method),(he=e.DocumentHighlightRequest||(e.DocumentHighlightRequest={})).method="textDocument/documentHighlight",he.messageDirection=t.MessageDirection.clientToServer,he.type=new t.ProtocolRequestType(he.method),(de=e.DocumentSymbolRequest||(e.DocumentSymbolRequest={})).method="textDocument/documentSymbol",de.messageDirection=t.MessageDirection.clientToServer,de.type=new t.ProtocolRequestType(de.method),(pe=e.CodeActionRequest||(e.CodeActionRequest={})).method="textDocument/codeAction",pe.messageDirection=t.MessageDirection.clientToServer,pe.type=new t.ProtocolRequestType(pe.method),(fe=e.CodeActionResolveRequest||(e.CodeActionResolveRequest={})).method="codeAction/resolve",fe.messageDirection=t.MessageDirection.clientToServer,fe.type=new t.ProtocolRequestType(fe.method),(me=e.WorkspaceSymbolRequest||(e.WorkspaceSymbolRequest={})).method="workspace/symbol",me.messageDirection=t.MessageDirection.clientToServer,me.type=new t.ProtocolRequestType(me.method),(ge=e.WorkspaceSymbolResolveRequest||(e.WorkspaceSymbolResolveRequest={})).method="workspaceSymbol/resolve",ge.messageDirection=t.MessageDirection.clientToServer,ge.type=new t.ProtocolRequestType(ge.method),(ye=e.CodeLensRequest||(e.CodeLensRequest={})).method="textDocument/codeLens",ye.messageDirection=t.MessageDirection.clientToServer,ye.type=new t.ProtocolRequestType(ye.method),(ve=e.CodeLensResolveRequest||(e.CodeLensResolveRequest={})).method="codeLens/resolve",ve.messageDirection=t.MessageDirection.clientToServer,ve.type=new t.ProtocolRequestType(ve.method),(be=e.CodeLensRefreshRequest||(e.CodeLensRefreshRequest={})).method="workspace/codeLens/refresh",be.messageDirection=t.MessageDirection.serverToClient,be.type=new t.ProtocolRequestType0(be.method),(Se=e.DocumentLinkRequest||(e.DocumentLinkRequest={})).method="textDocument/documentLink",Se.messageDirection=t.MessageDirection.clientToServer,Se.type=new t.ProtocolRequestType(Se.method),(we=e.DocumentLinkResolveRequest||(e.DocumentLinkResolveRequest={})).method="documentLink/resolve",we.messageDirection=t.MessageDirection.clientToServer,we.type=new t.ProtocolRequestType(we.method),(Re=e.DocumentFormattingRequest||(e.DocumentFormattingRequest={})).method="textDocument/formatting",Re.messageDirection=t.MessageDirection.clientToServer,Re.type=new t.ProtocolRequestType(Re.method),(_e=e.DocumentRangeFormattingRequest||(e.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",_e.messageDirection=t.MessageDirection.clientToServer,_e.type=new t.ProtocolRequestType(_e.method),(Ee=e.DocumentOnTypeFormattingRequest||(e.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method),(e.PrepareSupportDefaultBehavior||(e.PrepareSupportDefaultBehavior={})).Identifier=1,(Ce=e.RenameRequest||(e.RenameRequest={})).method="textDocument/rename",Ce.messageDirection=t.MessageDirection.clientToServer,Ce.type=new t.ProtocolRequestType(Ce.method),(De=e.PrepareRenameRequest||(e.PrepareRenameRequest={})).method="textDocument/prepareRename",De.messageDirection=t.MessageDirection.clientToServer,De.type=new t.ProtocolRequestType(De.method),(Te=e.ExecuteCommandRequest||(e.ExecuteCommandRequest={})).method="workspace/executeCommand",Te.messageDirection=t.MessageDirection.clientToServer,Te.type=new t.ProtocolRequestType(Te.method),(ke=e.ApplyWorkspaceEditRequest||(e.ApplyWorkspaceEditRequest={})).method="workspace/applyEdit",ke.messageDirection=t.MessageDirection.serverToClient,ke.type=new t.ProtocolRequestType("workspace/applyEdit")}(Gn);var gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.createProtocolConnection=void 0;const yr=Te;gr.createProtocolConnection=function(e,t,n,r){return yr.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,yr.createMessageConnection)(e,t,n,r)},function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(Te,e),n(Un,e),n(Kn,e),n(Gn,e);var r,i=gr;Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}}),(r=e.LSPErrorCodes||(e.LSPErrorCodes={})).lspReservedErrorRangeStart=-32899,r.RequestFailed=-32803,r.ServerCancelled=-32802,r.ContentModified=-32801,r.RequestCancelled=-32800,r.lspReservedErrorRangeEnd=-32800}(Gt),function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;const r=Ce;n(Ce,e),n(Gt,e),e.createProtocolConnection=function(e,t,n,i){return(0,r.createMessageConnection)(e,t,n,i)}}(Ee);const vr=k(Ee);var br={};Object.defineProperty(br,"__esModule",{value:!0}),br.generateUuid=br.parse=br.isUUID=br.v4=br.empty=void 0;class Sr{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class wr extends Sr{constructor(){super([wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),"-",wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),"-","4",wr._randomHex(),wr._randomHex(),wr._randomHex(),"-",wr._oneOf(wr._timeHighBits),wr._randomHex(),wr._randomHex(),wr._randomHex(),"-",wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return wr._oneOf(wr._chars)}}function Rr(){return new wr}wr._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],wr._timeHighBits=["8","9","a","b"],br.empty=new Sr("00000000-0000-0000-0000-000000000000"),br.v4=Rr;const _r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Er(e){return _r.test(e)}br.isUUID=Er,br.parse=function(e){if(!Er(e))throw new Error("invalid uuid");return new Sr(e)},br.generateUuid=function(){return Rr().asHex()};var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.attachPartialResult=Cr.ProgressFeature=Nr=Cr.attachWorkDone=void 0;const Dr=Ee,Tr=br;class kr{constructor(e,t){this._connection=e,this._token=t,kr.Instances.set(this._token,this)}begin(e,t,n,r){let i={kind:"begin",title:e,percentage:t,message:n,cancellable:r};this._connection.sendProgress(Dr.WorkDoneProgress.type,this._token,i)}report(e,t){let n={kind:"report"};"number"==typeof e?(n.percentage=e,void 0!==t&&(n.message=t)):n.message=e,this._connection.sendProgress(Dr.WorkDoneProgress.type,this._token,n)}done(){kr.Instances.delete(this._token),this._connection.sendProgress(Dr.WorkDoneProgress.type,this._token,{kind:"end"})}}kr.Instances=new Map;class xr extends kr{constructor(e,t){super(e,t),this._source=new Dr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class Pr{constructor(){}begin(){}report(){}done(){}}class Or extends Pr{constructor(){super(),this._source=new Dr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}var Nr=Cr.attachWorkDone=function(e,t){if(void 0===t||void 0===t.workDoneToken)return new Pr;const n=t.workDoneToken;return delete t.workDoneToken,new kr(e,n)};var qr;Cr.ProgressFeature=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),!0===e?.window?.workDoneProgress&&(this._progressSupported=!0,this.connection.onNotification(Dr.WorkDoneProgressCancelNotification.type,(e=>{let t=kr.Instances.get(e.token);(t instanceof xr||t instanceof Or)&&t.cancel()})))}attachWorkDoneProgress(e){return void 0===e?new Pr:new kr(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,Tr.generateUuid)();return this.connection.sendRequest(Dr.WorkDoneProgressCreateRequest.type,{token:e}).then((()=>new xr(this.connection,e)))}return Promise.resolve(new Or)}},function(e){e.type=new Dr.ProgressType}(qr||(qr={}));class Ir{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(qr.type,this._token,e)}}Cr.attachPartialResult=function(e,t){if(void 0===t||void 0===t.partialResultToken)return;const n=t.partialResultToken;return delete t.partialResultToken,new Ir(e,n)};var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.ConfigurationFeature=void 0;const Mr=Ee,Fr=be;Ar.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?Fr.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Mr.ConfigurationRequest.type,t).then((t=>Array.isArray(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null))}};var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.WorkspaceFoldersFeature=void 0;const jr=Ee;Lr.WorkspaceFoldersFeature=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new jr.Emitter,this.connection.onNotification(jr.DidChangeWorkspaceFoldersNotification.type,(e=>{this._onDidChangeWorkspaceFolders.fire(e.event)})))}fillServerCapabilities(e){super.fillServerCapabilities(e);const t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=!0===t||"string"==typeof t}getWorkspaceFolders(){return this.connection.sendRequest(jr.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._notificationIsAutoRegistered||this._unregistration||(this._unregistration=this.connection.client.register(jr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};var $r={};Object.defineProperty($r,"__esModule",{value:!0}),$r.CallHierarchyFeature=void 0;const Hr=Ee;$r.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Hr.CallHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onIncomingCalls:e=>{const t=Hr.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=Hr.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.SemanticTokensBuilder=Wr.SemanticTokensDiff=Wr.SemanticTokensFeature=void 0;const Vr=Ee;Wr.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Vr.SemanticTokensRefreshRequest.type),on:e=>{const t=Vr.SemanticTokensRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=Vr.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=Vr.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};class Ur{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){const e=this.originalSequence.length,t=this.modifiedSequence.length;let n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let r=e-1,i=t-1;for(;r>=n&&i>=n&&this.originalSequence[r]===this.modifiedSequence[i];)r--,i--;(r<n||i<n)&&(r++,i++);const o=r-n+1,s=this.modifiedSequence.slice(n,i+1);return 1===s.length&&s[0]===this.originalSequence[r]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:s}]}return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}}Wr.SemanticTokensDiff=Ur;Wr.SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,n,r,i){let o=e,s=t;this._dataLen>0&&(o-=this._prevLine,0===o&&(s-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return void 0!==this._prevData}buildEdits(){return void 0!==this._prevData?{resultId:this.id,edits:new Ur(this._prevData,this._data).computeDiff()}:this.build()}};var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.ShowDocumentFeature=void 0;const Gr=Ee;Kr.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(Gr.ShowDocumentRequest.type,e)}};var zr={};Object.defineProperty(zr,"__esModule",{value:!0}),zr.FileOperationsFeature=void 0;const Br=Ee;zr.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){return this.connection.onNotification(Br.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){return this.connection.onNotification(Br.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){return this.connection.onNotification(Br.DidDeleteFilesNotification.type,(t=>{e(t)}))}onWillCreateFiles(e){return this.connection.onRequest(Br.WillCreateFilesRequest.type,((t,n)=>e(t,n)))}onWillRenameFiles(e){return this.connection.onRequest(Br.WillRenameFilesRequest.type,((t,n)=>e(t,n)))}onWillDeleteFiles(e){return this.connection.onRequest(Br.WillDeleteFilesRequest.type,((t,n)=>e(t,n)))}};var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.LinkedEditingRangeFeature=void 0;const Xr=Ee;Jr.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){return this.connection.onRequest(Xr.LinkedEditingRangeRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))}};var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.TypeHierarchyFeature=void 0;const Qr=Ee;Yr.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Qr.TypeHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onSupertypes:e=>{const t=Qr.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onSubtypes:e=>{const t=Qr.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.InlineValueFeature=void 0;const ei=Ee;Zr.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(ei.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(ei.InlineValueRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t))))}}};var ti={};Object.defineProperty(ti,"__esModule",{value:!0}),ti.InlayHintFeature=void 0;const ni=Ee;ti.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(ni.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(ni.InlayHintRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t)))),resolve:e=>this.connection.onRequest(ni.InlayHintResolveRequest.type,((t,n)=>e(t,n)))}}};var ri={};Object.defineProperty(ri,"__esModule",{value:!0}),ri.DiagnosticFeature=void 0;const ii=Ee;ri.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(ii.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(ii.DocumentDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ii.DocumentDiagnosticRequest.partialResult,t)))),onWorkspace:e=>this.connection.onRequest(ii.WorkspaceDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ii.WorkspaceDiagnosticRequest.partialResult,t))))}}};var oi={},si={};Object.defineProperty(si,"__esModule",{value:!0}),si.TextDocuments=void 0;const ai=Ee;si.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ai.Emitter,this._onDidOpen=new ai.Emitter,this._onDidClose=new ai.Emitter,this._onDidSave=new ai.Emitter,this._onWillSave=new ai.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=ai.TextDocumentSyncKind.Incremental;const t=[];return t.push(e.onDidOpenTextDocument((e=>{const t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._syncedDocuments.set(t.uri,n);const r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)}))),t.push(e.onDidChangeTextDocument((e=>{const t=e.textDocument,n=e.contentChanges;if(0===n.length)return;const{version:r}=t;if(null==r)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);let i=this._syncedDocuments.get(t.uri);void 0!==i&&(i=this._configuration.update(i,n,r),this._syncedDocuments.set(t.uri,i),this._onDidChangeContent.fire(Object.freeze({document:i})))}))),t.push(e.onDidCloseTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&(this._syncedDocuments.delete(e.textDocument.uri),this._onDidClose.fire(Object.freeze({document:t})))}))),t.push(e.onWillSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))}))),t.push(e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._syncedDocuments.get(e.textDocument.uri);return void 0!==n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]}))),t.push(e.onDidSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onDidSave.fire(Object.freeze({document:t}))}))),ai.Disposable.create((()=>{t.forEach((e=>e.dispose()))}))}},Object.defineProperty(oi,"__esModule",{value:!0}),oi.NotebookDocuments=oi.NotebookSyncFeature=void 0;const ci=Ee,ui=si;oi.NotebookSyncFeature=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(ci.DidOpenNotebookDocumentNotification.type,(t=>{e(t)})),onDidChangeNotebookDocument:e=>this.connection.onNotification(ci.DidChangeNotebookDocumentNotification.type,(t=>{e(t)})),onDidSaveNotebookDocument:e=>this.connection.onNotification(ci.DidSaveNotebookDocumentNotification.type,(t=>{e(t)})),onDidCloseNotebookDocument:e=>this.connection.onNotification(ci.DidCloseNotebookDocumentNotification.type,(t=>{e(t)}))}}};class li{onDidOpenTextDocument(e){return this.openHandler=e,ci.Disposable.create((()=>{this.openHandler=void 0}))}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,ci.Disposable.create((()=>{this.changeHandler=e}))}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,ci.Disposable.create((()=>{this.closeHandler=void 0}))}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return li.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return li.NULL_DISPOSE}onDidSaveTextDocument(){return li.NULL_DISPOSE}}li.NULL_DISPOSE=Object.freeze({dispose:()=>{}});oi.NotebookDocuments=class{constructor(e){e instanceof ui.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ui.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new ci.Emitter,this._onDidChange=new ci.Emitter,this._onDidSave=new ci.Emitter,this._onDidClose=new ci.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){const t="string"==typeof e?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const t=new li,n=[];return n.push(this.cellTextDocuments.listen(t)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument((e=>{this.notebookDocuments.set(e.notebookDocument.uri,e.notebookDocument);for(const n of e.cellTextDocuments)t.openTextDocument({textDocument:n});this.updateCellMap(e.notebookDocument),this._onDidOpen.fire(e.notebookDocument)}))),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0===n)return;n.version=e.notebookDocument.version;const r=n.metadata;let i=!1;const o=e.change;void 0!==o.metadata&&(i=!0,n.metadata=o.metadata);const s=[],a=[],c=[],u=[];if(void 0!==o.cells){const e=o.cells;if(void 0!==e.structure){const r=e.structure.array;if(n.cells.splice(r.start,r.deleteCount,...void 0!==r.cells?r.cells:[]),void 0!==e.structure.didOpen)for(const n of e.structure.didOpen)t.openTextDocument({textDocument:n}),s.push(n.uri);if(e.structure.didClose)for(const n of e.structure.didClose)t.closeTextDocument({textDocument:n}),a.push(n.uri)}if(void 0!==e.data){const t=new Map(e.data.map((e=>[e.document,e])));for(let e=0;e<=n.cells.length;e++){const r=t.get(n.cells[e].document);if(void 0!==r){const i=n.cells.splice(e,1,r);if(c.push({old:i[0],new:r}),t.delete(r.document),0===t.size)break}}}if(void 0!==e.textContent)for(const n of e.textContent)t.changeTextDocument({textDocument:n.document,contentChanges:n.changes}),u.push(n.document.uri)}this.updateCellMap(n);const l={notebookDocument:n};i&&(l.metadata={old:r,new:n.metadata});const h=[];for(const e of s)h.push(this.getNotebookCell(e));const d=[];for(const e of a)d.push(this.getNotebookCell(e));const p=[];for(const e of u)p.push(this.getNotebookCell(e));(h.length>0||d.length>0||c.length>0||p.length>0)&&(l.cells={added:h,removed:d,changed:{data:c,textContent:p}}),void 0===l.metadata&&void 0===l.cells||this._onDidChange.fire(l)}))),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument((e=>{const t=this.notebookDocuments.get(e.notebookDocument.uri);void 0!==t&&this._onDidSave.fire(t)}))),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0!==n){this._onDidClose.fire(n);for(const n of e.cellTextDocuments)t.closeTextDocument({textDocument:n});this.notebookDocuments.delete(e.notebookDocument.uri);for(const e of n.cells)this.notebookCellMap.delete(e.document)}}))),ci.Disposable.create((()=>{n.forEach((e=>e.dispose()))}))}updateCellMap(e){for(const t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};var hi={};Object.defineProperty(hi,"__esModule",{value:!0}),hi.MonikerFeature=void 0;const di=Ee;hi.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{const t=di.MonikerRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.combineFeatures=e.combineNotebooksFeatures=e.combineLanguagesFeatures=e.combineWorkspaceFeatures=e.combineWindowFeatures=e.combineClientFeatures=e.combineTracerFeatures=e.combineTelemetryFeatures=e.combineConsoleFeatures=e._NotebooksImpl=e._LanguagesImpl=e.BulkUnregistration=e.BulkRegistration=e.ErrorMessageTracker=void 0;const t=Ee,n=be,r=br,i=Cr,o=Ar,s=Lr,a=$r,c=Wr,u=Kr,l=zr,h=Jr,d=Yr,p=Zr,f=ti,m=ri,g=oi,y=hi;function v(e){if(null!==e)return e}e.ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach((t=>{e.window.showErrorMessage(t)}))}};class b{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(t.MessageType.Error,e)}warn(e){this.send(t.MessageType.Warning,e)}info(e){this.send(t.MessageType.Info,e)}log(e){this.send(t.MessageType.Log,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:e,message:n}).catch((()=>{(0,t.RAL)().console.error("Sending log message failed")}))}}const S=(0,u.ShowDocumentFeature)((0,i.ProgressFeature)(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:t.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(v)}showWarningMessage(e,...n){let r={type:t.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(v)}showInformationMessage(e,...n){let r={type:t.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(v)}}));(e.BulkRegistration||(e.BulkRegistration={})).create=function(){return new w};class w{constructor(){this._registrations=[],this._registered=new Set}add(e,t){const i=n.string(e)?e:e.method;if(this._registered.has(i))throw new Error(`${i} is already added to this registration`);const o=r.generateUuid();this._registrations.push({id:o,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}}(e.BulkUnregistration||(e.BulkUnregistration={})).create=function(){return new R(void 0,[])};class R{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach((e=>{this._unregistrations.set(e.method,e)}))}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let t of this._unregistrations.values())e.push(t);let n={unregisterations:e};this._connection.sendRequest(t.UnregistrationRequest.type,n).catch((()=>{this._connection.console.info("Bulk unregistration failed.")}))}disposeSingle(e){const r=n.string(e)?e:e.method,i=this._unregistrations.get(r);if(!i)return!1;let o={unregisterations:[i]};return this._connection.sendRequest(t.UnregistrationRequest.type,o).then((()=>{this._unregistrations.delete(r)}),(e=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)})),!0}}class _{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof w?this.registerMany(e):e instanceof R?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,i,o){const s=n.string(i)?i:i.method,a=r.generateUuid();let c={registrations:[{id:a,method:s,registerOptions:o||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,c).then((t=>(e.add({id:a,method:s}),e)),(e=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(e))))}registerSingle2(e,i){const o=n.string(e)?e:e.method,s=r.generateUuid();let a={registrations:[{id:s,method:o,registerOptions:i||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,a).then((e=>t.Disposable.create((()=>{this.unregisterSingle(s,o).catch((()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)}))}))),(e=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(e))))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(t.UnregistrationRequest.type,r).catch((()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)}))}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,n).then((()=>new R(this._connection,n.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const E=(0,l.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,o.ConfigurationFeature)(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){let n=(r=e)&&r.edit?e:{edit:e};var r;return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,n)}})));class C{constructor(){this._trace=t.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:e,verbose:this._trace===t.Trace.Verbose?n:void 0}).catch((()=>{}))}}class D{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(t.TelemetryEventNotification.type,e).catch((()=>{this.connection.console.log("Sending TelemetryEventNotification failed")}))}}class T{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}}e._LanguagesImpl=T;const k=(0,y.MonikerFeature)((0,m.DiagnosticFeature)((0,f.InlayHintFeature)((0,p.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,h.LinkedEditingRangeFeature)((0,c.SemanticTokensFeature)((0,a.CallHierarchyFeature)(T))))))));class x{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}}e._NotebooksImpl=x;const P=(0,g.NotebookSyncFeature)(x);function O(e,t){return function(n){return t(e(n))}}function N(e,t){return function(n){return t(e(n))}}function q(e,t){return function(n){return t(e(n))}}function I(e,t){return function(n){return t(e(n))}}function A(e,t){return function(n){return t(e(n))}}function M(e,t){return function(n){return t(e(n))}}function F(e,t){return function(n){return t(e(n))}}function L(e,t){return function(n){return t(e(n))}}e.combineConsoleFeatures=O,e.combineTelemetryFeatures=N,e.combineTracerFeatures=q,e.combineClientFeatures=I,e.combineWindowFeatures=A,e.combineWorkspaceFeatures=M,e.combineLanguagesFeatures=F,e.combineNotebooksFeatures=L,e.combineFeatures=function(e,t){function n(e,t,n){return e&&t?n(e,t):e||t}return{__brand:"features",console:n(e.console,t.console,O),tracer:n(e.tracer,t.tracer,q),telemetry:n(e.telemetry,t.telemetry,N),client:n(e.client,t.client,I),window:n(e.window,t.window,A),workspace:n(e.workspace,t.workspace,M),languages:n(e.languages,t.languages,F),notebooks:n(e.notebooks,t.notebooks,L)}},e.createConnection=function(e,r,o){const s=o&&o.console?new(o.console(b)):new b,a=e(s);s.rawAttach(a);const c=o&&o.tracer?new(o.tracer(C)):new C,u=o&&o.telemetry?new(o.telemetry(D)):new D,l=o&&o.client?new(o.client(_)):new _,h=o&&o.window?new(o.window(S)):new S,d=o&&o.workspace?new(o.workspace(E)):new E,p=o&&o.languages?new(o.languages(k)):new k,f=o&&o.notebooks?new(o.notebooks(P)):new P,m=[s,c,u,l,h,d,p,f];function g(e){return e instanceof Promise?e:n.thenable(e)?new Promise(((t,n)=>{e.then((e=>t(e)),(e=>n(e)))})):Promise.resolve(e)}let y,v,w,R={listen:()=>a.listen(),sendRequest:(e,...t)=>a.sendRequest(n.string(e)?e:e.method,...t),onRequest:(e,t)=>a.onRequest(e,t),sendNotification:(e,t)=>{const r=n.string(e)?e:e.method;return 1===arguments.length?a.sendNotification(r):a.sendNotification(r,t)},onNotification:(e,t)=>a.onNotification(e,t),onProgress:a.onProgress,sendProgress:a.sendProgress,onInitialize:e=>(v=e,{dispose:()=>{v=void 0}}),onInitialized:e=>a.onNotification(t.InitializedNotification.type,e),onShutdown:e=>(y=e,{dispose:()=>{y=void 0}}),onExit:e=>(w=e,{dispose:()=>{w=void 0}}),get console(){return s},get telemetry(){return u},get tracer(){return c},get client(){return l},get window(){return h},get workspace(){return d},get languages(){return p},get notebooks(){return f},onDidChangeConfiguration:e=>a.onNotification(t.DidChangeConfigurationNotification.type,e),onDidChangeWatchedFiles:e=>a.onNotification(t.DidChangeWatchedFilesNotification.type,e),__textDocumentSync:void 0,onDidOpenTextDocument:e=>a.onNotification(t.DidOpenTextDocumentNotification.type,e),onDidChangeTextDocument:e=>a.onNotification(t.DidChangeTextDocumentNotification.type,e),onDidCloseTextDocument:e=>a.onNotification(t.DidCloseTextDocumentNotification.type,e),onWillSaveTextDocument:e=>a.onNotification(t.WillSaveTextDocumentNotification.type,e),onWillSaveTextDocumentWaitUntil:e=>a.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,e),onDidSaveTextDocument:e=>a.onNotification(t.DidSaveTextDocumentNotification.type,e),sendDiagnostics:e=>a.sendNotification(t.PublishDiagnosticsNotification.type,e),onHover:e=>a.onRequest(t.HoverRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onCompletion:e=>a.onRequest(t.CompletionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onCompletionResolve:e=>a.onRequest(t.CompletionResolveRequest.type,e),onSignatureHelp:e=>a.onRequest(t.SignatureHelpRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onDeclaration:e=>a.onRequest(t.DeclarationRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDefinition:e=>a.onRequest(t.DefinitionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onTypeDefinition:e=>a.onRequest(t.TypeDefinitionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onImplementation:e=>a.onRequest(t.ImplementationRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onReferences:e=>a.onRequest(t.ReferencesRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDocumentHighlight:e=>a.onRequest(t.DocumentHighlightRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDocumentSymbol:e=>a.onRequest(t.DocumentSymbolRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onWorkspaceSymbol:e=>a.onRequest(t.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onWorkspaceSymbolResolve:e=>a.onRequest(t.WorkspaceSymbolResolveRequest.type,e),onCodeAction:e=>a.onRequest(t.CodeActionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onCodeActionResolve:e=>a.onRequest(t.CodeActionResolveRequest.type,((t,n)=>e(t,n))),onCodeLens:e=>a.onRequest(t.CodeLensRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onCodeLensResolve:e=>a.onRequest(t.CodeLensResolveRequest.type,((t,n)=>e(t,n))),onDocumentFormatting:e=>a.onRequest(t.DocumentFormattingRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onDocumentRangeFormatting:e=>a.onRequest(t.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onDocumentOnTypeFormatting:e=>a.onRequest(t.DocumentOnTypeFormattingRequest.type,((t,n)=>e(t,n))),onRenameRequest:e=>a.onRequest(t.RenameRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onPrepareRename:e=>a.onRequest(t.PrepareRenameRequest.type,((t,n)=>e(t,n))),onDocumentLinks:e=>a.onRequest(t.DocumentLinkRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDocumentLinkResolve:e=>a.onRequest(t.DocumentLinkResolveRequest.type,((t,n)=>e(t,n))),onDocumentColor:e=>a.onRequest(t.DocumentColorRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onColorPresentation:e=>a.onRequest(t.ColorPresentationRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onFoldingRanges:e=>a.onRequest(t.FoldingRangeRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onSelectionRanges:e=>a.onRequest(t.SelectionRangeRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onExecuteCommand:e=>a.onRequest(t.ExecuteCommandRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),dispose:()=>a.dispose()};for(let e of m)e.attach(R);return a.onRequest(t.InitializeRequest.type,(e=>{r.initialize(e),n.string(e.trace)&&(c.trace=t.Trace.fromString(e.trace));for(let t of m)t.initialize(e.capabilities);if(v){return g(v(e,(new t.CancellationTokenSource).token,(0,i.attachWorkDone)(a,e),void 0)).then((e=>{if(e instanceof t.ResponseError)return e;let r=e;r||(r={capabilities:{}});let i=r.capabilities;i||(i={},r.capabilities=i),void 0===i.textDocumentSync||null===i.textDocumentSync?i.textDocumentSync=n.number(R.__textDocumentSync)?R.__textDocumentSync:t.TextDocumentSyncKind.None:n.number(i.textDocumentSync)||n.number(i.textDocumentSync.change)||(i.textDocumentSync.change=n.number(R.__textDocumentSync)?R.__textDocumentSync:t.TextDocumentSyncKind.None);for(let e of m)e.fillServerCapabilities(i);return r}))}{let e={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let t of m)t.fillServerCapabilities(e.capabilities);return e}})),a.onRequest(t.ShutdownRequest.type,(()=>(r.shutdownReceived=!0,y?y((new t.CancellationTokenSource).token):void 0))),a.onNotification(t.ExitNotification.type,(()=>{try{w&&w()}finally{r.shutdownReceived?r.exit(0):r.exit(1)}})),a.onNotification(t.SetTraceNotification.type,(e=>{c.trace=t.Trace.fromString(e.value)})),R}}(_e);var pi={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolveModulePath=e.FileSystem=e.resolveGlobalYarnPath=e.resolveGlobalNodePath=e.resolve=e.uriToFilePath=void 0;const t=f,n=s,r=a,i=o;function c(){return"win32"===process.platform}function u(e,t,o,s){const a="NODE_PATH",c=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise(((u,l)=>{let h=process.env,d=Object.create(null);Object.keys(h).forEach((e=>d[e]=h[e])),t&&r.existsSync(t)&&(d[a]?d[a]=t+n.delimiter+d[a]:d[a]=t,s&&s(`NODE_PATH value is: ${d[a]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let t=(0,i.fork)("",[],{cwd:o,env:d,execArgv:["-e",c]});if(void 0===t.pid)return void l(new Error(`Starting process to resolve node module ${e} failed`));t.on("error",(e=>{l(e)})),t.on("message",(n=>{"r"===n.c&&(t.send({c:"e"}),n.s?u(n.r):l(new Error(`Failed to resolve module: ${e}`)))}));let n={c:"rs",a:e};t.send(n)}catch(e){l(e)}}))}function l(e){let t="npm";const r=Object.create(null);Object.keys(process.env).forEach((e=>r[e]=process.env[e])),r.NO_UPDATE_NOTIFIER="true";const o={encoding:"utf8",env:r};c()&&(t="npm.cmd",o.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let r=(0,i.spawnSync)(t,["config","get","prefix"],o).stdout;if(!r)return void(e&&e("'npm config get prefix' didn't return a value."));let a=r.trim();return e&&e(`'npm config get prefix' value is: ${a}`),a.length>0?c()?n.join(a,"node_modules"):n.join(a,"lib","node_modules"):void 0}catch(e){return}finally{process.removeListener("SIGPIPE",s)}}var h;e.uriToFilePath=function(e){let r=t.parse(e);if("file:"!==r.protocol||!r.path)return;let i=r.path.split("/");for(var o=0,s=i.length;o<s;o++)i[o]=decodeURIComponent(i[o]);if("win32"===process.platform&&i.length>1){let e=i[0],t=i[1];0===e.length&&t.length>1&&":"===t[1]&&i.shift()}return n.normalize(i.join("/"))},e.resolve=u,e.resolveGlobalNodePath=l,e.resolveGlobalYarnPath=function(e){let t="yarn",r={encoding:"utf8"};c()&&(t="yarn.cmd",r.shell=!0);let o=()=>{};try{process.on("SIGPIPE",o);let s=(0,i.spawnSync)(t,["global","dir","--json"],r),a=s.stdout;if(!a)return void(e&&(e("'yarn global dir' didn't return a value."),s.stderr&&e(s.stderr)));let c=a.trim().split(/\r?\n/);for(let e of c)try{let t=JSON.parse(e);if("log"===t.type)return n.join(t.data,"node_modules")}catch(e){}return}catch(e){return}finally{process.removeListener("SIGPIPE",o)}},function(e){let t;function i(){return void 0!==t||(t="win32"!==process.platform&&(!r.existsSync(__filename.toUpperCase())||!r.existsSync(__filename.toLowerCase()))),t}e.isCaseSensitive=i,e.isParent=function(e,t){return i()?0===n.normalize(t).indexOf(n.normalize(e)):0===n.normalize(t).toLowerCase().indexOf(n.normalize(e).toLowerCase())}}(h=e.FileSystem||(e.FileSystem={})),e.resolveModulePath=function(e,t,r,i){return r?(n.isAbsolute(r)||(r=n.join(e,r)),u(t,r,r,i).then((e=>h.isParent(r,e)?e:Promise.reject(new Error(`Failed to load ${t} from node path location.`)))).then(void 0,(n=>u(t,l(i),e,i)))):u(t,l(i),e,i)}}(pi);var fi={};({get exports(){return fi},set exports(e){fi=e}}).exports=Ee;var mi={};!function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.ProposedFeatures=e.NotebookDocuments=e.TextDocuments=e.SemanticTokensBuilder=void 0;const r=Wr;Object.defineProperty(e,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}}),n(Ee,e);const i=si;Object.defineProperty(e,"TextDocuments",{enumerable:!0,get:function(){return i.TextDocuments}});const o=oi;Object.defineProperty(e,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(_e,e),(e.ProposedFeatures||(e.ProposedFeatures={})).all={__brand:"features"}}(mi),function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.Files=void 0;const r=be,i=_e,o=pi,s=fi;var a;n(fi,e),n(mi,e),(a=e.Files||(e.Files={})).uriToFilePath=o.uriToFilePath,a.resolveGlobalNodePath=o.resolveGlobalNodePath,a.resolveGlobalYarnPath=o.resolveGlobalYarnPath,a.resolve=o.resolve,a.resolveModulePath=o.resolveModulePath;let c,u=!1;!function(){const e="--clientProcessId";function t(e){try{let t=parseInt(e);isNaN(t)||(c=setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(u?0:1)}}),3e3))}catch(e){}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length)return void t(process.argv[n+1]);{let n=r.split("=");n[0]===e&&t(n[1])}}}();const l={initialize:e=>{const t=e.processId;r.number(t)&&void 0===c&&setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(u?0:1)}}),3e3)},get shutdownReceived(){return u},set shutdownReceived(e){u=e},exit:e=>{process.exit(e)}};e.createConnection=function(e,t,n,o){let a,c,h,d;return void 0!==e&&"features"===e.__brand&&(a=e,e=t,t=n,n=o),s.ConnectionStrategy.is(e)||s.ConnectionOptions.is(e)?d=e:(c=e,h=t,d=n),function(e,t,n,o){if(!e&&!t&&process.argv.length>2){let n,r,i=process.argv.slice(2);for(let o=0;o<i.length;o++){let c=i[o];if("--node-ipc"===c){e=new s.IPCMessageReader(process),t=new s.IPCMessageWriter(process);break}if("--stdio"===c){e=process.stdin,t=process.stdout;break}if("--socket"===c){n=parseInt(i[o+1]);break}if("--pipe"===c){r=i[o+1];break}var a=c.split("=");if("--socket"===a[0]){n=parseInt(a[1]);break}if("--pipe"===a[0]){r=a[1];break}}if(n){let r=(0,s.createServerSocketTransport)(n);e=r[0],t=r[1]}else if(r){let n=(0,s.createServerPipeTransport)(r);e=n[0],t=n[1]}}var c="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+c);if(!t)throw new Error("Connection output stream is not set. "+c);if(r.func(e.read)&&r.func(e.on)){let t=e;t.on("end",(()=>{process.exit(u?0:1)})),t.on("close",(()=>{process.exit(u?0:1)}))}const h=r=>(0,s.createProtocolConnection)(e,t,r,n);return(0,i.createConnection)(h,l,o)}(c,h,d,a)}}(ve);const gi=k(ve);var yi={};({get exports(){return yi},set exports(e){yi=e}}).exports=ve;const vi=k(yi);var bi;!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Log=3]="Log"}(bi=bi||(bi={})),function(e){e.fromString=function(t){switch(t?.toLowerCase()){case"log":return e.Log;case"info":return e.Info;case"warning":return e.Warning;default:return e.Error}},e.toString=function(t){switch(t){case e.Error:return"error";case e.Warning:return"warning";case e.Info:return"info";case e.Log:return"log"}}}(bi=bi||(bi={}));class Si{constructor(e,t){this.client=e,this.level=t}sendMessage(e,t,n){if(this.level>=e||n?.overrideLevel){const n=t.map((e=>"object"==typeof e?JSON.stringify(e,null,2):e)).join(" ");this.client.logMessage({type:e,message:n})}}logLevelToLspMessageType(e){switch(e){case bi.Log:return gi.MessageType.Log;case bi.Info:return gi.MessageType.Info;case bi.Warning:return gi.MessageType.Warning;case bi.Error:return gi.MessageType.Error}}error(...e){this.sendMessage(gi.MessageType.Error,e)}warn(...e){this.sendMessage(gi.MessageType.Warning,e)}info(...e){this.sendMessage(gi.MessageType.Info,e)}log(...e){this.sendMessage(gi.MessageType.Log,e)}logIgnoringVerbosity(e,...t){this.sendMessage(this.logLevelToLspMessageType(e),t,{overrideLevel:!0})}trace(e,t,n){this.logIgnoringVerbosity(bi.Log,`[${e} - ${Ri()}] ${t}`),n&&this.logIgnoringVerbosity(bi.Log,Ei(n))}}class wi{constructor(e,t){this.logger=e,this.prefix=t}error(...e){this.logger.error(this.prefix,...e)}warn(...e){this.logger.warn(this.prefix,...e)}info(...e){this.logger.info(this.prefix,...e)}log(...e){this.logger.log(this.prefix,...e)}logIgnoringVerbosity(e,...t){this.logger.logIgnoringVerbosity(e,this.prefix,...t)}trace(e,t,n){this.logIgnoringVerbosity(bi.Log,this.prefix,`[${e} - ${Ri()}] ${t}`),n&&this.logIgnoringVerbosity(bi.Log,this.prefix,Ei(n))}}function Ri(){const e=new Date;return`${_i(`${e.getUTCHours()}`,2,"0")}:${_i(`${e.getMinutes()}`,2,"0")}:${_i(`${e.getUTCSeconds()}`,2,"0")}.${e.getMilliseconds()}`}function _i(e,t,n=" "){return n.repeat(Math.max(0,t-e.length))+e}function Ei(e){return e instanceof Error?e.stack||e.message:!1===e.success&&e.message?e.message:e.toString()}var Ci={},Di={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},Ti=v,ki=process.cwd,xi=null,Pi=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xi||(xi=ki.call(process)),xi};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Oi=process.chdir;process.chdir=function(e){xi=null,Oi.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Oi)}var Ni=function(e){Ti.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,Ti.O_WRONLY|Ti.O_SYMLINK,n,(function(t,i){t?r&&r(t):e.fchmod(i,n,(function(t){e.close(i,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,i=e.openSync(t,Ti.O_WRONLY|Ti.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(i,n),o=!1}finally{if(o)try{e.closeSync(i)}catch(e){}else e.closeSync(i)}return r}}(e);e.lutimes||function(e){Ti.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,n,r,i){e.open(t,Ti.O_SYMLINK,(function(t,o){t?i&&i(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){i&&i(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var i,o=e.openSync(t,Ti.O_SYMLINK),s=!0;try{i=e.futimesSync(o,n,r),s=!1}finally{if(s)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return i}):(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=a(e.statSync),e.fstatSync=a(e.fstatSync),e.lstatSync=a(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.lchown||(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Pi&&(e.rename=(t=e.rename,function(n,r,i){var o=Date.now(),s=0;t(n,r,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,a):i(c)}))}),s),void(s<100&&(s+=10));i&&i(c)}))}));var t;function n(t){return t?function(n,r,i){return t.call(e,n,r,(function(e){c(e)&&(e=null),i&&i.apply(this,arguments)}))}:t}function r(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!c(e))throw e}}:t}function i(t){return t?function(n,r,i,o){return t.call(e,n,r,i,(function(e){c(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function o(t){return t?function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!c(e))throw e}}:t}function s(t){return t?function(n,r,i){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof r&&(i=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function a(t){return t?function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296),i}:t}function c(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read=function(t){function n(n,r,i,o,s,a){var c;if(a&&"function"==typeof a){var u=0;c=function(l,h,d){if(l&&"EAGAIN"===l.code&&u<10)return u++,t.call(e,n,r,i,o,s,c);a.apply(this,arguments)}}return t.call(e,n,r,i,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync=(u=e.readSync,function(t,n,r,i,o){for(var s=0;;)try{return u.call(e,t,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var u};var qi=b.Stream,Ii=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);qi.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){i._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return i.emit("error",e),void(i.readable=!1);i.fd=t,i.emit("open",t),i._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);qi.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var i=Object.keys(r),o=0,s=i.length;o<s;o++){var a=i[o];this[a]=r[a]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Ai=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:Mi(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},Mi=Object.getPrototypeOf||function(e){return e.__proto__};var Fi,Li,ji=a,$i=Ni,Hi=Ii,Wi=Ai,Vi=u;function Ui(e,t){Object.defineProperty(e,Fi,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Fi=Symbol.for("graceful-fs.queue"),Li=Symbol.for("graceful-fs.previous")):(Fi="___graceful-fs.queue",Li="___graceful-fs.previous");var Ki=function(){};if(Vi.debuglog?Ki=Vi.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ki=function(){var e=Vi.format.apply(Vi,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!ji[Fi]){var Gi=T[Fi]||[];Ui(ji,Gi),ji.close=function(e){function t(t,n){return e.call(ji,t,(function(e){e||Yi(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Li,{value:e}),t}(ji.close),ji.closeSync=function(e){function t(t){e.apply(ji,arguments),Yi()}return Object.defineProperty(t,Li,{value:e}),t}(ji.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ki(ji[Fi]),S.equal(ji[Fi].length,0)}))}T[Fi]||Ui(T,ji[Fi]);var zi,Bi=Ji(Wi(ji));function Ji(e){$i(e),e.gracefulify=Ji,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,i,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):Xi([e,[n,r,i],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,o,s){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):Xi([e,[t,r,i,o],n,s||Date.now(),Date.now()])}))}(e,t,r,i)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,i){"function"==typeof n&&(i=n,n=null);return function e(t,n,i,o,s){return r(t,n,i,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):Xi([e,[t,n,i,o],r,s||Date.now(),Date.now()])}))}(e,t,n,i)});var i=e.copyFile;i&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,s){return i(t,n,r,(function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof o&&o.apply(this,arguments):Xi([e,[t,n,r,o],i,s||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;if(e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);return function e(t,n,r,i){return o(t,n,(function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof r&&r.call(this,o,s)):Xi([e,[t,n,r],o,i||Date.now(),Date.now()])}))}(e,t,n)},"v0.8"===process.version.substr(0,4)){var s=Hi(e);h=s.ReadStream,d=s.WriteStream}var a=e.ReadStream;a&&(h.prototype=Object.create(a.prototype),h.prototype.open=function(){var e=this;f(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var c=e.WriteStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;f(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var u=h;Object.defineProperty(e,"FileReadStream",{get:function(){return u},set:function(e){u=e},enumerable:!0,configurable:!0});var l=d;function h(e,t){return this instanceof h?(a.apply(this,arguments),this):h.apply(Object.create(h.prototype),arguments)}function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var p=e.open;function f(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,o){return p(t,n,r,(function(s,a){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):Xi([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=f,e}function Xi(e){Ki("ENQUEUE",e[0].name,e[1]),ji[Fi].push(e),Qi()}function Yi(){for(var e=Date.now(),t=0;t<ji[Fi].length;++t)ji[Fi][t].length>2&&(ji[Fi][t][3]=e,ji[Fi][t][4]=e);Qi()}function Qi(){if(clearTimeout(zi),zi=void 0,0!==ji[Fi].length){var e=ji[Fi].shift(),t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];if(void 0===i)Ki("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){Ki("TIMEOUT",t.name,n);var s=n.pop();"function"==typeof s&&s.call(null,r)}else{var a=Date.now()-o,c=Math.max(o-i,1);a>=Math.min(1.2*c,100)?(Ki("RETRY",t.name,n),t.apply(null,n.concat([i]))):ji[Fi].push(e)}void 0===zi&&(zi=setTimeout(Qi,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ji.__patched&&(Bi=Ji(ji),ji.__patched=!0),function(e){const t=Di.fromCallback,n=Bi,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,i,o,s){return"function"==typeof s?n.read(e,t,r,i,o,s):new Promise(((s,a)=>{n.read(e,t,r,i,o,((e,t,n)=>{if(e)return a(e);s({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((i,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesWritten:t,buffer:n})}))}))},e.readv=function(e,t,...r){return"function"==typeof r[r.length-1]?n.readv(e,t,...r):new Promise(((i,o)=>{n.readv(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesRead:t,buffers:n})}))}))},e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((i,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesWritten:t,buffers:n})}))}))},"function"==typeof n.realpath.native?e.realpath.native=t(n.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(Ci);var Zi={},eo={};const to=s;eo.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(to.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const no=Ci,{checkPath:ro}=eo,io=e=>"number"==typeof e?e:{mode:511,...e}.mode;Zi.makeDir=async(e,t)=>(ro(e),no.mkdir(e,{mode:io(t),recursive:!0})),Zi.makeDirSync=(e,t)=>(ro(e),no.mkdirSync(e,{mode:io(t),recursive:!0}));const oo=Di.fromPromise,{makeDir:so,makeDirSync:ao}=Zi,co=oo(so);var uo={mkdirs:co,mkdirsSync:ao,mkdirp:co,mkdirpSync:ao,ensureDir:co,ensureDirSync:ao};const lo=Di.fromPromise,ho=Ci;var po={pathExists:lo((function(e){return ho.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:ho.existsSync};const fo=Bi;var mo=function(e,t,n,r){fo.open(e,"r+",((e,i)=>{if(e)return r(e);fo.futimes(i,t,n,(e=>{fo.close(i,(t=>{r&&r(e||t)}))}))}))},go=function(e,t,n){const r=fo.openSync(e,"r+");return fo.futimesSync(r,t,n),fo.closeSync(r)};const yo=Ci,vo=s,bo=u;function So(e,t,n){const r=n.dereference?e=>yo.stat(e,{bigint:!0}):e=>yo.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function wo(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ro(e,t){const n=vo.resolve(e).split(vo.sep).filter((e=>e)),r=vo.resolve(t).split(vo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function _o(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Eo={checkPaths:function(e,t,n,r,i){bo.callbackify(So)(e,t,r,((r,o)=>{if(r)return i(r);const{srcStat:s,destStat:a}=o;if(a){if(wo(s,a)){const r=vo.basename(e),o=vo.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?i(null,{srcStat:s,destStat:a,isChangingCase:!0}):i(new Error("Source and destination must not be the same."))}if(s.isDirectory()&&!a.isDirectory())return i(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!s.isDirectory()&&a.isDirectory())return i(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return s.isDirectory()&&Ro(e,t)?i(new Error(_o(e,t,n))):i(null,{srcStat:s,destStat:a})}))},checkPathsSync:function(e,t,n,r){const{srcStat:i,destStat:o}=function(e,t,n){let r;const i=n.dereference?e=>yo.statSync(e,{bigint:!0}):e=>yo.lstatSync(e,{bigint:!0}),o=i(e);try{r=i(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(wo(i,o)){const r=vo.basename(e),s=vo.basename(t);if("move"===n&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&Ro(e,t))throw new Error(_o(e,t,n));return{srcStat:i,destStat:o}},checkParentPaths:function e(t,n,r,i,o){const s=vo.resolve(vo.dirname(t)),a=vo.resolve(vo.dirname(r));if(a===s||a===vo.parse(a).root)return o();yo.stat(a,{bigint:!0},((s,c)=>s?"ENOENT"===s.code?o():o(s):wo(n,c)?o(new Error(_o(t,r,i))):e(t,n,a,i,o)))},checkParentPathsSync:function e(t,n,r,i){const o=vo.resolve(vo.dirname(t)),s=vo.resolve(vo.dirname(r));if(s===o||s===vo.parse(s).root)return;let a;try{a=yo.statSync(s,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(wo(n,a))throw new Error(_o(t,r,i));return e(t,n,s,i)},isSrcSubdir:Ro,areIdentical:wo};const Co=Bi,Do=s,To=uo.mkdirs,ko=po.pathExists,xo=mo,Po=Eo;function Oo(e,t,n,r){if(!n.filter)return r(null,!0);Promise.resolve(n.filter(e,t)).then((e=>r(null,e)),(e=>r(e)))}function No(e,t,n,r,i){(r.dereference?Co.stat:Co.lstat)(t,((o,s)=>o?i(o):s.isDirectory()?function(e,t,n,r,i,o){return t?Mo(n,r,i,o):function(e,t,n,r,i){Co.mkdir(n,(o=>{if(o)return i(o);Mo(t,n,r,(t=>t?i(t):Ao(n,e,i)))}))}(e.mode,n,r,i,o)}(s,e,t,n,r,i):s.isFile()||s.isCharacterDevice()||s.isBlockDevice()?function(e,t,n,r,i,o){return t?function(e,t,n,r,i){if(!r.overwrite)return r.errorOnExist?i(new Error(`'${n}' already exists`)):i();Co.unlink(n,(o=>o?i(o):qo(e,t,n,r,i)))}(e,n,r,i,o):qo(e,n,r,i,o)}(s,e,t,n,r,i):s.isSymbolicLink()?function(e,t,n,r,i){Co.readlink(t,((t,o)=>t?i(t):(r.dereference&&(o=Do.resolve(process.cwd(),o)),e?void Co.readlink(n,((e,t)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?Co.symlink(o,n,i):i(e):(r.dereference&&(t=Do.resolve(process.cwd(),t)),Po.isSrcSubdir(o,t)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${t}'.`)):Po.isSrcSubdir(t,o)?i(new Error(`Cannot overwrite '${t}' with '${o}'.`)):function(e,t,n){Co.unlink(t,(r=>r?n(r):Co.symlink(e,t,n)))}(o,n,i)))):Co.symlink(o,n,i))))}(e,t,n,r,i):s.isSocket()?i(new Error(`Cannot copy a socket file: ${t}`)):s.isFIFO()?i(new Error(`Cannot copy a FIFO pipe: ${t}`)):i(new Error(`Unknown file: ${t}`))))}function qo(e,t,n,r,i){Co.copyFile(t,n,(o=>o?i(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return Ao(e,128|t,n)}(n,e,(i=>i?r(i):Io(e,t,n,r)));return Io(e,t,n,r)}(e.mode,t,n,i):Ao(n,e.mode,i)))}function Io(e,t,n,r){!function(e,t,n){Co.stat(e,((e,r)=>e?n(e):xo(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):Ao(n,e,r)))}function Ao(e,t,n){return Co.chmod(e,t,n)}function Mo(e,t,n,r){Co.readdir(e,((i,o)=>i?r(i):Fo(o,e,t,n,r)))}function Fo(e,t,n,r,i){const o=e.pop();return o?function(e,t,n,r,i,o){const s=Do.join(n,t),a=Do.join(r,t);Oo(s,a,i,((t,c)=>t?o(t):c?void Po.checkPaths(s,a,"copy",i,((t,c)=>{if(t)return o(t);const{destStat:u}=c;No(u,s,a,i,(t=>t?o(t):Fo(e,n,r,i,o)))})):Fo(e,n,r,i,o)))}(e,o,t,n,r,i):i()}var Lo=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),Po.checkPaths(e,t,"copy",n,((i,o)=>{if(i)return r(i);const{srcStat:s,destStat:a}=o;Po.checkParentPaths(e,s,t,"copy",(i=>{if(i)return r(i);Oo(e,t,n,((i,o)=>i?r(i):o?void function(e,t,n,r,i){const o=Do.dirname(n);ko(o,((s,a)=>s?i(s):a?No(e,t,n,r,i):void To(o,(o=>o?i(o):No(e,t,n,r,i)))))}(a,e,t,n,r):r()))}))}))};const jo=Bi,$o=s,Ho=uo.mkdirsSync,Wo=go,Vo=Eo;function Uo(e,t,n,r){const i=(r.dereference?jo.statSync:jo.lstatSync)(t);if(i.isDirectory())return function(e,t,n,r,i){return t?zo(n,r,i):function(e,t,n,r){return jo.mkdirSync(n),zo(t,n,r),Go(n,e)}(e.mode,n,r,i)}(i,e,t,n,r);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return function(e,t,n,r,i){return t?function(e,t,n,r){if(r.overwrite)return jo.unlinkSync(n),Ko(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,i):Ko(e,n,r,i)}(i,e,t,n,r);if(i.isSymbolicLink())return function(e,t,n,r){let i=jo.readlinkSync(t);r.dereference&&(i=$o.resolve(process.cwd(),i));if(e){let e;try{e=jo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return jo.symlinkSync(i,n);throw e}if(r.dereference&&(e=$o.resolve(process.cwd(),e)),Vo.isSrcSubdir(i,e))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${e}'.`);if(Vo.isSrcSubdir(e,i))throw new Error(`Cannot overwrite '${e}' with '${i}'.`);return function(e,t){return jo.unlinkSync(t),jo.symlinkSync(e,t)}(i,n)}return jo.symlinkSync(i,n)}(e,t,n,r);if(i.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(i.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function Ko(e,t,n,r){return jo.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){Go(e,128|t)}(n,e);(function(e,t){const n=jo.statSync(e);Wo(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),Go(n,e.mode)}function Go(e,t){return jo.chmodSync(e,t)}function zo(e,t,n){jo.readdirSync(e).forEach((r=>function(e,t,n,r){const i=$o.join(t,e),o=$o.join(n,e);if(r.filter&&!r.filter(i,o))return;const{destStat:s}=Vo.checkPathsSync(i,o,"copy",r);return Uo(s,i,o,r)}(r,e,t,n)))}var Bo=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:i}=Vo.checkPathsSync(e,t,"copy",n);if(Vo.checkParentPathsSync(e,r,t,"copy"),n.filter&&!n.filter(e,t))return;const o=$o.dirname(t);return jo.existsSync(o)||Ho(o),Uo(i,e,t,n)};var Jo={copy:(0,Di.fromCallback)(Lo),copySync:Bo};const Xo=Bi;var Yo={remove:(0,Di.fromCallback)((function(e,t){Xo.rm(e,{recursive:!0,force:!0},t)})),removeSync:function(e){Xo.rmSync(e,{recursive:!0,force:!0})}};const Qo=Di.fromPromise,Zo=Ci,es=s,ts=uo,ns=Yo,rs=Qo((async function(e){let t;try{t=await Zo.readdir(e)}catch{return ts.mkdirs(e)}return Promise.all(t.map((t=>ns.remove(es.join(e,t)))))}));function is(e){let t;try{t=Zo.readdirSync(e)}catch{return ts.mkdirsSync(e)}t.forEach((t=>{t=es.join(e,t),ns.removeSync(t)}))}var os={emptyDirSync:is,emptydirSync:is,emptyDir:rs,emptydir:rs};const ss=Di.fromCallback,as=s,cs=Bi,us=uo;var ls={createFile:ss((function(e,t){function n(){cs.writeFile(e,"",(e=>{if(e)return t(e);t()}))}cs.stat(e,((r,i)=>{if(!r&&i.isFile())return t();const o=as.dirname(e);cs.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?us.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():cs.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=cs.statSync(e)}catch{}if(t&&t.isFile())return;const n=as.dirname(e);try{cs.statSync(n).isDirectory()||cs.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;us.mkdirsSync(n)}cs.writeFileSync(e,"")}};const hs=Di.fromCallback,ds=s,ps=Bi,fs=uo,ms=po.pathExists,{areIdentical:gs}=Eo;var ys={createLink:hs((function(e,t,n){function r(e,t){ps.link(e,t,(e=>{if(e)return n(e);n(null)}))}ps.lstat(t,((i,o)=>{ps.lstat(e,((i,s)=>{if(i)return i.message=i.message.replace("lstat","ensureLink"),n(i);if(o&&gs(s,o))return n(null);const a=ds.dirname(t);ms(a,((i,o)=>i?n(i):o?r(e,t):void fs.mkdirs(a,(i=>{if(i)return n(i);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=ps.lstatSync(t)}catch{}try{const t=ps.lstatSync(e);if(n&&gs(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=ds.dirname(t);return ps.existsSync(r)||fs.mkdirsSync(r),ps.linkSync(e,t)}};const vs=s,bs=Bi,Ss=po.pathExists;var ws={symlinkPaths:function(e,t,n){if(vs.isAbsolute(e))return bs.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=vs.dirname(t),i=vs.join(r,e);return Ss(i,((t,o)=>t?n(t):o?n(null,{toCwd:i,toDst:e}):bs.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:vs.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(vs.isAbsolute(e)){if(n=bs.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=vs.dirname(t),i=vs.join(r,e);if(n=bs.existsSync(i),n)return{toCwd:i,toDst:e};if(n=bs.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:vs.relative(r,e)}}}};const Rs=Bi;var _s={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Rs.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Rs.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=Di.fromCallback,Cs=s,Ds=Ci,Ts=uo.mkdirs,ks=uo.mkdirsSync,xs=ws.symlinkPaths,Ps=ws.symlinkPathsSync,Os=_s.symlinkType,Ns=_s.symlinkTypeSync,qs=po.pathExists,{areIdentical:Is}=Eo;function As(e,t,n,r){xs(e,t,((i,o)=>{if(i)return r(i);e=o.toDst,Os(o.toCwd,n,((n,i)=>{if(n)return r(n);const o=Cs.dirname(t);qs(o,((n,s)=>n?r(n):s?Ds.symlink(e,t,i,r):void Ts(o,(n=>{if(n)return r(n);Ds.symlink(e,t,i,r)}))))}))}))}var Ms={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ds.lstat(t,((i,o)=>{!i&&o.isSymbolicLink()?Promise.all([Ds.stat(e),Ds.stat(t)]).then((([i,o])=>{if(Is(i,o))return r(null);As(e,t,n,r)})):As(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Ds.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Ds.statSync(e),r=Ds.statSync(t);if(Is(n,r))return}const i=Ps(e,t);e=i.toDst,n=Ns(i.toCwd,n);const o=Cs.dirname(t);return Ds.existsSync(o)||ks(o),Ds.symlinkSync(e,t,n)}};const{createFile:Fs,createFileSync:Ls}=ls,{createLink:js,createLinkSync:$s}=ys,{createSymlink:Hs,createSymlinkSync:Ws}=Ms;var Vs,Us,Ks,Gs,zs,Bs,Js,Xs,Ys={createFile:Fs,createFileSync:Ls,ensureFile:Fs,ensureFileSync:Ls,createLink:js,createLinkSync:$s,ensureLink:js,ensureLinkSync:$s,createSymlink:Hs,createSymlinkSync:Ws,ensureSymlink:Hs,ensureSymlinkSync:Ws};function Qs(){if(Us)return Vs;Us=1;var e=v,t=process.cwd,n=null,r=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return n||(n=t.call(process)),n};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var i=process.chdir;process.chdir=function(e){n=null,i.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i)}return Vs=function(t){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(n,r,i){t.open(n,e.O_WRONLY|e.O_SYMLINK,r,(function(e,n){e?i&&i(e):t.fchmod(n,r,(function(e){t.close(n,(function(t){i&&i(e||t)}))}))}))},t.lchmodSync=function(n,r){var i,o=t.openSync(n,e.O_WRONLY|e.O_SYMLINK,r),s=!0;try{i=t.fchmodSync(o,r),s=!1}finally{if(s)try{t.closeSync(o)}catch(e){}else t.closeSync(o)}return i}}(t);t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")?(t.lutimes=function(n,r,i,o){t.open(n,e.O_SYMLINK,(function(e,n){e?o&&o(e):t.futimes(n,r,i,(function(e){t.close(n,(function(t){o&&o(e||t)}))}))}))},t.lutimesSync=function(n,r,i){var o,s=t.openSync(n,e.O_SYMLINK),a=!0;try{o=t.futimesSync(s,r,i),a=!1}finally{if(a)try{t.closeSync(s)}catch(e){}else t.closeSync(s)}return o}):(t.lutimes=function(e,t,n,r){r&&process.nextTick(r)},t.lutimesSync=function(){})}(t);t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=c(t.stat),t.fstat=c(t.fstat),t.lstat=c(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.lchmod||(t.lchmod=function(e,t,n){n&&process.nextTick(n)},t.lchmodSync=function(){});t.lchown||(t.lchown=function(e,t,n,r){r&&process.nextTick(r)},t.lchownSync=function(){});"win32"===r&&(t.rename=(n=t.rename,function(e,r,i){var o=Date.now(),s=0;n(e,r,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){t.stat(r,(function(t,o){t&&"ENOENT"===t.code?n(e,r,a):i(c)}))}),s),void(s<100&&(s+=10));i&&i(c)}))}));var n;function i(e){return e?function(n,r,i){return e.call(t,n,r,(function(e){l(e)&&(e=null),i&&i.apply(this,arguments)}))}:e}function o(e){return e?function(n,r){try{return e.call(t,n,r)}catch(e){if(!l(e))throw e}}:e}function s(e){return e?function(n,r,i,o){return e.call(t,n,r,i,(function(e){l(e)&&(e=null),o&&o.apply(this,arguments)}))}:e}function a(e){return e?function(n,r,i){try{return e.call(t,n,r,i)}catch(e){if(!l(e))throw e}}:e}function c(e){return e?function(n,r,i){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof r&&(i=r,r=null),r?e.call(t,n,r,o):e.call(t,n,o)}:e}function u(e){return e?function(n,r){var i=r?e.call(t,n,r):e.call(t,n);return i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296),i}:e}function l(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}t.read=function(e){function n(n,r,i,o,s,a){var c;if(a&&"function"==typeof a){var u=0;c=function(l,h,d){if(l&&"EAGAIN"===l.code&&u<10)return u++,e.call(t,n,r,i,o,s,c);a.apply(this,arguments)}}return e.call(t,n,r,i,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.read),t.readSync=(h=t.readSync,function(e,n,r,i,o){for(var s=0;;)try{return h.call(t,e,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var h},Vs}var Zs={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:i}={}){const o=n?t:"";return JSON.stringify(e,r,i).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let ea;try{ea=function(){if(Xs)return Js;Xs=1;var e,t,n=a,r=Qs(),i=function(){if(Gs)return Ks;Gs=1;var e=b.Stream;return Ks=function(t){return{ReadStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this);var o=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;a<c;a++){var u=s[a];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}null===this.fd?t.open(this.path,this.flags,this.mode,(function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()})):process.nextTick((function(){o._read()}))},WriteStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=i[c]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},Ks}(),o=function(){if(Bs)return zs;Bs=1,zs=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var n={__proto__:e(t)};else n=Object.create(null);return Object.getOwnPropertyNames(t).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})),n};var e=Object.getPrototypeOf||function(e){return e.__proto__};return zs}(),s=u;function c(t,n){Object.defineProperty(t,e,{get:function(){return n}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),t=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var l,h=function(){};if(s.debuglog?h=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(h=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!n[e]){var d=T[e]||[];c(n,d),n.close=function(e){function r(t,r){return e.call(n,t,(function(e){e||m(),"function"==typeof r&&r.apply(this,arguments)}))}return Object.defineProperty(r,t,{value:e}),r}(n.close),n.closeSync=function(e){function r(t){e.apply(n,arguments),m()}return Object.defineProperty(r,t,{value:e}),r}(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){h(n[e]),S.equal(n[e].length,0)}))}function p(e){r(e),e.gracefulify=p,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){return"function"==typeof n&&(r=n,n=null),function e(n,r,i,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):f([e,[n,r,i],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){return"function"==typeof r&&(i=r,r=null),function e(t,r,i,o,s){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):f([e,[t,r,i,o],n,s||Date.now(),Date.now()])}))}(e,t,r,i)};var o=e.appendFile;o&&(e.appendFile=function(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,s){return o(t,n,r,(function(o){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):f([e,[t,n,r,i],o,s||Date.now(),Date.now()])}))}(e,t,n,r)});var s=e.copyFile;s&&(e.copyFile=function(e,t,n,r){return"function"==typeof n&&(r=n,n=0),function e(t,n,r,i,o){return s(t,n,r,(function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):f([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)});var a=e.readdir;if(e.readdir=function(e,t,n){return"function"==typeof t&&(n=t,t=null),function e(t,n,r,i){return a(t,n,(function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof r&&r.call(this,o,s)):f([e,[t,n,r],o,i||Date.now(),Date.now()])}))}(e,t,n)},"v0.8"===process.version.substr(0,4)){var c=i(e);m=c.ReadStream,g=c.WriteStream}var u=e.ReadStream;u&&(m.prototype=Object.create(u.prototype),m.prototype.open=function(){var e=this;v(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var l=e.WriteStream;l&&(g.prototype=Object.create(l.prototype),g.prototype.open=function(){var e=this;v(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return g},set:function(e){g=e},enumerable:!0,configurable:!0});var h=m;Object.defineProperty(e,"FileReadStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0});var d=g;function m(e,t){return this instanceof m?(u.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function g(e,t){return this instanceof g?(l.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var y=e.open;function v(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,o){return y(t,n,r,(function(s,a){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):f([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=v,e}function f(t){h("ENQUEUE",t[0].name,t[1]),n[e].push(t),g()}function m(){for(var t=Date.now(),r=0;r<n[e].length;++r)n[e][r].length>2&&(n[e][r][3]=t,n[e][r][4]=t);g()}function g(){if(clearTimeout(l),l=void 0,0!==n[e].length){var t=n[e].shift(),r=t[0],i=t[1],o=t[2],s=t[3],a=t[4];if(void 0===s)h("RETRY",r.name,i),r.apply(null,i);else if(Date.now()-s>=6e4){h("TIMEOUT",r.name,i);var c=i.pop();"function"==typeof c&&c.call(null,o)}else{var u=Date.now()-a,d=Math.max(a-s,1);u>=Math.min(1.2*d,100)?(h("RETRY",r.name,i),r.apply(null,i.concat([s]))):n[e].push(t)}void 0===l&&(l=setTimeout(g,0))}}return T[e]||c(T,n[e]),Js=p(o(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(Js=p(n),n.__patched=!0),Js}()}catch(e){ea=a}const ta=Di,{stringify:na,stripBom:ra}=Zs;const ia=ta.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||ea,r=!("throws"in t)||t.throws;let i,o=await ta.fromCallback(n.readFile)(e,t);o=ra(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return i}));const oa=ta.fromPromise((async function(e,t,n={}){const r=n.fs||ea,i=na(t,n);await ta.fromCallback(r.writeFile)(e,i,n)}));const sa={readFile:ia,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||ea,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=ra(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:oa,writeFileSync:function(e,t,n={}){const r=n.fs||ea,i=na(t,n);return r.writeFileSync(e,i,n)}};var aa={readJson:sa.readFile,readJsonSync:sa.readFileSync,writeJson:sa.writeFile,writeJsonSync:sa.writeFileSync};const ca=Di.fromCallback,ua=Bi,la=s,ha=uo,da=po.pathExists;var pa={outputFile:ca((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const i=la.dirname(e);da(i,((o,s)=>o?r(o):s?ua.writeFile(e,t,n,r):void ha.mkdirs(i,(i=>{if(i)return r(i);ua.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=la.dirname(e);if(ua.existsSync(n))return ua.writeFileSync(e,...t);ha.mkdirsSync(n),ua.writeFileSync(e,...t)}};const{stringify:fa}=Zs,{outputFile:ma}=pa;var ga=async function(e,t,n={}){const r=fa(t,n);await ma(e,r,n)};const{stringify:ya}=Zs,{outputFileSync:va}=pa;var ba=function(e,t,n){const r=ya(t,n);va(e,r,n)};const Sa=Di.fromPromise,wa=aa;wa.outputJson=Sa(ga),wa.outputJsonSync=ba,wa.outputJSON=wa.outputJson,wa.outputJSONSync=wa.outputJsonSync,wa.writeJSON=wa.writeJson,wa.writeJSONSync=wa.writeJsonSync,wa.readJSON=wa.readJson,wa.readJSONSync=wa.readJsonSync;var Ra=wa;const _a=Bi,Ea=s,Ca=Jo.copy,Da=Yo.remove,Ta=uo.mkdirp,ka=po.pathExists,xa=Eo;function Pa(e,t,n,r,i){return r?Oa(e,t,n,i):n?Da(t,(r=>r?i(r):Oa(e,t,n,i))):void ka(t,((r,o)=>r?i(r):o?i(new Error("dest already exists.")):Oa(e,t,n,i)))}function Oa(e,t,n,r){_a.rename(e,t,(i=>i?"EXDEV"!==i.code?r(i):function(e,t,n,r){const i={overwrite:n,errorOnExist:!0};Ca(e,t,i,(t=>t?r(t):Da(e,r)))}(e,t,n,r):r()))}var Na=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const i=(n=n||{}).overwrite||n.clobber||!1;xa.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:s,isChangingCase:a=!1}=o;xa.checkParentPaths(e,s,t,"move",(n=>n?r(n):function(e){const t=Ea.dirname(e);return Ea.parse(t).root===t}(t)?Pa(e,t,i,a,r):void Ta(Ea.dirname(t),(n=>n?r(n):Pa(e,t,i,a,r)))))}))};const qa=Bi,Ia=s,Aa=Jo.copySync,Ma=Yo.removeSync,Fa=uo.mkdirpSync,La=Eo;function ja(e,t,n){try{qa.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Aa(e,t,r),Ma(e)}(e,t,n)}}var $a=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:i,isChangingCase:o=!1}=La.checkPathsSync(e,t,"move",n);return La.checkParentPathsSync(e,i,t,"move"),function(e){const t=Ia.dirname(e);return Ia.parse(t).root===t}(t)||Fa(Ia.dirname(t)),function(e,t,n,r){if(r)return ja(e,t,n);if(n)return Ma(t),ja(e,t,n);if(qa.existsSync(t))throw new Error("dest already exists.");return ja(e,t,n)}(e,t,r,o)};var Ha={move:(0,Di.fromCallback)(Na),moveSync:$a};const Wa={...Ci,...Jo,...os,...Ys,...Ra,...uo,...Ha,...pa,...po,...Yo},Va=(e,t,n={})=>{if(!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let r,i,o=[];return function(...s){return new Promise((a=>{const c=n.before&&!i;clearTimeout(i),i=setTimeout((()=>{i=null;const t=n.before?r:e.apply(this,s);for(a of o)a(t);o=[]}),t),c?(r=e.apply(this,s),a(r)):o.push(a)}))}};Va.promise=e=>{let t;return async function(...n){if(t)return t;try{return t=e.apply(this,n),await t}finally{t=void 0}}};var Ua={},Ka={get exports(){return Ua},set exports(e){Ua=e}};var Ga={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};var za="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n}=Ga,r=za,i=(t=e.exports={}).re=[],o=t.src=[],s=t.t={};let a=0;const c=(e,t,n)=>{const c=a++;r(e,c,t),s[e]=c,o[c]=t,i[c]=new RegExp(t,n?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${o[s.NUMERICIDENTIFIER]})\\.(${o[s.NUMERICIDENTIFIER]})\\.(${o[s.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${o[s.NUMERICIDENTIFIERLOOSE]})\\.(${o[s.NUMERICIDENTIFIERLOOSE]})\\.(${o[s.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${o[s.NUMERICIDENTIFIER]}|${o[s.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${o[s.NUMERICIDENTIFIERLOOSE]}|${o[s.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${o[s.PRERELEASEIDENTIFIER]}(?:\\.${o[s.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${o[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[s.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${o[s.BUILDIDENTIFIER]}(?:\\.${o[s.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${o[s.MAINVERSION]}${o[s.PRERELEASE]}?${o[s.BUILD]}?`),c("FULL",`^${o[s.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${o[s.MAINVERSIONLOOSE]}${o[s.PRERELEASELOOSE]}?${o[s.BUILD]}?`),c("LOOSE",`^${o[s.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${o[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${o[s.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${o[s.XRANGEIDENTIFIER]})(?:\\.(${o[s.XRANGEIDENTIFIER]})(?:\\.(${o[s.XRANGEIDENTIFIER]})(?:${o[s.PRERELEASE]})?${o[s.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${o[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[s.XRANGEIDENTIFIERLOOSE]})(?:${o[s.PRERELEASELOOSE]})?${o[s.BUILD]}?)?)?`),c("XRANGE",`^${o[s.GTLT]}\\s*${o[s.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${o[s.GTLT]}\\s*${o[s.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),c("COERCERTL",o[s.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${o[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${o[s.LONETILDE]}${o[s.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${o[s.LONETILDE]}${o[s.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${o[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${o[s.LONECARET]}${o[s.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${o[s.LONECARET]}${o[s.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${o[s.GTLT]}\\s*(${o[s.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${o[s.GTLT]}\\s*(${o[s.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${o[s.GTLT]}\\s*(${o[s.LOOSEPLAIN]}|${o[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${o[s.XRANGEPLAIN]})\\s+-\\s+(${o[s.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${o[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[s.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ka,Ua);const Ba=["includePrerelease","loose","rtl"];var Ja=e=>e?"object"!=typeof e?{loose:!0}:Ba.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{};const Xa=/^[0-9]+$/,Ya=(e,t)=>{const n=Xa.test(e),r=Xa.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var Qa={compareIdentifiers:Ya,rcompareIdentifiers:(e,t)=>Ya(t,e)};const Za=za,{MAX_LENGTH:ec,MAX_SAFE_INTEGER:tc}=Ga,{re:nc,t:rc}=Ua,ic=Ja,{compareIdentifiers:oc}=Qa;let sc=class{constructor(e,t){if(t=ic(t),e instanceof sc){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>ec)throw new TypeError(`version is longer than ${ec} characters`);Za("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?nc[rc.LOOSE]:nc[rc.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>tc||this.major<0)throw new TypeError("Invalid major version");if(this.minor>tc||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>tc||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<tc)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Za("SemVer.compare",this.version,this.options,e),!(e instanceof sc)){if("string"==typeof e&&e===this.version)return 0;e=new sc(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof sc||(e=new sc(e,this.options)),oc(this.major,e.major)||oc(this.minor,e.minor)||oc(this.patch,e.patch)}comparePre(e){if(e instanceof sc||(e=new sc(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(Za("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return oc(n,r)}while(++t)}compareBuild(e){e instanceof sc||(e=new sc(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(Za("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return oc(n,r)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(0===oc(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};var ac=sc;const{MAX_LENGTH:cc}=Ga,{re:uc,t:lc}=Ua,hc=ac,dc=Ja;var pc=(e,t)=>{if(t=dc(t),e instanceof hc)return e;if("string"!=typeof e)return null;if(e.length>cc)return null;if(!(t.loose?uc[lc.LOOSE]:uc[lc.FULL]).test(e))return null;try{return new hc(e,t)}catch(e){return null}};const fc=pc;var mc=(e,t)=>{const n=fc(e,t);return n?n.version:null};const gc=pc;var yc=(e,t)=>{const n=gc(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};const vc=ac;var bc=(e,t,n,r)=>{"string"==typeof n&&(r=n,n=void 0);try{return new vc(e instanceof vc?e.version:e,n).inc(t,r).version}catch(e){return null}};const Sc=ac;var wc=(e,t,n)=>new Sc(e,n).compare(new Sc(t,n));const Rc=wc;var _c=(e,t,n)=>0===Rc(e,t,n);const Ec=pc,Cc=_c;var Dc=(e,t)=>{if(Cc(e,t))return null;{const n=Ec(e),r=Ec(t),i=n.prerelease.length||r.prerelease.length,o=i?"pre":"",s=i?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==r[e])return o+e;return s}};const Tc=ac;var kc=(e,t)=>new Tc(e,t).major;const xc=ac;var Pc=(e,t)=>new xc(e,t).minor;const Oc=ac;var Nc=(e,t)=>new Oc(e,t).patch;const qc=pc;var Ic=(e,t)=>{const n=qc(e,t);return n&&n.prerelease.length?n.prerelease:null};const Ac=wc;var Mc=(e,t,n)=>Ac(t,e,n);const Fc=wc;var Lc=(e,t)=>Fc(e,t,!0);const jc=ac;var $c=(e,t,n)=>{const r=new jc(e,n),i=new jc(t,n);return r.compare(i)||r.compareBuild(i)};const Hc=$c;var Wc=(e,t)=>e.sort(((e,n)=>Hc(e,n,t)));const Vc=$c;var Uc=(e,t)=>e.sort(((e,n)=>Vc(n,e,t)));const Kc=wc;var Gc=(e,t,n)=>Kc(e,t,n)>0;const zc=wc;var Bc=(e,t,n)=>zc(e,t,n)<0;const Jc=wc;var Xc=(e,t,n)=>0!==Jc(e,t,n);const Yc=wc;var Qc=(e,t,n)=>Yc(e,t,n)>=0;const Zc=wc;var eu=(e,t,n)=>Zc(e,t,n)<=0;const tu=_c,nu=Xc,ru=Gc,iu=Qc,ou=Bc,su=eu;var au=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return tu(e,n,r);case"!=":return nu(e,n,r);case">":return ru(e,n,r);case">=":return iu(e,n,r);case"<":return ou(e,n,r);case"<=":return su(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const cu=ac,uu=pc,{re:lu,t:hu}=Ua;var du,pu,fu,mu,gu,yu,vu,bu,Su,wu,Ru=(e,t)=>{if(e instanceof cu)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=lu[hu.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),lu[hu.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;lu[hu.COERCERTL].lastIndex=-1}else n=e.match(lu[hu.COERCE]);return null===n?null:uu(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function _u(){if(mu)return fu;function e(t){var n=this;if(n instanceof e||(n=new e),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){n.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)n.push(arguments[r]);return n}function t(e,t,n){var r=t===e.head?new i(n,null,t,e):new i(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function n(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function r(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,n,r){if(!(this instanceof i))return new i(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}mu=1,fu=e,e.Node=i,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},e.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},e.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},e.prototype.map=function(t,n){n=n||this;for(var r=new e,i=this.head;null!==i;)r.push(t.call(n,i.value,this)),i=i.next;return r},e.prototype.mapReverse=function(t,n){n=n||this;for(var r=new e,i=this.tail;null!==i;)r.push(t.call(n,i.value,this)),i=i.prev;return r},e.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},e.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},e.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=0,o=this.head;null!==o&&i<t;i++)o=o.next;for(;null!==o&&i<n;i++,o=o.next)r.push(o.value);return r},e.prototype.sliceReverse=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=this.length,o=this.tail;null!==o&&i>n;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},e.prototype.splice=function(e,n,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;var s=[];for(i=0;o&&i<n;i++)s.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(i=0;i<r.length;i++)o=t(this,o,r[i]);return s},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{(pu?du:(pu=1,du=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return fu}function Eu(){if(bu)return vu;bu=1;class e{constructor(t,n){if(n=r(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t,this.set=t.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!d(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&p(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=n.get(t);if(r)return r;const s=this.options.loose,p=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(p,C(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],u),o("comparator trim",e);let f=(e=(e=(e=e.replace(a[c.TILDETRIM],l)).replace(a[c.CARETTRIM],h)).split(/\s+/).join(" ")).split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));s&&(f=f.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),o("range list",f);const g=new Map,y=f.map((e=>new i(e,this.options)));for(const e of y){if(d(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const v=[...g.values()];return n.set(t,v),v}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>f(e,n)&&t.set.some((t=>f(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(D(this.set[t],e,this.options))return!0;return!1}}vu=e;const t=function(){if(yu)return gu;yu=1;const e=_u(),t=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),i=Symbol("allowStale"),o=Symbol("maxAge"),s=Symbol("dispose"),a=Symbol("noDisposeOnSet"),c=Symbol("lruList"),u=Symbol("cache"),l=Symbol("updateAgeOnGet"),h=()=>1,d=(e,t,n)=>{const r=e[u].get(t);if(r){const t=r.value;if(p(e,t)){if(m(e,r),!e[i])return}else n&&(e[l]&&(r.value.now=Date.now()),e[c].unshiftNode(r));return t.value}},p=(e,t)=>{if(!t||!t.maxAge&&!e[o])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[o]&&n>e[o]},f=e=>{if(e[n]>e[t])for(let r=e[c].tail;e[n]>e[t]&&null!==r;){const t=r.prev;m(e,r),r=t}},m=(e,t)=>{if(t){const r=t.value;e[s]&&e[s](r.key,r.value),e[n]-=r.length,e[u].delete(r.key),e[c].removeNode(t)}};class g{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const y=(e,t,n,r)=>{let o=n.value;p(e,o)&&(m(e,n),e[i]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};return gu=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const n=e.length||h;if(this[r]="function"!=typeof n?h:n,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[o]=e.maxAge||0,this[s]=e.dispose,this[a]=e.noDisposeOnSet||!1,this[l]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,f(this)}get max(){return this[t]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[o]=e,f(this)}get maxAge(){return this[o]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[r]&&(this[r]=e,this[n]=0,this[c].forEach((e=>{e.length=this[r](e.value,e.key),this[n]+=e.length}))),f(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[c].length}rforEach(e,t){t=t||this;for(let n=this[c].tail;null!==n;){const r=n.prev;y(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[c].head;null!==n;){const r=n.next;y(this,e,n,t),n=r}}keys(){return this[c].toArray().map((e=>e.key))}values(){return this[c].toArray().map((e=>e.value))}reset(){this[s]&&this[c]&&this[c].length&&this[c].forEach((e=>this[s](e.key,e.value))),this[u]=new Map,this[c]=new e,this[n]=0}dump(){return this[c].map((e=>!p(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[c]}set(e,i,l){if((l=l||this[o])&&"number"!=typeof l)throw new TypeError("maxAge must be a number");const h=l?Date.now():0,d=this[r](i,e);if(this[u].has(e)){if(d>this[t])return m(this,this[u].get(e)),!1;const r=this[u].get(e).value;return this[s]&&(this[a]||this[s](e,r.value)),r.now=h,r.maxAge=l,r.value=i,this[n]+=d-r.length,r.length=d,this.get(e),f(this),!0}const p=new g(e,i,d,h,l);return p.length>this[t]?(this[s]&&this[s](e,i),!1):(this[n]+=p.length,this[c].unshift(p),this[u].set(e,this[c].head),f(this),!0)}has(e){if(!this[u].has(e))return!1;const t=this[u].get(e).value;return!p(this,t)}get(e){return d(this,e,!0)}peek(e){return d(this,e,!1)}pop(){const e=this[c].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[u].forEach(((e,t)=>d(this,t,!1)))}},gu}(),n=new t({max:1e3}),r=Ja,i=Cu(),o=za,s=ac,{re:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=Ua,d=e=>"<0.0.0-0"===e.value,p=e=>""===e.value,f=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},m=(e,t)=>(o("comp",e,t),e=b(e,t),o("caret",e),e=y(e,t),o("tildes",e),e=w(e,t),o("xrange",e),e=_(e,t),o("stars",e),e),g=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,t)=>e.trim().split(/\s+/).map((e=>v(e,t))).join(" "),v=(e,t)=>{const n=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(n,((t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),g(n)?a="":g(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:g(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a}))},b=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{o("caret",e,t);const n=t.loose?a[c.CARETLOOSE]:a[c.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),g(n)?c="":g(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:g(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c}))},w=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>R(e,t))).join(" ")),R=(e,t)=>{e=e.trim();const n=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(n,((n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const u=g(i),l=u||g(s),h=l||g(a),d=h;return"="===r&&d&&(r=""),c=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(l&&(s=0),a=0,">"===r?(r=">=",l?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",l?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:h&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n}))},_=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),E=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),C=e=>(t,n,r,i,o,s,a,c,u,l,h,d,p)=>`${n=g(r)?"":g(i)?`>=${r}.0.0${e?"-0":""}`:g(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=g(u)?"":g(l)?`<${+u+1}.0.0-0`:g(h)?`<${u}.${+l+1}.0-0`:d?`<=${u}.${l}.${h}-${d}`:e?`<${u}.${l}.${+h+1}-0`:`<=${c}`}`.trim(),D=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return vu}function Cu(){if(wu)return Su;wu=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}s("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new c(e.value,n).test(this.value);if(""===e.operator)return""===e.value||new c(this.value,n).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),u=o(this.semver,"<",e.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),l=o(this.semver,">",e.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||s&&a||u||l}}Su=t;const n=Ja,{re:r,t:i}=Ua,o=au,s=za,a=ac,c=Eu();return Su}const Du=Eu();var Tu=(e,t,n)=>{try{t=new Du(t,n)}catch(e){return!1}return t.test(e)};const ku=Eu();var xu=(e,t)=>new ku(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const Pu=ac,Ou=Eu();var Nu=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Ou(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&-1!==i.compare(e)||(r=e,i=new Pu(r,n)))})),r};const qu=ac,Iu=Eu();var Au=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Iu(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&1!==i.compare(e)||(r=e,i=new qu(r,n)))})),r};const Mu=ac,Fu=Eu(),Lu=Gc;var ju=(e,t)=>{e=new Fu(e,t);let n=new Mu("0.0.0");if(e.test(n))return n;if(n=new Mu("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new Mu(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!Lu(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!Lu(n,i)||(n=i)}return n&&e.test(n)?n:null};const $u=Eu();var Hu=(e,t)=>{try{return new $u(e,t).range||"*"}catch(e){return null}};const Wu=ac,Vu=Cu(),{ANY:Uu}=Vu,Ku=Eu(),Gu=Tu,zu=Gc,Bu=Bc,Ju=eu,Xu=Qc;var Yu=(e,t,n,r)=>{let i,o,s,a,c;switch(e=new Wu(e,r),t=new Ku(t,r),n){case">":i=zu,o=Ju,s=Bu,a=">",c=">=";break;case"<":i=Bu,o=Xu,s=zu,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gu(e,t,r))return!1;for(let n=0;n<t.set.length;++n){const u=t.set[n];let l=null,h=null;if(u.forEach((e=>{e.semver===Uu&&(e=new Vu(">=0.0.0")),l=l||e,h=h||e,i(e.semver,l.semver,r)?l=e:s(e.semver,h.semver,r)&&(h=e)})),l.operator===a||l.operator===c)return!1;if((!h.operator||h.operator===a)&&o(e,h.semver))return!1;if(h.operator===c&&s(e,h.semver))return!1}return!0};const Qu=Yu;var Zu=(e,t,n)=>Qu(e,t,">",n);const el=Yu;var tl=(e,t,n)=>el(e,t,"<",n);const nl=Eu();var rl=(e,t,n)=>(e=new nl(e,n),t=new nl(t,n),e.intersects(t));const il=Tu,ol=wc;const sl=Eu(),al=Cu(),{ANY:cl}=al,ul=Tu,ll=wc,hl=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===cl){if(1===t.length&&t[0].semver===cl)return!0;e=n.includePrerelease?[new al(">=0.0.0-0")]:[new al(">=0.0.0")]}if(1===t.length&&t[0].semver===cl){if(n.includePrerelease)return!0;t=[new al(">=0.0.0")]}const r=new Set;let i,o,s,a,c,u,l;for(const t of e)">"===t.operator||">="===t.operator?i=dl(i,t,n):"<"===t.operator||"<="===t.operator?o=pl(o,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&o){if(s=ll(i.semver,o.semver,n),s>0)return null;if(0===s&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of r){if(i&&!ul(e,String(i),n))return null;if(o&&!ul(e,String(o),n))return null;for(const r of t)if(!ul(e,String(r),n))return!1;return!0}let h=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver,d=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;h&&1===h.prerelease.length&&"<"===o.operator&&0===h.prerelease[0]&&(h=!1);for(const e of t){if(l=l||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,i)if(d&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===d.major&&e.semver.minor===d.minor&&e.semver.patch===d.patch&&(d=!1),">"===e.operator||">="===e.operator){if(a=dl(i,e,n),a===e&&a!==i)return!1}else if(">="===i.operator&&!ul(i.semver,String(e),n))return!1;if(o)if(h&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===h.major&&e.semver.minor===h.minor&&e.semver.patch===h.patch&&(h=!1),"<"===e.operator||"<="===e.operator){if(c=pl(o,e,n),c===e&&c!==o)return!1}else if("<="===o.operator&&!ul(o.semver,String(e),n))return!1;if(!e.operator&&(o||i)&&0!==s)return!1}return!(i&&u&&!o&&0!==s)&&(!(o&&l&&!i&&0!==s)&&(!d&&!h))},dl=(e,t,n)=>{if(!e)return t;const r=ll(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},pl=(e,t,n)=>{if(!e)return t;const r=ll(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};var fl=(e,t,n={})=>{if(e===t)return!0;e=new sl(e,n),t=new sl(t,n);let r=!1;e:for(const i of e.set){for(const e of t.set){const t=hl(i,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0};const ml=Ua,gl=Ga,yl=ac,vl=Qa,bl=(e,t,n)=>{const r=[];let i=null,o=null;const s=e.sort(((e,t)=>ol(e,t,n)));for(const e of s){il(e,t,n)?(o=e,i||(i=e)):(o&&r.push([i,o]),o=null,i=null)}i&&r.push([i,null]);const a=[];for(const[e,t]of r)e===t?a.push(e):t||e!==s[0]?t?e===s[0]?a.push(`<=${t}`):a.push(`${e} - ${t}`):a.push(`>=${e}`):a.push("*");const c=a.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return c.length<u.length?c:t};var Sl,wl,Rl,_l,El,Cl,Dl,Tl,kl,xl,Pl,Ol={parse:pc,valid:mc,clean:yc,inc:bc,diff:Dc,major:kc,minor:Pc,patch:Nc,prerelease:Ic,compare:wc,rcompare:Mc,compareLoose:Lc,compareBuild:$c,sort:Wc,rsort:Uc,gt:Gc,lt:Bc,eq:_c,neq:Xc,gte:Qc,lte:eu,cmp:au,coerce:Ru,Comparator:Cu(),Range:Eu(),satisfies:Tu,toComparators:xu,maxSatisfying:Nu,minSatisfying:Au,minVersion:ju,validRange:Hu,outside:Yu,gtr:Zu,ltr:tl,intersects:rl,simplifyRange:bl,subset:fl,SemVer:yl,re:ml.re,src:ml.src,tokens:ml.t,SEMVER_SPEC_VERSION:gl.SEMVER_SPEC_VERSION,compareIdentifiers:vl.compareIdentifiers,rcompareIdentifiers:vl.rcompareIdentifiers};class Nl{static fromSimpleString(e){return new Nl(e,e,e)}static fromVersionString(e){let t=Ol.valid(e);if(!t)return new Nl("invalid version","1.0.0","1.0.0");const n=e.indexOf("-");return n>=0&&(t=t.substr(0,n)),new Nl(e,t,e)}constructor(e,t,n){this.displayName=e,this.version=t,this.fullVersionString=n}eq(e){return Ol.eq(this.version,e.version)}gte(e){return Ol.gte(this.version,e.version)}lt(e){return!this.gte(e)}}Nl.defaultVersion=Nl.fromSimpleString("1.0.0"),Nl.v240=Nl.fromSimpleString("2.4.0"),Nl.v250=Nl.fromSimpleString("2.5.0"),Nl.v260=Nl.fromSimpleString("2.6.0"),Nl.v270=Nl.fromSimpleString("2.7.0"),Nl.v280=Nl.fromSimpleString("2.8.0"),Nl.v290=Nl.fromSimpleString("2.9.0"),Nl.v291=Nl.fromSimpleString("2.9.1"),Nl.v300=Nl.fromSimpleString("3.0.0"),Nl.v310=Nl.fromSimpleString("3.1.0"),Nl.v314=Nl.fromSimpleString("3.1.4"),Nl.v320=Nl.fromSimpleString("3.2.0"),Nl.v333=Nl.fromSimpleString("3.3.3"),Nl.v340=Nl.fromSimpleString("3.4.0"),Nl.v345=Nl.fromSimpleString("3.4.5"),Nl.v350=Nl.fromSimpleString("3.5.0"),Nl.v380=Nl.fromSimpleString("3.8.0"),Nl.v381=Nl.fromSimpleString("3.8.1"),Nl.v390=Nl.fromSimpleString("3.9.0"),Nl.v400=Nl.fromSimpleString("4.0.0"),Nl.v401=Nl.fromSimpleString("4.0.1"),Nl.v420=Nl.fromSimpleString("4.2.0"),Nl.v430=Nl.fromSimpleString("4.3.0"),Nl.v440=Nl.fromSimpleString("4.4.0"),Nl.v460=Nl.fromSimpleString("4.6.0"),Nl.v470=Nl.fromSimpleString("4.7.0"),Nl.v480=Nl.fromSimpleString("4.8.0"),Nl.v490=Nl.fromSimpleString("4.9.0"),function(e){e.type=new vr.RequestType("_typescript.rename")}(Sl=Sl||(Sl={})),function(e){e.JsxClosingTag="jsxClosingTag",e.Brace="brace",e.BraceCompletion="braceCompletion",e.GetSpanOfEnclosingComment="getSpanOfEnclosingComment",e.Change="change",e.Close="close",e.Completions="completions",e.CompletionInfo="completionInfo",e.CompletionDetails="completionEntryDetails",e.CompileOnSaveAffectedFileList="compileOnSaveAffectedFileList",e.CompileOnSaveEmitFile="compileOnSaveEmitFile",e.Configure="configure",e.Definition="definition",e.DefinitionAndBoundSpan="definitionAndBoundSpan",e.EncodedSemanticClassificationsFull="encodedSemanticClassifications-full",e.Implementation="implementation",e.Exit="exit",e.FileReferences="fileReferences",e.Format="format",e.Formatonkey="formatonkey",e.Geterr="geterr",e.GeterrForProject="geterrForProject",e.SemanticDiagnosticsSync="semanticDiagnosticsSync",e.SyntacticDiagnosticsSync="syntacticDiagnosticsSync",e.SuggestionDiagnosticsSync="suggestionDiagnosticsSync",e.NavBar="navbar",e.Navto="navto",e.NavTree="navtree",e.NavTreeFull="navtree-full",e.Occurrences="occurrences",e.DocumentHighlights="documentHighlights",e.Open="open",e.Quickinfo="quickinfo",e.References="references",e.Reload="reload",e.Rename="rename",e.Saveto="saveto",e.SignatureHelp="signatureHelp",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.UpdateOpen="updateOpen",e.GetOutliningSpans="getOutliningSpans",e.TodoComments="todoComments",e.Indentation="indentation",e.DocCommentTemplate="docCommentTemplate",e.CompilerOptionsForInferredProjects="compilerOptionsForInferredProjects",e.GetCodeFixes="getCodeFixes",e.GetCombinedCodeFix="getCombinedCodeFix",e.ApplyCodeActionCommand="applyCodeActionCommand",e.GetSupportedCodeFixes="getSupportedCodeFixes",e.GetApplicableRefactors="getApplicableRefactors",e.GetEditsForRefactor="getEditsForRefactor",e.OrganizeImports="organizeImports",e.GetEditsForFileRename="getEditsForFileRename",e.ConfigurePlugin="configurePlugin",e.SelectionRange="selectionRange",e.ToggleLineComment="toggleLineComment",e.ToggleMultilineComment="toggleMultilineComment",e.CommentSelection="commentSelection",e.UncommentSelection="uncommentSelection",e.PrepareCallHierarchy="prepareCallHierarchy",e.ProvideCallHierarchyIncomingCalls="provideCallHierarchyIncomingCalls",e.ProvideCallHierarchyOutgoingCalls="provideCallHierarchyOutgoingCalls",e.ProvideInlayHints="provideInlayHints"}(wl=wl||(wl={})),function(e){e.none="none",e.definition="definition",e.reference="reference",e.writtenReference="writtenReference"}(Rl=Rl||(Rl={})),function(e){e.None="None",e.Preserve="Preserve",e.ReactNative="ReactNative",e.React="React"}(_l=_l||(_l={})),function(e){e.None="None",e.CommonJS="CommonJS",e.AMD="AMD",e.UMD="UMD",e.System="System",e.ES6="ES6",e.ES2015="ES2015",e.ESNext="ESNext"}(El=El||(El={})),function(e){e.Classic="Classic",e.Node="Node"}(Cl=Cl||(Cl={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove"}(Dl=Dl||(Dl={})),function(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.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"}(Tl=Tl||(Tl={})),function(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"}(kl=kl||(kl={})),function(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.ESNext="ESNext"}(xl=xl||(xl={})),function(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"}(Pl=Pl||(Pl={}));class ql{}ql.optional="optional",ql.deprecated="deprecated",ql.dtsFile=".d.ts",ql.tsFile=".ts",ql.tsxFile=".tsx",ql.jsFile=".js",ql.jsxFile=".jsx",ql.jsonFile=".json",ql.fileExtensionKindModifiers=[ql.dtsFile,ql.tsFile,ql.tsxFile,ql.jsFile,ql.jsxFile,ql.jsonFile];const Il={aliasName:0,className:1,enumName:2,fieldName:3,interfaceName:4,keyword:5,lineBreak:6,numericLiteral:7,stringLiteral:8,localName:9,methodName:10,moduleName:11,operator:12,parameterName:13,propertyName:14,punctuation:15,space:16,text:17,typeParameterName:18,enumMemberName:19,functionName:20,regularExpressionLiteral:21,link:22,linkName:23,linkText:24};function Al(e){return Il[e]}var Ml,Fl;!function(e){e.Syntax="syntax",e.Semantic="semantic"}(Ml=Ml||(Ml={})),function(e){e.Cancelled=class{constructor(e){this.reason=e,this.type="cancelled"}},e.NoContent={type:"noContent"},e.NoServer={type:"noServer"}}(Fl=Fl||(Fl={}));class Ll extends Error{static create(e,t,n){const r=Ll.parseErrorText(n);return new Ll(e,t,n,r?.message,r?.stack)}constructor(e,t,n,r,i){super(`<${e}> TypeScript Server Error (${t.versionString})\n${r}\n${i}`),this.serverId=e,this.version=t,this.response=n,this.serverMessage=r,this.serverStack=i}get serverErrorText(){return this.response.message}get serverCommand(){return this.response.command}static parseErrorText(e){const t=e.message;if(t){const e="Error processing request. ";if(t.startsWith(e)){const n=t.substr(e.length),r=n.indexOf("\n");if(r>=0){const e=n.substring(r+1);return{message:n.substring(0,r),stack:e}}}}}}const jl=l(d.randomBytes),$l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""),Hl="0123456789".split(""),Wl="CDEHKMPRTUWXY012458".split(""),Vl="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""),Ul="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Kl=new Set([void 0,"hex","base64","url-safe","numeric","distinguishable","ascii-printable","alphanumeric"]),Gl=(e,t)=>({length:n,type:r,characters:i})=>{if(!(n>=0&&Number.isFinite(n)))throw new TypeError("Expected a `length` to be a non-negative finite number");if(void 0!==r&&void 0!==i)throw new TypeError("Expected either `type` or `characters`");if(void 0!==i&&"string"!=typeof i)throw new TypeError("Expected `characters` to be string");if(!Kl.has(r))throw new TypeError(`Unknown type: ${r}`);if(void 0===r&&void 0===i&&(r="hex"),"hex"===r||void 0===r&&void 0===i)return t(Math.ceil(.5*n),"hex",n);if("base64"===r)return t(Math.ceil(.75*n),"base64",n);if("url-safe"===r)return e(n,$l);if("numeric"===r)return e(n,Hl);if("distinguishable"===r)return e(n,Wl);if("ascii-printable"===r)return e(n,Vl);if("alphanumeric"===r)return e(n,Ul);if(0===i.length)throw new TypeError("Expected `characters` string length to be greater than or equal to 1");if(i.length>65536)throw new TypeError("Expected `characters` string length to be less or equal to 65536");return e(n,i.split(""))},zl=Gl(((e,t)=>{const n=t.length,r=Math.floor(65536/n)*n-1,i=2*Math.ceil(1.1*e);let o="",s=0;for(;s<e;){const a=d.randomBytes(i);let c=0;for(;c<i&&s<e;){const e=a.readUInt16LE(c);c+=2,e>r||(o+=t[e%n],s++)}}return o}),((e,t,n)=>d.randomBytes(e).toString(t).slice(0,n)));zl.async=Gl((async(e,t)=>{const n=t.length,r=Math.floor(65536/n)*n-1,i=2*Math.ceil(1.1*e);let o="",s=0;for(;s<e;){const a=await jl(i);let c=0;for(;c<i&&s<e;){const e=a.readUInt16LE(c);c+=2,e>r||(o+=t[e%n],s++)}}return o}),(async(e,t,n)=>(await jl(e)).toString(t).slice(0,n)));const Bl=a,Jl=h,Xl=Symbol.for("__RESOLVED_TEMP_DIRECTORY__");T[Xl]||Object.defineProperty(T,Xl,{value:Bl.realpathSync(Jl.tmpdir())});var Yl=T[Xl];R(w.pipeline);const Ql=(e="")=>g.join(Yl,e+zl({length:32}));function Zl({name:t,extension:n}={}){if(t){if(null!=n)throw new Error("The `name` and `extension` options are mutually exclusive");return g.join(function({prefix:t=""}={}){const n=Ql(t);return e.mkdirSync(n),n}(),t)}return Ql()+(null==n?"":"."+n.replace(/^\./,""))}class eh{constructor(e,t){this._serverId=e,this._tracer=t,this.cancellationPipeName=Zl({name:"tscancellation"})}tryCancelOngoingRequest(t){if(!this.cancellationPipeName)return!1;this._tracer.logTrace(this._serverId,`TypeScript Server: trying to cancel ongoing request with sequence number ${t}`);try{e.writeFileSync(this.cancellationPipeName+String(t),"")}catch{}return!0}}const th=new class{create(e,t){return new eh(e,t)}};var nh,rh;!function(e){e[e.Normal=1]="Normal",e[e.LowPriority=2]="LowPriority",e[e.Fence=3]="Fence"}(nh=nh||(nh={}));class ih{constructor(){this.queue=[],this.sequenceNumber=0}get length(){return this.queue.length}enqueue(e){if(e.queueingType===nh.Normal){let t=this.queue.length-1;for(;t>=0&&this.queue[t].queueingType===nh.LowPriority;)--t;this.queue.splice(t+1,0,e)}else this.queue.push(e)}dequeue(){return this.queue.shift()}tryDeletePendingRequest(e){for(let t=0;t<this.queue.length;t++)if(this.queue[t].request.seq===e)return this.queue.splice(t,1),!0;return!1}createRequest(e,t){return{seq:this.sequenceNumber++,type:"request",command:e,arguments:t}}}class oh{constructor(){this._callbacks=new Map,this._asyncCallbacks=new Map}destroy(e){const t=new Fl.Cancelled(e);for(const e of this._callbacks.values())e.onSuccess(t);this._callbacks.clear();for(const e of this._asyncCallbacks.values())e.onSuccess(t);this._asyncCallbacks.clear()}add(e,t,n){n?this._asyncCallbacks.set(e,t):this._callbacks.set(e,t)}fetch(e){const t=this._callbacks.get(e)||this._asyncCallbacks.get(e);return this.delete(e),t}delete(e){this._callbacks.delete(e)||this._asyncCallbacks.delete(e)}}!function(e){e[e.Semantic=0]="Semantic",e[e.Syntax=1]="Syntax"}(rh=rh||(rh={}));class sh{constructor(e,t,n,r,i,o,s){this._serverId=e,this._serverSource=t,this._process=n,this._tsServerLogFile=r,this._requestCanceller=i,this._version=o,this._tracer=s,this._requestQueue=new ih,this._callbacks=new oh,this._pendingResponses=new Set,this._eventHandlers=new Set,this._exitHandlers=new Set,this._errorHandlers=new Set,this._stdErrHandlers=new Set,this._process.onData((e=>{this.dispatchMessage(e)})),this._process.onStdErr((e=>{this._stdErrHandlers.forEach((t=>t(e)))})),this._process.onExit(((e,t)=>{this._exitHandlers.forEach((n=>n({code:e,signal:t}))),this._callbacks.destroy("server exited")})),this._process.onError((e=>{this._errorHandlers.forEach((t=>t(e))),this._callbacks.destroy("server errored")}))}onEvent(e){this._eventHandlers.add(e)}onExit(e){this._exitHandlers.add(e)}onStdErr(e){this._stdErrHandlers.add(e)}onError(e){this._errorHandlers.add(e)}get tsServerLogFile(){return this._tsServerLogFile}write(e){this._process.write(e)}dispose(){this._callbacks.destroy("server disposed"),this._pendingResponses.clear(),this._eventHandlers.clear(),this._exitHandlers.clear(),this._errorHandlers.clear()}kill(){this.dispose(),this._process.kill()}dispatchMessage(e){try{switch(e.type){case"response":this._serverSource?this.dispatchResponse({...e}):this.dispatchResponse(e);break;case"event":{const t=e;if("requestCompleted"===t.event){const e=t.body.request_seq,n=this._callbacks.fetch(e);n&&(this._tracer.traceRequestCompleted(this._serverId,"requestCompleted",e,n),n.onSuccess(void 0))}else this._tracer.traceEvent(this._serverId,t),this._eventHandlers.forEach((e=>e(t)));break}default:throw new Error(`Unknown message type ${e.type} received`)}}finally{this.sendNextRequests()}}tryCancelRequest(e,t){try{return this._requestQueue.tryDeletePendingRequest(e)?(this.logTrace(`Canceled request with sequence number ${e}`),!0):!!this._requestCanceller.tryCancelOngoingRequest(e)||(this.logTrace(`Tried to cancel request with sequence number ${e}. But request got already delivered.`),!1)}finally{this.fetchCallback(e)?.onSuccess(new Fl.Cancelled(`Cancelled request ${e} - ${t}`))}}dispatchResponse(e){const t=this.fetchCallback(e.request_seq);t&&(this._tracer.traceResponse(this._serverId,e,t),e.success?t.onSuccess(e):"No content available."===e.message?t.onSuccess(Fl.NoContent):t.onError(Ll.create(this._serverId,this._version,e)))}executeImpl(e,t,n){const r=this._requestQueue.createRequest(e,t),i={request:r,expectsResponse:n.expectsResult,isAsync:n.isAsync,queueingType:sh.getQueueingType(e,n.lowPriority)};let o;return n.expectsResult&&(o=new Promise(((t,i)=>{this._callbacks.add(r.seq,{onSuccess:t,onError:i,queuingStartTime:Date.now(),isAsync:n.isAsync},n.isAsync),n.token&&n.token.onCancellationRequested((()=>{this.tryCancelRequest(r.seq,e)}))}))),this._requestQueue.enqueue(i),this.sendNextRequests(),[o]}sendNextRequests(){for(;0===this._pendingResponses.size&&this._requestQueue.length>0;){const e=this._requestQueue.dequeue();e&&this.sendRequest(e)}}sendRequest(e){const t=e.request;this._tracer.traceRequest(this._serverId,t,e.expectsResponse,this._requestQueue.length),e.expectsResponse&&!e.isAsync&&this._pendingResponses.add(e.request.seq);try{this.write(t)}catch(e){this.fetchCallback(t.seq)?.onError(e)}}fetchCallback(e){const t=this._callbacks.fetch(e);if(t)return this._pendingResponses.delete(e),t}logTrace(e){this._tracer.logTrace(this._serverId,e)}static getQueueingType(e,t){return sh.fenceCommands.has(e)?nh.Fence:t?nh.LowPriority:nh.Normal}}sh.fenceCommands=new Set(["change","close","open","updateOpen"]);class ah{fork(e,t,n,r){const i=e.tsServerPath,o=e.version?.gte(Nl.v490),s=[...t];o&&s.push("--useNodeIpc");const a=_.fork(i,s,{silent:!0,cwd:void 0,env:ch(process.env,i),execArgv:uh(n,r),stdio:o?["pipe","pipe","pipe","ipc"]:void 0});return o?new hh(a):new dh(a)}}function ch(e,t){const n=Object.assign({},e);return n.NODE_PATH=g.join(t,"..","..",".."),n.PATH=n.PATH||process.env.PATH,n}function uh(e,t){const n=[],r=function(e){if("syntax"===e)return;const t=lh()||process.env.TSS_DEBUG;if(t){const e=parseInt(t);if(!isNaN(e))return e}return}(e);if(r){const e=lh()?"--inspect-brk":"--inspect";n.push(`${e}=${r}`)}return t.maxTsServerMemory&&n.push(`--max-old-space-size=${t.maxTsServerMemory}`),n}function lh(){return process.env.TSS_DEBUG_BRK}class hh{constructor(e){this._process=e}write(e){this._process.send(e)}onData(e){this._process.on("message",e)}onExit(e){this._process.on("exit",e)}onStdErr(e){this._process.stderr.on("data",(t=>e(t.toString())))}onError(e){this._process.on("error",e)}kill(){this._process.kill()}}class dh{constructor(e){this._process=e,this._reader=new ph(this._process.stdout)}get reader(){return this._reader}write(e){this._process.stdin.write(`${JSON.stringify(e)}\r\n`,"utf8")}onData(e){this.reader.onData(e)}onExit(e){this._process.on("exit",e)}onStdErr(e){this._process.stderr.on("data",(t=>e(t.toString())))}onError(e){this._process.on("error",e),this.reader.onError(e)}kill(){this._process.kill(),this.reader.dispose(),this._reader=null}}class ph{constructor(e){this.buffer=new bh,this.nextMessageLength=-1,this._onError=e=>{},this._onData=e=>{},this.isDisposed=!1,e.on("data",(e=>this.onLengthData(e)))}dispose(){this.isDisposed=!0,this._onError=e=>{},this._onData=e=>{}}onError(e){this._onError=e}onData(e){this._onData=e}onLengthData(e){if(!this.isDisposed)try{for(this.buffer.append(e);;){if(-1===this.nextMessageLength&&(this.nextMessageLength=this.buffer.tryReadContentLength(),-1===this.nextMessageLength))return;const e=this.buffer.tryReadContent(this.nextMessageLength);if(null===e)return;this.nextMessageLength=-1;const t=JSON.parse(e);this._onData(t)}}catch(e){this._onError(e)}}}const fh=8192,mh=Buffer.byteLength("Content-Length: ","utf8"),gh=Buffer.from(" ","utf8")[0],yh=Buffer.from("\r","utf8")[0],vh=Buffer.from("\n","utf8")[0];class bh{constructor(){this.index=0,this.buffer=Buffer.allocUnsafe(fh)}append(e){let t=null;if(t=Buffer.isBuffer(e)?e:Buffer.from(e,"utf8"),this.buffer.length-this.index>=t.length)t.copy(this.buffer,this.index,0,t.length);else{const e=(Math.ceil((this.index+t.length)/fh)+1)*fh;0===this.index?(this.buffer=Buffer.allocUnsafe(e),t.copy(this.buffer,0,0,t.length)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),t],e)}this.index+=t.length}tryReadContentLength(){let e=-1,t=0;for(;t<this.index&&(this.buffer[t]===gh||this.buffer[t]===yh||this.buffer[t]===vh);)t++;if(this.index<t+mh)return e;t+=mh;const n=t;for(;t<this.index&&this.buffer[t]!==yh;)t++;if(t+3>=this.index||this.buffer[t+1]!==vh||this.buffer[t+2]!==yh||this.buffer[t+3]!==vh)return e;const r=this.buffer.toString("utf8",n,t);return e=parseInt(r),this.buffer=this.buffer.slice(t+4),this.index=this.index-(t+4),e}tryReadContent(e){if(this.index<e)return null;const t=this.buffer.toString("utf8",0,e);let n=e;for(;n<this.index&&(this.buffer[n]===yh||this.buffer[n]===vh);)n++;return this.buffer.copy(this.buffer,0,n),this.index=this.index-n,t}}var Sh,wh,Rh;!function(e){e[e.Off=0]="Off",e[e.Normal=1]="Normal",e[e.Terse=2]="Terse",e[e.RequestTime=3]="RequestTime",e[e.Verbose=4]="Verbose"}(Sh=Sh||(Sh={})),function(e){e.fromString=function(t){switch(t?.toLowerCase()){case"normal":return e.Normal;case"terse":return e.Terse;case"requestTime":return e.RequestTime;case"verbose":return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Normal:return"normal";case e.Terse:return"terse";case e.Verbose:return"verbose";case e.Off:default:return"off"}}}(Sh=Sh||(Sh={}));class _h{constructor(e,t,n,r){this._apiVersion=e,this._logDirectoryProvider=t,this._logger=n,this._tracer=r}spawn(e,t){const n="main",r=new ah,i=th.create(n,this._tracer),{args:o,tsServerLogFile:s}=this.getTsServerArgs("main",t,this._apiVersion,i.cancellationPipeName);this.isLoggingEnabled(t)&&(s?this._logger.logIgnoringVerbosity(bi.Info,`<${n}> Log file: ${s}`):this._logger.logIgnoringVerbosity(bi.Error,`<${n}> Could not create log directory`));const a=r.fork(e,o,"main",t);return this._logger.log("Starting tsserver"),new sh(n,this.kindToServerType(n),a,s,i,e,this._tracer)}kindToServerType(e){return"syntax"===e?Ml.Syntax:Ml.Semantic}getTsServerArgs(e,t,n,r){const i=[];let o;"syntax"===e&&(n.gte(Nl.v401)?i.push("--serverMode","partialSemantic"):i.push("--syntaxOnly")),n.gte(Nl.v250)?i.push("--useInferredProjectPerProjectRoot"):i.push("--useSingleInferredProject");const{disableAutomaticTypingAcquisition:s,globalPlugins:a,locale:c,npmLocation:u,pluginProbeLocations:l}=t;if((s||"syntax"===e||"diagnostics"===e)&&i.push("--disableAutomaticTypingAcquisition"),r&&i.push("--cancellationPipeName",`${r}*`),this.isLoggingEnabled(t)){const e=this._logDirectoryProvider.getNewLogDirectory();e&&(o=g.join(e,"tsserver.log"),i.push("--logVerbosity",Sh.toString(t.logVerbosity)),i.push("--logFile",o))}return a?.length&&i.push("--globalPlugins",a.join(",")),l?.length&&i.push("--pluginProbeLocations",l.join(",")),u&&(this._logger.info(`using npm from ${u}`),i.push("--npmLocation",`"${u}"`)),i.push("--locale",c||"en"),i.push("--validateDefaultNpmLocation"),{args:i,tsServerLogFile:o,tsServerTraceDirectory:undefined}}isLoggingEnabled(e){return e.logVerbosity!==Sh.Off}}!function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(wh=wh||(wh={})),function(e){e.fromString=function(t){switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose}}}(wh=wh||(wh={}));class Eh{constructor(e,t){this.logger=e,this.trace=t}traceRequest(e,t,n,r){if(this.trace===wh.Off)return;let i;this.trace===wh.Verbose&&t.arguments&&(i=`Arguments: ${JSON.stringify(t.arguments,null,4)}`),this.logTrace(e,`Sending request: ${t.command} (${t.seq}). Response expected: ${n?"yes":"no"}. Current queue length: ${r}`,i)}traceResponse(e,t,n){if(this.trace===wh.Off)return;let r;this.trace===wh.Verbose&&t.body&&(r=`Result: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Response received: ${t.command} (${t.request_seq}). Request took ${Date.now()-n.queuingStartTime} ms. Success: ${t.success} ${t.success?"":`. Message: ${t.message}`}`,r)}traceRequestCompleted(e,t,n,r){this.trace!==wh.Off&&this.logTrace(e,`Async response received: ${t} (${n}). Request took ${Date.now()-r.queuingStartTime} ms.`)}traceEvent(e,t){if(this.trace===wh.Off)return;let n;this.trace===wh.Verbose&&t.body&&(n=`Data: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Event received: ${t.event} (${t.seq}).`,n)}logTrace(e,t,n){this.trace!==wh.Off&&this.logger.trace("Trace",`<${e}> ${t}`,n)}}class Ch{constructor(e){this.lspClient=e}reset(){if(this._loadingProjectName&&(this._loadingProjectName=void 0,this._task)){const e=this._task;this._task=void 0,e.then((e=>e.done()))}}startedLoadingProject(e){this.reset(),this._loadingProjectName=e,this._task=this.lspClient.createProgressReporter(),this._task.then((e=>e.begin("Initializing JS/TS language features…")))}finishedLoadingProject(e){this._loadingProjectName===e&&this.reset()}}class Dh{constructor(e){this.options=e,this.primaryTsServer=null,this.apiVersion=e.typescriptVersion.version||Nl.defaultVersion,this.logger=new wi(e.logger,"[tsclient]"),this.tsserverLogger=new wi(e.logger,"[tsserver]"),this.loadingIndicator=new Ch(e.lspClient),this.tracer=new Eh(this.tsserverLogger,e.trace)}start(){const e=new _h(this.apiVersion,this.options.logDirectoryProvider,this.logger,this.tracer).spawn(this.options.typescriptVersion,this.options);return e.onExit((e=>{this.primaryTsServer=null,this.shutdown(),this.tsserverLogger.error(`Exited. Code: ${e.code}. Signal: ${e.signal}`),this.options.onExit&&this.options.onExit(e.code,e.signal)})),e.onStdErr((e=>{e&&this.logger.error(e)})),e.onError((e=>{e&&this.tsserverLogger.error("Exited with error. Error message is: {0}",e.message||e.name),this.serviceExited()})),e.onEvent((e=>this.dispatchEvent(e))),this.primaryTsServer=e,!0}serviceExited(){this.primaryTsServer=null,this.loadingIndicator.reset()}dispatchEvent(e){switch(e.event){case"syntaxDiag":case"semanticDiag":case"suggestionDiag":this.loadingIndicator.reset(),this.options.onEvent?.(e);break;case"projectLoadingStart":this.loadingIndicator.startedLoadingProject(e.body.projectName);break;case"projectLoadingFinish":this.loadingIndicator.finishedLoadingProject(e.body.projectName)}}shutdown(){this.loadingIndicator&&this.loadingIndicator.reset(),this.primaryTsServer&&this.primaryTsServer.kill()}notify(e,t){this.executeWithoutWaitingForResponse(e,t)}requestGeterr(e,t){return this.executeAsync(wl.Geterr,e,t)}request(e,t,n,r){return this.execute(e,t,n,r)}execute(e,t,n,r){let i;return i||(i=this.executeImpl(e,t,{isAsync:!1,token:n,expectsResult:!0,...r})),r?.nonRecoverable&&i[0].catch((t=>this.fatalError(e,t))),e===wl.UpdateOpen&&Promise.all(i).then((()=>{this.loadingIndicator.reset()})),i[0]}executeWithoutWaitingForResponse(e,t){this.executeImpl(e,t,{isAsync:!1,token:void 0,expectsResult:!1})}executeAsync(e,t,n){return this.executeImpl(e,t,{isAsync:!0,token:n,expectsResult:!0})[0]}executeImpl(e,t,n){return this.primaryTsServer?this.primaryTsServer.executeImpl(e,t,n):[Promise.resolve(Fl.NoServer)]}fatalError(e,t){this.tsserverLogger.error(`A non-recoverable error occurred while executing command: ${e}`),t instanceof Ll&&t.serverErrorText&&this.tsserverLogger.error(t.serverErrorText),this.primaryTsServer&&(this.logger.info("Killing TS Server"),this.primaryTsServer.kill(),t instanceof Ll&&(this.primaryTsServer=null))}}(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var c=n.length-a,u=s<c?s:c,l=-1,h=0;h<=u;++h){if(h===u){if(c>u){if(47===n.charCodeAt(a+h))return n.slice(a+h+1);if(0===h)return n.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?l=h:0===h&&(l=0));break}var d=e.charCodeAt(i+h);if(d!==n.charCodeAt(a+h))break;47===d&&(l=h)}var p="";for(h=i+l+1;h<=o;++h)h!==o&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(a+l):(a+=l,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){i=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(u===n.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=c))}return i===o?o=c:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(o=!1,i=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!o){r=a+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,u=!0,l=e.length-1,h=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===i?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=l+1;break}return-1===s||-1===c||0===h||1===h&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&o?e.slice(1,c):e.slice(a,c)):(0===a&&o?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{var e;if(n.r(r),n.d(r,{URI:()=>f,Utils:()=>C}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){var t=navigator.userAgent;e=t.indexOf("Windows")>=0}var i,o,s=(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=/^\w[\w\d+.-]*$/,c=/^\//,u=/^\/\//;function l(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(e.authority,'", path: "').concat(e.path,'", query: "').concat(e.query,'", fragment: "').concat(e.fragment,'"}'));if(e.scheme&&!a.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!c.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}var h="",d="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,f=function(){function t(e,t,n,r,i,o){void 0===o&&(o=!1),"object"==typeof e?(this.scheme=e.scheme||h,this.authority=e.authority||h,this.path=e.path||h,this.query=e.query||h,this.fragment=e.fragment||h):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||h,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==d&&(t=d+t):t=d}return t}(this.scheme,n||h),this.query=r||h,this.fragment=i||h,l(this,o))}return t.isUri=function(e){return e instanceof t||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString},Object.defineProperty(t.prototype,"fsPath",{get:function(){return S(this,!1)},enumerable:!1,configurable:!0}),t.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=h),void 0===n?n=this.authority:null===n&&(n=h),void 0===r?r=this.path:null===r&&(r=h),void 0===i?i=this.query:null===i&&(i=h),void 0===o?o=this.fragment:null===o&&(o=h),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new g(t,n,r,i,o)},t.parse=function(e,t){void 0===t&&(t=!1);var n=p.exec(e);return n?new g(n[2]||h,E(n[4]||h),E(n[5]||h),E(n[7]||h),E(n[9]||h),t):new g(h,h,h,h,h)},t.file=function(t){var n=h;if(e&&(t=t.replace(/\\/g,d)),t[0]===d&&t[1]===d){var r=t.indexOf(d,2);-1===r?(n=t.substring(2),t=d):(n=t.substring(2,r),t=t.substring(r)||d)}return new g("file",n,t,h,h)},t.from=function(e){var t=new g(e.scheme,e.authority,e.path,e.query,e.fragment);return l(t,!0),t},t.prototype.toString=function(e){return void 0===e&&(e=!1),w(this,e)},t.prototype.toJSON=function(){return this},t.revive=function(e){if(e){if(e instanceof t)return e;var n=new g(e);return n._formatted=e.external,n._fsPath=e._sep===m?e.fsPath:null,n}return e},t}(),m=e?1:void 0,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return s(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=S(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=m),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(f),y=((o={})[58]="%3A",o[47]="%2F",o[63]="%3F",o[35]="%23",o[91]="%5B",o[93]="%5D",o[64]="%40",o[33]="%21",o[36]="%24",o[38]="%26",o[39]="%27",o[40]="%28",o[41]="%29",o[42]="%2A",o[43]="%2B",o[44]="%2C",o[59]="%3B",o[61]="%3D",o[32]="%20",o);function v(e,t,n){for(var r=void 0,i=-1,o=0;o<e.length;o++){var s=e.charCodeAt(o);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s||n&&91===s||n&&93===s||n&&58===s)-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),void 0!==r&&(r+=e.charAt(o));else{void 0===r&&(r=e.substr(0,o));var a=y[s];void 0!==a?(-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),r+=a):-1===i&&(i=o)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function b(e){for(var t=void 0,n=0;n<e.length;n++){var r=e.charCodeAt(n);35===r||63===r?(void 0===t&&(t=e.substr(0,n)),t+=y[r]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function S(t,n){var r;return r=t.authority&&t.path.length>1&&"file"===t.scheme?"//".concat(t.authority).concat(t.path):47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function w(e,t){var n=t?b:v,r="",i=e.scheme,o=e.authority,s=e.path,a=e.query,c=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=d,r+=d),o){var u=o.indexOf("@");if(-1!==u){var l=o.substr(0,u);o=o.substr(u+1),-1===(u=l.lastIndexOf(":"))?r+=n(l,!1,!1):(r+=n(l.substr(0,u),!1,!1),r+=":",r+=n(l.substr(u+1),!1,!0)),r+="@"}-1===(u=(o=o.toLowerCase()).lastIndexOf(":"))?r+=n(o,!1,!0):(r+=n(o.substr(0,u),!1,!0),r+=o.substr(u))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(h=s.charCodeAt(1))>=65&&h<=90&&(s="/".concat(String.fromCharCode(h+32),":").concat(s.substr(3)));else if(s.length>=2&&58===s.charCodeAt(1)){var h;(h=s.charCodeAt(0))>=65&&h<=90&&(s="".concat(String.fromCharCode(h+32),":").concat(s.substr(2)))}r+=n(s,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),c&&(r+="#",r+=t?c:v(c,!1,!1)),r}function R(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+R(e.substr(3)):e}}var _=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(e){return e.match(_)?e.replace(_,(function(e){return R(e)})):e}var C,D=n(470),T=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},k=D.posix||D,x="/";!function(e){e.joinPath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.with({path:k.join.apply(k,T([e.path],t,!1))})},e.resolvePath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e.path,i=!1;r[0]!==x&&(r=x+r,i=!0);var o=k.resolve.apply(k,T([r],t,!1));return i&&o[0]===x&&!e.authority&&(o=o.substring(1)),e.with({path:o})},e.dirname=function(e){if(0===e.path.length||e.path===x)return e;var t=k.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return k.basename(e.path)},e.extname=function(e){return k.extname(e.path)}}(C||(C={}))})(),Rh=r})();const{URI:Th,Utils:kh}=Rh;var xh,Ph,Oh;!function(e){e.fromTextSpan=t=>e.fromLocations(t.start,t.end),e.toTextSpan=e=>({start:Ph.toLocation(e.start),end:Ph.toLocation(e.end)}),e.fromLocations=(e,t)=>Ee.Range.create(Math.max(0,e.line-1),Math.max(e.offset-1,0),Math.max(0,t.line-1),Math.max(0,t.offset-1)),e.toFileRangeRequestArgs=(e,t)=>({file:e,startLine:t.start.line+1,startOffset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1}),e.toFormattingRequestArgs=(e,t)=>({file:e,line:t.start.line+1,offset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1}),e.intersection=function(e,t){const n=Ph.Max(t.start,e.start),r=Ph.Min(t.end,e.end);if(!Ph.isAfter(n,r))return Ee.Range.create(n,r)}}(xh=xh||(xh={})),function(e){function t(e,t){return e.line<t.line||!(t.line<e.line)&&e.character<t.character}function n(e,t){return!r(e,t)}function r(e,t){return e.line<t.line||!(t.line<e.line)&&e.character<=t.character}e.fromLocation=e=>({line:Math.max(e.line-1,0),character:Math.max(e.offset-1,0)}),e.toLocation=e=>({line:e.line+1,offset:e.character+1}),e.toFileLocationRequestArgs=(e,t)=>({file:e,line:t.line+1,offset:t.character+1}),e.Min=function(...e){if(!e.length)return;let n=e.pop();for(const r of e)t(r,n)&&(n=r);return n},e.isBefore=t,e.Max=function(...e){if(!e.length)return;let t=e.pop();for(const r of e)n(r,t)&&(t=r);return t},e.isAfter=n,e.isBeforeOrEqual=r}(Ph=Ph||(Ph={})),function(e){e.fromTextSpan=(e,t)=>Ee.Location.create(e,xh.fromTextSpan(t))}(Oh=Oh||(Oh={}));const Nh=/\\/g;function qh(e){if(e.startsWith("zipfile:"))return e;const t=Th.parse(e);return"file"===t.scheme?Mh(t.fsPath):void 0}function Ih(e,t){if(e.startsWith("zipfile:"))return e;const n=Th.file(e),r=Ah(n.fsPath),i=t?.get(r);return i?i.uri:n.toString()}function Ah(e){return Mh(Th.file(e).fsPath)}function Mh(e){return e.replace(Nh,"/")}function Fh(e,t){const n=Ah(Th.file(e).fsPath),r=t?.get(n);return r?r.version:null}function Lh(e,t){return{uri:Ih(e.file,t),range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)}}}const jh={"enum member":ve.SymbolKind.Constant,"JSX attribute":ve.SymbolKind.Property,"local class":ve.SymbolKind.Class,"local function":ve.SymbolKind.Function,"local var":ve.SymbolKind.Variable,"type parameter":ve.SymbolKind.Variable,alias:ve.SymbolKind.Variable,class:ve.SymbolKind.Class,const:ve.SymbolKind.Constant,constructor:ve.SymbolKind.Constructor,enum:ve.SymbolKind.Enum,field:ve.SymbolKind.Field,file:ve.SymbolKind.File,function:ve.SymbolKind.Function,getter:ve.SymbolKind.Method,interface:ve.SymbolKind.Interface,let:ve.SymbolKind.Variable,method:ve.SymbolKind.Method,module:ve.SymbolKind.Module,parameter:ve.SymbolKind.Variable,property:ve.SymbolKind.Property,setter:ve.SymbolKind.Method,var:ve.SymbolKind.Variable};function $h(e){return jh[e]||ve.SymbolKind.Variable}function Hh(e){switch(e){case"error":default:return ve.DiagnosticSeverity.Error;case"warning":return ve.DiagnosticSeverity.Warning;case"suggestion":return ve.DiagnosticSeverity.Hint}}function Wh(e,t,n){const r={range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)},message:e.text,severity:Hh(e.category),code:e.code,source:e.source||"typescript",relatedInformation:Vh(e.relatedInformation,t)};return n.diagnosticsTagSupport&&(r.tags=function(e){const t=[];e.reportsUnnecessary&&t.push(ve.DiagnosticTag.Unnecessary);e.reportsDeprecated&&t.push(ve.DiagnosticTag.Deprecated);return t}(e)),r}function Vh(e,t){if(!e)return;const n=[];for(const r of e){const e=r.span;e&&n.push(ve.DiagnosticRelatedInformation.create(Lh(e,t),r.message))}return n}function Uh(e){return ve.SelectionRange.create(xh.fromTextSpan(e.textSpan),e.parent?Uh(e.parent):void 0)}function Kh(e){return{range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)},newText:e.newText}}function Gh(e,t){return{textDocument:{uri:Ih(e.fileName,t),version:Fh(e.fileName,t)},edits:e.textChanges.map((e=>Kh(e)))}}function zh(e){return e.highlightSpans.map((e=>({kind:Bh(e.kind),range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)}})))}function Bh(e){switch(e){case Rl.definition:return ve.DocumentHighlightKind.Write;case Rl.reference:case Rl.writtenReference:return ve.DocumentHighlightKind.Read;default:return ve.DocumentHighlightKind.Text}}class Jh{constructor(e,t,n,r){this.uri=e,this.publishDiagnostics=t,this.documents=n,this.features=r,this.diagnosticsPerKind=new Map,this.firePublishDiagnostics=Va((()=>{const e=this.getDiagnostics();this.publishDiagnostics({uri:this.uri,diagnostics:e})}),50)}update(e,t){this.diagnosticsPerKind.set(e,t),this.firePublishDiagnostics()}getDiagnostics(){const e=[];for(const t of this.diagnosticsPerKind.values())for(const n of t)e.push(Wh(n,this.documents,this.features));return e}}class Xh{constructor(e,t,n,r){this.publishDiagnostics=e,this.documents=t,this.features=n,this.logger=r,this.diagnostics=new Map,this.ignoredDiagnosticCodes=new Set}updateDiagnostics(e,t){if(!t.body)return void this.logger.error(`Received empty ${t.event} diagnostics.`);const{file:n}=t.body;let{diagnostics:r}=t.body;this.ignoredDiagnosticCodes.size&&(r=r.filter((e=>!this.isDiagnosticIgnored(e))));const i=Ih(n,this.documents),o=this.diagnostics.get(i)||new Jh(i,this.publishDiagnostics,this.documents,this.features);o.update(e,r),this.diagnostics.set(i,o)}updateIgnoredDiagnosticCodes(e){this.ignoredDiagnosticCodes=new Set(e)}getDiagnosticsForFile(e){const t=Ih(e,this.documents);return this.diagnostics.get(t)?.getDiagnostics()||[]}isDiagnosticIgnored(e){return void 0!==e.code&&this.ignoredDiagnosticCodes.has(e.code)}}var Yh,Qh=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Zh=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(t,n){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(e.isIncremental(o)){var s=nd(o.range),a=this.offsetAt(s.start),c=this.offsetAt(s.end);this._content=this._content.substring(0,a)+o.text+this._content.substring(c,this._content.length);var u=Math.max(s.start.line,0),l=Math.max(s.end.line,0),h=this._lineOffsets,d=td(o.text,!1,a);if(l-u===d.length)for(var p=0,f=d.length;p<f;p++)h[p+u+1]=d[p];else d.length<1e4?h.splice.apply(h,Qh([u+1,l-u],d,!1)):this._lineOffsets=h=h.slice(0,u+1).concat(d,h.slice(l+1));var m=o.text.length-(c-a);if(0!==m)for(p=u+1+d.length,f=h.length;p<f;p++)h[p]=h[p]+m}else{if(!e.isFull(o))throw new Error("Unknown change event received");this._content=o.text,this._lineOffsets=void 0}}this._version=n},e.prototype.getLineOffsets=function(){return void 0===this._lineOffsets&&(this._lineOffsets=td(this._content,!0)),this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return{line:0,character:e};for(;n<r;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return{line:o,character:e-t[o]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e.isIncremental=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},e.isFull=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},e}();function ed(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);ed(r,t),ed(i,t);for(var o=0,s=0,a=0;o<r.length&&s<i.length;){var c=t(r[o],i[s]);e[a++]=c<=0?r[o++]:i[s++]}for(;o<r.length;)e[a++]=r[o++];for(;s<i.length;)e[a++]=i[s++];return e}function td(e,t,n){void 0===n&&(n=0);for(var r=t?[n]:[],i=0;i<e.length;i++){var o=e.charCodeAt(i);13!==o&&10!==o||(13===o&&i+1<e.length&&10===e.charCodeAt(i+1)&&i++,r.push(n+i+1))}return r}function nd(e){var t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function rd(e){var t=nd(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new Zh(e,t,n,r)},e.update=function(e,t,n){if(e instanceof Zh)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){for(var n=e.getText(),r=ed(t.map(rd),(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),i=0,o=[],s=0,a=r;s<a.length;s++){var c=a[s],u=e.offsetAt(c.range.start);if(u<i)throw new Error("Overlapping edit");u>i&&o.push(n.substring(i,u)),c.newText.length&&o.push(c.newText),i=e.offsetAt(c.range.end)}return o.push(n.substr(i)),o.join("")}}(Yh||(Yh={}));class id{constructor(e){const{uri:t,languageId:n,version:r,text:i}=e;this.document=Yh.create(t,n,r,i)}get uri(){return this.document.uri}get languageId(){return this.document.languageId}get version(){return this.document.version}getText(e){return this.document.getText(e)}positionAt(e){return this.document.positionAt(e)}offsetAt(e){return this.document.offsetAt(e)}get lineCount(){return this.document.lineCount}getLine(e){const t=this.getLineRange(e);return this.getText(t)}getLineRange(e){const t=this.getLineStart(e),n=this.getLineEnd(e);return ve.Range.create(t,n)}getLineEnd(e){const t=this.getLineOffset(e+1);return this.positionAt(t-1)}getLineOffset(e){const t=this.getLineStart(e);return this.offsetAt(t)}getLineStart(e){return ve.Position.create(e,0)}applyEdit(e,t){const n=this.getText();let r=t.text;if(ve.TextDocumentContentChangeEvent.isIncremental(t)){const e=this.offsetAt(t.range.start),i=this.offsetAt(t.range.end);r=n.substr(0,e)+t.text+n.substr(i)}this.document=Yh.create(this.uri,this.languageId,e,r)}}class od{constructor(){this._files=[],this.documents=new Map}get files(){return this._files}get(e){const t=this.documents.get(e);if(t)return this.files[0]!==e&&(this._files.splice(this._files.indexOf(e),1),this._files.unshift(e)),t}open(e,t){return!this.documents.has(e)&&(this.documents.set(e,new id(t)),this._files.unshift(e),!0)}close(e){const t=this.documents.get(e);if(t)return this.documents.delete(e),this._files.splice(this._files.indexOf(e),1),t}toResource(e){const t=this.documents.get(e);return t?Th.parse(t.uri):Th.file(e)}}class sd{static async execute(e,t,n,r,i,o){if(r.apiVersion.lt(sd.minVersion))return void i.showErrorMessage("Go to Source Definition failed. Requires TypeScript 4.7+.");if(!t||"number"!=typeof t.character||"number"!=typeof t.line)return void i.showErrorMessage("Go to Source Definition failed. Invalid position.");let s;if(!e||"string"!=typeof e||!(s=qh(e)))return void i.showErrorMessage("Go to Source Definition failed. No resource provided.");if(!n.get(s))return void i.showErrorMessage("Go to Source Definition failed. File not opened in the editor.");const a=Ph.toFileLocationRequestArgs(s,t);return await i.withProgress({message:"Finding source definitions…",reporter:o},(async()=>{const e=await r.request(wl.FindSourceDefinition,a);if("response"===e.type&&e.body)return e.body.map((e=>Lh(e,n)));i.showErrorMessage("No source definitions found.")}))}}sd.id="_typescript.goToSourceDefinition",sd.minVersion=Nl.v470;const ad={APPLY_WORKSPACE_EDIT:"_typescript.applyWorkspaceEdit",APPLY_CODE_ACTION:"_typescript.applyCodeAction",APPLY_REFACTORING:"_typescript.applyRefactoring",CONFIGURE_PLUGIN:"_typescript.configurePlugin",ORGANIZE_IMPORTS:"_typescript.organizeImports",APPLY_RENAME_FILE:"_typescript.applyRenameFile",APPLY_COMPLETION_CODE_ACTION:"_typescript.applyCompletionCodeAction",SELECT_REFACTORING:"_typescript.selectRefactoring",SOURCE_DEFINITION:sd.id};class cd{constructor(e=""){this.value=e}appendText(e,t=0){var n;return this.value+=(n=e,n.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}toMarkupContent(){return{kind:"markdown",value:this.value}}}function ud(e){return function(e){return e.replace(/\{@(link|linkplain|linkcode) (https?:\/\/[^ |}]+?)(?:[| ]([^{}\n]+?))?\}/gi,((e,t,n,r)=>"linkcode"===t?`[\`${r?r.trim():n}\`](${n})`:`[${r?r.trim():n}](${n})`))}(e)}function ld(e,t){switch(e.name){case"augments":case"extends":case"param":case"template":{const n=dd(e.text,t).split(/^(\S+)\s*-?\s*/);if(3===n?.length){const t=n[1],r=n[2],i=`*@${e.name}* \`${t}\``;return r?i+(r.match(/\r\n|\n/g)?" \n"+ud(r):` — ${ud(r)}`):i}}}const n=`*@${e.name}*`,r=function(e,t){if(!e.text)return;function n(e){return/^\s*[~`]{3}/m.test(e)?e:"```\n"+e+"\n```"}const r=dd(e.text,t);switch(e.name){case"example":{const e=r.match(/<caption>(.*?)<\/caption>\s*(\r\n|\n)/);return e&&0===e.index?e[1]+"\n"+n(r.substring(e[0].length)):n(r)}case"author":{const e=r.match(/(.+)\s<([-.\w]+@[-.\w]+)>/);return null===e?r:`${e[1]} ${e[2]}`}case"default":return n(r)}return ud(r)}(e,t);return r?n+(r.match(/\r\n|\n/g)?" \n"+r:` — ${r}`):n}function hd(e,t){return ud(dd(e,t))}function dd(e,t){if(!e)return"";if("string"==typeof e)return e;const n=[];let r;for(const i of e)switch(i.kind){case"link":if(r){if(r.target){const e=t.toResource(r.target.file).with({fragment:`L${r.target.start.line},${r.target.start.offset}`}),i=r.text?r.text:md(r.name??"");n.push(`[${r.linkcode?"`"+i+"`":i}](${e.toString()})`)}else{const e=r.text??r.name;if(e)if(/^https?:/.test(e)){const t=e.split(" ");if(1===t.length)n.push(t[0]);else if(t.length>1){const e=md(t.slice(1).join(" "));n.push(`[${r.linkcode?"`"+e+"`":e}](${t[0]})`)}}else n.push(md(e))}r=void 0}else r={linkcode:"{@linkcode "===i.text};break;case"linkName":r&&(r.name=i.text,r.target=i.target);break;case"linkText":r&&(r.text=i.text);break;default:n.push(i.text)}return ud(n.join(""))}function pd(e,t,n){const r=new cd;return fd(r,e,t,n),r.value?r.toMarkupContent():void 0}function fd(e,t,n,r){if(t&&e.appendMarkdown(hd(t,r)),n){const t=function(e,t){return e.map((e=>ld(e,t))).join(" \n\n")}(n,r);t&&e.appendMarkdown("\n\n"+t)}return e}function md(e){return e.replace(/`/g,"\\$&")}class gd{static isSnippetString(e){return e instanceof gd||!!e&&"string"==typeof e.value}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=gd._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,t=this._tabstop++){if("function"==typeof e){const t=new gd;t._tabstop=this._tabstop,e(t),this._tabstop=t._tabstop,e=t.value}else e=gd._escape(e);return this.value+="${",this.value+=t,this.value+=":",this.value+=e,this.value+="}",this}appendVariable(e,t){if("function"==typeof t){const e=new gd;e._tabstop=this._tabstop,t(e),this._tabstop=e._tabstop,t=e.value}else"string"==typeof t&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}}function yd(e,t,n,r,i,o,s,a){const c={label:e.name,...a.completionLabelDetails?{labelDetails:e.labelDetails}:{},kind:bd(e.kind),sortText:e.sortText,commitCharacters:Sd(e.kind),preselect:e.isRecommended,data:{file:n,line:r.line+1,offset:r.character+1,entryNames:[e.source||e.data?{name:e.name,source:e.source,data:e.data}:e.name]}};e.source&&e.hasAction&&(c.sortText=`${e.sortText}`);const{isSnippet:u,replacementSpan:l,sourceDisplay:h}=e;if(u&&!a.completionSnippets)return null;a.completionSnippets&&(u||Rd(c.kind,s))&&(c.insertTextFormat=ve.InsertTextFormat.Snippet),h&&(c.detail=hd(h,o));let{insertText:d}=e;if(e.kindModifiers){const t=new Set(e.kindModifiers.split(/,|\s+/g));if(t.has(ql.optional)&&(d||(d=c.label),c.filterText||(c.filterText=c.label),c.label+="?"),t.has(ql.deprecated)&&(c.tags=[ve.CompletionItemTag.Deprecated]),e.kind===Tl.scriptElement)for(const n of ql.fileExtensionKindModifiers)if(t.has(n)){e.name.toLowerCase().endsWith(n)?c.detail=e.name:c.detail=e.name+n;break}}const p=function(e,t,n,r,i){if(e)return{replace:vd(xh.fromTextSpan(e),r)};if(i.completionInsertReplaceSupport&&t){const e=vd(xh.fromTextSpan(t),r);return{insert:ve.Range.create(e.start,n),replace:vd(e,r)}}}(l,t,r,i,a);return p?c.textEdit=p.insert?ve.InsertReplaceEdit.create(d||c.label,p.insert,p.replace):ve.TextEdit.replace(p.replace,d||c.label):c.insertText=d,c}function vd(e,t){return e.start.line!==e.end.line?ve.Range.create(e.start,t.getLineEnd(e.start.line)):e}function bd(e){switch(e){case Tl.primitiveType:case Tl.keyword:return ve.CompletionItemKind.Keyword;case Tl.constElement:return ve.CompletionItemKind.Constant;case Tl.letElement:case Tl.variableElement:case Tl.localVariableElement:case Tl.alias:return ve.CompletionItemKind.Variable;case Tl.memberVariableElement:case Tl.memberGetAccessorElement:case Tl.memberSetAccessorElement:return ve.CompletionItemKind.Field;case Tl.functionElement:return ve.CompletionItemKind.Function;case Tl.memberFunctionElement:case Tl.constructSignatureElement:case Tl.callSignatureElement:case Tl.indexSignatureElement:return ve.CompletionItemKind.Method;case Tl.enumElement:return ve.CompletionItemKind.Enum;case Tl.moduleElement:case Tl.externalModuleName:return ve.CompletionItemKind.Module;case Tl.classElement:case Tl.typeElement:return ve.CompletionItemKind.Class;case Tl.interfaceElement:return ve.CompletionItemKind.Interface;case Tl.warning:case Tl.scriptElement:return ve.CompletionItemKind.File;case Tl.directory:return ve.CompletionItemKind.Folder;case Tl.string:return ve.CompletionItemKind.Constant}return ve.CompletionItemKind.Property}function Sd(e){const t=[];switch(e){case Tl.memberGetAccessorElement:case Tl.memberSetAccessorElement:case Tl.constructSignatureElement:case Tl.callSignatureElement:case Tl.indexSignatureElement:case Tl.enumElement:case Tl.interfaceElement:t.push(".");break;case Tl.moduleElement:case Tl.alias:case Tl.constElement:case Tl.letElement:case Tl.variableElement:case Tl.localVariableElement:case Tl.memberVariableElement:case Tl.classElement:case Tl.functionElement:case Tl.memberFunctionElement:t.push(".",","),t.push("(")}return 0===t.length?void 0:t}async function wd(e,t,n,r,i,o,s){e.detail=function({displayParts:e,sourceDisplay:t,source:n},r){const i=[],o=t||n;o&&i.push(`Auto import from '${hd(o,r)}'`);const s=hd(e,r);s&&i.push(s);return i.join("\n")}(t,i);const{documentation:a,tags:c}=t;e.documentation=pd(a,c,i);const u=Ah(e.data.file);if(t.codeActions?.length&&(e.additionalTextEdits=function(e,t){const n=[];for(const r of e)if(r.changes)for(const e of r.changes)if(e.fileName===t)for(const t of e.textChanges)n.push(Kh(t));return n.length?n:void 0}(t.codeActions,u),e.command=function(e,t){let n=!1;for(const r of e){if(r.commands){n=!0;break}if(r.changes)for(const e of r.changes)if(e.fileName!==t){n=!0;break}}if(n)return{title:"",command:ad.APPLY_COMPLETION_CODE_ACTION,arguments:[t,e.map((e=>({commands:e.commands,description:e.description,changes:e.changes.filter((e=>e.fileName!==t))})))]}}(t.codeActions,e.data.file)),n&&s.completionSnippets&&Rd(e.kind,o)){const{line:i,offset:o}=e.data,s=Ph.fromLocation({line:i,offset:o}),a=await async function(e,t,n,r){try{const r=Ph.toFileLocationRequestArgs(e,t),i=await n.request(wl.Quickinfo,r);if("response"===i.type&&i.body)switch(i.body.kind){case"var":case"let":case"const":case"alias":return!1}}catch{}const i=r.getLine(t.line).slice(t.character);return null===i.match(/^[a-z_$0-9]*\s*\(/gi)}(u,s,r,n);a&&function(e,t){const{displayParts:n}=t,r=function(e){const t=[];let n=!1,r=!1,i=0,o=0;e:for(let s=0;s<e.length;++s){const a=e[s];switch(Al(a.kind)){case Pl.methodName:case Pl.functionName:case Pl.text:case Pl.propertyName:0===i&&0===o&&(n=!0);break;case Pl.parameterName:if(1===i&&0===o&&n){const n=e[s+1],i=n&&"?"===n.text,o="this"===a.text;i||o||t.push(a),r=r||i}break;case Pl.punctuation:if("("===a.text)++i;else if(")"===a.text){if(--i,i<=0&&n)break e}else{if("..."===a.text&&1===i){r=!0;break e}"{"===a.text?++o:"}"===a.text&&--o}}}return{hasOptionalParameters:r,parts:t}}(n),i=new gd;i.appendText(`${e.insertText||e.label}(`),function(e,t,n){for(let r=0;r<t.length;++r){const i=t[r];e.appendPlaceholder(i.text),r!==t.length-1&&e.appendText(n)}}(i,r.parts,", "),r.hasOptionalParameters&&i.appendTabstop();i.appendText(")"),i.appendTabstop(0),e.insertText=i.value,e.insertTextFormat=ve.InsertTextFormat.Snippet,e.textEdit&&(e.textEdit.newText=i.value)}(e,t)}return e}function Rd(e,t){return!0===t.completeFunctionCalls&&(e===ve.CompletionItemKind.Function||e===ve.CompletionItemKind.Method)}function _d(e){switch(e){case"@":case"#":case" ":case".":case'"':case"'":case"`":case"/":case"<":return e;default:return}}function Ed(e,t,n){const r=e.items.map((e=>function(e,t){const n=e.parameters.map((e=>function(e,t){const{displayParts:n,documentation:r}=e;return{label:hd(n,t),documentation:pd(r,void 0,t)}}(e,t))),r={label:hd(e.prefixDisplayParts,t),documentation:pd(e.documentation,e.tags.filter((e=>"param"!==e.name)),t),parameters:n};return r.label+=n.map((e=>e.label)).join(hd(e.separatorDisplayParts,t)),r.label+=hd(e.suffixDisplayParts,t),r}(e,n)));return{activeSignature:Cd(e,r,t),activeParameter:Dd(e),signatures:r}}function Cd(e,t,n){if(void 0!==n?.activeSignatureHelp?.activeSignature){const e=n.activeSignatureHelp.signatures[n.activeSignatureHelp.activeSignature];if(e&&n.isRetrigger){const n=t.findIndex((t=>t.label===e.label));if(-1!==n)return n}}return e.selectedItemIndex}function Dd(e){const t=e.items[e.selectedItemIndex];return t?.isVariadic?Math.min(e.argumentIndex,t.parameters.length-1):e.argumentIndex}function Td(e){switch(e.triggerKind){case ve.SignatureHelpTriggerKind.TriggerCharacter:return e.triggerCharacter?e.isRetrigger?{kind:"retrigger",triggerCharacter:e.triggerCharacter}:{kind:"characterTyped",triggerCharacter:e.triggerCharacter}:{kind:"invoked"};case ve.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case ve.SignatureHelpTriggerKind.Invoked:default:return{kind:"invoked"}}}function kd(e,t){return ve.CodeAction.create(e.description,ve.Command.create(e.description,ad.SELECT_REFACTORING,e,t),ve.CodeActionKind.Refactor)}function xd(e,t,n){const r=ve.CodeAction.create(e.description,function(e){if(e.name.startsWith("function_"))return`${ve.CodeActionKind.RefactorExtract}.function`;if(e.name.startsWith("constant_"))return`${ve.CodeActionKind.RefactorExtract}.constant`;if(e.name.startsWith("Move"))return`${ve.CodeActionKind.Refactor}.move`;return ve.CodeActionKind.Refactor}(t));return e.notApplicableReason?r.disabled={reason:e.notApplicableReason}:r.command=ve.Command.create(e.description,ad.APPLY_REFACTORING,{...n,refactor:t.name,action:e.name}),r}class Pd{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||e.value.startsWith(this.value+Pd.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Pd(this.value+Pd.sep+e)}}function Od(e,t){return Nd(e,t,{start:xh.fromTextSpan(e.spans[0]).start,end:xh.fromTextSpan(e.spans[e.spans.length-1]).end})}function Nd(e,t,n){let r=Id(e);for(const i of e.spans){const o=xh.fromTextSpan(i);if(!xh.intersection(n,o))continue;const s=[];if(e.childItems)for(const t of e.childItems)if(t.spans.some((e=>!!xh.intersection(o,xh.fromTextSpan(e))))){const e=Nd(t,s,o);r=r||e}let a=o;if(e.nameSpan){const t=xh.fromTextSpan(e.nameSpan);xh.intersection(o,t)&&(a=t)}r&&t.push({name:e.text,detail:"",kind:$h(e.kind),range:o,selectionRange:a,children:s})}return r}function qd(e,t,n,r){let i=Id(t);const o=t.text;for(const s of t.spans){const a=xh.fromTextSpan(s),c=[];if(t.childItems)for(const n of t.childItems)if(n.spans.some((e=>!!xh.intersection(a,xh.fromTextSpan(e))))){const t=qd(e,n,c,o);i=i||t}i&&(n.push({name:o,kind:$h(t.kind),location:{uri:e,range:a},containerName:r}),n.push(...c))}return i}function Id(e){return e.kind!==Tl.alias&&!(!e.text||"<function>"===e.text||"<class>"===e.text)}function Ad(e,t,n){const r=function(e){return e.kind===Tl.scriptElement||e.kind===Tl.moduleElement&&1===e.selectionSpan.start.line&&1===e.selectionSpan.start.offset}(e),i=r?g.basename(e.file):e.name,o=r?n?g.relative(n,g.dirname(e.file)):g.dirname(e.file):e.containerName??"",s={kind:Md(e.kind),name:i,detail:o,uri:Ih(e.file,t),range:xh.fromTextSpan(e.span),selectionRange:xh.fromTextSpan(e.selectionSpan)};return(e.kindModifiers?function(e){return new Set(e.split(/,|\s+/g))}(e.kindModifiers):void 0)?.has(kl.deprecatedModifier)&&(s.tags=[ve.SymbolTag.Deprecated]),s}function Md(e){switch(e){case Tl.moduleElement:return ve.SymbolKind.Module;case Tl.classElement:return ve.SymbolKind.Class;case Tl.enumElement:return ve.SymbolKind.Enum;case Tl.enumMemberElement:return ve.SymbolKind.EnumMember;case Tl.interfaceElement:return ve.SymbolKind.Interface;case Tl.indexSignatureElement:case Tl.callSignatureElement:case Tl.memberFunctionElement:return ve.SymbolKind.Method;case Tl.memberVariableElement:case Tl.memberGetAccessorElement:case Tl.memberSetAccessorElement:return ve.SymbolKind.Property;case Tl.variableElement:case Tl.letElement:case Tl.constElement:case Tl.localVariableElement:case Tl.alias:return ve.SymbolKind.Variable;case Tl.functionElement:case Tl.localFunctionElement:return ve.SymbolKind.Function;case Tl.constructSignatureElement:case Tl.constructorImplementationElement:return ve.SymbolKind.Constructor;case Tl.typeParameterElement:return ve.SymbolKind.TypeParameter;case Tl.string:return ve.SymbolKind.String;default:return ve.SymbolKind.Variable}}Pd.sep=".",Pd.Empty=new Pd(ve.CodeActionKind.Empty),Pd.QuickFix=new Pd(ve.CodeActionKind.QuickFix),Pd.Refactor=new Pd(ve.CodeActionKind.Refactor),Pd.Source=new Pd(ve.CodeActionKind.Source),Pd.SourceAddMissingImportsTs=Pd.Source.append("addMissingImports").append("ts"),Pd.SourceRemoveUnusedTs=Pd.Source.append("removeUnused").append("ts"),Pd.SourceOrganizeImports=new Pd(ve.CodeActionKind.SourceOrganizeImports),Pd.SourceOrganizeImportsTs=Pd.SourceOrganizeImports.append("ts"),Pd.SourceFixAll=new Pd(ve.CodeActionKind.SourceFixAll),Pd.SourceFixAllTs=Pd.SourceFixAll.append("ts");const Fd=new Set([6196,6133]),Ld=new Set([7027]),jd=new Set([2420]),$d=new Set([2552,2304]),Hd=new Set([1308]);async function Wd(e,t,n,r,i){const o=[];for(const s of i)for(const{codes:i,fixName:a}of e){if(!i.has(s.code))continue;const e={...xh.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(wl.GetCodeFixes,e);if("response"!==c.type||!c.body?.length)continue;const u=c.body?.find((e=>e.fixName===a));if(!u)continue;if(!u.fixId)return o.push(...u.changes.map((e=>Gh(e,r)))),o;const l={scope:{type:"file",args:{file:n}},fixId:u.fixId},h=await t.request(wl.GetCombinedCodeFix,l);return"response"===h.type&&h.body?(o.push(...h.body.changes.map((e=>Gh(e,r)))),o):o}return o}class Vd{}class Ud extends Vd{constructor(){super(...arguments),this.title="Fix all"}async build(e,t,n,r){const i=[];return i.push(...await async function(e,t,n,r,i){const o=[];for(const s of i)for(const{codes:i,fixName:a}of e){if(!i.has(s.code))continue;const e={...xh.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(wl.GetCodeFixes,e);if("response"!==c.type)continue;const u=c.body?.find((e=>e.fixName===a));if(u){o.push(...u.changes.map((e=>Gh(e,r))));break}}return o}([{codes:jd,fixName:"fixClassIncorrectlyImplementsInterface"},{codes:Hd,fixName:"fixAwaitInSyncFunction"}],e,t,n,r)),i.push(...await Wd([{codes:Ld,fixName:"fixUnreachableCode"}],e,t,n,r)),i.length?ve.CodeAction.create(this.title,{documentChanges:i},Ud.kind.value):null}}Ud.kind=Pd.SourceFixAllTs;class Kd extends Vd{constructor(){super(...arguments),this.title="Remove all unused code"}async build(e,t,n,r){const i=await Wd([{codes:Fd,fixName:"unusedIdentifier"}],e,t,n,r);return i.length?ve.CodeAction.create(this.title,{documentChanges:i},Kd.kind.value):null}}Kd.kind=Pd.SourceRemoveUnusedTs;class Gd extends Vd{constructor(){super(...arguments),this.title="Add all missing imports"}async build(e,t,n,r){const i=await Wd([{codes:$d,fixName:"import"}],e,t,n,r);return i.length?ve.CodeAction.create(this.title,{documentChanges:i},Gd.kind.value):null}}Gd.kind=Pd.SourceAddMissingImportsTs;class zd{static get kinds(){return zd.kindProviders.map((e=>e.kind))}constructor(e){this.client=e}async provideCodeActions(e,t,n,r){const i=[];for(const o of zd.kindProviders)e.some((e=>e.contains(o.kind)))&&i.push((new o).build(this.client,t,r,n));return(await Promise.all(i)).flatMap((e=>e||[]))}}zd.kindProviders=[Ud,Kd,Gd];class Bd{static async provideInlayHints(e,t,n,r,i,o){if(r.apiVersion.lt(Bd.minVersion))return i.showErrorMessage("Inlay Hints request failed. Requires TypeScript 4.4+."),[];const s=qh(e);if(!s)return i.showErrorMessage("Inlay Hints request failed. No resource provided."),[];const a=n.get(s);if(!a)return i.showErrorMessage("Inlay Hints request failed. File not opened in the editor."),[];if(!function(e,t){const n=e.getPreferences(t);return"literals"===n.includeInlayParameterNameHints||"all"===n.includeInlayParameterNameHints||n.includeInlayEnumMemberValueHints||n.includeInlayFunctionLikeReturnTypeHints||n.includeInlayFunctionParameterTypeHints||n.includeInlayPropertyDeclarationTypeHints||n.includeInlayVariableTypeHints}(o,s))return[];await o.configureGloballyFromDocument(s);const c=a.offsetAt(t.start),u=a.offsetAt(t.end)-c,l=await r.request(wl.ProvideInlayHints,{file:s,start:c,length:u});return"response"===l.type&&l.success&&l.body?l.body.map((e=>{const t=ve.InlayHint.create(Ph.fromLocation(e.position),e.text,function(e){switch(e){case"Parameter":return ve.InlayHintKind.Parameter;case"Type":return ve.InlayHintKind.Type;default:return}}(e.kind));return e.whitespaceBefore&&(t.paddingLeft=!0),e.whitespaceAfter&&(t.paddingRight=!0),t})):[]}}var Jd,Xd,Yd,Qd,Zd,ep;function tp(e,t){const n=[];let r=0,i=0;for(let o=0;o<t.length;o+=3){const s=t[o],a=t[o+1],c=t[o+2],u=c&Jd.modifierMask,l=(c>>Jd.typeOffset)-1,{line:h,character:d}=e.positionAt(s),p=h-r,f=r===h?d-i:d;n.push(p,f,a,l,u),i=d,r=h}return n}Bd.minVersion=Nl.v440,function(e){e[e.typeOffset=8]="typeOffset",e[e.modifierMask=255]="modifierMask"}(Jd||(Jd={}));class np{constructor(e){this.rootPath=e}getNewLogDirectory(){const t=this.logDirectory();if(t)try{return e.mkdtempSync(g.join(t,"tsserver-log-"))}catch(e){return}}logDirectory(){if(this.rootPath)try{return e.existsSync(this.rootPath)||e.mkdirSync(this.rootPath),this.rootPath}catch{return}}}ep="win32"===process.platform||T.TESTING_WINDOWS?function(){if(Yd)return Xd;Yd=1,Xd=n,n.sync=function(n,r){return t(e.statSync(n),n,r)};var e=a;function t(e,t,n){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var n=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}(t,n)}function n(n,r,i){e.stat(n,(function(e,o){i(e,!e&&t(o,n,r))}))}return Xd}():function(){if(Zd)return Qd;Zd=1,Qd=t,t.sync=function(t,r){return n(e.statSync(t),r)};var e=a;function t(t,r,i){e.stat(t,(function(e,t){i(e,!e&&n(t,r))}))}function n(e,t){return e.isFile()&&function(e,t){var n=e.mode,r=e.uid,i=e.gid,o=void 0!==t.uid?t.uid:process.getuid&&process.getuid(),s=void 0!==t.gid?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8);return n&parseInt("001",8)||n&c&&i===s||n&a&&r===o||n&(a|c)&&0===o}(e,t)}return Qd}();var rp=ip;function ip(e,t,n){if("function"==typeof t&&(n=t,t={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,r){ip(e,t||{},(function(e,t){e?r(e):n(t)}))}))}ep(e,t||{},(function(e,r){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)}))}ip.sync=function(e,t){try{return ep.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}};const op=rp,{join:sp,delimiter:ap,sep:cp,posix:up}=s,lp="win32"===process.platform,hp=new RegExp(`[${up.sep}${cp===up.sep?"":cp}]`.replace(/(\\)/g,"\\$1")),dp=new RegExp(`^\\.${hp.source}`),pp=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),fp=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=ap})=>{const i=e.match(hp)?[""]:[...lp?[process.cwd()]:[],...(t||"").split(r)];if(lp){const t=n||[".EXE",".CMD",".BAT",".COM"].join(r),o=t.split(r);return e.includes(".")&&""!==o[0]&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:t}}return{pathEnv:i,pathExt:[""]}},mp=(e,t)=>{const n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&dp.test(t)?t.slice(0,2):"")+sp(n,t)},gp=async(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=fp(e,t),o=[];for(const s of n){const n=mp(s,e);for(const e of r){const r=n+e;if(await op(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;o.push(r)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw pp(e)};var yp=gp;gp.sync=(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=fp(e,t),o=[];for(const s of n){const n=mp(s,e);for(const e of r){const r=n+e;if(op.sync(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;o.push(r)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw pp(e)};const vp={directory:"isDirectory",file:"isFile"};const bp=(e,t)=>t[vp[e]]();function Sp(t,{cwd:n=D.cwd(),type:r="file",allowSymlinks:i=!0}={}){var o;!function(e){if(!Object.hasOwnProperty.call(vp,e))throw new Error(`Invalid type specified: ${e}`)}(r),n=(o=n)instanceof URL?C(o):o;const s=i?e.statSync:e.lstatSync;for(const e of t)try{const t=s(g.resolve(n,e));if(bp(r,t))return e}catch{}}const wp=Symbol("findUpStop");function Rp(e,t={}){let n=g.resolve(((r=t.cwd)instanceof URL?C(r):r)||"");var r;const{root:i}=g.parse(n),o=t.stopAt||i,s=t.limit||Number.POSITIVE_INFINITY,a=[e].flat(),c=t=>{if("function"!=typeof e)return Sp(a,t);const n=e(t.cwd);return"string"==typeof n?Sp([n],t):n},u=[];for(;;){const e=c({...t,cwd:n});if(e===wp)break;if(e&&u.push(g.resolve(n,e)),n===o||u.length>=s)break;n=g.dirname(n)}return u}function _p({cwd:e}={}){return function(e,t={}){return Rp(e,{...t,limit:1})[0]}("package.json",{cwd:e})}function Ep(e,r){if(t(e).isDirectory()){const t=r.map((t=>y(e,t))).find(n);if(t)return t}const i=y(e,"..");if(i!==e)return Ep(i,r)}class Cp{constructor(e,t,n){this.source=e,this.path=t,this.logger=n,this._api=null}get tsServerPath(){return this.path}get isValid(){return null!==this.version}get version(){return this._api||(this._api=this.getTypeScriptVersion(this.tsServerPath)),this._api}get versionString(){const e=this.version;return e?e.displayName:null}getTypeScriptVersion(t){if(this.logger.log(`Resolving TypeScript version from path "${t}"...`),!e.existsSync(t))return this.logger.log("Server path does not exist on disk"),null;const n=t.split(g.sep);if(n.length<=2)return this.logger.log("Server path is invalid (has less than two path components)."),null;const r=n.slice(0,-2).join(g.sep);let i=g.join(r,"package.json");if(e.existsSync(i)||"built"===g.basename(r)&&(i=g.join(r,"..","package.json")),!e.existsSync(i))return this.logger.log(`Failed to find package.json at path "${i}"`),null;this.logger.log(`Reading version from package.json at "${i}"`);const o=e.readFileSync(i).toString();let s=null;try{s=JSON.parse(o)}catch(e){return this.logger.log("Failed parsing contents of package.json."),null}return s?.version?(this.logger.log(`Resolved TypeScript version to "${s.version}"`),Nl.fromVersionString(s.version)):(this.logger.log("Failed reading version number from package.json."),null)}}const Dp=["node_modules/typescript/lib",".vscode/pnpify/typescript/lib",".yarn/sdks/typescript/lib"];class Tp{constructor(e,t){this.userTsserverPath=e,this.logger=t}getUserSettingVersion(){if(!this.userTsserverPath)return null;this.logger.log(`Resolving user-provided tsserver path "${this.userTsserverPath}"...`);let t=this.userTsserverPath;if(!g.isAbsolute(t)){const e=yp.sync(t,{nothrow:!0});e&&(t=e),this.logger.log(`Non-absolute tsserver path resolved to "${e?t:"<failed>"}"`)}let n=e.lstatSync(t,{throwIfNoEntry:!1});if(n?.isSymbolicLink()&&(t=e.realpathSync(t),this.logger.log(`Symbolic link tsserver path resolved to "${t}"`)),n=e.lstatSync(t,{throwIfNoEntry:!1}),n?.isFile()){if("tsserver.js"===g.basename(t))return this.logger.log(`Resolved tsserver location: ${t}`),new Cp("user-setting",t,this.logger);t=g.dirname(t),this.logger.log(`Resolved directory path from a file path: ${t}`)}try{const e=_p({cwd:t});this.logger.log(`Resolved package.json location: "${e}"`),e&&(t=g.join(g.dirname(e),"lib","tsserver.js"),this.logger.log(`Resolved tsserver location: "${t}"`))}catch{}return new Cp("user-setting",t,this.logger)}getWorkspaceVersion(e){for(const t of e){const e=Ep(t,Dp);if(e){const t=g.join(e,"tsserver.js"),n=new Cp("workspace",t,this.logger);if(n.isValid)return n}}return null}bundledVersion(){const e=E(import.meta.url);try{const t=e.resolve("typescript"),n=g.join(g.dirname(t),"tsserver.js");return new Cp("bundled",n,this.logger)}catch(e){return null}}}const kp=Object.freeze({module:El.ESNext,moduleResolution:Cl.Node,target:xl.ES2020,jsx:_l.React});function xp(e){const t={...kp};return e.checkJs&&(t.checkJs=!0),e.experimentalDecorators&&(t.experimentalDecorators=!0),e.strictNullChecks&&(t.strictNullChecks=!0),e.strictFunctionTypes&&(t.strictFunctionTypes=!0),e.module&&(t.module=e.module),e.target&&(t.target=e.target),t.sourceMap=!0,t}var Pp=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Op}(e)}(e)};var Op="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Np(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Fp((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function qp(e,t,n){return e.concat(t).map((function(e){return Np(e,n)}))}function Ip(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function Ap(e,t){try{return t in e}catch(e){return!1}}function Mp(e,t,n){var r={};return n.isMergeableObject(e)&&Ip(e).forEach((function(t){r[t]=Np(e[t],n)})),Ip(t).forEach((function(i){(function(e,t){return Ap(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(Ap(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Fp;var n=t.customMerge(e);return"function"==typeof n?n:Fp}(i,n)(e[i],t[i],n):r[i]=Np(t[i],n))})),r}function Fp(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||qp,n.isMergeableObject=n.isMergeableObject||Pp,n.cloneUnlessOtherwiseSpecified=Np;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Mp(e,t,n):Np(t,n)}Fp.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Fp(e,n,t)}),{})};var Lp=Fp;const jp={allowIncompleteCompletions:!0,allowRenameOfImportPath:!0,allowTextChangesInNewFiles:!0,autoImportFileExcludePatterns:[],disableLineTextInReferences:!0,disableSuggestions:!1,displayPartsForJSDoc:!0,generateReturnInDocTemplate:!0,importModuleSpecifierEnding:"auto",importModuleSpecifierPreference:"shortest",includeAutomaticOptionalChainCompletions:!0,includeCompletionsForImportStatements:!0,includeCompletionsForModuleExports:!0,includeCompletionsWithClassMemberSnippets:!0,includeCompletionsWithInsertText:!0,includeCompletionsWithObjectLiteralMethodSnippets:!0,includeCompletionsWithSnippetText:!0,includeInlayEnumMemberValueHints:!1,includeInlayFunctionLikeReturnTypeHints:!1,includeInlayFunctionParameterTypeHints:!1,includeInlayParameterNameHints:"none",includeInlayParameterNameHintsWhenArgumentMatchesName:!1,includeInlayPropertyDeclarationTypeHints:!1,includeInlayVariableTypeHints:!1,includeInlayVariableTypeHintsWhenTypeMatchesName:!1,includePackageJsonAutoImports:"auto",jsxAttributeCompletionStyle:"auto",lazyConfiguredProjectsFromExternalProject:!1,providePrefixAndSuffixTextForRename:!0,provideRefactorNotApplicableReason:!0,quotePreference:"auto",useLabelDetailsInCompletionEntries:!0},$p={implicitProjectConfiguration:{checkJs:!1,experimentalDecorators:!1,module:El.ESNext,strictFunctionTypes:!0,strictNullChecks:!0,target:xl.ES2020}};class Hp{constructor(e){this.documents=e,this.tsPreferences=Lp({},jp),this.workspaceConfiguration=Lp({},$p),this.tspClient=null}mergeTsPreferences(e){this.tsPreferences=Lp(this.tsPreferences,e)}setWorkspaceConfiguration(e){this.workspaceConfiguration=Lp($p,e)}setAndConfigureTspClient(e,t,n){this.tspClient=t;const r={...n?{hostInfo:n}:{},formatOptions:{newLineCharacter:"\n"},preferences:{...this.tsPreferences,autoImportFileExcludePatterns:this.getAutoImportFileExcludePatternsPreference(e)}};t.executeWithoutWaitingForResponse(wl.Configure,r)}async configureGloballyFromDocument(e,t){const n={formatOptions:this.getFormattingOptions(e,t),preferences:this.getPreferences(e)};await(this.tspClient?.request(wl.Configure,n))}getPreferences(e){if(this.tspClient?.apiVersion.lt(Nl.v290))return{};const t=this.getWorkspacePreferencesForFile(e),n=Object.assign({},this.tsPreferences,t?.inlayHints||{});return{...n,quotePreference:this.getQuoteStylePreference(n)}}getFormattingOptions(e,t){const n={...this.getWorkspacePreferencesForFile(e)?.format,...t};return void 0===n.convertTabsToSpaces&&(n.convertTabsToSpaces=t?.insertSpaces),void 0===n.indentSize&&(n.indentSize=t?.tabSize),n}getQuoteStylePreference(e){switch(e.quotePreference){case"single":return"single";case"double":return"double";default:return this.tspClient?.apiVersion.gte(Nl.v333)?"auto":void 0}}getWorkspacePreferencesForFile(e){const t=this.documents.get(e)?.languageId.startsWith("typescript")?"typescript":"javascript";return this.workspaceConfiguration[t]||{}}getAutoImportFileExcludePatternsPreference(e){if(e&&0!==this.tsPreferences.autoImportFileExcludePatterns.length)return this.tsPreferences.autoImportFileExcludePatterns.map((t=>{const n=t.replace(/\\/g,"/"),r=/^\.\.?($|\/)/.test(n);return g.posix.isAbsolute(t)?t:t.startsWith("*")?`/${n}`:r?g.posix.join(e,t):`/**/${n}`}))}}class Wp{constructor(e){this.options=e,this._tspClient=null,this.hasShutDown=!1,this.initializeParams=null,this.typeScriptAutoFixProvider=null,this.features={},this.documents=new od,this.pendingDebouncedRequest=!1,this.doRequestDiagnosticsDebounced=Va((()=>this.doRequestDiagnostics()),200),this.configurationManager=new Hp(this.documents),this.logger=new wi(e.logger,"[lspserver]")}closeAll(){for(const e of[...this.documents.files])this.closeDocument(e)}shutdown(){this._tspClient&&(this._tspClient.shutdown(),this._tspClient=null,this.hasShutDown=!0)}get tspClient(){if(!this._tspClient)throw new Error('TS client not created. Did you forget to send the "initialize" request?');return this._tspClient}async initialize(e){if(this.logger.log("initialize",e),this._tspClient)throw new Error('The "initialize" request has already called before.');this.initializeParams=e;const t=this.initializeParams.capabilities;this.workspaceRoot=this.initializeParams.rootUri?qh(this.initializeParams.rootUri):this.initializeParams.rootPath||void 0;const n=this.initializeParams.initializationOptions||{},{disableAutomaticTypingAcquisition:r,hostInfo:i,maxTsServerMemory:o,npmLocation:s,locale:a,tsserver:c}=n,{plugins:u}={plugins:n.plugins||[]},l=[],h=[];for(const e of u)l.push(e.name),h.push(e.location);const d=this.findTypescriptVersion(c?.path);if(!d)throw Error('Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting.');this.options.lspClient.logMessage({type:bi.Info,message:`Using Typescript version (${d.source}) ${d.versionString} from path "${d.tsServerPath}"`}),this.configurationManager.mergeTsPreferences(n.preferences||{});const{textDocument:p}=t;if(p){const e=p.completion;this.features.codeActionDisabledSupport=p.codeAction?.disabledSupport,this.features.definitionLinkSupport=p.definition?.linkSupport&&d.version?.gte(Nl.v270),this.features.completionInsertReplaceSupport=e?.completionItem?.insertReplaceSupport,e?.completionItem&&(this.configurationManager.tsPreferences.useLabelDetailsInCompletionEntries&&e.completionItem.labelDetailsSupport&&d.version?.gte(Nl.v470)&&(this.features.completionLabelDetails=!0),e.completionItem.snippetSupport&&(this.features.completionSnippets=!0),p.publishDiagnostics?.tagSupport&&(this.features.diagnosticsTagSupport=!0))}this.configurationManager.mergeTsPreferences({useLabelDetailsInCompletionEntries:this.features.completionLabelDetails}),this.diagnosticQueue=new Xh((e=>this.options.lspClient.publishDiagnostics(e)),this.documents,this.features,this.logger);const f=c?.logVerbosity&&Sh.fromString(c?.logVerbosity);this._tspClient=new Dh({lspClient:this.options.lspClient,trace:wh.fromString(c?.trace||"off"),typescriptVersion:d,logDirectoryProvider:new np(this.getLogDirectoryPath(n)),logVerbosity:f??this.options.tsserverLogVerbosity,disableAutomaticTypingAcquisition:r,maxTsServerMemory:o,npmLocation:s,locale:a,globalPlugins:l,pluginProbeLocations:h,logger:this.options.logger,onEvent:this.onTsEvent.bind(this),onExit:(e,t)=>{if(this.shutdown(),e)throw new Error(`tsserver process has exited (exit code: ${e}, signal: ${t}). Stopping the server.`)}});if(!this.tspClient.start())throw new Error("tsserver process has failed to start.");process.on("exit",(()=>{this.shutdown()})),process.on("SIGINT",(()=>{process.exit()})),this.typeScriptAutoFixProvider=new zd(this.tspClient),this.configurationManager.setAndConfigureTspClient(this.workspaceRoot,this._tspClient,i),this.setCompilerOptionsForInferredProjects();const m=p?.rename?.prepareSupport&&this.tspClient.apiVersion.gte(Nl.v310),g={capabilities:{textDocumentSync:ve.TextDocumentSyncKind.Incremental,completionProvider:{triggerCharacters:[".",'"',"'","/","@","<"],resolveProvider:!0},codeActionProvider:!t.textDocument?.codeAction?.codeActionLiteralSupport||{codeActionKinds:[...zd.kinds.map((e=>e.value)),Pd.SourceOrganizeImportsTs.value,Pd.QuickFix.value,Pd.Refactor.value]},definitionProvider:!0,documentFormattingProvider:!0,documentRangeFormattingProvider:!0,documentHighlightProvider:!0,documentSymbolProvider:!0,executeCommandProvider:{commands:[ad.APPLY_WORKSPACE_EDIT,ad.APPLY_CODE_ACTION,ad.APPLY_REFACTORING,ad.CONFIGURE_PLUGIN,ad.ORGANIZE_IMPORTS,ad.APPLY_RENAME_FILE,ad.SOURCE_DEFINITION]},hoverProvider:!0,inlayHintProvider:!0,renameProvider:!m||{prepareProvider:!0},referencesProvider:!0,selectionRangeProvider:!0,signatureHelpProvider:{triggerCharacters:["(",",","<"],retriggerCharacters:[")"]},workspaceSymbolProvider:!0,implementationProvider:!0,typeDefinitionProvider:!0,foldingRangeProvider:!0,semanticTokensProvider:{documentSelector:null,legend:{tokenTypes:["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","member"],tokenModifiers:["declaration","static","async","readonly","defaultLibrary","local"]},full:!0,range:!0}}};return p?.callHierarchy&&d.version?.gte(Nl.v380)&&(g.capabilities.callHierarchyProvider=!0),this.logger.log("onInitialize result",g),g}findTypescriptVersion(e){const t=new Tp(e||this.options.tsserverPath,this.logger),n=t.getUserSettingVersion();if(n){if(n.isValid)return n;this.logger.logIgnoringVerbosity(bi.Warning,`Typescript specified through user setting ignored due to invalid path "${n.path}"`)}if(this.workspaceRoot){const e=t.getWorkspaceVersion([this.workspaceRoot]);if(e)return e}const r=t.bundledVersion();return r?.isValid?r:null}getLogDirectoryPath(e){return e.tsserver?.logDirectory?e.tsserver.logDirectory:this.workspaceRoot?m.join(this.workspaceRoot,".log"):void 0}setCompilerOptionsForInferredProjects(){const e={options:{...xp(this.configurationManager.workspaceConfiguration.implicitProjectConfiguration),allowJs:!0,allowNonTsExtensions:!0,allowSyntheticDefaultImports:!0,resolveJsonModule:!0}};this.tspClient.executeWithoutWaitingForResponse(wl.CompilerOptionsForInferredProjects,e)}didChangeConfiguration(e){this.configurationManager.setWorkspaceConfiguration(e.settings||{}),this.setCompilerOptionsForInferredProjects();const t=this.configurationManager.workspaceConfiguration.diagnostics?.ignoredCodes||[];this.diagnosticQueue?.updateIgnoredDiagnosticCodes(t)}interuptDiagnostics(e){if(!this.diagnosticsTokenSource)return e();this.cancelDiagnostics();const t=e();return this.requestDiagnostics(),t}async requestDiagnostics(){this.pendingDebouncedRequest=!0,await this.doRequestDiagnosticsDebounced()}async doRequestDiagnostics(){if(this.cancelDiagnostics(),this.hasShutDown)return;const e=new ve.CancellationTokenSource;this.diagnosticsTokenSource=e;const{files:t}=this.documents;try{return await this.tspClient.requestGeterr({delay:0,files:t},this.diagnosticsTokenSource.token)}finally{this.diagnosticsTokenSource===e&&(this.diagnosticsTokenSource=void 0,this.pendingDebouncedRequest=!1)}}cancelDiagnostics(){this.diagnosticsTokenSource&&(this.diagnosticsTokenSource.cancel(),this.diagnosticsTokenSource=void 0)}didOpenTextDocument(e){const t=qh(e.textDocument.uri);this.logger.log("onDidOpenTextDocument",e,t),t&&(this.documents.open(t,e.textDocument)?(this.tspClient.notify(wl.Open,{file:t,fileContent:e.textDocument.text,scriptKindName:this.getScriptKindName(e.textDocument.languageId),projectRootPath:this.workspaceRoot}),this.requestDiagnostics()):(this.logger.log(`Cannot open already opened doc '${e.textDocument.uri}'.`),this.didChangeTextDocument({textDocument:e.textDocument,contentChanges:[{text:e.textDocument.text}]})))}getScriptKindName(e){switch(e){case"typescript":return"TS";case"typescriptreact":return"TSX";case"javascript":return"JS";case"javascriptreact":return"JSX"}}didCloseTextDocument(e){const t=qh(e.textDocument.uri);this.logger.log("onDidCloseTextDocument",e,t),t&&this.closeDocument(t)}closeDocument(e){const t=this.documents.close(e);t&&(this.tspClient.notify(wl.Close,{file:e}),this.options.lspClient.publishDiagnostics({uri:t.uri,diagnostics:[]}))}didChangeTextDocument(e){const{textDocument:t}=e,n=qh(t.uri);if(this.logger.log("onDidChangeTextDocument",e,n),!n)return;const r=this.documents.get(n);if(!r)throw this.logger.error(`Received change on non-opened document ${t.uri}`),new Error(`Received change on non-opened document ${t.uri}`);if(null===t.version)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);for(const i of e.contentChanges){let e=0,o=0,s=0,a=0;if(ve.TextDocumentContentChangeEvent.isIncremental(i))e=i.range.start.line+1,o=i.range.start.character+1,s=i.range.end.line+1,a=i.range.end.character+1;else{e=1,o=1;const t=r.positionAt(r.getText().length);s=t.line+1,a=t.character+1}this.tspClient.notify(wl.Change,{file:n,line:e,offset:o,endLine:s,endOffset:a,insertString:i.text}),r.applyEdit(t.version,i)}this.requestDiagnostics()}didSaveTextDocument(e){}async definition(e){return this.getDefinition({type:this.features.definitionLinkSupport?wl.DefinitionAndBoundSpan:wl.Definition,params:e})}async implementation(e){return this.getSymbolLocations({type:wl.Implementation,params:e})}async typeDefinition(e){return this.getSymbolLocations({type:wl.TypeDefinition,params:e})}async getDefinition({type:e,params:t}){const n=qh(t.textDocument.uri);if(this.logger.log(e,t,n),n){if(e===wl.DefinitionAndBoundSpan){const r=Ph.toFileLocationRequestArgs(n,t.position),i=await this.tspClient.request(e,r);if("response"!==i.type||!i.body)return;const o=i.body.textSpan?xh.fromTextSpan(i.body.textSpan):void 0;return i.body.definitions.map((e=>{const t=Lh(e,this.documents),n=e.contextStart&&e.contextEnd?xh.fromLocations(e.contextStart,e.contextEnd):t.range;return{originSelectionRange:o,targetRange:n,targetUri:t.uri,targetSelectionRange:t.range}}))}return this.getSymbolLocations({type:wl.Definition,params:t})}}async getSymbolLocations({type:e,params:t}){const n=qh(t.textDocument.uri);if(this.logger.log(e,t,n),!n)return[];const r=Ph.toFileLocationRequestArgs(n,t.position),i=await this.tspClient.request(e,r);return"response"===i.type&&i.body?i.body.map((e=>Lh(e,this.documents))):void 0}async documentSymbol(e){const t=qh(e.textDocument.uri);if(this.logger.log("symbol",e,t),!t)return[];const n=(await this.tspClient.request(wl.NavTree,{file:t})).body;if(!n?.childItems)return[];if(this.supportHierarchicalDocumentSymbol){const e=[];for(const t of n.childItems)Od(t,e);return e}const r=[];for(const t of n.childItems)qd(e.textDocument.uri,t,r);return r}get supportHierarchicalDocumentSymbol(){const e=this.initializeParams?.capabilities.textDocument,t=e?.documentSymbol;return!!t&&!!t.hierarchicalDocumentSymbolSupport}async completion(e){const t=qh(e.textDocument.uri);if(this.logger.log("completion",e,t),!t)return ve.CompletionList.create([]);const n=this.documents.get(t);if(!n)throw new Error(`The document should be opened for completion, file: ${t}`);const r=this.configurationManager.workspaceConfiguration.completions||{};try{const i=await this.interuptDiagnostics((()=>this.tspClient.request(wl.CompletionInfo,{file:t,line:e.position.line+1,offset:e.position.character+1,triggerCharacter:_d(e.context?.triggerCharacter),triggerKind:e.context?.triggerKind}))),{body:o}=i;if(!o)return ve.CompletionList.create();const{entries:s,isIncomplete:a,optionalReplacementSpan:c}=o,u=[];for(const i of s||[]){if("warning"===i.kind)continue;const o=yd(i,c,t,e.position,n,this.documents,r,this.features);o&&u.push(o)}return ve.CompletionList.create(u,a)}catch(e){if("No content available."===e.message)return this.logger.info("No content was available for completion request"),null;throw e}}async completionResolve(e){this.logger.log("completion/resolve",e);const t=e.data?.file?this.documents.get(e.data.file):void 0;await this.configurationManager.configureGloballyFromDocument(e.data.file);const{body:n}=await this.interuptDiagnostics((()=>this.tspClient.request(wl.CompletionDetails,e.data))),r=n?.length&&n[0];return r?wd(e,r,t,this.tspClient,this.documents,this.configurationManager.workspaceConfiguration.completions||{},this.features):e}async hover(e){const t=qh(e.textDocument.uri);if(this.logger.log("hover",e,t),!t)return{contents:[]};const n=await this.interuptDiagnostics((()=>this.getQuickInfo(t,e.position)));if(!n?.body)return{contents:[]};const r=new cd,{displayString:i,documentation:o,tags:s}=n.body;return i&&r.appendCodeblock("typescript",i),fd(r,o,s,this.documents),{contents:r.toMarkupContent(),range:xh.fromTextSpan(n.body)}}async getQuickInfo(e,t){try{return await this.tspClient.request(wl.Quickinfo,{file:e,line:t.line+1,offset:t.character+1})}catch(e){return}}async prepareRename(e){const t=qh(e.textDocument.uri);if(!t)return null;const n=(await this.tspClient.request(wl.Rename,Ph.toFileLocationRequestArgs(t,e.position))).body?.info;if(!n)return null;if(!n.canRename)throw new Error(n.localizedErrorMessage);return xh.fromTextSpan(n.triggerSpan)}async rename(e){const t=qh(e.textDocument.uri);if(this.logger.log("onRename",e,t),!t)return null;const n=await this.tspClient.request(wl.Rename,Ph.toFileLocationRequestArgs(t,e.position));if(!n.body?.info.canRename||0===n.body.locs.length)return null;const r={};return n.body.locs.forEach((t=>{const n=Ih(t.file,this.documents);r.changes||(r.changes={});const i=r.changes[n]||(r.changes[n]=[]);t.locs.forEach((t=>{i.push({newText:`${t.prefixText||""}${e.newName}${t.suffixText||""}`,range:{start:Ph.fromLocation(t.start),end:Ph.fromLocation(t.end)}})}))})),r}async references(e){const t=qh(e.textDocument.uri);if(this.logger.log("onReferences",e,t),!t)return[];const n=await this.tspClient.request(wl.References,{file:t,line:e.position.line+1,offset:e.position.character+1});return n.body?n.body.refs.filter((t=>e.context.includeDeclaration||!t.isDefinition)).map((e=>Lh(e,this.documents))):[]}async documentFormatting(e){const t=qh(e.textDocument.uri);if(this.logger.log("documentFormatting",e,t),!t)return[];const n=e.options;await this.configurationManager.configureGloballyFromDocument(t,n);const r=await this.tspClient.request(wl.Format,{file:t,line:1,offset:1,endLine:Number.MAX_SAFE_INTEGER,endOffset:Number.MAX_SAFE_INTEGER,options:n});return r.body?r.body.map((e=>Kh(e))):[]}async documentRangeFormatting(e){const t=qh(e.textDocument.uri);if(this.logger.log("documentRangeFormatting",e,t),!t)return[];const n=e.options;await this.configurationManager.configureGloballyFromDocument(t,n);const r=await this.tspClient.request(wl.Format,{file:t,line:e.range.start.line+1,offset:e.range.start.character+1,endLine:e.range.end.line+1,endOffset:e.range.end.character+1,options:n});return r.body?r.body.map((e=>Kh(e))):[]}async selectionRanges(e){const t=qh(e.textDocument.uri);if(!t)return null;const n=await this.tspClient.request(wl.SelectionRange,{file:t,locations:e.positions.map(Ph.toLocation)});return"response"===n.type&&n.body?n.body.map(Uh):null}async signatureHelp(e){const t=qh(e.textDocument.uri);if(this.logger.log("signatureHelp",e,t),!t)return;const n=await this.interuptDiagnostics((()=>this.getSignatureHelp(t,e)));return n?.body?Ed(n.body,e.context,this.documents):void 0}async getSignatureHelp(e,t){try{const{position:n,context:r}=t;return await this.tspClient.request(wl.SignatureHelp,{file:e,line:n.line+1,offset:n.character+1,triggerReason:r?Td(r):void 0})}catch(e){return}}async codeAction(e){const t=qh(e.textDocument.uri);if(this.logger.log("codeAction",e,t),!t)return[];const n=xh.toFileRangeRequestArgs(t,e.range),r=[],i=e.context.only?.map((e=>new Pd(e)));var o,s;if(i&&!i.some((e=>e.contains(Pd.QuickFix)))||r.push(...(o=await this.getCodeFixes(n,e.context),s=this.documents,o?.body?o.body.map((e=>ve.CodeAction.create(e.description,{title:e.description,command:ad.APPLY_WORKSPACE_EDIT,arguments:[{documentChanges:e.changes.map((e=>Gh(e,s)))}]},ve.CodeActionKind.QuickFix))):[])),i&&!i.some((e=>e.contains(Pd.Refactor)))||r.push(...function(e,t,n){if(!e?.body)return[];const r=[];for(const i of e.body)if(!1===i.inlineable)r.push(kd(i,t));else{const e=n.codeActionDisabledSupport?i.actions:i.actions.filter((e=>!e.notApplicableReason));for(const n of e)r.push(xd(n,i,t))}return r}(await this.getRefactors(n,e.context),n,this.features)),i?.some((e=>e.contains(Pd.SourceOrganizeImportsTs)))){const t=e.context.diagnostics.some((e=>(e.severity??0)<=2)),i=await this.getOrganizeImports({scope:{type:"file",args:n},skipDestructiveCodeActions:t});r.push(...function(e,t){return e&&0!==e.body.length?[ve.CodeAction.create("Organize imports",{documentChanges:e.body.map((e=>Gh(e,t)))},Pd.SourceOrganizeImportsTs.value)]:[]}(i,this.documents))}if(i&&!this.pendingDebouncedRequest){const e=this.diagnosticQueue?.getDiagnosticsForFile(t)||[];e.length&&r.push(...await this.typeScriptAutoFixProvider.provideCodeActions(i,t,e,this.documents))}return r}async getCodeFixes(e,t){const n=t.diagnostics.map((e=>Number(e.code))),r={...e,errorCodes:n};try{return await this.tspClient.request(wl.GetCodeFixes,r)}catch(e){return}}async getRefactors(e,t){const n={...e,triggerReason:t.triggerKind===ve.CodeActionTriggerKind.Invoked?"invoked":void 0,kind:1===t.only?.length?t.only[0]:void 0};try{return await this.tspClient.request(wl.GetApplicableRefactors,n)}catch(e){return}}async getOrganizeImports(e){try{return await this.configurationManager.configureGloballyFromDocument(e.scope.args.file),await this.tspClient.request(wl.OrganizeImports,e)}catch(e){return}}async executeCommand(e,t,n){if(this.logger.log("executeCommand",e),e.command===ad.APPLY_WORKSPACE_EDIT&&e.arguments){const t=e.arguments[0];await this.options.lspClient.applyWorkspaceEdit({edit:t})}else if(e.command===ad.APPLY_CODE_ACTION&&e.arguments){const t=e.arguments[0];if(!await this.applyFileCodeEdits(t.changes))return;if(t.commands?.length)for(const e of t.commands)await this.tspClient.request(wl.ApplyCodeActionCommand,{command:e})}else if(e.command===ad.APPLY_REFACTORING&&e.arguments){const t=e.arguments[0],{body:n}=await this.tspClient.request(wl.GetEditsForRefactor,t);if(!n?.edits.length)return;for(const e of n.edits)await Wa.ensureFile(e.fileName);if(!await this.applyFileCodeEdits(n.edits))return;const r=n.renameLocation;r&&await this.options.lspClient.rename({textDocument:{uri:Ih(t.file,this.documents)},position:Ph.fromLocation(r)})}else if(e.command===ad.CONFIGURE_PLUGIN&&e.arguments){const[t,n]=e.arguments;this.tspClient?.apiVersion.gte(Nl.v314)&&this.tspClient.executeWithoutWaitingForResponse(wl.ConfigurePlugin,{configuration:n,pluginName:t})}else if(e.command===ad.ORGANIZE_IMPORTS&&e.arguments){const t=e.arguments[0],n=e.arguments[1]||{};await this.configurationManager.configureGloballyFromDocument(t);const{body:r}=await this.tspClient.request(wl.OrganizeImports,{scope:{type:"file",args:{file:t}},skipDestructiveCodeActions:n.skipDestructiveCodeActions});await this.applyFileCodeEdits(r)}else if(e.command===ad.APPLY_RENAME_FILE&&e.arguments){const{sourceUri:t,targetUri:n}=e.arguments[0];this.applyRenameFile(t,n)}else if(e.command===ad.APPLY_COMPLETION_CODE_ACTION&&e.arguments){const[t,n]=e.arguments;for(const e of n){if(await this.applyFileCodeEdits(e.changes),e.commands?.length)for(const t of e.commands)await this.tspClient.request(wl.ApplyCodeActionCommand,{command:t});break}}else{if(e.command===ad.SOURCE_DEFINITION){const[r,i]=e.arguments||[],o=await this.options.lspClient.createProgressReporter(t,n);return sd.execute(r,i,this.documents,this.tspClient,this.options.lspClient,o)}this.logger.error(`Unknown command ${e.command}.`)}}async applyFileCodeEdits(e){if(!e.length)return!1;const t={};for(const n of e)t[Ih(n.fileName,this.documents)]=n.textChanges.map(Kh);const{applied:n}=await this.options.lspClient.applyWorkspaceEdit({edit:{changes:t}});return n}async applyRenameFile(e,t){const n=await this.getEditsForFileRename(e,t);this.applyFileCodeEdits(n)}async getEditsForFileRename(e,t){const n=qh(t),r=qh(e);if(!n||!r)return[];try{const{body:e}=await this.tspClient.request(wl.GetEditsForFileRename,{oldFilePath:r,newFilePath:n});return e}catch(e){return[]}}async documentHighlight(e){const t=qh(e.textDocument.uri);if(this.logger.log("documentHighlight",e,t),!t)return[];let n;try{n=await this.tspClient.request(wl.DocumentHighlights,{file:t,line:e.position.line+1,offset:e.position.character+1,filesToSearch:[t]})}catch(e){return[]}if(!n.body)return[];const r=[];for(const e of n.body)if(Ah(e.file)===t){const t=zh(e);r.push(...t)}return r}lastFileOrDummy(){return this.documents.files[0]||this.workspaceRoot}async workspaceSymbol(e){const t=await this.tspClient.request(wl.Navto,{file:this.lastFileOrDummy(),searchValue:e.query});return t.body?t.body.map((e=>({location:{uri:Ih(e.file,this.documents),range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)}},kind:$h(e.kind),name:e.name}))):[]}async foldingRanges(e){const t=qh(e.textDocument.uri);if(this.logger.log("foldingRanges",e,t),!t)return;const n=this.documents.get(t);if(!n)throw new Error(`The document should be opened for foldingRanges', file: ${t}`);const{body:r}=await this.tspClient.request(wl.GetOutliningSpans,{file:t});if(!r)return;const i=[];for(const e of r){const t=this.asFoldingRange(e,n);t&&i.push(t)}return i}asFoldingRange(e,t){const n=xh.fromTextSpan(e.textSpan),r=this.asFoldingRangeKind(e);if("comment"===e.kind){if(t.getLine(n.start.line).match(/\/\/\s*#endregion/gi))return}return{startLine:n.start.line,endLine:n.end.character>0&&"}"===t.getText(ve.Range.create(ve.Position.create(n.end.line,n.end.character-1),n.end))?Math.max(n.end.line-1,n.start.line):n.end.line,kind:r}}asFoldingRangeKind(e){switch(e.kind){case"comment":return ve.FoldingRangeKind.Comment;case"region":return ve.FoldingRangeKind.Region;case"imports":return ve.FoldingRangeKind.Imports;default:return}}async onTsEvent(e){"semanticDiag"!==e.event&&"syntaxDiag"!==e.event&&"suggestionDiag"!==e.event||this.diagnosticQueue?.updateDiagnostics(e.event,e)}async prepareCallHierarchy(e){const t=qh(e.textDocument.uri);if(!t)return null;const n=Ph.toFileLocationRequestArgs(t,e.position),r=await this.tspClient.request(wl.PrepareCallHierarchy,n);if("response"!==r.type||!r.body)return null;return(Array.isArray(r.body)?r.body:[r.body]).map((e=>Ad(e,this.documents,this.workspaceRoot)))}async callHierarchyIncomingCalls(e){const t=qh(e.item.uri);if(!t)return null;const n=Ph.toFileLocationRequestArgs(t,e.item.selectionRange.start),r=await this.tspClient.request(wl.ProvideCallHierarchyIncomingCalls,n);return"response"===r.type&&r.body?r.body.map((e=>function(e,t,n){return{from:Ad(e.from,t,n),fromRanges:e.fromSpans.map(xh.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async callHierarchyOutgoingCalls(e){const t=qh(e.item.uri);if(!t)return null;const n=Ph.toFileLocationRequestArgs(t,e.item.selectionRange.start),r=await this.tspClient.request(wl.ProvideCallHierarchyOutgoingCalls,n);return"response"===r.type&&r.body?r.body.map((e=>function(e,t,n){return{to:Ad(e.to,t,n),fromRanges:e.fromSpans.map(xh.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async inlayHints(e){return await Bd.provideInlayHints(e.textDocument.uri,e.range,this.documents,this.tspClient,this.options.lspClient,this.configurationManager)}async semanticTokensFull(e){const t=qh(e.textDocument.uri);if(this.logger.log("semanticTokensFull",e,t),!t)return{data:[]};const n=this.documents.get(t);if(!n)return{data:[]};const r=n.offsetAt({line:0,character:0}),i=n.offsetAt({line:n.lineCount,character:0});return this.getSemanticTokens(n,t,r,i)}async semanticTokensRange(e){const t=qh(e.textDocument.uri);if(this.logger.log("semanticTokensRange",e,t),!t)return{data:[]};const n=this.documents.get(t);if(!n)return{data:[]};const r=n.offsetAt(e.range.start),i=n.offsetAt(e.range.end);return this.getSemanticTokens(n,t,r,i)}async getSemanticTokens(e,t,n,r){try{const i=await this.tspClient.request(wl.EncodedSemanticClassificationsFull,{file:t,start:n,length:r-n,format:"2020"});return{data:tp(e,i.body?.spans??[])}}catch{return{data:[]}}}}const Vp=Nr(void 0,void 0);class Up{constructor(e){this.connection=e}async createProgressReporter(e,t){let n;return n=t&&t.constructor!==Vp.constructor?t:t||await this.connection.window.createWorkDoneProgress(),n}async withProgress(e,t){const{message:n,reporter:r}=e;return r.begin(n),t(r).then((e=>(r.done(),e)))}publishDiagnostics(e){this.connection.sendDiagnostics(e)}showErrorMessage(e){this.connection.sendNotification(ve.ShowMessageNotification.type,{type:ve.MessageType.Error,message:e})}logMessage(e){this.connection.sendNotification(ve.LogMessageNotification.type,e)}async applyWorkspaceEdit(e){return this.connection.workspace.applyEdit(e)}async rename(e){return this.connection.sendRequest(Sl.type,e)}}const Kp=gi.MessageType.Info,{version:Gp}=JSON.parse(r(new URL("../package.json",import.meta.url),{encoding:"utf8"})),zp=new fe("typescript-language-server").version(Gp).requiredOption("--stdio","use stdio").option("--log-level <logLevel>","A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `2`.").option("--tsserver-log-verbosity <tsserverLogVerbosity>","[deprecated] Specify a tsserver log verbosity (terse, normal, verbose). Defaults to `normal`. example: --tsserver-log-verbosity verbose").option("--tsserver-path <path>","[deprecated] Specify path to tsserver.js or the lib directory. example: --tsserver-path=/Users/me/typescript/lib/tsserver.js").parse(process.argv).opts();let Bp=Kp;zp.logLevel&&(Bp=parseInt(zp.logLevel,10),Bp&&(Bp<1||Bp>4)&&(console.error(`Invalid '--log-level ${Bp}'. Falling back to 'info' level.`),Bp=Kp)),function(e){const t=vi.createConnection(vi.ProposedFeatures.all),n=new Up(t),r=new Si(n,e.showMessageLevel),i=new Wp({logger:r,lspClient:n,tsserverPath:e.cmdLineTsserverPath,tsserverLogVerbosity:e.cmdLineTsserverLogVerbosity});return t.onInitialize(i.initialize.bind(i)),t.onDidChangeConfiguration(i.didChangeConfiguration.bind(i)),t.onDidOpenTextDocument(i.didOpenTextDocument.bind(i)),t.onDidSaveTextDocument(i.didSaveTextDocument.bind(i)),t.onDidCloseTextDocument(i.didCloseTextDocument.bind(i)),t.onDidChangeTextDocument(i.didChangeTextDocument.bind(i)),t.onCodeAction(i.codeAction.bind(i)),t.onCompletion(i.completion.bind(i)),t.onCompletionResolve(i.completionResolve.bind(i)),t.onDefinition(i.definition.bind(i)),t.onImplementation(i.implementation.bind(i)),t.onTypeDefinition(i.typeDefinition.bind(i)),t.onDocumentFormatting(i.documentFormatting.bind(i)),t.onDocumentRangeFormatting(i.documentRangeFormatting.bind(i)),t.onDocumentHighlight(i.documentHighlight.bind(i)),t.onDocumentSymbol(i.documentSymbol.bind(i)),t.onExecuteCommand(i.executeCommand.bind(i)),t.onHover(i.hover.bind(i)),t.onReferences(i.references.bind(i)),t.onRenameRequest(i.rename.bind(i)),t.onPrepareRename(i.prepareRename.bind(i)),t.onSelectionRanges(i.selectionRanges.bind(i)),t.onSignatureHelp(i.signatureHelp.bind(i)),t.onWorkspaceSymbol(i.workspaceSymbol.bind(i)),t.onFoldingRanges(i.foldingRanges.bind(i)),t.languages.callHierarchy.onPrepare(i.prepareCallHierarchy.bind(i)),t.languages.callHierarchy.onIncomingCalls(i.callHierarchyIncomingCalls.bind(i)),t.languages.callHierarchy.onOutgoingCalls(i.callHierarchyOutgoingCalls.bind(i)),t.languages.inlayHint.on(i.inlayHints.bind(i)),t.languages.semanticTokens.on(i.semanticTokensFull.bind(i)),t.languages.semanticTokens.onRange(i.semanticTokensRange.bind(i)),t}({cmdLineTsserverPath:zp.tsserverPath,cmdLineTsserverLogVerbosity:Sh.fromString(zp.tsserverLogVerbosity),showMessageLevel:Bp}).listen();
|
|
2
|
+
import e,{statSync as t,existsSync as n,readFileSync as r}from"node:fs";import i from"events";import o from"child_process";import s from"path";import a from"fs";import c from"process";import u,{promisify as l}from"util";import h from"os";import d from"crypto";import p from"net";import f from"url";import*as m from"node:path";import g,{resolve as y}from"node:path";import v from"constants";import b from"stream";import S from"assert";import"node:fs/promises";import w from"node:stream";import{promisify as R}from"node:util";import _ from"node:child_process";import{createRequire as E}from"node:module";import{fileURLToPath as C}from"node:url";import D from"node:process";var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function k(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function x(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];n.push.apply(n,arguments);var r=Function.bind.apply(t,n);return new r}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var P={},O={get exports(){return P},set exports(e){P=e}},N={},q={};let I=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}};q.CommanderError=I,q.InvalidArgumentError=class extends I{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:A}=q;N.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new A(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},N.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"};var M={},F={};const{humanReadableArgName:L}=N;F.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));if(e._hasImplicitHelpCommand()){const[,n,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),i=e.createCommand(n).helpOption(!1);i.description(e._helpCommandDescription),r&&i.arguments(r),t.push(i)}return this.sortSubcommands&&t.sort(((e,t)=>e.name().localeCompare(t.name()))),t}compareOptions(e,t){const n=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){const t=e.options.filter((e=>!e.hidden)),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||r){let i;i=n?r?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let n=e.parent;n;n=n.parent){const e=n.options.filter((e=>!e.hidden));t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e._args.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""})),e._args.find((e=>e.description))?e._args:[]}subcommandTerm(e){const t=e._args.map((e=>L(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce(((e,n)=>Math.max(e,t.subcommandTerm(n).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,n)=>Math.max(e,t.argumentTerm(n).length)),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let t=e.parent;t;t=t.parent)n=t.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth||80;function i(e,i){if(i){const o=`${e.padEnd(n+2)}${i}`;return t.wrap(o,r-2,n+2)}return e}function o(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);a.length>0&&(s=s.concat([t.wrap(a,r,0),""]));const c=t.visibleArguments(e).map((e=>i(t.argumentTerm(e),t.argumentDescription(e))));c.length>0&&(s=s.concat(["Arguments:",o(c),""]));const u=t.visibleOptions(e).map((e=>i(t.optionTerm(e),t.optionDescription(e))));if(u.length>0&&(s=s.concat(["Options:",o(u),""])),this.showGlobalOptions){const n=t.visibleGlobalOptions(e).map((e=>i(t.optionTerm(e),t.optionDescription(e))));n.length>0&&(s=s.concat(["Global Options:",o(n),""]))}const l=t.visibleCommands(e).map((e=>i(t.subcommandTerm(e),t.subcommandDescription(e))));return l.length>0&&(s=s.concat(["Commands:",o(l),""])),s.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){const i=new RegExp("[\\n][ \\f\\t\\v - \ufeff]+");if(e.match(i))return e;const o=t-n;if(o<r)return e;const s=e.slice(0,n),a=e.slice(n).replace("\r\n","\n"),c=" ".repeat(n),u="\\s",l=new RegExp(`\n|.{1,${o-1}}([${u}]|$)|[^${u}]+?([${u}]|$)`,"g");return s+(a.match(l)||[]).map(((e,t)=>"\n"===e?"":(t>0?c:"")+e.trimEnd())).join("\n")}};var j={};const{InvalidArgumentError:$}=q;function H(e){let t,n;const r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0),{shortFlag:t,longFlag:n}}j.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=H(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){return this.implied=Object.assign(this.implied||{},e),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new $(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},j.splitOptionFlags=H,j.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)})),this.negativeOptions.forEach(((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)}))}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,i=void 0!==r&&r;return t.negate===(i===e)}};var W={};W.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const n=e.startsWith("--");n&&(e=e.slice(2),t=t.map((e=>e.slice(2))));let r=[],i=3;return t.forEach((t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let o=1;o=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+o),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}(e,t),o=Math.max(e.length,t.length);(o-n)/o>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))})),r.sort(((e,t)=>e.localeCompare(t))),n&&(r=r.map((e=>`--${e}`))),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""};const V=i.EventEmitter,U=o,K=s,G=a,z=c,{Argument:B,humanReadableArgName:J}=N,{CommanderError:X}=q,{Help:Y}=F,{Option:Q,splitOptionFlags:Z,DualOptions:ee}=j,{suggestSimilar:te}=W;let ne=class extends V{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>z.stdout.write(e),writeErr:e=>z.stderr.write(e),getOutHelpWidth:()=>z.stdout.isTTY?z.stdout.columns:void 0,getErrHelpWidth:()=>z.stderr.isTTY?z.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,t,n){let r=t,i=n;"object"==typeof r&&null!==r&&(i=r,r=null),i=i||{};const[,o,s]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(o);return r&&(a.description(r),a._executableHandler=!0),i.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!i.noHelp&&!i.hidden),a._executableFile=i.executableFile||null,s&&a.arguments(s),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(e){return new ne(e)}createHelp(){return Object.assign(new Y,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new B(e,t)}argument(e,t,n,r){const i=this.createArgument(e,t);return"function"==typeof n?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.split(/ +/).forEach((e=>{this.argument(e)})),this}addArgument(e){const t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new X(e,t,n)),z.exit(e)}action(e){return this._actionHandler=t=>{const n=this._args.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new Q(e,t)}addOption(e){const t=e.name(),n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(n,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(n,e.defaultValue,"default");this.options.push(e);const r=(t,r,i)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const o=this.getOptionValue(n);if(null!==t&&e.parseArg)try{t=e.parseArg(t,o)}catch(e){if("commander.invalidArgument"===e.code){const t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,o));null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(n,t,i)};return this.on("option:"+t,(t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,"cli")})),e.envVar&&this.on("optionEnv:"+t,(t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,"env")})),this}_optionEx(e,t,n,r,i){if("object"==typeof t&&t instanceof Q)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const o=this.createOption(t,n);if(o.makeOptionMandatory(!!e.mandatory),"function"==typeof r)o.default(i).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},o.default(i).argParser(r)}else o.default(r);return this.addOption(o)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return oe(this).forEach((n=>{void 0!==n.getOptionValueSource(e)&&(t=n.getOptionValueSource(e))})),t}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let n;switch(t=t||{},void 0===e&&(e=z.argv,z.versions&&z.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":z.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function i(e,t){const n=K.resolve(e,t);if(G.existsSync(n))return n;if(r.includes(K.extname(t)))return;const i=r.find((e=>G.existsSync(`${n}${e}`)));return i?`${n}${i}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o,s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let e;try{e=G.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}a=K.resolve(K.dirname(e),a)}if(a){let t=i(a,s);if(!t&&!e._executableFile&&this._scriptPath){const n=K.basename(this._scriptPath,K.extname(this._scriptPath));n!==this._name&&(t=i(a,`${n}-${e._name}`))}s=t||s}if(n=r.includes(K.extname(s)),"win32"!==z.platform?n?(t.unshift(s),t=ie(z.execArgv).concat(t),o=U.spawn(z.argv[0],t,{stdio:"inherit"})):o=U.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=ie(z.execArgv).concat(t),o=U.spawn(z.execPath,t,{stdio:"inherit"})),!o.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{z.on(e,(()=>{!1===o.killed&&null===o.exitCode&&o.kill(e)}))}))}const c=this._exitCallback;c?o.on("close",(()=>{c(new X(z.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):o.on("close",z.exit.bind(z)),o.on("error",(t=>{if("ENOENT"===t.code){const t=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${s}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(n)}if("EACCES"===t.code)throw new Error(`'${s}' not executable`);if(c){const e=new X(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,c(e)}else z.exit(1)})),this.runningCommand=o}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);let i;return r||this.help({error:!0}),i=this._chainOrCallSubCommandHook(i,r,"preSubcommand"),i=this._chainOrCall(i,(()=>{if(!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))})),i}_checkNumberOfArguments(){this._args.forEach(((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg)try{r=e.parseArg(t,n)}catch(n){if("commander.invalidArgument"===n.code){const r=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${n.message}`;this.error(r,{exitCode:n.exitCode,code:n.code})}throw n}return r};this._checkNumberOfArguments();const t=[];this._args.forEach(((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce(((t,r)=>e(n,r,t)),n.defaultValue))):void 0===i&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i})),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then((()=>t())):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return oe(this).reverse().filter((e=>void 0!==e._lifeCycleHooks[t])).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{r.push({hookedCommand:e,callback:t})}))})),"postAction"===t&&r.reverse(),r.forEach((e=>{n=this._chainOrCall(n,(()=>e.callback(e.hookedCommand,this)))})),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach((e=>{r=this._chainOrCall(r,(()=>e(this,t)))})),r}_parseCommand(e,t){const n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return re(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),re(this,n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs))),this.parent&&(n=this._chainOrCall(n,(()=>{this.parent.emit(i,e,t)}))),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find((t=>t._name===e||t._aliases.includes(e)))}_findOption(e){return this.options.find((t=>t.is(e)))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach((t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)})),t=e.filter((e=>e.conflictsWith.length>0));t.forEach((t=>{const n=e.find((e=>t.conflictsWith.includes(e.attributeName())));n&&this._conflictingOption(t,n)}))}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){const t=[],n=[];let r=t;const i=e.slice();function o(e){return e.length>1&&"-"===e[0]}let s=null;for(;i.length;){const e=i.shift();if("--"===e){r===n&&r.push(e),r.push(...i);break}if(!s||o(e)){if(s=null,o(e)){const t=this._findOption(e);if(t){if(t.required){const e=i.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;i.length>0&&!o(i[0])&&(e=i.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);s=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),i.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(o(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(e)){t.push(e),i.length>0&&n.push(...i);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),i.length>0&&t.push(...i);break}if(this._defaultCommandName){n.push(e),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}else this.emit(`option:${s.name()}`,e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return oe(this).reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=t||{},r=n.exitCode||1,i=n.code||"commander.error";this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in z.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,z.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}}))}_parseOptionsImplied(){const e=new ee(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((n=>void 0!==n.implied&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n))).forEach((e=>{Object.keys(e.implied).filter((e=>!t(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const n=e=>{const t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find((e=>e.negate&&t===e.attributeName())),i=this.options.find((e=>!e.negate&&t===e.attributeName()));return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:i||e},r=e=>{const t=n(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const e=r.createHelp().visibleOptions(r).filter((e=>e.long)).map((e=>e.long));n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=te(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this._args.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach((e=>{n.push(e.name()),e.alias()&&n.push(e.alias())})),t=te(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)})),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach((e=>this.alias(e))),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this._args.map((e=>J(e)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=K.basename(e,K.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getHelpContext(e);oe(this).reverse().forEach((e=>e.emit("beforeAllHelp",n))),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t&&(r=t(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",n),oe(this).forEach((e=>e.emit("afterAllHelp",n)))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const n=Z(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let t=z.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${e}Help`;return this.on(r,(e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)})),this}};function re(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function ie(e){return e.map((e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",i="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],i=n[4]),t&&"0"!==i?`${t}=${r}:${parseInt(i)+1}`:e}))}function oe(e){const t=[];for(let n=e;n;n=n.parent)t.push(n);return t}M.Command=ne,function(e,t){const{Argument:n}=N,{Command:r}=M,{CommanderError:i,InvalidArgumentError:o}=q,{Help:s}=F,{Option:a}=j;(t=e.exports=new r).program=t,t.Argument=n,t.Command=r,t.CommanderError=i,t.Help=s,t.InvalidArgumentError=o,t.InvalidOptionArgumentError=o,t.Option=a}(O,P);const se=P,{program:ae,createCommand:ce,createArgument:ue,createOption:le,CommanderError:he,InvalidArgumentError:de,InvalidOptionArgumentError:pe,Command:fe,Argument:me,Option:ge,Help:ye}=se;var ve={},be={};function Se(e){return"string"==typeof e||e instanceof String}function we(e){return"function"==typeof e}function Re(e){return Array.isArray(e)}Object.defineProperty(be,"__esModule",{value:!0}),be.thenable=be.typedArray=be.stringArray=be.array=be.func=be.error=be.number=be.string=be.boolean=void 0,be.boolean=function(e){return!0===e||!1===e},be.string=Se,be.number=function(e){return"number"==typeof e||e instanceof Number},be.error=function(e){return e instanceof Error},be.func=we,be.array=Re,be.stringArray=function(e){return Re(e)&&e.every((e=>Se(e)))},be.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},be.thenable=function(e){return e&&we(e.then)};var _e={},Ee={},Ce={},De={get exports(){return Ce},set exports(e){Ce=e}},Te={},ke={},xe={};let Pe;function Oe(){if(void 0===Pe)throw new Error("No runtime abstraction layer installed");return Pe}Object.defineProperty(xe,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");Pe=e}}(Oe||(Oe={})),xe.default=Oe;var Ne,qe={};Ne=qe,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.Disposable=void 0,(Ne.Disposable||(Ne.Disposable={})).create=function(e){return{dispose:e}};var Ie={};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.AbstractMessageBuffer=void 0;Ie.AbstractMessageBuffer=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t="string"==typeof e?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(){if(0===this._chunks.length)return;let e=0,t=0,n=0,r=0;e:for(;t<this._chunks.length;){const i=this._chunks[t];for(n=0;n<i.length;){switch(i[n]){case 13:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case 10:switch(e){case 1:e=2;break;case 3:e=4,n++;break e;default:e=0}break;default:e=0}n++}r+=i.byteLength,t++}if(4!==e)return;const i=this._read(r+n),o=new Map,s=this.toString(i,"ascii").split("\r\n");if(s.length<2)return o;for(let e=0;e<s.length-2;e++){const t=s[e],n=t.indexOf(":");if(-1===n)throw new Error("Message header must separate key and value using :");const r=t.substr(0,n),i=t.substr(n+1).trim();o.set(r,i)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(0===e)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){const t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}const t=this.allocNative(e);let n=0;for(;e>0;){const r=this._chunks[0];if(r.byteLength>e){const i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}},Object.defineProperty(ke,"__esModule",{value:!0});const Ae=xe,Me=u,Fe=qe,Le=Ie;class je extends Le.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return je.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new Me.TextDecoder(t).decode(e)}asNative(e,t){return void 0===t?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}}je.emptyBuffer=Buffer.allocUnsafe(0);class $e{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Fe.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),Fe.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),Fe.Disposable.create((()=>this.stream.off("end",e)))}onData(e){return this.stream.on("data",e),Fe.Disposable.create((()=>this.stream.off("data",e)))}}class He{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Fe.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),Fe.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),Fe.Disposable.create((()=>this.stream.off("end",e)))}write(e,t){return new Promise(((n,r)=>{const i=e=>{null==e?n():r(e)};"string"==typeof e?this.stream.write(e,t,i):this.stream.write(e,i)}))}end(){this.stream.end()}}const We=Object.freeze({messageBuffer:Object.freeze({create:e=>new je(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(e){return Promise.reject(e)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new Me.TextDecoder(t.charset).decode(e)))}catch(e){return Promise.reject(e)}}})}),stream:Object.freeze({asReadableStream:e=>new $e(e),asWritableStream:e=>new He(e)}),console:console,timer:Object.freeze({setTimeout(e,t,...n){const r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){const n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){const r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function Ve(){return We}!function(e){e.install=function(){Ae.default.install(We)}}(Ve||(Ve={})),ke.default=Ve;var Ue,Ke,Ge={},ze={},Be={};function Je(){if(Ue)return Be;function e(e){return"string"==typeof e||e instanceof String}function t(e){return Array.isArray(e)}return Ue=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.stringArray=Be.array=Be.func=Be.error=Be.number=Be.string=Be.boolean=void 0,Be.boolean=function(e){return!0===e||!1===e},Be.string=e,Be.number=function(e){return"number"==typeof e||e instanceof Number},Be.error=function(e){return e instanceof Error},Be.func=function(e){return"function"==typeof e},Be.array=t,Be.stringArray=function(n){return t(n)&&n.every((t=>e(t)))},Be}function Xe(){return Ke||(Ke=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;const t=Je();var n,r;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3}(n=e.ErrorCodes||(e.ErrorCodes={}));class i extends Error{constructor(e,r,o){super(r),this.code=t.number(e)?e:n.UnknownErrorCode,this.data=o,Object.setPrototypeOf(this,i.prototype)}toJson(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}}e.ResponseError=i;class o{constructor(e){this.kind=e}static is(e){return e===o.auto||e===o.byName||e===o.byPosition}toString(){return this.kind}}e.ParameterStructures=o,o.auto=new o("auto"),o.byPosition=new o("byPosition"),o.byName=new o("byName");class s{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return o.auto}}e.AbstractMessageSignature=s;e.RequestType0=class extends s{constructor(e){super(e,0)}};e.RequestType=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.RequestType1=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.RequestType2=class extends s{constructor(e){super(e,2)}};e.RequestType3=class extends s{constructor(e){super(e,3)}};e.RequestType4=class extends s{constructor(e){super(e,4)}};e.RequestType5=class extends s{constructor(e){super(e,5)}};e.RequestType6=class extends s{constructor(e){super(e,6)}};e.RequestType7=class extends s{constructor(e){super(e,7)}};e.RequestType8=class extends s{constructor(e){super(e,8)}};e.RequestType9=class extends s{constructor(e){super(e,9)}};e.NotificationType=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.NotificationType0=class extends s{constructor(e){super(e,0)}};e.NotificationType1=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.NotificationType2=class extends s{constructor(e){super(e,2)}};e.NotificationType3=class extends s{constructor(e){super(e,3)}};e.NotificationType4=class extends s{constructor(e){super(e,4)}};e.NotificationType5=class extends s{constructor(e){super(e,5)}};e.NotificationType6=class extends s{constructor(e){super(e,6)}};e.NotificationType7=class extends s{constructor(e){super(e,7)}};e.NotificationType8=class extends s{constructor(e){super(e,8)}};e.NotificationType9=class extends s{constructor(e){super(e,9)}},(r=e.Message||(e.Message={})).isRequest=function(e){const n=e;return n&&t.string(n.method)&&(t.string(n.id)||t.number(n.id))},r.isNotification=function(e){const n=e;return n&&t.string(n.method)&&void 0===e.id},r.isResponse=function(e){const n=e;return n&&(void 0!==n.result||!!n.error)&&(t.string(n.id)||t.number(n.id)||null===n.id)}}(ze)),ze}var Ye,Qe={};function Ze(){return Ye||(Ye=1,function(e){var t,n;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0,function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last}(n=e.Touch||(e.Touch={}));class r{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){const r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===n.First||t===n.Last)if(t===n.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}e.LinkedMap=r;e.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}}(Qe)),Qe}var et,tt={};function nt(){return et||(et=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;const t=xe;!function(e){const t={dispose(){}};e.None=function(){return t}}(e.Event||(e.Event={}));class n{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t)return this._callbacks.splice(r,1),void this._contexts.splice(r,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],e))}catch(e){(0,t.default)().console.error(e)}return n}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const o={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),o.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}e.Emitter=r,r._noop=function(){}}(tt)),tt}var rt,it={};function ot(){return rt||(rt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;const t=xe,n=Je(),r=nt();var i;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None}),e.is=function(t){const r=t;return r&&(r===e.None||r===e.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}}(i=e.CancellationToken||(e.CancellationToken={}));const o=Object.freeze((function(e,n){const r=(0,t.default)().timer.setTimeout(e.bind(n),0);return{dispose(){r.dispose()}}}));class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?o:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}e.CancellationTokenSource=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}}}(it)),it}var st,at={};var ct,ut,lt={},ht={};function dt(){return ut||(ut=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;const t=xe,n=Je(),r=function(){if(ct)return ht;ct=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.Semaphore=void 0;const e=xe;return ht.Semaphore=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise(((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()}))}get active(){return this._active}runNext(){0!==this._waiting.length&&this._active!==this._capacity&&(0,e.default)().timer.setImmediate((()=>this.doRunNext()))}doRunNext(){if(0===this._waiting.length||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then((t=>{this._active--,e.resolve(t),this.runNext()}),(t=>{this._active--,e.reject(t),this.runNext()})):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}},ht}(),i=nt();var o;(e.MessageWriter||(e.MessageWriter={})).is=function(e){let t=e;return t&&n.func(t.dispose)&&n.func(t.onClose)&&n.func(t.onError)&&n.func(t.write)};class s{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${n.string(e.message)?e.message:"unknown"}`)}}e.AbstractMessageWriter=s,function(e){e.fromOptions=function(e){return void 0===e||"string"==typeof e?{charset:e??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:e.charset??"utf-8",contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}}(o||(o={}));e.WriteableStreamMessageWriter=class extends s{constructor(e,t){super(),this.writable=e,this.options=o.fromOptions(t),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError((e=>this.fireError(e))),this.writable.onClose((()=>this.fireClose()))}async write(e){return this.writeSemaphore.lock((async()=>this.options.contentTypeEncoder.encode(e,this.options).then((e=>void 0!==this.options.contentEncoder?this.options.contentEncoder.encode(e):e)).then((t=>{const n=[];return n.push("Content-Length: ",t.byteLength.toString(),"\r\n"),n.push("\r\n"),this.doWrite(e,n,t)}),(e=>{throw this.fireError(e),e}))))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}}(lt)),lt}var pt,ft,mt={};function gt(){return pt||(pt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;const t=xe,n=Je(),r=Xe(),i=Ze(),o=nt(),s=ot();var a,c,u,l,h,d,p,f,m,g,y,v,b,S,w;!function(e){e.type=new r.NotificationType("$/cancelRequest")}(a||(a={})),function(e){e.is=function(e){return"string"==typeof e||"number"==typeof e}}(c=e.ProgressToken||(e.ProgressToken={})),function(e){e.type=new r.NotificationType("$/progress")}(u||(u={}));e.ProgressType=class{constructor(){}},function(e){e.is=function(e){return n.func(e)}}(l||(l={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"}(h=e.Trace||(e.Trace={})),(d=e.TraceValues||(e.TraceValues={})).Off="off",d.Messages="messages",d.Compact="compact",d.Verbose="verbose",function(e){e.fromString=function(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}}(h=e.Trace||(e.Trace={})),function(e){e.Text="text",e.JSON="json"}(e.TraceFormat||(e.TraceFormat={})),function(e){e.fromString=function(t){return n.string(t)&&"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(p=e.TraceFormat||(e.TraceFormat={})),function(e){e.type=new r.NotificationType("$/setTrace")}(f=e.SetTraceNotification||(e.SetTraceNotification={})),function(e){e.type=new r.NotificationType("$/logTrace")}(m=e.LogTraceNotification||(e.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(g=e.ConnectionErrors||(e.ConnectionErrors={}));class R extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,R.prototype)}}e.ConnectionError=R,function(e){e.is=function(e){const t=e;return t&&n.func(t.cancelUndispatched)}}(y=e.ConnectionStrategy||(e.ConnectionStrategy={})),function(e){e.Message=Object.freeze({createCancellationTokenSource:e=>new s.CancellationTokenSource}),e.is=function(e){const t=e;return t&&n.func(t.createCancellationTokenSource)}}(v=e.CancellationReceiverStrategy||(e.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation:(e,t)=>e.sendNotification(a.type,{id:t}),cleanup(e){}}),e.is=function(e){const t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)}}(b=e.CancellationSenderStrategy||(e.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:v.Message,sender:b.Message}),e.is=function(e){const t=e;return t&&v.is(t.receiver)&&b.is(t.sender)}}(S=e.CancellationStrategy||(e.CancellationStrategy={})),(e.ConnectionOptions||(e.ConnectionOptions={})).is=function(e){const t=e;return t&&(S.is(t.cancellationStrategy)||y.is(t.connectionStrategy))},function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(w||(w={})),e.createMessageConnection=function(d,y,v,b){const _=void 0!==v?v:e.NullLogger;let E=0,C=0,D=0;const T="2.0";let k;const x=new Map;let P;const O=new Map,N=new Map;let q,I,A=new i.LinkedMap,M=new Map,F=new Set,L=new Map,j=h.Off,$=p.Text,H=w.New;const W=new o.Emitter,V=new o.Emitter,U=new o.Emitter,K=new o.Emitter,G=new o.Emitter,z=b&&b.cancellationStrategy?b.cancellationStrategy:S.Message;function B(e){if(null===e)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+e.toString()}function J(e,t){var n;r.Message.isRequest(t)?e.set(B(t.id),t):r.Message.isResponse(t)?e.set(null===(n=t.id)?"res-unknown-"+(++D).toString():"res-"+n.toString(),t):e.set("not-"+(++C).toString(),t)}function X(e){}function Y(){return H===w.Listening}function Q(){return H===w.Closed}function Z(){return H===w.Disposed}function ee(){H!==w.New&&H!==w.Listening||(H=w.Closed,V.fire(void 0))}function te(){q||0===A.size||(q=(0,t.default)().timer.setImmediate((()=>{q=void 0,function(){if(0===A.size)return;const e=A.shift();try{r.Message.isRequest(e)?function(e){if(Z())return;function t(t,n,i){const o={jsonrpc:T,id:e.id};t instanceof r.ResponseError?o.error=t.toJson():o.result=void 0===t?null:t,ie(o,n,i),y.write(o).catch((()=>_.error("Sending response failed.")))}function i(t,n,r){const i={jsonrpc:T,id:e.id,error:t.toJson()};ie(i,n,r),y.write(i).catch((()=>_.error("Sending response failed.")))}function o(t,n,r){void 0===t&&(t=null);const i={jsonrpc:T,id:e.id,result:t};ie(i,n,r),y.write(i).catch((()=>_.error("Sending response failed.")))}!function(e){if(j===h.Off||!I)return;if($===p.Text){let t;j!==h.Verbose&&j!==h.Compact||!e.params||(t=`Params: ${re(e.params)}\n\n`),I.log(`Received request '${e.method} - (${e.id})'.`,t)}else se("receive-request",e)}(e);const s=x.get(e.method);let a,c;s&&(a=s.type,c=s.handler);const u=Date.now();if(c||k){const s=e.id??String(Date.now()),l=z.receiver.createCancellationTokenSource(s);null!==e.id&&F.has(e.id)&&l.cancel(),null!==e.id&&L.set(s,l);try{let h;if(c)if(void 0===e.params){if(void 0!==a&&0!==a.numberOfParams)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but received none.`),e.method,u);h=c(l.token)}else if(Array.isArray(e.params)){if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byName)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,u);h=c(...e.params,l.token)}else{if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byPosition)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,u);h=c(e.params,l.token)}else k&&(h=k(e.method,e.params,l.token));const d=h;h?d.then?d.then((n=>{L.delete(s),t(n,e.method,u)}),(t=>{L.delete(s),t instanceof r.ResponseError?i(t,e.method,u):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)})):(L.delete(s),t(h,e.method,u)):(L.delete(s),o(h,e.method,u))}catch(o){L.delete(s),o instanceof r.ResponseError?t(o,e.method,u):o&&n.string(o.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${o.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):r.Message.isNotification(e)?function(e){if(Z())return;let t,n;if(e.method===a.type.method){const t=e.params.id;return F.delete(t),void oe(e)}{const r=O.get(e.method);r&&(n=r.handler,t=r.type)}if(n||P)try{if(oe(e),n)if(void 0===e.params)void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==r.ParameterStructures.byName&&_.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){const i=e.params;e.method===u.type.method&&2===i.length&&c.is(i[0])?n({token:i[0],value:i[1]}):(void 0!==t&&(t.parameterStructures===r.ParameterStructures.byName&&_.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&_.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else void 0!==t&&t.parameterStructures===r.ParameterStructures.byPosition&&_.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else P&&P(e.method,e.params)}catch(t){t.message?_.error(`Notification handler '${e.method}' failed with message: ${t.message}`):_.error(`Notification handler '${e.method}' failed unexpectedly.`)}else U.fire(e)}(e):r.Message.isResponse(e)?function(e){if(Z())return;if(null===e.id)e.error?_.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):_.error("Received response message without id. No further error information provided.");else{const t=e.id,n=M.get(t);if(function(e,t){if(j===h.Off||!I)return;if($===p.Text){let n;if(j!==h.Verbose&&j!==h.Compact||(e.error&&e.error.data?n=`Error data: ${re(e.error.data)}\n\n`:e.result?n=`Result: ${re(e.result)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){const r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";I.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else I.log(`Received response ${e.id} without active response promise.`,n)}else se("receive-response",e)}(e,n),void 0!==n){M.delete(t);try{if(e.error){const t=e.error;n.reject(new r.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");n.resolve(e.result)}}catch(e){e.message?_.error(`Response handler '${n.method}' failed with message: ${e.message}`):_.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void _.error("Received empty message.");_.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);const t=e;if(n.string(t.id)||n.number(t.id)){const e=t.id,n=M.get(e);n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{te()}}()})))}d.onClose(ee),d.onError((function(e){W.fire([e,void 0,void 0])})),y.onClose(ee),y.onError((function(e){W.fire(e)}));const ne=e=>{try{if(r.Message.isNotification(e)&&e.method===a.type.method){const t=e.params.id,n=B(t),i=A.get(n);if(r.Message.isRequest(i)){const r=b?.connectionStrategy,o=r&&r.cancelUndispatched?r.cancelUndispatched(i,X):void 0;if(o&&(void 0!==o.error||void 0!==o.result))return A.delete(n),L.delete(t),o.id=i.id,ie(o,e.method,Date.now()),void y.write(o).catch((()=>_.error("Sending response for canceled message failed.")))}const o=L.get(t);if(void 0!==o)return o.cancel(),void oe(e);F.add(t)}J(A,e)}finally{te()}};function re(e){if(null!=e)switch(j){case h.Verbose:return JSON.stringify(e,null,4);case h.Compact:return JSON.stringify(e);default:return}}function ie(e,t,n){if(j!==h.Off&&I)if($===p.Text){let r;j!==h.Verbose&&j!==h.Compact||(e.error&&e.error.data?r=`Error data: ${re(e.error.data)}\n\n`:e.result?r=`Result: ${re(e.result)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),I.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else se("send-response",e)}function oe(e){if(j!==h.Off&&I&&e.method!==m.type.method)if($===p.Text){let t;j!==h.Verbose&&j!==h.Compact||(t=e.params?`Params: ${re(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Received notification '${e.method}'.`,t)}else se("receive-notification",e)}function se(e,t){if(!I||j===h.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};I.log(n)}function ae(){if(Q())throw new R(g.Closed,"Connection is closed.");if(Z())throw new R(g.Disposed,"Connection is disposed.")}function ce(e){return void 0===e?null:e}function ue(e){return null===e?void 0:e}function le(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function he(e,t){switch(e){case r.ParameterStructures.auto:return le(t)?ue(t):[ce(t)];case r.ParameterStructures.byName:if(!le(t))throw new Error("Received parameters by name but param is not an object literal.");return ue(t);case r.ParameterStructures.byPosition:return[ce(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function de(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=he(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(ce(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}const pe={sendNotification:(e,...t)=>{let i,o;if(ae(),n.string(e)){i=e;const n=t[0];let s=0,a=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(s=1,a=n);let c=t.length;const u=c-s;switch(u){case 0:o=void 0;break;case 1:o=he(a,t[s]);break;default:if(a===r.ParameterStructures.byName)throw new Error(`Received ${u} parameters for 'by Name' notification parameter structure.`);o=t.slice(s,c).map((e=>ce(e)))}}else{const n=t;i=e.method,o=de(e,n)}const s={jsonrpc:T,method:i,params:o};return function(e){if(j!==h.Off&&I)if($===p.Text){let t;j!==h.Verbose&&j!==h.Compact||(t=e.params?`Params: ${re(e.params)}\n\n`:"No parameters provided.\n\n"),I.log(`Sending notification '${e.method}'.`,t)}else se("send-notification",e)}(s),y.write(s).catch((()=>_.error("Sending notification failed.")))},onNotification:(e,t)=>{let r;return ae(),n.func(e)?P=e:t&&(n.string(e)?(r=e,O.set(e,{type:void 0,handler:t})):(r=e.method,O.set(e.method,{type:e,handler:t}))),{dispose:()=>{void 0!==r?O.delete(r):P=void 0}}},onProgress:(e,t,n)=>{if(N.has(t))throw new Error(`Progress handler for token ${t} already registered`);return N.set(t,n),{dispose:()=>{N.delete(t)}}},sendProgress:(e,t,n)=>pe.sendNotification(u.type,{token:t,value:n}),onUnhandledProgress:K.event,sendRequest:(e,...t)=>{let i,o,a;if(ae(),function(){if(!Y())throw new Error("Call listen() first.")}(),n.string(e)){i=e;const n=t[0],c=t[t.length-1];let u=0,l=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(u=1,l=n);let h=t.length;s.CancellationToken.is(c)&&(h-=1,a=c);const d=h-u;switch(d){case 0:o=void 0;break;case 1:o=he(l,t[u]);break;default:if(l===r.ParameterStructures.byName)throw new Error(`Received ${d} parameters for 'by Name' request parameter structure.`);o=t.slice(u,h).map((e=>ce(e)))}}else{const n=t;i=e.method,o=de(e,n);const r=e.numberOfParams;a=s.CancellationToken.is(n[r])?n[r]:void 0}const c=E++;let u;a&&(u=a.onCancellationRequested((()=>{const e=z.sender.sendCancellation(pe,c);return void 0===e?(_.log(`Received no promise from cancellation strategy when cancelling id ${c}`),Promise.resolve()):e.catch((()=>{_.log(`Sending cancellation messages for id ${c} failed`)}))})));const l=new Promise(((e,t)=>{const n={jsonrpc:T,id:c,method:i,params:o};let s={method:i,timerStart:Date.now(),resolve:t=>{e(t),z.sender.cleanup(c),u?.dispose()},reject:e=>{t(e),z.sender.cleanup(c),u?.dispose()}};!function(e){if(j!==h.Off&&I)if($===p.Text){let t;j!==h.Verbose&&j!==h.Compact||!e.params||(t=`Params: ${re(e.params)}\n\n`),I.log(`Sending request '${e.method} - (${e.id})'.`,t)}else se("send-request",e)}(n);try{y.write(n).catch((()=>_.error("Sending request failed.")))}catch(e){s.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),s=null}s&&M.set(c,s)}));return l},onRequest:(e,t)=>{ae();let r=null;return l.is(e)?(r=void 0,k=e):n.string(e)?(r=null,void 0!==t&&(r=e,x.set(e,{handler:t,type:void 0}))):void 0!==t&&(r=e.method,x.set(e.method,{type:e,handler:t})),{dispose:()=>{null!==r&&(void 0!==r?x.delete(r):k=void 0)}}},hasPendingResponse:()=>M.size>0,trace:async(e,t,r)=>{let i=!1,o=p.Text;void 0!==r&&(n.boolean(r)?i=r:(i=r.sendNotification||!1,o=r.traceFormat||p.Text)),j=e,$=o,I=j===h.Off?void 0:t,!i||Q()||Z()||await pe.sendNotification(f.type,{value:h.toString(e)})},onError:W.event,onClose:V.event,onUnhandledNotification:U.event,onDispose:G.event,end:()=>{y.end()},dispose:()=>{if(Z())return;H=w.Disposed,G.fire(void 0);const e=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const t of M.values())t.reject(e);M=new Map,L=new Map,F=new Set,A=new i.LinkedMap,n.func(y.dispose)&&y.dispose(),n.func(d.dispose)&&d.dispose()},listen:()=>{ae(),function(){if(Y())throw new R(g.AlreadyListening,"Connection is already listening")}(),H=w.Listening,d.listen(ne)},inspect:()=>{(0,t.default)().console.log("inspect")}};return pe.onNotification(m.type,(e=>{if(j===h.Off||!I)return;const t=j===h.Verbose||j===h.Compact;I.log(e.message,t?e.verbose:void 0)})),pe.onNotification(u.type,(e=>{const t=N.get(e.token);t?t(e.value):K.fire(e)})),pe}}(mt)),mt}function yt(){return ft||(ft=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TraceFormat=e.TraceValues=e.Trace=e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=void 0;const t=Xe();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});const n=Ze();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=qe;Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=nt();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const o=ot();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const s=(st||(st=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;const t=xe,n=Je(),r=nt();var i;(e.MessageReader||(e.MessageReader={})).is=function(e){let t=e;return t&&n.func(t.listen)&&n.func(t.dispose)&&n.func(t.onError)&&n.func(t.onClose)&&n.func(t.onPartialMessage)};class o{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${n.string(e.message)?e.message:"unknown"}`)}}e.AbstractMessageReader=o,function(e){e.fromOptions=function(e){let n,r;const i=new Map;let o;const s=new Map;if(void 0===e||"string"==typeof e)n=e??"utf-8";else{if(n=e.charset??"utf-8",void 0!==e.contentDecoder&&(r=e.contentDecoder,i.set(r.name,r)),void 0!==e.contentDecoders)for(const t of e.contentDecoders)i.set(t.name,t);if(void 0!==e.contentTypeDecoder&&(o=e.contentTypeDecoder,s.set(o.name,o)),void 0!==e.contentTypeDecoders)for(const t of e.contentTypeDecoders)s.set(t.name,t)}return void 0===o&&(o=(0,t.default)().applicationJson.decoder,s.set(o.name,o)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:o,contentTypeDecoders:s}}}(i||(i={})),e.ReadableStreamMessageReader=class extends o{constructor(e,n){super(),this.readable=e,this.options=i.fromOptions(n),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const t=this.readable.onData((e=>{this.onData(e)}));return this.readable.onError((e=>this.fireError(e))),this.readable.onClose((()=>this.fireClose())),t}onData(e){for(this.buffer.append(e);;){if(-1===this.nextMessageLength){const e=this.buffer.tryReadHeaders();if(!e)return;const t=e.get("Content-Length");if(!t)throw new Error("Header must provide a Content-Length property.");const n=parseInt(t);if(isNaN(n))throw new Error("Content-Length value must be a number.");this.nextMessageLength=n}const e=this.buffer.tryReadBody(this.nextMessageLength);if(void 0===e)return void this.setPartialMessageTimer();let t;this.clearPartialMessageTimer(),this.nextMessageLength=-1,t=void 0!==this.options.contentDecoder?this.options.contentDecoder.decode(e):Promise.resolve(e),t.then((e=>{this.options.contentTypeDecoder.decode(e,this.options).then((e=>{this.callback(e)}),(e=>{this.fireError(e)}))}),(e=>{this.fireError(e)}))}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,t.default)().timer.setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}}(at)),at);Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return s.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return s.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return s.ReadableStreamMessageReader}});const a=dt();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return a.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return a.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return a.WriteableStreamMessageWriter}});const c=gt();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return c.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return c.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return c.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return c.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return c.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return c.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return c.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return c.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return c.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return c.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return c.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return c.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return c.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return c.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return c.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return c.CancellationStrategy}});const u=xe;e.RAL=u.default}(Ge)),Ge}!function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.createServerSocketTransport=e.createClientSocketTransport=e.createServerPipeTransport=e.createClientPipeTransport=e.generateRandomPipeName=e.StreamMessageWriter=e.StreamMessageReader=e.SocketMessageWriter=e.SocketMessageReader=e.IPCMessageWriter=e.IPCMessageReader=void 0;const r=ke;r.default.install();const i=yt(),o=s,a=h,c=d,u=p;n(yt(),e);class l extends i.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose()))}listen(e){return this.process.on("message",e),i.Disposable.create((()=>this.process.off("message",e)))}}e.IPCMessageReader=l;class f extends i.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose))}write(e){try{return"function"==typeof this.process.send&&this.process.send(e,void 0,void 0,(t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0})),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}e.IPCMessageWriter=f;class m extends i.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,r.default)().stream.asReadableStream(e),t)}}e.SocketMessageReader=m;class g extends i.WriteableStreamMessageWriter{constructor(e,t){super((0,r.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}}e.SocketMessageWriter=g;class y extends i.ReadableStreamMessageReader{constructor(e,t){super((0,r.default)().stream.asReadableStream(e),t)}}e.StreamMessageReader=y;class v extends i.WriteableStreamMessageWriter{constructor(e,t){super((0,r.default)().stream.asWritableStream(e),t)}}e.StreamMessageWriter=v;const b=process.env.XDG_RUNTIME_DIR,S=new Map([["linux",107],["darwin",103]]);e.generateRandomPipeName=function(){const e=(0,c.randomBytes)(21).toString("hex");if("win32"===process.platform)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=b?o.join(b,`vscode-ipc-${e}.sock`):o.join(a.tmpdir(),`vscode-${e}.sock`);const n=S.get(process.platform);return void 0!==n&&t.length>=n&&(0,r.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t},e.createClientPipeTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((i,o)=>{let s=(0,u.createServer)((e=>{s.close(),n([new m(e,t),new g(e,t)])}));s.on("error",o),s.listen(e,(()=>{s.removeListener("error",o),i({onConnected:()=>r})}))}))},e.createServerPipeTransport=function(e,t="utf-8"){const n=(0,u.createConnection)(e);return[new m(n,t),new g(n,t)]},e.createClientSocketTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((i,o)=>{const s=(0,u.createServer)((e=>{s.close(),n([new m(e,t),new g(e,t)])}));s.on("error",o),s.listen(e,"127.0.0.1",(()=>{s.removeListener("error",o),i({onConnected:()=>r})}))}))},e.createServerSocketTransport=function(e,t="utf-8"){const n=(0,u.createConnection)(e,"127.0.0.1");return[new m(n,t),new g(n,t)]},e.createMessageConnection=function(e,t,n,r){n||(n=i.NullLogger);const o=function(e){const t=e;return void 0!==t.read&&void 0!==t.addListener}(e)?new y(e):e,s=function(e){const t=e;return void 0!==t.write&&void 0!==t.addListener}(t)?new v(t):t;return i.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,i.createMessageConnection)(o,s,n,r)}}(Te),De.exports=Te;var vt,bt,St,wt,Rt,_t,Et,Ct,Dt,Tt,kt,xt,Pt,Ot,Nt,qt,It,At,Mt,Ft,Lt,jt,$t,Ht,Wt,Vt,Ut,Kt,Gt={};!function(e){e.is=function(e){return"string"==typeof e}}(vt||(vt={})),(bt||(bt={})).is=function(e){return"string"==typeof e},function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(St||(St={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(wt||(wt={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=wt.MAX_VALUE),t===Number.MAX_VALUE&&(t=wt.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.uinteger(t.line)&&Wn.uinteger(t.character)}}(Rt||(Rt={})),function(e){e.create=function(e,t,n,r){if(Wn.uinteger(e)&&Wn.uinteger(t)&&Wn.uinteger(n)&&Wn.uinteger(r))return{start:Rt.create(e,t),end:Rt.create(n,r)};if(Rt.is(e)&&Rt.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Rt.is(t.start)&&Rt.is(t.end)}}(_t||(_t={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&_t.is(t.range)&&(Wn.string(t.uri)||Wn.undefined(t.uri))}}(Et||(Et={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&_t.is(t.targetRange)&&Wn.string(t.targetUri)&&_t.is(t.targetSelectionRange)&&(_t.is(t.originSelectionRange)||Wn.undefined(t.originSelectionRange))}}(Ct||(Ct={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.numberRange(t.red,0,1)&&Wn.numberRange(t.green,0,1)&&Wn.numberRange(t.blue,0,1)&&Wn.numberRange(t.alpha,0,1)}}(Dt||(Dt={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&_t.is(t.range)&&Dt.is(t.color)}}(Tt||(Tt={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.label)&&(Wn.undefined(t.textEdit)||Ft.is(t))&&(Wn.undefined(t.additionalTextEdits)||Wn.typedArray(t.additionalTextEdits,Ft.is))}}(kt||(kt={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(xt||(xt={})),function(e){e.create=function(e,t,n,r,i,o){var s={startLine:e,endLine:t};return Wn.defined(n)&&(s.startCharacter=n),Wn.defined(r)&&(s.endCharacter=r),Wn.defined(i)&&(s.kind=i),Wn.defined(o)&&(s.collapsedText=o),s},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.uinteger(t.startLine)&&Wn.uinteger(t.startLine)&&(Wn.undefined(t.startCharacter)||Wn.uinteger(t.startCharacter))&&(Wn.undefined(t.endCharacter)||Wn.uinteger(t.endCharacter))&&(Wn.undefined(t.kind)||Wn.string(t.kind))}}(Pt||(Pt={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Et.is(t.location)&&Wn.string(t.message)}}(Ot||(Ot={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(Nt||(Nt={})),function(e){e.Unnecessary=1,e.Deprecated=2}(qt||(qt={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.href)}}(It||(It={})),function(e){e.create=function(e,t,n,r,i,o){var s={range:e,message:t};return Wn.defined(n)&&(s.severity=n),Wn.defined(r)&&(s.code=r),Wn.defined(i)&&(s.source=i),Wn.defined(o)&&(s.relatedInformation=o),s},e.is=function(e){var t,n=e;return Wn.defined(n)&&_t.is(n.range)&&Wn.string(n.message)&&(Wn.number(n.severity)||Wn.undefined(n.severity))&&(Wn.integer(n.code)||Wn.string(n.code)||Wn.undefined(n.code))&&(Wn.undefined(n.codeDescription)||Wn.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Wn.string(n.source)||Wn.undefined(n.source))&&(Wn.undefined(n.relatedInformation)||Wn.typedArray(n.relatedInformation,Ot.is))}}(At||(At={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={title:e,command:t};return Wn.defined(n)&&n.length>0&&(i.arguments=n),i},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.title)&&Wn.string(t.command)}}(Mt||(Mt={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.newText)&&_t.is(t.range)}}(Ft||(Ft={})),function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.label)&&(Wn.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Wn.string(t.description)||void 0===t.description)}}(Lt||(Lt={})),function(e){e.is=function(e){var t=e;return Wn.string(t)}}(jt||(jt={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return Ft.is(t)&&(Lt.is(t.annotationId)||jt.is(t.annotationId))}}($t||($t={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Jt.is(t.textDocument)&&Array.isArray(t.edits)}}(Ht||(Ht={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"create"===t.kind&&Wn.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Wn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Wn.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||jt.is(t.annotationId))}}(Wt||(Wt={})),function(e){e.create=function(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){var t=e;return t&&"rename"===t.kind&&Wn.string(t.oldUri)&&Wn.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Wn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Wn.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||jt.is(t.annotationId))}}(Vt||(Vt={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"delete"===t.kind&&Wn.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Wn.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Wn.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||jt.is(t.annotationId))}}(Ut||(Ut={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return Wn.string(e.kind)?Wt.is(e)||Vt.is(e)||Ut.is(e):Ht.is(e)})))}}(Kt||(Kt={}));var zt,Bt,Jt,Xt,Yt,Qt,Zt,en,tn,nn,rn,on,sn,an,cn,un,ln,hn,dn,pn,fn,mn,gn,yn,vn,bn,Sn,wn,Rn,_n,En,Cn,Dn,Tn,kn,xn,Pn,On,Nn,qn,In,An,Mn,Fn,Ln=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=Ft.insert(e,t):jt.is(n)?(i=n,r=$t.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=$t.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=Ft.replace(e,t):jt.is(n)?(i=n,r=$t.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=$t.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=Ft.del(e):jt.is(t)?(r=t,n=$t.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=$t.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),jn=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(jt.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),$n=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new jn(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(Ht.is(e)){var n=new Ln(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Ln(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(Jt.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new Ln(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new Ln(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new jn,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(Lt.is(t)||jt.is(t)?r=t:n=t,void 0===r?i=Wt.create(e,n):(o=jt.is(r)?r:this._changeAnnotations.manage(r),i=Wt.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,s;if(Lt.is(n)||jt.is(n)?i=n:r=n,void 0===i?o=Vt.create(e,t,r):(s=jt.is(i)?i:this._changeAnnotations.manage(i),o=Vt.create(e,t,r,s)),this._workspaceEdit.documentChanges.push(o),void 0!==s)return s},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(Lt.is(t)||jt.is(t)?r=t:n=t,void 0===r?i=Ut.create(e,n):(o=jt.is(r)?r:this._changeAnnotations.manage(r),i=Ut.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)}}(zt||(zt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&Wn.integer(t.version)}}(Bt||(Bt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&(null===t.version||Wn.integer(t.version))}}(Jt||(Jt={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&Wn.string(t.languageId)&&Wn.integer(t.version)&&Wn.string(t.text)}}(Xt||(Xt={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(Yt||(Yt={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(e)&&Yt.is(t.kind)&&Wn.string(t.value)}}(Qt||(Qt={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(Zt||(Zt={})),function(e){e.PlainText=1,e.Snippet=2}(en||(en={})),function(e){e.Deprecated=1}(tn||(tn={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&Wn.string(t.newText)&&_t.is(t.insert)&&_t.is(t.replace)}}(nn||(nn={})),function(e){e.asIs=1,e.adjustIndentation=2}(rn||(rn={})),function(e){e.is=function(e){var t=e;return t&&(Wn.string(t.detail)||void 0===t.detail)&&(Wn.string(t.description)||void 0===t.description)}}(on||(on={})),function(e){e.create=function(e){return{label:e}}}(sn||(sn={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(an||(an={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return Wn.string(t)||Wn.objectLiteral(t)&&Wn.string(t.language)&&Wn.string(t.value)}}(cn||(cn={})),function(e){e.is=function(e){var t=e;return!!t&&Wn.objectLiteral(t)&&(Qt.is(t.contents)||cn.is(t.contents)||Wn.typedArray(t.contents,cn.is))&&(void 0===e.range||_t.is(e.range))}}(un||(un={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(ln||(ln={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={label:e};return Wn.defined(t)&&(i.documentation=t),Wn.defined(n)?i.parameters=n:i.parameters=[],i}}(hn||(hn={})),function(e){e.Text=1,e.Read=2,e.Write=3}(dn||(dn={})),function(e){e.create=function(e,t){var n={range:e};return Wn.number(t)&&(n.kind=t),n}}(pn||(pn={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(fn||(fn={})),function(e){e.Deprecated=1}(mn||(mn={})),function(e){e.create=function(e,t,n,r,i){var o={name:e,kind:t,location:{uri:r,range:n}};return i&&(o.containerName=i),o}}(gn||(gn={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(yn||(yn={})),function(e){e.create=function(e,t,n,r,i,o){var s={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==o&&(s.children=o),s},e.is=function(e){var t=e;return t&&Wn.string(t.name)&&Wn.number(t.kind)&&_t.is(t.range)&&_t.is(t.selectionRange)&&(void 0===t.detail||Wn.string(t.detail))&&(void 0===t.deprecated||Wn.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(vn||(vn={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(bn||(bn={})),function(e){e.Invoked=1,e.Automatic=2}(Sn||(Sn={})),function(e){e.create=function(e,t,n){var r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.typedArray(t.diagnostics,At.is)&&(void 0===t.only||Wn.typedArray(t.only,Wn.string))&&(void 0===t.triggerKind||t.triggerKind===Sn.Invoked||t.triggerKind===Sn.Automatic)}}(wn||(wn={})),function(e){e.create=function(e,t,n){var r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):Mt.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return t&&Wn.string(t.title)&&(void 0===t.diagnostics||Wn.typedArray(t.diagnostics,At.is))&&(void 0===t.kind||Wn.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||Mt.is(t.command))&&(void 0===t.isPreferred||Wn.boolean(t.isPreferred))&&(void 0===t.edit||Kt.is(t.edit))}}(Rn||(Rn={})),function(e){e.create=function(e,t){var n={range:e};return Wn.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return Wn.defined(t)&&_t.is(t.range)&&(Wn.undefined(t.command)||Mt.is(t.command))}}(_n||(_n={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.uinteger(t.tabSize)&&Wn.boolean(t.insertSpaces)}}(En||(En={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return Wn.defined(t)&&_t.is(t.range)&&(Wn.undefined(t.target)||Wn.string(t.target))}}(Cn||(Cn={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return Wn.objectLiteral(n)&&_t.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(Dn||(Dn={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(Tn||(Tn={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(kn||(kn={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(xn||(xn={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){var t=e;return null!=t&&_t.is(t.range)&&Wn.string(t.text)}}(Pn||(Pn={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){var t=e;return null!=t&&_t.is(t.range)&&Wn.boolean(t.caseSensitiveLookup)&&(Wn.string(t.variableName)||void 0===t.variableName)}}(On||(On={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){var t=e;return null!=t&&_t.is(t.range)&&(Wn.string(t.expression)||void 0===t.expression)}}(Nn||(Nn={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){var t=e;return Wn.defined(t)&&_t.is(e.stoppedLocation)}}(qn||(qn={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(In||(In={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&(void 0===t.tooltip||Wn.string(t.tooltip)||Qt.is(t.tooltip))&&(void 0===t.location||Et.is(t.location))&&(void 0===t.command||Mt.is(t.command))}}(An||(An={})),function(e){e.create=function(e,t,n){var r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Rt.is(t.position)&&(Wn.string(t.label)||Wn.typedArray(t.label,An.is))&&(void 0===t.kind||In.is(t.kind))&&void 0===t.textEdits||Wn.typedArray(t.textEdits,Ft.is)&&(void 0===t.tooltip||Wn.string(t.tooltip)||Qt.is(t.tooltip))&&(void 0===t.paddingLeft||Wn.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Wn.boolean(t.paddingRight))}}(Mn||(Mn={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(t)&&bt.is(t.uri)&&Wn.string(t.name)}}(Fn||(Fn={}));var Hn;!function(e){function t(e,n){if(e.length<=1)return e;var r=e.length/2|0,i=e.slice(0,r),o=e.slice(r);t(i,n),t(o,n);for(var s=0,a=0,c=0;s<i.length&&a<o.length;){var u=n(i[s],o[a]);e[c++]=u<=0?i[s++]:o[a++]}for(;s<i.length;)e[c++]=i[s++];for(;a<o.length;)e[c++]=o[a++];return e}e.create=function(e,t,n,r){return new Vn(e,t,n,r)},e.is=function(e){var t=e;return!!(Wn.defined(t)&&Wn.string(t.uri)&&(Wn.undefined(t.languageId)||Wn.string(t.languageId))&&Wn.uinteger(t.lineCount)&&Wn.func(t.getText)&&Wn.func(t.positionAt)&&Wn.func(t.offsetAt))},e.applyEdits=function(e,n){for(var r=e.getText(),i=t(n,(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),o=r.length,s=i.length-1;s>=0;s--){var a=i[s],c=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=o))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(u,r.length),o=c}return r}}(Hn||(Hn={}));var Wn,Vn=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var i=t.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return Rt.create(0,e);for(;n<r;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return Rt.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.numberRange=function(e,n,r){return"[object Number]"===t.call(e)&&n<=e&&e<=r},e.integer=function(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647},e.uinteger=function(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(Wn||(Wn={}));const Un=x(Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return $t},get ChangeAnnotation(){return Lt},get ChangeAnnotationIdentifier(){return jt},get CodeAction(){return Rn},get CodeActionContext(){return wn},get CodeActionKind(){return bn},get CodeActionTriggerKind(){return Sn},get CodeDescription(){return It},get CodeLens(){return _n},get Color(){return Dt},get ColorInformation(){return Tt},get ColorPresentation(){return kt},get Command(){return Mt},get CompletionItem(){return sn},get CompletionItemKind(){return Zt},get CompletionItemLabelDetails(){return on},get CompletionItemTag(){return tn},get CompletionList(){return an},get CreateFile(){return Wt},get DeleteFile(){return Ut},get Diagnostic(){return At},get DiagnosticRelatedInformation(){return Ot},get DiagnosticSeverity(){return Nt},get DiagnosticTag(){return qt},get DocumentHighlight(){return pn},get DocumentHighlightKind(){return dn},get DocumentLink(){return Cn},get DocumentSymbol(){return vn},get DocumentUri(){return vt},EOL:["\n","\r\n","\r"],get FoldingRange(){return Pt},get FoldingRangeKind(){return xt},get FormattingOptions(){return En},get Hover(){return un},get InlayHint(){return Mn},get InlayHintKind(){return In},get InlayHintLabelPart(){return An},get InlineValueContext(){return qn},get InlineValueEvaluatableExpression(){return Nn},get InlineValueText(){return Pn},get InlineValueVariableLookup(){return On},get InsertReplaceEdit(){return nn},get InsertTextFormat(){return en},get InsertTextMode(){return rn},get Location(){return Et},get LocationLink(){return Ct},get MarkedString(){return cn},get MarkupContent(){return Qt},get MarkupKind(){return Yt},get OptionalVersionedTextDocumentIdentifier(){return Jt},get ParameterInformation(){return ln},get Position(){return Rt},get Range(){return _t},get RenameFile(){return Vt},get SelectionRange(){return Dn},get SemanticTokenModifiers(){return kn},get SemanticTokenTypes(){return Tn},get SemanticTokens(){return xn},get SignatureInformation(){return hn},get SymbolInformation(){return gn},get SymbolKind(){return fn},get SymbolTag(){return mn},get TextDocument(){return Hn},get TextDocumentEdit(){return Ht},get TextDocumentIdentifier(){return zt},get TextDocumentItem(){return Xt},get TextEdit(){return Ft},get URI(){return bt},get VersionedTextDocumentIdentifier(){return Bt},WorkspaceChange:$n,get WorkspaceEdit(){return Kt},get WorkspaceFolder(){return Fn},get WorkspaceSymbol(){return yn},get integer(){return St},get uinteger(){return wt}},Symbol.toStringTag,{value:"Module"})));var Kn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;const t=Te;var n;(n=e.MessageDirection||(e.MessageDirection={})).clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both";e.RegistrationType=class{constructor(e){this.method=e}};e.ProtocolRequestType0=class extends t.RequestType0{constructor(e){super(e)}};e.ProtocolRequestType=class extends t.RequestType{constructor(e){super(e,t.ParameterStructures.byName)}};e.ProtocolNotificationType0=class extends t.NotificationType0{constructor(e){super(e)}};e.ProtocolNotificationType=class extends t.NotificationType{constructor(e){super(e,t.ParameterStructures.byName)}}}(Kn);var Gn={},zn={};function Bn(e){return"string"==typeof e||e instanceof String}function Jn(e){return Array.isArray(e)}Object.defineProperty(zn,"__esModule",{value:!0}),zn.objectLiteral=zn.typedArray=zn.stringArray=zn.array=zn.func=zn.error=zn.number=zn.string=zn.boolean=void 0,zn.boolean=function(e){return!0===e||!1===e},zn.string=Bn,zn.number=function(e){return"number"==typeof e||e instanceof Number},zn.error=function(e){return e instanceof Error},zn.func=function(e){return"function"==typeof e},zn.array=Jn,zn.stringArray=function(e){return Jn(e)&&e.every((e=>Bn(e)))},zn.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},zn.objectLiteral=function(e){return null!==e&&"object"==typeof e};var Xn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;const t=Kn;var n;(n=e.ImplementationRequest||(e.ImplementationRequest={})).method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(Xn);var Yn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;const t=Kn;var n;(n=e.TypeDefinitionRequest||(e.TypeDefinitionRequest={})).method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(Yn);var Qn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;const t=Kn;var n,r;(n=e.WorkspaceFoldersRequest||(e.WorkspaceFoldersRequest={})).method="workspace/workspaceFolders",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method),(r=e.DidChangeWorkspaceFoldersNotification||(e.DidChangeWorkspaceFoldersNotification={})).method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(Qn);var Zn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;const t=Kn;var n;(n=e.ConfigurationRequest||(e.ConfigurationRequest={})).method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(Zn);var er={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;const t=Kn;var n,r;(n=e.DocumentColorRequest||(e.DocumentColorRequest={})).method="textDocument/documentColor",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.ColorPresentationRequest||(e.ColorPresentationRequest={})).method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(er);var tr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRequest=void 0;const t=Kn;var n;(n=e.FoldingRangeRequest||(e.FoldingRangeRequest={})).method="textDocument/foldingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(tr);var nr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;const t=Kn;var n;(n=e.DeclarationRequest||(e.DeclarationRequest={})).method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(nr);var rr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;const t=Kn;var n;(n=e.SelectionRangeRequest||(e.SelectionRangeRequest={})).method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(rr);var ir={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;const t=Te,n=Kn;var r,i,o;(r=e.WorkDoneProgress||(e.WorkDoneProgress={})).type=new t.ProgressType,r.is=function(e){return e===r.type},(i=e.WorkDoneProgressCreateRequest||(e.WorkDoneProgressCreateRequest={})).method="window/workDoneProgress/create",i.messageDirection=n.MessageDirection.serverToClient,i.type=new n.ProtocolRequestType(i.method),(o=e.WorkDoneProgressCancelNotification||(e.WorkDoneProgressCancelNotification={})).method="window/workDoneProgress/cancel",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolNotificationType(o.method)}(ir);var or={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;const t=Kn;var n,r,i;(n=e.CallHierarchyPrepareRequest||(e.CallHierarchyPrepareRequest={})).method="textDocument/prepareCallHierarchy",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.CallHierarchyIncomingCallsRequest||(e.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.CallHierarchyOutgoingCallsRequest||(e.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(or);var sr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;const t=Kn;var n,r,i,o,s;(e.TokenFormat||(e.TokenFormat={})).Relative="relative",function(e){e.method="textDocument/semanticTokens",e.type=new t.RegistrationType(e.method)}(n=e.SemanticTokensRegistrationType||(e.SemanticTokensRegistrationType={})),(r=e.SemanticTokensRequest||(e.SemanticTokensRequest={})).method="textDocument/semanticTokens/full",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),r.registrationMethod=n.method,(i=e.SemanticTokensDeltaRequest||(e.SemanticTokensDeltaRequest={})).method="textDocument/semanticTokens/full/delta",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method),i.registrationMethod=n.method,(o=e.SemanticTokensRangeRequest||(e.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method,(s=e.SemanticTokensRefreshRequest||(e.SemanticTokensRefreshRequest={})).method="workspace/semanticTokens/refresh",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType0(s.method)}(sr);var ar={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;const t=Kn;var n;(n=e.ShowDocumentRequest||(e.ShowDocumentRequest={})).method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(ar);var cr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;const t=Kn;var n;(n=e.LinkedEditingRangeRequest||(e.LinkedEditingRangeRequest={})).method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(cr);var ur={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;const t=Kn;var n,r,i,o,s,a,c;(n=e.FileOperationPatternKind||(e.FileOperationPatternKind={})).file="file",n.folder="folder",(r=e.WillCreateFilesRequest||(e.WillCreateFilesRequest={})).method="workspace/willCreateFiles",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.DidCreateFilesNotification||(e.DidCreateFilesNotification={})).method="workspace/didCreateFiles",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolNotificationType(i.method),(o=e.WillRenameFilesRequest||(e.WillRenameFilesRequest={})).method="workspace/willRenameFiles",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),(s=e.DidRenameFilesNotification||(e.DidRenameFilesNotification={})).method="workspace/didRenameFiles",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolNotificationType(s.method),(a=e.DidDeleteFilesNotification||(e.DidDeleteFilesNotification={})).method="workspace/didDeleteFiles",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolNotificationType(a.method),(c=e.WillDeleteFilesRequest||(e.WillDeleteFilesRequest={})).method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)}(ur);var lr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;const t=Kn;var n,r,i;(n=e.UniquenessLevel||(e.UniquenessLevel={})).document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global",(r=e.MonikerKind||(e.MonikerKind={})).$import="import",r.$export="export",r.local="local",(i=e.MonikerRequest||(e.MonikerRequest={})).method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(lr);var hr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;const t=Kn;var n,r,i;(n=e.TypeHierarchyPrepareRequest||(e.TypeHierarchyPrepareRequest={})).method="textDocument/prepareTypeHierarchy",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.TypeHierarchySupertypesRequest||(e.TypeHierarchySupertypesRequest={})).method="typeHierarchy/supertypes",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.TypeHierarchySubtypesRequest||(e.TypeHierarchySubtypesRequest={})).method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(hr);var dr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;const t=Kn;var n,r;(n=e.InlineValueRequest||(e.InlineValueRequest={})).method="textDocument/inlineValue",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.InlineValueRefreshRequest||(e.InlineValueRefreshRequest={})).method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType0(r.method)}(dr);var pr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;const t=Kn;var n,r,i;(n=e.InlayHintRequest||(e.InlayHintRequest={})).method="textDocument/inlayHint",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.InlayHintResolveRequest||(e.InlayHintResolveRequest={})).method="inlayHint/resolve",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.InlayHintRefreshRequest||(e.InlayHintRefreshRequest={})).method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType0(i.method)}(pr);var fr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;const t=Te,n=zn,r=Kn;var i,o,s,a;(e.DiagnosticServerCancellationData||(e.DiagnosticServerCancellationData={})).is=function(e){const t=e;return t&&n.boolean(t.retriggerRequest)},(i=e.DocumentDiagnosticReportKind||(e.DocumentDiagnosticReportKind={})).Full="full",i.Unchanged="unchanged",(o=e.DocumentDiagnosticRequest||(e.DocumentDiagnosticRequest={})).method="textDocument/diagnostic",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method),o.partialResult=new t.ProgressType,(s=e.WorkspaceDiagnosticRequest||(e.WorkspaceDiagnosticRequest={})).method="workspace/diagnostic",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),s.partialResult=new t.ProgressType,(a=e.DiagnosticRefreshRequest||(e.DiagnosticRefreshRequest={})).method="workspace/diagnostic/refresh",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolRequestType0(a.method)}(fr);var mr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;const t=Un,n=zn,r=Kn;var i,o,s,a,c,u,l,h,d,p;!function(e){e.Markup=1,e.Code=2,e.is=function(e){return 1===e||2===e}}(i=e.NotebookCellKind||(e.NotebookCellKind={})),function(e){e.create=function(e,t){const n={executionOrder:e};return!0!==t&&!1!==t||(n.success=t),n},e.is=function(e){const r=e;return n.objectLiteral(r)&&t.uinteger.is(r.executionOrder)&&(void 0===r.success||n.boolean(r.success))},e.equals=function(e,t){return e===t||null!=e&&null!=t&&(e.executionOrder===t.executionOrder&&e.success===t.success)}}(o=e.ExecutionSummary||(e.ExecutionSummary={})),function(e){function r(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;const i=Array.isArray(e),o=Array.isArray(t);if(i!==o)return!1;if(i&&o){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}if(n.objectLiteral(e)&&n.objectLiteral(t)){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(n.sort(),i.sort(),!r(n,i))return!1;for(let i=0;i<n.length;i++){const o=n[i];if(!r(e[o],t[o]))return!1}}return!0}e.create=function(e,t){return{kind:e,document:t}},e.is=function(e){const r=e;return n.objectLiteral(r)&&i.is(r.kind)&&t.DocumentUri.is(r.document)&&(void 0===r.metadata||n.objectLiteral(r.metadata))},e.diff=function(e,t){const n=new Set;return e.document!==t.document&&n.add("document"),e.kind!==t.kind&&n.add("kind"),e.executionSummary!==t.executionSummary&&n.add("executionSummary"),void 0===e.metadata&&void 0===t.metadata||r(e.metadata,t.metadata)||n.add("metadata"),void 0===e.executionSummary&&void 0===t.executionSummary||o.equals(e.executionSummary,t.executionSummary)||n.add("executionSummary"),n}}(s=e.NotebookCell||(e.NotebookCell={})),(a=e.NotebookDocument||(e.NotebookDocument={})).create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},a.is=function(e){const r=e;return n.objectLiteral(r)&&n.string(r.uri)&&t.integer.is(r.version)&&n.typedArray(r.cells,s.is)},function(e){e.method="notebookDocument/sync",e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.RegistrationType(e.method)}(c=e.NotebookDocumentSyncRegistrationType||(e.NotebookDocumentSyncRegistrationType={})),(u=e.DidOpenNotebookDocumentNotification||(e.DidOpenNotebookDocumentNotification={})).method="notebookDocument/didOpen",u.messageDirection=r.MessageDirection.clientToServer,u.type=new r.ProtocolNotificationType(u.method),u.registrationMethod=c.method,(l=e.NotebookCellArrayChange||(e.NotebookCellArrayChange={})).is=function(e){const r=e;return n.objectLiteral(r)&&t.uinteger.is(r.start)&&t.uinteger.is(r.deleteCount)&&(void 0===r.cells||n.typedArray(r.cells,s.is))},l.create=function(e,t,n){const r={start:e,deleteCount:t};return void 0!==n&&(r.cells=n),r},(h=e.DidChangeNotebookDocumentNotification||(e.DidChangeNotebookDocumentNotification={})).method="notebookDocument/didChange",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=c.method,(d=e.DidSaveNotebookDocumentNotification||(e.DidSaveNotebookDocumentNotification={})).method="notebookDocument/didSave",d.messageDirection=r.MessageDirection.clientToServer,d.type=new r.ProtocolNotificationType(d.method),d.registrationMethod=c.method,(p=e.DidCloseNotebookDocumentNotification||(e.DidCloseNotebookDocumentNotification={})).method="notebookDocument/didClose",p.messageDirection=r.MessageDirection.clientToServer,p.type=new r.ProtocolNotificationType(p.method),p.registrationMethod=c.method}(mr),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=void 0;const t=Kn,n=Un,r=zn,i=Xn;Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const o=Yn;Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return o.TypeDefinitionRequest}});const s=Qn;Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const a=Zn;Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=er;Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=tr;Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}});const l=nr;Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const h=rr;Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const d=ir;Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const p=or;Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const f=sr;Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return f.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return f.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return f.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return f.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return f.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return f.SemanticTokensRegistrationType}});const m=ar;Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return m.ShowDocumentRequest}});const g=cr;Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return g.LinkedEditingRangeRequest}});const y=ur;Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return y.WillDeleteFilesRequest}});const v=lr;Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return v.MonikerRequest}});const b=hr;Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return b.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySupertypesRequest}});const S=dr;Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return S.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return S.InlineValueRefreshRequest}});const w=pr;Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return w.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return w.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return w.InlayHintRefreshRequest}});const R=fr;Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return R.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return R.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return R.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return R.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return R.DiagnosticRefreshRequest}});const _=mr;var E,C,D,T,k,x,P,O,N,q,I,A,M,F,L,j,$,H,W,V,U,K,G,z,B,J,X,Y,Q,Z,ee,te,ne,re,ie,oe,se,ae,ce,ue,le,he,de,pe,fe,me,ge,ye,ve,be,Se,we,Re,_e,Ee,Ce,De,Te,ke;Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return _.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return _.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return _.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return _.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return _.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return _.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return _.DidCloseNotebookDocumentNotification}}),function(e){e.is=function(e){const t=e;return r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(E=e.TextDocumentFilter||(e.TextDocumentFilter={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))}}(C=e.NotebookDocumentFilter||(e.NotebookDocumentFilter={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||C.is(t.notebook))&&(void 0===t.language||r.string(t.language))}}(D=e.NotebookCellTextDocumentFilter||(e.NotebookCellTextDocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!E.is(t)&&!D.is(t))return!1;return!0}}(T=e.DocumentSelector||(e.DocumentSelector={})),(k=e.RegistrationRequest||(e.RegistrationRequest={})).method="client/registerCapability",k.messageDirection=t.MessageDirection.serverToClient,k.type=new t.ProtocolRequestType(k.method),(x=e.UnregistrationRequest||(e.UnregistrationRequest={})).method="client/unregisterCapability",x.messageDirection=t.MessageDirection.serverToClient,x.type=new t.ProtocolRequestType(x.method),(P=e.ResourceOperationKind||(e.ResourceOperationKind={})).Create="create",P.Rename="rename",P.Delete="delete",(O=e.FailureHandlingKind||(e.FailureHandlingKind={})).Abort="abort",O.Transactional="transactional",O.TextOnlyTransactional="textOnlyTransactional",O.Undo="undo",(N=e.PositionEncodingKind||(e.PositionEncodingKind={})).UTF8="utf-8",N.UTF16="utf-16",N.UTF32="utf-32",(e.StaticRegistrationOptions||(e.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0},(e.TextDocumentRegistrationOptions||(e.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||T.is(t.documentSelector))},(q=e.WorkDoneProgressOptions||(e.WorkDoneProgressOptions={})).is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},q.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)},(I=e.InitializeRequest||(e.InitializeRequest={})).method="initialize",I.messageDirection=t.MessageDirection.clientToServer,I.type=new t.ProtocolRequestType(I.method),(e.InitializeErrorCodes||(e.InitializeErrorCodes={})).unknownProtocolVersion=1,(A=e.InitializedNotification||(e.InitializedNotification={})).method="initialized",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method),(M=e.ShutdownRequest||(e.ShutdownRequest={})).method="shutdown",M.messageDirection=t.MessageDirection.clientToServer,M.type=new t.ProtocolRequestType0(M.method),(F=e.ExitNotification||(e.ExitNotification={})).method="exit",F.messageDirection=t.MessageDirection.clientToServer,F.type=new t.ProtocolNotificationType0(F.method),(L=e.DidChangeConfigurationNotification||(e.DidChangeConfigurationNotification={})).method="workspace/didChangeConfiguration",L.messageDirection=t.MessageDirection.clientToServer,L.type=new t.ProtocolNotificationType(L.method),(j=e.MessageType||(e.MessageType={})).Error=1,j.Warning=2,j.Info=3,j.Log=4,($=e.ShowMessageNotification||(e.ShowMessageNotification={})).method="window/showMessage",$.messageDirection=t.MessageDirection.serverToClient,$.type=new t.ProtocolNotificationType($.method),(H=e.ShowMessageRequest||(e.ShowMessageRequest={})).method="window/showMessageRequest",H.messageDirection=t.MessageDirection.serverToClient,H.type=new t.ProtocolRequestType(H.method),(W=e.LogMessageNotification||(e.LogMessageNotification={})).method="window/logMessage",W.messageDirection=t.MessageDirection.serverToClient,W.type=new t.ProtocolNotificationType(W.method),(V=e.TelemetryEventNotification||(e.TelemetryEventNotification={})).method="telemetry/event",V.messageDirection=t.MessageDirection.serverToClient,V.type=new t.ProtocolNotificationType(V.method),(U=e.TextDocumentSyncKind||(e.TextDocumentSyncKind={})).None=0,U.Full=1,U.Incremental=2,(K=e.DidOpenTextDocumentNotification||(e.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",K.messageDirection=t.MessageDirection.clientToServer,K.type=new t.ProtocolNotificationType(K.method),(G=e.TextDocumentContentChangeEvent||(e.TextDocumentContentChangeEvent={})).isIncremental=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},G.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(z=e.DidChangeTextDocumentNotification||(e.DidChangeTextDocumentNotification={})).method="textDocument/didChange",z.messageDirection=t.MessageDirection.clientToServer,z.type=new t.ProtocolNotificationType(z.method),(B=e.DidCloseTextDocumentNotification||(e.DidCloseTextDocumentNotification={})).method="textDocument/didClose",B.messageDirection=t.MessageDirection.clientToServer,B.type=new t.ProtocolNotificationType(B.method),(J=e.DidSaveTextDocumentNotification||(e.DidSaveTextDocumentNotification={})).method="textDocument/didSave",J.messageDirection=t.MessageDirection.clientToServer,J.type=new t.ProtocolNotificationType(J.method),(X=e.TextDocumentSaveReason||(e.TextDocumentSaveReason={})).Manual=1,X.AfterDelay=2,X.FocusOut=3,(Y=e.WillSaveTextDocumentNotification||(e.WillSaveTextDocumentNotification={})).method="textDocument/willSave",Y.messageDirection=t.MessageDirection.clientToServer,Y.type=new t.ProtocolNotificationType(Y.method),(Q=e.WillSaveTextDocumentWaitUntilRequest||(e.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",Q.messageDirection=t.MessageDirection.clientToServer,Q.type=new t.ProtocolRequestType(Q.method),(Z=e.DidChangeWatchedFilesNotification||(e.DidChangeWatchedFilesNotification={})).method="workspace/didChangeWatchedFiles",Z.messageDirection=t.MessageDirection.clientToServer,Z.type=new t.ProtocolNotificationType(Z.method),(ee=e.FileChangeType||(e.FileChangeType={})).Created=1,ee.Changed=2,ee.Deleted=3,(e.RelativePattern||(e.RelativePattern={})).is=function(e){const t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)},(te=e.WatchKind||(e.WatchKind={})).Create=1,te.Change=2,te.Delete=4,(ne=e.PublishDiagnosticsNotification||(e.PublishDiagnosticsNotification={})).method="textDocument/publishDiagnostics",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolNotificationType(ne.method),(re=e.CompletionTriggerKind||(e.CompletionTriggerKind={})).Invoked=1,re.TriggerCharacter=2,re.TriggerForIncompleteCompletions=3,(ie=e.CompletionRequest||(e.CompletionRequest={})).method="textDocument/completion",ie.messageDirection=t.MessageDirection.clientToServer,ie.type=new t.ProtocolRequestType(ie.method),(oe=e.CompletionResolveRequest||(e.CompletionResolveRequest={})).method="completionItem/resolve",oe.messageDirection=t.MessageDirection.clientToServer,oe.type=new t.ProtocolRequestType(oe.method),(se=e.HoverRequest||(e.HoverRequest={})).method="textDocument/hover",se.messageDirection=t.MessageDirection.clientToServer,se.type=new t.ProtocolRequestType(se.method),(ae=e.SignatureHelpTriggerKind||(e.SignatureHelpTriggerKind={})).Invoked=1,ae.TriggerCharacter=2,ae.ContentChange=3,(ce=e.SignatureHelpRequest||(e.SignatureHelpRequest={})).method="textDocument/signatureHelp",ce.messageDirection=t.MessageDirection.clientToServer,ce.type=new t.ProtocolRequestType(ce.method),(ue=e.DefinitionRequest||(e.DefinitionRequest={})).method="textDocument/definition",ue.messageDirection=t.MessageDirection.clientToServer,ue.type=new t.ProtocolRequestType(ue.method),(le=e.ReferencesRequest||(e.ReferencesRequest={})).method="textDocument/references",le.messageDirection=t.MessageDirection.clientToServer,le.type=new t.ProtocolRequestType(le.method),(he=e.DocumentHighlightRequest||(e.DocumentHighlightRequest={})).method="textDocument/documentHighlight",he.messageDirection=t.MessageDirection.clientToServer,he.type=new t.ProtocolRequestType(he.method),(de=e.DocumentSymbolRequest||(e.DocumentSymbolRequest={})).method="textDocument/documentSymbol",de.messageDirection=t.MessageDirection.clientToServer,de.type=new t.ProtocolRequestType(de.method),(pe=e.CodeActionRequest||(e.CodeActionRequest={})).method="textDocument/codeAction",pe.messageDirection=t.MessageDirection.clientToServer,pe.type=new t.ProtocolRequestType(pe.method),(fe=e.CodeActionResolveRequest||(e.CodeActionResolveRequest={})).method="codeAction/resolve",fe.messageDirection=t.MessageDirection.clientToServer,fe.type=new t.ProtocolRequestType(fe.method),(me=e.WorkspaceSymbolRequest||(e.WorkspaceSymbolRequest={})).method="workspace/symbol",me.messageDirection=t.MessageDirection.clientToServer,me.type=new t.ProtocolRequestType(me.method),(ge=e.WorkspaceSymbolResolveRequest||(e.WorkspaceSymbolResolveRequest={})).method="workspaceSymbol/resolve",ge.messageDirection=t.MessageDirection.clientToServer,ge.type=new t.ProtocolRequestType(ge.method),(ye=e.CodeLensRequest||(e.CodeLensRequest={})).method="textDocument/codeLens",ye.messageDirection=t.MessageDirection.clientToServer,ye.type=new t.ProtocolRequestType(ye.method),(ve=e.CodeLensResolveRequest||(e.CodeLensResolveRequest={})).method="codeLens/resolve",ve.messageDirection=t.MessageDirection.clientToServer,ve.type=new t.ProtocolRequestType(ve.method),(be=e.CodeLensRefreshRequest||(e.CodeLensRefreshRequest={})).method="workspace/codeLens/refresh",be.messageDirection=t.MessageDirection.serverToClient,be.type=new t.ProtocolRequestType0(be.method),(Se=e.DocumentLinkRequest||(e.DocumentLinkRequest={})).method="textDocument/documentLink",Se.messageDirection=t.MessageDirection.clientToServer,Se.type=new t.ProtocolRequestType(Se.method),(we=e.DocumentLinkResolveRequest||(e.DocumentLinkResolveRequest={})).method="documentLink/resolve",we.messageDirection=t.MessageDirection.clientToServer,we.type=new t.ProtocolRequestType(we.method),(Re=e.DocumentFormattingRequest||(e.DocumentFormattingRequest={})).method="textDocument/formatting",Re.messageDirection=t.MessageDirection.clientToServer,Re.type=new t.ProtocolRequestType(Re.method),(_e=e.DocumentRangeFormattingRequest||(e.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",_e.messageDirection=t.MessageDirection.clientToServer,_e.type=new t.ProtocolRequestType(_e.method),(Ee=e.DocumentOnTypeFormattingRequest||(e.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method),(e.PrepareSupportDefaultBehavior||(e.PrepareSupportDefaultBehavior={})).Identifier=1,(Ce=e.RenameRequest||(e.RenameRequest={})).method="textDocument/rename",Ce.messageDirection=t.MessageDirection.clientToServer,Ce.type=new t.ProtocolRequestType(Ce.method),(De=e.PrepareRenameRequest||(e.PrepareRenameRequest={})).method="textDocument/prepareRename",De.messageDirection=t.MessageDirection.clientToServer,De.type=new t.ProtocolRequestType(De.method),(Te=e.ExecuteCommandRequest||(e.ExecuteCommandRequest={})).method="workspace/executeCommand",Te.messageDirection=t.MessageDirection.clientToServer,Te.type=new t.ProtocolRequestType(Te.method),(ke=e.ApplyWorkspaceEditRequest||(e.ApplyWorkspaceEditRequest={})).method="workspace/applyEdit",ke.messageDirection=t.MessageDirection.serverToClient,ke.type=new t.ProtocolRequestType("workspace/applyEdit")}(Gn);var gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.createProtocolConnection=void 0;const yr=Te;gr.createProtocolConnection=function(e,t,n,r){return yr.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,yr.createMessageConnection)(e,t,n,r)},function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(Te,e),n(Un,e),n(Kn,e),n(Gn,e);var r,i=gr;Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}}),(r=e.LSPErrorCodes||(e.LSPErrorCodes={})).lspReservedErrorRangeStart=-32899,r.RequestFailed=-32803,r.ServerCancelled=-32802,r.ContentModified=-32801,r.RequestCancelled=-32800,r.lspReservedErrorRangeEnd=-32800}(Gt),function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;const r=Ce;n(Ce,e),n(Gt,e),e.createProtocolConnection=function(e,t,n,i){return(0,r.createMessageConnection)(e,t,n,i)}}(Ee);const vr=k(Ee);var br={};Object.defineProperty(br,"__esModule",{value:!0}),br.generateUuid=br.parse=br.isUUID=br.v4=br.empty=void 0;class Sr{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class wr extends Sr{constructor(){super([wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),"-",wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),"-","4",wr._randomHex(),wr._randomHex(),wr._randomHex(),"-",wr._oneOf(wr._timeHighBits),wr._randomHex(),wr._randomHex(),wr._randomHex(),"-",wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return wr._oneOf(wr._chars)}}function Rr(){return new wr}wr._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],wr._timeHighBits=["8","9","a","b"],br.empty=new Sr("00000000-0000-0000-0000-000000000000"),br.v4=Rr;const _r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Er(e){return _r.test(e)}br.isUUID=Er,br.parse=function(e){if(!Er(e))throw new Error("invalid uuid");return new Sr(e)},br.generateUuid=function(){return Rr().asHex()};var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.attachPartialResult=Cr.ProgressFeature=Nr=Cr.attachWorkDone=void 0;const Dr=Ee,Tr=br;class kr{constructor(e,t){this._connection=e,this._token=t,kr.Instances.set(this._token,this)}begin(e,t,n,r){let i={kind:"begin",title:e,percentage:t,message:n,cancellable:r};this._connection.sendProgress(Dr.WorkDoneProgress.type,this._token,i)}report(e,t){let n={kind:"report"};"number"==typeof e?(n.percentage=e,void 0!==t&&(n.message=t)):n.message=e,this._connection.sendProgress(Dr.WorkDoneProgress.type,this._token,n)}done(){kr.Instances.delete(this._token),this._connection.sendProgress(Dr.WorkDoneProgress.type,this._token,{kind:"end"})}}kr.Instances=new Map;class xr extends kr{constructor(e,t){super(e,t),this._source=new Dr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class Pr{constructor(){}begin(){}report(){}done(){}}class Or extends Pr{constructor(){super(),this._source=new Dr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}var Nr=Cr.attachWorkDone=function(e,t){if(void 0===t||void 0===t.workDoneToken)return new Pr;const n=t.workDoneToken;return delete t.workDoneToken,new kr(e,n)};var qr;Cr.ProgressFeature=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),!0===e?.window?.workDoneProgress&&(this._progressSupported=!0,this.connection.onNotification(Dr.WorkDoneProgressCancelNotification.type,(e=>{let t=kr.Instances.get(e.token);(t instanceof xr||t instanceof Or)&&t.cancel()})))}attachWorkDoneProgress(e){return void 0===e?new Pr:new kr(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,Tr.generateUuid)();return this.connection.sendRequest(Dr.WorkDoneProgressCreateRequest.type,{token:e}).then((()=>new xr(this.connection,e)))}return Promise.resolve(new Or)}},function(e){e.type=new Dr.ProgressType}(qr||(qr={}));class Ir{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(qr.type,this._token,e)}}Cr.attachPartialResult=function(e,t){if(void 0===t||void 0===t.partialResultToken)return;const n=t.partialResultToken;return delete t.partialResultToken,new Ir(e,n)};var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.ConfigurationFeature=void 0;const Mr=Ee,Fr=be;Ar.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?Fr.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Mr.ConfigurationRequest.type,t).then((t=>Array.isArray(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null))}};var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.WorkspaceFoldersFeature=void 0;const jr=Ee;Lr.WorkspaceFoldersFeature=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new jr.Emitter,this.connection.onNotification(jr.DidChangeWorkspaceFoldersNotification.type,(e=>{this._onDidChangeWorkspaceFolders.fire(e.event)})))}fillServerCapabilities(e){super.fillServerCapabilities(e);const t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=!0===t||"string"==typeof t}getWorkspaceFolders(){return this.connection.sendRequest(jr.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._notificationIsAutoRegistered||this._unregistration||(this._unregistration=this.connection.client.register(jr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};var $r={};Object.defineProperty($r,"__esModule",{value:!0}),$r.CallHierarchyFeature=void 0;const Hr=Ee;$r.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Hr.CallHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onIncomingCalls:e=>{const t=Hr.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=Hr.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.SemanticTokensBuilder=Wr.SemanticTokensDiff=Wr.SemanticTokensFeature=void 0;const Vr=Ee;Wr.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Vr.SemanticTokensRefreshRequest.type),on:e=>{const t=Vr.SemanticTokensRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=Vr.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=Vr.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};class Ur{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){const e=this.originalSequence.length,t=this.modifiedSequence.length;let n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let r=e-1,i=t-1;for(;r>=n&&i>=n&&this.originalSequence[r]===this.modifiedSequence[i];)r--,i--;(r<n||i<n)&&(r++,i++);const o=r-n+1,s=this.modifiedSequence.slice(n,i+1);return 1===s.length&&s[0]===this.originalSequence[r]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:s}]}return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}}Wr.SemanticTokensDiff=Ur;Wr.SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,n,r,i){let o=e,s=t;this._dataLen>0&&(o-=this._prevLine,0===o&&(s-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return void 0!==this._prevData}buildEdits(){return void 0!==this._prevData?{resultId:this.id,edits:new Ur(this._prevData,this._data).computeDiff()}:this.build()}};var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.ShowDocumentFeature=void 0;const Gr=Ee;Kr.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(Gr.ShowDocumentRequest.type,e)}};var zr={};Object.defineProperty(zr,"__esModule",{value:!0}),zr.FileOperationsFeature=void 0;const Br=Ee;zr.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){return this.connection.onNotification(Br.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){return this.connection.onNotification(Br.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){return this.connection.onNotification(Br.DidDeleteFilesNotification.type,(t=>{e(t)}))}onWillCreateFiles(e){return this.connection.onRequest(Br.WillCreateFilesRequest.type,((t,n)=>e(t,n)))}onWillRenameFiles(e){return this.connection.onRequest(Br.WillRenameFilesRequest.type,((t,n)=>e(t,n)))}onWillDeleteFiles(e){return this.connection.onRequest(Br.WillDeleteFilesRequest.type,((t,n)=>e(t,n)))}};var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.LinkedEditingRangeFeature=void 0;const Xr=Ee;Jr.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){return this.connection.onRequest(Xr.LinkedEditingRangeRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))}};var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.TypeHierarchyFeature=void 0;const Qr=Ee;Yr.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Qr.TypeHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onSupertypes:e=>{const t=Qr.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onSubtypes:e=>{const t=Qr.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.InlineValueFeature=void 0;const ei=Ee;Zr.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(ei.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(ei.InlineValueRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t))))}}};var ti={};Object.defineProperty(ti,"__esModule",{value:!0}),ti.InlayHintFeature=void 0;const ni=Ee;ti.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(ni.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(ni.InlayHintRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t)))),resolve:e=>this.connection.onRequest(ni.InlayHintResolveRequest.type,((t,n)=>e(t,n)))}}};var ri={};Object.defineProperty(ri,"__esModule",{value:!0}),ri.DiagnosticFeature=void 0;const ii=Ee;ri.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(ii.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(ii.DocumentDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ii.DocumentDiagnosticRequest.partialResult,t)))),onWorkspace:e=>this.connection.onRequest(ii.WorkspaceDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ii.WorkspaceDiagnosticRequest.partialResult,t))))}}};var oi={},si={};Object.defineProperty(si,"__esModule",{value:!0}),si.TextDocuments=void 0;const ai=Ee;si.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ai.Emitter,this._onDidOpen=new ai.Emitter,this._onDidClose=new ai.Emitter,this._onDidSave=new ai.Emitter,this._onWillSave=new ai.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=ai.TextDocumentSyncKind.Incremental;const t=[];return t.push(e.onDidOpenTextDocument((e=>{const t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._syncedDocuments.set(t.uri,n);const r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)}))),t.push(e.onDidChangeTextDocument((e=>{const t=e.textDocument,n=e.contentChanges;if(0===n.length)return;const{version:r}=t;if(null==r)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);let i=this._syncedDocuments.get(t.uri);void 0!==i&&(i=this._configuration.update(i,n,r),this._syncedDocuments.set(t.uri,i),this._onDidChangeContent.fire(Object.freeze({document:i})))}))),t.push(e.onDidCloseTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&(this._syncedDocuments.delete(e.textDocument.uri),this._onDidClose.fire(Object.freeze({document:t})))}))),t.push(e.onWillSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))}))),t.push(e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._syncedDocuments.get(e.textDocument.uri);return void 0!==n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]}))),t.push(e.onDidSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onDidSave.fire(Object.freeze({document:t}))}))),ai.Disposable.create((()=>{t.forEach((e=>e.dispose()))}))}},Object.defineProperty(oi,"__esModule",{value:!0}),oi.NotebookDocuments=oi.NotebookSyncFeature=void 0;const ci=Ee,ui=si;oi.NotebookSyncFeature=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(ci.DidOpenNotebookDocumentNotification.type,(t=>{e(t)})),onDidChangeNotebookDocument:e=>this.connection.onNotification(ci.DidChangeNotebookDocumentNotification.type,(t=>{e(t)})),onDidSaveNotebookDocument:e=>this.connection.onNotification(ci.DidSaveNotebookDocumentNotification.type,(t=>{e(t)})),onDidCloseNotebookDocument:e=>this.connection.onNotification(ci.DidCloseNotebookDocumentNotification.type,(t=>{e(t)}))}}};class li{onDidOpenTextDocument(e){return this.openHandler=e,ci.Disposable.create((()=>{this.openHandler=void 0}))}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,ci.Disposable.create((()=>{this.changeHandler=e}))}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,ci.Disposable.create((()=>{this.closeHandler=void 0}))}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return li.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return li.NULL_DISPOSE}onDidSaveTextDocument(){return li.NULL_DISPOSE}}li.NULL_DISPOSE=Object.freeze({dispose:()=>{}});oi.NotebookDocuments=class{constructor(e){e instanceof ui.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ui.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new ci.Emitter,this._onDidChange=new ci.Emitter,this._onDidSave=new ci.Emitter,this._onDidClose=new ci.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){const t="string"==typeof e?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const t=new li,n=[];return n.push(this.cellTextDocuments.listen(t)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument((e=>{this.notebookDocuments.set(e.notebookDocument.uri,e.notebookDocument);for(const n of e.cellTextDocuments)t.openTextDocument({textDocument:n});this.updateCellMap(e.notebookDocument),this._onDidOpen.fire(e.notebookDocument)}))),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0===n)return;n.version=e.notebookDocument.version;const r=n.metadata;let i=!1;const o=e.change;void 0!==o.metadata&&(i=!0,n.metadata=o.metadata);const s=[],a=[],c=[],u=[];if(void 0!==o.cells){const e=o.cells;if(void 0!==e.structure){const r=e.structure.array;if(n.cells.splice(r.start,r.deleteCount,...void 0!==r.cells?r.cells:[]),void 0!==e.structure.didOpen)for(const n of e.structure.didOpen)t.openTextDocument({textDocument:n}),s.push(n.uri);if(e.structure.didClose)for(const n of e.structure.didClose)t.closeTextDocument({textDocument:n}),a.push(n.uri)}if(void 0!==e.data){const t=new Map(e.data.map((e=>[e.document,e])));for(let e=0;e<=n.cells.length;e++){const r=t.get(n.cells[e].document);if(void 0!==r){const i=n.cells.splice(e,1,r);if(c.push({old:i[0],new:r}),t.delete(r.document),0===t.size)break}}}if(void 0!==e.textContent)for(const n of e.textContent)t.changeTextDocument({textDocument:n.document,contentChanges:n.changes}),u.push(n.document.uri)}this.updateCellMap(n);const l={notebookDocument:n};i&&(l.metadata={old:r,new:n.metadata});const h=[];for(const e of s)h.push(this.getNotebookCell(e));const d=[];for(const e of a)d.push(this.getNotebookCell(e));const p=[];for(const e of u)p.push(this.getNotebookCell(e));(h.length>0||d.length>0||c.length>0||p.length>0)&&(l.cells={added:h,removed:d,changed:{data:c,textContent:p}}),void 0===l.metadata&&void 0===l.cells||this._onDidChange.fire(l)}))),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument((e=>{const t=this.notebookDocuments.get(e.notebookDocument.uri);void 0!==t&&this._onDidSave.fire(t)}))),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0!==n){this._onDidClose.fire(n);for(const n of e.cellTextDocuments)t.closeTextDocument({textDocument:n});this.notebookDocuments.delete(e.notebookDocument.uri);for(const e of n.cells)this.notebookCellMap.delete(e.document)}}))),ci.Disposable.create((()=>{n.forEach((e=>e.dispose()))}))}updateCellMap(e){for(const t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};var hi={};Object.defineProperty(hi,"__esModule",{value:!0}),hi.MonikerFeature=void 0;const di=Ee;hi.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{const t=di.MonikerRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.combineFeatures=e.combineNotebooksFeatures=e.combineLanguagesFeatures=e.combineWorkspaceFeatures=e.combineWindowFeatures=e.combineClientFeatures=e.combineTracerFeatures=e.combineTelemetryFeatures=e.combineConsoleFeatures=e._NotebooksImpl=e._LanguagesImpl=e.BulkUnregistration=e.BulkRegistration=e.ErrorMessageTracker=void 0;const t=Ee,n=be,r=br,i=Cr,o=Ar,s=Lr,a=$r,c=Wr,u=Kr,l=zr,h=Jr,d=Yr,p=Zr,f=ti,m=ri,g=oi,y=hi;function v(e){if(null!==e)return e}e.ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach((t=>{e.window.showErrorMessage(t)}))}};class b{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(t.MessageType.Error,e)}warn(e){this.send(t.MessageType.Warning,e)}info(e){this.send(t.MessageType.Info,e)}log(e){this.send(t.MessageType.Log,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:e,message:n}).catch((()=>{(0,t.RAL)().console.error("Sending log message failed")}))}}const S=(0,u.ShowDocumentFeature)((0,i.ProgressFeature)(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:t.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(v)}showWarningMessage(e,...n){let r={type:t.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(v)}showInformationMessage(e,...n){let r={type:t.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(v)}}));(e.BulkRegistration||(e.BulkRegistration={})).create=function(){return new w};class w{constructor(){this._registrations=[],this._registered=new Set}add(e,t){const i=n.string(e)?e:e.method;if(this._registered.has(i))throw new Error(`${i} is already added to this registration`);const o=r.generateUuid();this._registrations.push({id:o,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}}(e.BulkUnregistration||(e.BulkUnregistration={})).create=function(){return new R(void 0,[])};class R{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach((e=>{this._unregistrations.set(e.method,e)}))}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let t of this._unregistrations.values())e.push(t);let n={unregisterations:e};this._connection.sendRequest(t.UnregistrationRequest.type,n).catch((()=>{this._connection.console.info("Bulk unregistration failed.")}))}disposeSingle(e){const r=n.string(e)?e:e.method,i=this._unregistrations.get(r);if(!i)return!1;let o={unregisterations:[i]};return this._connection.sendRequest(t.UnregistrationRequest.type,o).then((()=>{this._unregistrations.delete(r)}),(e=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)})),!0}}class _{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof w?this.registerMany(e):e instanceof R?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,i,o){const s=n.string(i)?i:i.method,a=r.generateUuid();let c={registrations:[{id:a,method:s,registerOptions:o||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,c).then((t=>(e.add({id:a,method:s}),e)),(e=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(e))))}registerSingle2(e,i){const o=n.string(e)?e:e.method,s=r.generateUuid();let a={registrations:[{id:s,method:o,registerOptions:i||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,a).then((e=>t.Disposable.create((()=>{this.unregisterSingle(s,o).catch((()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)}))}))),(e=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(e))))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(t.UnregistrationRequest.type,r).catch((()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)}))}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,n).then((()=>new R(this._connection,n.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const E=(0,l.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,o.ConfigurationFeature)(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){let n=(r=e)&&r.edit?e:{edit:e};var r;return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,n)}})));class C{constructor(){this._trace=t.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:e,verbose:this._trace===t.Trace.Verbose?n:void 0}).catch((()=>{}))}}class D{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(t.TelemetryEventNotification.type,e).catch((()=>{this.connection.console.log("Sending TelemetryEventNotification failed")}))}}class T{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}}e._LanguagesImpl=T;const k=(0,y.MonikerFeature)((0,m.DiagnosticFeature)((0,f.InlayHintFeature)((0,p.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,h.LinkedEditingRangeFeature)((0,c.SemanticTokensFeature)((0,a.CallHierarchyFeature)(T))))))));class x{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}}e._NotebooksImpl=x;const P=(0,g.NotebookSyncFeature)(x);function O(e,t){return function(n){return t(e(n))}}function N(e,t){return function(n){return t(e(n))}}function q(e,t){return function(n){return t(e(n))}}function I(e,t){return function(n){return t(e(n))}}function A(e,t){return function(n){return t(e(n))}}function M(e,t){return function(n){return t(e(n))}}function F(e,t){return function(n){return t(e(n))}}function L(e,t){return function(n){return t(e(n))}}e.combineConsoleFeatures=O,e.combineTelemetryFeatures=N,e.combineTracerFeatures=q,e.combineClientFeatures=I,e.combineWindowFeatures=A,e.combineWorkspaceFeatures=M,e.combineLanguagesFeatures=F,e.combineNotebooksFeatures=L,e.combineFeatures=function(e,t){function n(e,t,n){return e&&t?n(e,t):e||t}return{__brand:"features",console:n(e.console,t.console,O),tracer:n(e.tracer,t.tracer,q),telemetry:n(e.telemetry,t.telemetry,N),client:n(e.client,t.client,I),window:n(e.window,t.window,A),workspace:n(e.workspace,t.workspace,M),languages:n(e.languages,t.languages,F),notebooks:n(e.notebooks,t.notebooks,L)}},e.createConnection=function(e,r,o){const s=o&&o.console?new(o.console(b)):new b,a=e(s);s.rawAttach(a);const c=o&&o.tracer?new(o.tracer(C)):new C,u=o&&o.telemetry?new(o.telemetry(D)):new D,l=o&&o.client?new(o.client(_)):new _,h=o&&o.window?new(o.window(S)):new S,d=o&&o.workspace?new(o.workspace(E)):new E,p=o&&o.languages?new(o.languages(k)):new k,f=o&&o.notebooks?new(o.notebooks(P)):new P,m=[s,c,u,l,h,d,p,f];function g(e){return e instanceof Promise?e:n.thenable(e)?new Promise(((t,n)=>{e.then((e=>t(e)),(e=>n(e)))})):Promise.resolve(e)}let y,v,w,R={listen:()=>a.listen(),sendRequest:(e,...t)=>a.sendRequest(n.string(e)?e:e.method,...t),onRequest:(e,t)=>a.onRequest(e,t),sendNotification:(e,t)=>{const r=n.string(e)?e:e.method;return 1===arguments.length?a.sendNotification(r):a.sendNotification(r,t)},onNotification:(e,t)=>a.onNotification(e,t),onProgress:a.onProgress,sendProgress:a.sendProgress,onInitialize:e=>(v=e,{dispose:()=>{v=void 0}}),onInitialized:e=>a.onNotification(t.InitializedNotification.type,e),onShutdown:e=>(y=e,{dispose:()=>{y=void 0}}),onExit:e=>(w=e,{dispose:()=>{w=void 0}}),get console(){return s},get telemetry(){return u},get tracer(){return c},get client(){return l},get window(){return h},get workspace(){return d},get languages(){return p},get notebooks(){return f},onDidChangeConfiguration:e=>a.onNotification(t.DidChangeConfigurationNotification.type,e),onDidChangeWatchedFiles:e=>a.onNotification(t.DidChangeWatchedFilesNotification.type,e),__textDocumentSync:void 0,onDidOpenTextDocument:e=>a.onNotification(t.DidOpenTextDocumentNotification.type,e),onDidChangeTextDocument:e=>a.onNotification(t.DidChangeTextDocumentNotification.type,e),onDidCloseTextDocument:e=>a.onNotification(t.DidCloseTextDocumentNotification.type,e),onWillSaveTextDocument:e=>a.onNotification(t.WillSaveTextDocumentNotification.type,e),onWillSaveTextDocumentWaitUntil:e=>a.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,e),onDidSaveTextDocument:e=>a.onNotification(t.DidSaveTextDocumentNotification.type,e),sendDiagnostics:e=>a.sendNotification(t.PublishDiagnosticsNotification.type,e),onHover:e=>a.onRequest(t.HoverRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onCompletion:e=>a.onRequest(t.CompletionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onCompletionResolve:e=>a.onRequest(t.CompletionResolveRequest.type,e),onSignatureHelp:e=>a.onRequest(t.SignatureHelpRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onDeclaration:e=>a.onRequest(t.DeclarationRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDefinition:e=>a.onRequest(t.DefinitionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onTypeDefinition:e=>a.onRequest(t.TypeDefinitionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onImplementation:e=>a.onRequest(t.ImplementationRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onReferences:e=>a.onRequest(t.ReferencesRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDocumentHighlight:e=>a.onRequest(t.DocumentHighlightRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDocumentSymbol:e=>a.onRequest(t.DocumentSymbolRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onWorkspaceSymbol:e=>a.onRequest(t.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onWorkspaceSymbolResolve:e=>a.onRequest(t.WorkspaceSymbolResolveRequest.type,e),onCodeAction:e=>a.onRequest(t.CodeActionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onCodeActionResolve:e=>a.onRequest(t.CodeActionResolveRequest.type,((t,n)=>e(t,n))),onCodeLens:e=>a.onRequest(t.CodeLensRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onCodeLensResolve:e=>a.onRequest(t.CodeLensResolveRequest.type,((t,n)=>e(t,n))),onDocumentFormatting:e=>a.onRequest(t.DocumentFormattingRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onDocumentRangeFormatting:e=>a.onRequest(t.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onDocumentOnTypeFormatting:e=>a.onRequest(t.DocumentOnTypeFormattingRequest.type,((t,n)=>e(t,n))),onRenameRequest:e=>a.onRequest(t.RenameRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onPrepareRename:e=>a.onRequest(t.PrepareRenameRequest.type,((t,n)=>e(t,n))),onDocumentLinks:e=>a.onRequest(t.DocumentLinkRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDocumentLinkResolve:e=>a.onRequest(t.DocumentLinkResolveRequest.type,((t,n)=>e(t,n))),onDocumentColor:e=>a.onRequest(t.DocumentColorRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onColorPresentation:e=>a.onRequest(t.ColorPresentationRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onFoldingRanges:e=>a.onRequest(t.FoldingRangeRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onSelectionRanges:e=>a.onRequest(t.SelectionRangeRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onExecuteCommand:e=>a.onRequest(t.ExecuteCommandRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),dispose:()=>a.dispose()};for(let e of m)e.attach(R);return a.onRequest(t.InitializeRequest.type,(e=>{r.initialize(e),n.string(e.trace)&&(c.trace=t.Trace.fromString(e.trace));for(let t of m)t.initialize(e.capabilities);if(v){return g(v(e,(new t.CancellationTokenSource).token,(0,i.attachWorkDone)(a,e),void 0)).then((e=>{if(e instanceof t.ResponseError)return e;let r=e;r||(r={capabilities:{}});let i=r.capabilities;i||(i={},r.capabilities=i),void 0===i.textDocumentSync||null===i.textDocumentSync?i.textDocumentSync=n.number(R.__textDocumentSync)?R.__textDocumentSync:t.TextDocumentSyncKind.None:n.number(i.textDocumentSync)||n.number(i.textDocumentSync.change)||(i.textDocumentSync.change=n.number(R.__textDocumentSync)?R.__textDocumentSync:t.TextDocumentSyncKind.None);for(let e of m)e.fillServerCapabilities(i);return r}))}{let e={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let t of m)t.fillServerCapabilities(e.capabilities);return e}})),a.onRequest(t.ShutdownRequest.type,(()=>(r.shutdownReceived=!0,y?y((new t.CancellationTokenSource).token):void 0))),a.onNotification(t.ExitNotification.type,(()=>{try{w&&w()}finally{r.shutdownReceived?r.exit(0):r.exit(1)}})),a.onNotification(t.SetTraceNotification.type,(e=>{c.trace=t.Trace.fromString(e.value)})),R}}(_e);var pi={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolveModulePath=e.FileSystem=e.resolveGlobalYarnPath=e.resolveGlobalNodePath=e.resolve=e.uriToFilePath=void 0;const t=f,n=s,r=a,i=o;function c(){return"win32"===process.platform}function u(e,t,o,s){const a="NODE_PATH",c=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise(((u,l)=>{let h=process.env,d=Object.create(null);Object.keys(h).forEach((e=>d[e]=h[e])),t&&r.existsSync(t)&&(d[a]?d[a]=t+n.delimiter+d[a]:d[a]=t,s&&s(`NODE_PATH value is: ${d[a]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let t=(0,i.fork)("",[],{cwd:o,env:d,execArgv:["-e",c]});if(void 0===t.pid)return void l(new Error(`Starting process to resolve node module ${e} failed`));t.on("error",(e=>{l(e)})),t.on("message",(n=>{"r"===n.c&&(t.send({c:"e"}),n.s?u(n.r):l(new Error(`Failed to resolve module: ${e}`)))}));let n={c:"rs",a:e};t.send(n)}catch(e){l(e)}}))}function l(e){let t="npm";const r=Object.create(null);Object.keys(process.env).forEach((e=>r[e]=process.env[e])),r.NO_UPDATE_NOTIFIER="true";const o={encoding:"utf8",env:r};c()&&(t="npm.cmd",o.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let r=(0,i.spawnSync)(t,["config","get","prefix"],o).stdout;if(!r)return void(e&&e("'npm config get prefix' didn't return a value."));let a=r.trim();return e&&e(`'npm config get prefix' value is: ${a}`),a.length>0?c()?n.join(a,"node_modules"):n.join(a,"lib","node_modules"):void 0}catch(e){return}finally{process.removeListener("SIGPIPE",s)}}var h;e.uriToFilePath=function(e){let r=t.parse(e);if("file:"!==r.protocol||!r.path)return;let i=r.path.split("/");for(var o=0,s=i.length;o<s;o++)i[o]=decodeURIComponent(i[o]);if("win32"===process.platform&&i.length>1){let e=i[0],t=i[1];0===e.length&&t.length>1&&":"===t[1]&&i.shift()}return n.normalize(i.join("/"))},e.resolve=u,e.resolveGlobalNodePath=l,e.resolveGlobalYarnPath=function(e){let t="yarn",r={encoding:"utf8"};c()&&(t="yarn.cmd",r.shell=!0);let o=()=>{};try{process.on("SIGPIPE",o);let s=(0,i.spawnSync)(t,["global","dir","--json"],r),a=s.stdout;if(!a)return void(e&&(e("'yarn global dir' didn't return a value."),s.stderr&&e(s.stderr)));let c=a.trim().split(/\r?\n/);for(let e of c)try{let t=JSON.parse(e);if("log"===t.type)return n.join(t.data,"node_modules")}catch(e){}return}catch(e){return}finally{process.removeListener("SIGPIPE",o)}},function(e){let t;function i(){return void 0!==t||(t="win32"!==process.platform&&(!r.existsSync(__filename.toUpperCase())||!r.existsSync(__filename.toLowerCase()))),t}e.isCaseSensitive=i,e.isParent=function(e,t){return i()?0===n.normalize(t).indexOf(n.normalize(e)):0===n.normalize(t).toLowerCase().indexOf(n.normalize(e).toLowerCase())}}(h=e.FileSystem||(e.FileSystem={})),e.resolveModulePath=function(e,t,r,i){return r?(n.isAbsolute(r)||(r=n.join(e,r)),u(t,r,r,i).then((e=>h.isParent(r,e)?e:Promise.reject(new Error(`Failed to load ${t} from node path location.`)))).then(void 0,(n=>u(t,l(i),e,i)))):u(t,l(i),e,i)}}(pi);var fi={};({get exports(){return fi},set exports(e){fi=e}}).exports=Ee;var mi={};!function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.ProposedFeatures=e.NotebookDocuments=e.TextDocuments=e.SemanticTokensBuilder=void 0;const r=Wr;Object.defineProperty(e,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}}),n(Ee,e);const i=si;Object.defineProperty(e,"TextDocuments",{enumerable:!0,get:function(){return i.TextDocuments}});const o=oi;Object.defineProperty(e,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(_e,e),(e.ProposedFeatures||(e.ProposedFeatures={})).all={__brand:"features"}}(mi),function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.Files=void 0;const r=be,i=_e,o=pi,s=fi;var a;n(fi,e),n(mi,e),(a=e.Files||(e.Files={})).uriToFilePath=o.uriToFilePath,a.resolveGlobalNodePath=o.resolveGlobalNodePath,a.resolveGlobalYarnPath=o.resolveGlobalYarnPath,a.resolve=o.resolve,a.resolveModulePath=o.resolveModulePath;let c,u=!1;!function(){const e="--clientProcessId";function t(e){try{let t=parseInt(e);isNaN(t)||(c=setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(u?0:1)}}),3e3))}catch(e){}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length)return void t(process.argv[n+1]);{let n=r.split("=");n[0]===e&&t(n[1])}}}();const l={initialize:e=>{const t=e.processId;r.number(t)&&void 0===c&&setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(u?0:1)}}),3e3)},get shutdownReceived(){return u},set shutdownReceived(e){u=e},exit:e=>{process.exit(e)}};e.createConnection=function(e,t,n,o){let a,c,h,d;return void 0!==e&&"features"===e.__brand&&(a=e,e=t,t=n,n=o),s.ConnectionStrategy.is(e)||s.ConnectionOptions.is(e)?d=e:(c=e,h=t,d=n),function(e,t,n,o){if(!e&&!t&&process.argv.length>2){let n,r,i=process.argv.slice(2);for(let o=0;o<i.length;o++){let c=i[o];if("--node-ipc"===c){e=new s.IPCMessageReader(process),t=new s.IPCMessageWriter(process);break}if("--stdio"===c){e=process.stdin,t=process.stdout;break}if("--socket"===c){n=parseInt(i[o+1]);break}if("--pipe"===c){r=i[o+1];break}var a=c.split("=");if("--socket"===a[0]){n=parseInt(a[1]);break}if("--pipe"===a[0]){r=a[1];break}}if(n){let r=(0,s.createServerSocketTransport)(n);e=r[0],t=r[1]}else if(r){let n=(0,s.createServerPipeTransport)(r);e=n[0],t=n[1]}}var c="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+c);if(!t)throw new Error("Connection output stream is not set. "+c);if(r.func(e.read)&&r.func(e.on)){let t=e;t.on("end",(()=>{process.exit(u?0:1)})),t.on("close",(()=>{process.exit(u?0:1)}))}const h=r=>(0,s.createProtocolConnection)(e,t,r,n);return(0,i.createConnection)(h,l,o)}(c,h,d,a)}}(ve);const gi=k(ve);var yi={};({get exports(){return yi},set exports(e){yi=e}}).exports=ve;const vi=k(yi);var bi;!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Log=3]="Log"}(bi=bi||(bi={})),function(e){e.fromString=function(t){switch(t?.toLowerCase()){case"log":return e.Log;case"info":return e.Info;case"warning":return e.Warning;default:return e.Error}},e.toString=function(t){switch(t){case e.Error:return"error";case e.Warning:return"warning";case e.Info:return"info";case e.Log:return"log"}}}(bi=bi||(bi={}));class Si{constructor(e,t){this.client=e,this.level=t}sendMessage(e,t,n){if(this.level>=e||n?.overrideLevel){const n=t.map((e=>"object"==typeof e?JSON.stringify(e,null,2):e)).join(" ");this.client.logMessage({type:e,message:n})}}logLevelToLspMessageType(e){switch(e){case bi.Log:return gi.MessageType.Log;case bi.Info:return gi.MessageType.Info;case bi.Warning:return gi.MessageType.Warning;case bi.Error:return gi.MessageType.Error}}error(...e){this.sendMessage(gi.MessageType.Error,e)}warn(...e){this.sendMessage(gi.MessageType.Warning,e)}info(...e){this.sendMessage(gi.MessageType.Info,e)}log(...e){this.sendMessage(gi.MessageType.Log,e)}logIgnoringVerbosity(e,...t){this.sendMessage(this.logLevelToLspMessageType(e),t,{overrideLevel:!0})}trace(e,t,n){this.logIgnoringVerbosity(bi.Log,`[${e} - ${Ri()}] ${t}`),n&&this.logIgnoringVerbosity(bi.Log,Ei(n))}}class wi{constructor(e,t){this.logger=e,this.prefix=t}error(...e){this.logger.error(this.prefix,...e)}warn(...e){this.logger.warn(this.prefix,...e)}info(...e){this.logger.info(this.prefix,...e)}log(...e){this.logger.log(this.prefix,...e)}logIgnoringVerbosity(e,...t){this.logger.logIgnoringVerbosity(e,this.prefix,...t)}trace(e,t,n){this.logIgnoringVerbosity(bi.Log,this.prefix,`[${e} - ${Ri()}] ${t}`),n&&this.logIgnoringVerbosity(bi.Log,this.prefix,Ei(n))}}function Ri(){const e=new Date;return`${_i(`${e.getUTCHours()}`,2,"0")}:${_i(`${e.getMinutes()}`,2,"0")}:${_i(`${e.getUTCSeconds()}`,2,"0")}.${e.getMilliseconds()}`}function _i(e,t,n=" "){return n.repeat(Math.max(0,t-e.length))+e}function Ei(e){return e instanceof Error?e.stack||e.message:!1===e.success&&e.message?e.message:e.toString()}var Ci={},Di={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},Ti=v,ki=process.cwd,xi=null,Pi=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xi||(xi=ki.call(process)),xi};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Oi=process.chdir;process.chdir=function(e){xi=null,Oi.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Oi)}var Ni=function(e){Ti.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,Ti.O_WRONLY|Ti.O_SYMLINK,n,(function(t,i){t?r&&r(t):e.fchmod(i,n,(function(t){e.close(i,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,i=e.openSync(t,Ti.O_WRONLY|Ti.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(i,n),o=!1}finally{if(o)try{e.closeSync(i)}catch(e){}else e.closeSync(i)}return r}}(e);e.lutimes||function(e){Ti.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,n,r,i){e.open(t,Ti.O_SYMLINK,(function(t,o){t?i&&i(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){i&&i(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var i,o=e.openSync(t,Ti.O_SYMLINK),s=!0;try{i=e.futimesSync(o,n,r),s=!1}finally{if(s)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return i}):(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=a(e.statSync),e.fstatSync=a(e.fstatSync),e.lstatSync=a(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.lchown||(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Pi&&(e.rename=(t=e.rename,function(n,r,i){var o=Date.now(),s=0;t(n,r,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,a):i(c)}))}),s),void(s<100&&(s+=10));i&&i(c)}))}));var t;function n(t){return t?function(n,r,i){return t.call(e,n,r,(function(e){c(e)&&(e=null),i&&i.apply(this,arguments)}))}:t}function r(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!c(e))throw e}}:t}function i(t){return t?function(n,r,i,o){return t.call(e,n,r,i,(function(e){c(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function o(t){return t?function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!c(e))throw e}}:t}function s(t){return t?function(n,r,i){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof r&&(i=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function a(t){return t?function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296),i}:t}function c(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read=function(t){function n(n,r,i,o,s,a){var c;if(a&&"function"==typeof a){var u=0;c=function(l,h,d){if(l&&"EAGAIN"===l.code&&u<10)return u++,t.call(e,n,r,i,o,s,c);a.apply(this,arguments)}}return t.call(e,n,r,i,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync=(u=e.readSync,function(t,n,r,i,o){for(var s=0;;)try{return u.call(e,t,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var u};var qi=b.Stream,Ii=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);qi.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){i._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return i.emit("error",e),void(i.readable=!1);i.fd=t,i.emit("open",t),i._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);qi.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var i=Object.keys(r),o=0,s=i.length;o<s;o++){var a=i[o];this[a]=r[a]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Ai=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:Mi(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},Mi=Object.getPrototypeOf||function(e){return e.__proto__};var Fi,Li,ji=a,$i=Ni,Hi=Ii,Wi=Ai,Vi=u;function Ui(e,t){Object.defineProperty(e,Fi,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Fi=Symbol.for("graceful-fs.queue"),Li=Symbol.for("graceful-fs.previous")):(Fi="___graceful-fs.queue",Li="___graceful-fs.previous");var Ki=function(){};if(Vi.debuglog?Ki=Vi.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ki=function(){var e=Vi.format.apply(Vi,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!ji[Fi]){var Gi=T[Fi]||[];Ui(ji,Gi),ji.close=function(e){function t(t,n){return e.call(ji,t,(function(e){e||Yi(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Li,{value:e}),t}(ji.close),ji.closeSync=function(e){function t(t){e.apply(ji,arguments),Yi()}return Object.defineProperty(t,Li,{value:e}),t}(ji.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ki(ji[Fi]),S.equal(ji[Fi].length,0)}))}T[Fi]||Ui(T,ji[Fi]);var zi,Bi=Ji(Wi(ji));function Ji(e){$i(e),e.gracefulify=Ji,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,i,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):Xi([e,[n,r,i],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,o,s){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):Xi([e,[t,r,i,o],n,s||Date.now(),Date.now()])}))}(e,t,r,i)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,i){"function"==typeof n&&(i=n,n=null);return function e(t,n,i,o,s){return r(t,n,i,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):Xi([e,[t,n,i,o],r,s||Date.now(),Date.now()])}))}(e,t,n,i)});var i=e.copyFile;i&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,s){return i(t,n,r,(function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof o&&o.apply(this,arguments):Xi([e,[t,n,r,o],i,s||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;if(e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);return function e(t,n,r,i){return o(t,n,(function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof r&&r.call(this,o,s)):Xi([e,[t,n,r],o,i||Date.now(),Date.now()])}))}(e,t,n)},"v0.8"===process.version.substr(0,4)){var s=Hi(e);h=s.ReadStream,d=s.WriteStream}var a=e.ReadStream;a&&(h.prototype=Object.create(a.prototype),h.prototype.open=function(){var e=this;f(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var c=e.WriteStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;f(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var u=h;Object.defineProperty(e,"FileReadStream",{get:function(){return u},set:function(e){u=e},enumerable:!0,configurable:!0});var l=d;function h(e,t){return this instanceof h?(a.apply(this,arguments),this):h.apply(Object.create(h.prototype),arguments)}function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var p=e.open;function f(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,o){return p(t,n,r,(function(s,a){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):Xi([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=f,e}function Xi(e){Ki("ENQUEUE",e[0].name,e[1]),ji[Fi].push(e),Qi()}function Yi(){for(var e=Date.now(),t=0;t<ji[Fi].length;++t)ji[Fi][t].length>2&&(ji[Fi][t][3]=e,ji[Fi][t][4]=e);Qi()}function Qi(){if(clearTimeout(zi),zi=void 0,0!==ji[Fi].length){var e=ji[Fi].shift(),t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];if(void 0===i)Ki("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){Ki("TIMEOUT",t.name,n);var s=n.pop();"function"==typeof s&&s.call(null,r)}else{var a=Date.now()-o,c=Math.max(o-i,1);a>=Math.min(1.2*c,100)?(Ki("RETRY",t.name,n),t.apply(null,n.concat([i]))):ji[Fi].push(e)}void 0===zi&&(zi=setTimeout(Qi,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ji.__patched&&(Bi=Ji(ji),ji.__patched=!0),function(e){const t=Di.fromCallback,n=Bi,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,i,o,s){return"function"==typeof s?n.read(e,t,r,i,o,s):new Promise(((s,a)=>{n.read(e,t,r,i,o,((e,t,n)=>{if(e)return a(e);s({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((i,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesWritten:t,buffer:n})}))}))},e.readv=function(e,t,...r){return"function"==typeof r[r.length-1]?n.readv(e,t,...r):new Promise(((i,o)=>{n.readv(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesRead:t,buffers:n})}))}))},e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((i,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesWritten:t,buffers:n})}))}))},"function"==typeof n.realpath.native?e.realpath.native=t(n.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(Ci);var Zi={},eo={};const to=s;eo.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(to.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const no=Ci,{checkPath:ro}=eo,io=e=>"number"==typeof e?e:{mode:511,...e}.mode;Zi.makeDir=async(e,t)=>(ro(e),no.mkdir(e,{mode:io(t),recursive:!0})),Zi.makeDirSync=(e,t)=>(ro(e),no.mkdirSync(e,{mode:io(t),recursive:!0}));const oo=Di.fromPromise,{makeDir:so,makeDirSync:ao}=Zi,co=oo(so);var uo={mkdirs:co,mkdirsSync:ao,mkdirp:co,mkdirpSync:ao,ensureDir:co,ensureDirSync:ao};const lo=Di.fromPromise,ho=Ci;var po={pathExists:lo((function(e){return ho.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:ho.existsSync};const fo=Bi;var mo=function(e,t,n,r){fo.open(e,"r+",((e,i)=>{if(e)return r(e);fo.futimes(i,t,n,(e=>{fo.close(i,(t=>{r&&r(e||t)}))}))}))},go=function(e,t,n){const r=fo.openSync(e,"r+");return fo.futimesSync(r,t,n),fo.closeSync(r)};const yo=Ci,vo=s,bo=u;function So(e,t,n){const r=n.dereference?e=>yo.stat(e,{bigint:!0}):e=>yo.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function wo(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ro(e,t){const n=vo.resolve(e).split(vo.sep).filter((e=>e)),r=vo.resolve(t).split(vo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function _o(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Eo={checkPaths:function(e,t,n,r,i){bo.callbackify(So)(e,t,r,((r,o)=>{if(r)return i(r);const{srcStat:s,destStat:a}=o;if(a){if(wo(s,a)){const r=vo.basename(e),o=vo.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?i(null,{srcStat:s,destStat:a,isChangingCase:!0}):i(new Error("Source and destination must not be the same."))}if(s.isDirectory()&&!a.isDirectory())return i(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!s.isDirectory()&&a.isDirectory())return i(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return s.isDirectory()&&Ro(e,t)?i(new Error(_o(e,t,n))):i(null,{srcStat:s,destStat:a})}))},checkPathsSync:function(e,t,n,r){const{srcStat:i,destStat:o}=function(e,t,n){let r;const i=n.dereference?e=>yo.statSync(e,{bigint:!0}):e=>yo.lstatSync(e,{bigint:!0}),o=i(e);try{r=i(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(wo(i,o)){const r=vo.basename(e),s=vo.basename(t);if("move"===n&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&Ro(e,t))throw new Error(_o(e,t,n));return{srcStat:i,destStat:o}},checkParentPaths:function e(t,n,r,i,o){const s=vo.resolve(vo.dirname(t)),a=vo.resolve(vo.dirname(r));if(a===s||a===vo.parse(a).root)return o();yo.stat(a,{bigint:!0},((s,c)=>s?"ENOENT"===s.code?o():o(s):wo(n,c)?o(new Error(_o(t,r,i))):e(t,n,a,i,o)))},checkParentPathsSync:function e(t,n,r,i){const o=vo.resolve(vo.dirname(t)),s=vo.resolve(vo.dirname(r));if(s===o||s===vo.parse(s).root)return;let a;try{a=yo.statSync(s,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(wo(n,a))throw new Error(_o(t,r,i));return e(t,n,s,i)},isSrcSubdir:Ro,areIdentical:wo};const Co=Bi,Do=s,To=uo.mkdirs,ko=po.pathExists,xo=mo,Po=Eo;function Oo(e,t,n,r){if(!n.filter)return r(null,!0);Promise.resolve(n.filter(e,t)).then((e=>r(null,e)),(e=>r(e)))}function No(e,t,n,r,i){(r.dereference?Co.stat:Co.lstat)(t,((o,s)=>o?i(o):s.isDirectory()?function(e,t,n,r,i,o){return t?Mo(n,r,i,o):function(e,t,n,r,i){Co.mkdir(n,(o=>{if(o)return i(o);Mo(t,n,r,(t=>t?i(t):Ao(n,e,i)))}))}(e.mode,n,r,i,o)}(s,e,t,n,r,i):s.isFile()||s.isCharacterDevice()||s.isBlockDevice()?function(e,t,n,r,i,o){return t?function(e,t,n,r,i){if(!r.overwrite)return r.errorOnExist?i(new Error(`'${n}' already exists`)):i();Co.unlink(n,(o=>o?i(o):qo(e,t,n,r,i)))}(e,n,r,i,o):qo(e,n,r,i,o)}(s,e,t,n,r,i):s.isSymbolicLink()?function(e,t,n,r,i){Co.readlink(t,((t,o)=>t?i(t):(r.dereference&&(o=Do.resolve(process.cwd(),o)),e?void Co.readlink(n,((e,t)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?Co.symlink(o,n,i):i(e):(r.dereference&&(t=Do.resolve(process.cwd(),t)),Po.isSrcSubdir(o,t)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${t}'.`)):Po.isSrcSubdir(t,o)?i(new Error(`Cannot overwrite '${t}' with '${o}'.`)):function(e,t,n){Co.unlink(t,(r=>r?n(r):Co.symlink(e,t,n)))}(o,n,i)))):Co.symlink(o,n,i))))}(e,t,n,r,i):s.isSocket()?i(new Error(`Cannot copy a socket file: ${t}`)):s.isFIFO()?i(new Error(`Cannot copy a FIFO pipe: ${t}`)):i(new Error(`Unknown file: ${t}`))))}function qo(e,t,n,r,i){Co.copyFile(t,n,(o=>o?i(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return Ao(e,128|t,n)}(n,e,(i=>i?r(i):Io(e,t,n,r)));return Io(e,t,n,r)}(e.mode,t,n,i):Ao(n,e.mode,i)))}function Io(e,t,n,r){!function(e,t,n){Co.stat(e,((e,r)=>e?n(e):xo(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):Ao(n,e,r)))}function Ao(e,t,n){return Co.chmod(e,t,n)}function Mo(e,t,n,r){Co.readdir(e,((i,o)=>i?r(i):Fo(o,e,t,n,r)))}function Fo(e,t,n,r,i){const o=e.pop();return o?function(e,t,n,r,i,o){const s=Do.join(n,t),a=Do.join(r,t);Oo(s,a,i,((t,c)=>t?o(t):c?void Po.checkPaths(s,a,"copy",i,((t,c)=>{if(t)return o(t);const{destStat:u}=c;No(u,s,a,i,(t=>t?o(t):Fo(e,n,r,i,o)))})):Fo(e,n,r,i,o)))}(e,o,t,n,r,i):i()}var Lo=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),Po.checkPaths(e,t,"copy",n,((i,o)=>{if(i)return r(i);const{srcStat:s,destStat:a}=o;Po.checkParentPaths(e,s,t,"copy",(i=>{if(i)return r(i);Oo(e,t,n,((i,o)=>i?r(i):o?void function(e,t,n,r,i){const o=Do.dirname(n);ko(o,((s,a)=>s?i(s):a?No(e,t,n,r,i):void To(o,(o=>o?i(o):No(e,t,n,r,i)))))}(a,e,t,n,r):r()))}))}))};const jo=Bi,$o=s,Ho=uo.mkdirsSync,Wo=go,Vo=Eo;function Uo(e,t,n,r){const i=(r.dereference?jo.statSync:jo.lstatSync)(t);if(i.isDirectory())return function(e,t,n,r,i){return t?zo(n,r,i):function(e,t,n,r){return jo.mkdirSync(n),zo(t,n,r),Go(n,e)}(e.mode,n,r,i)}(i,e,t,n,r);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return function(e,t,n,r,i){return t?function(e,t,n,r){if(r.overwrite)return jo.unlinkSync(n),Ko(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,i):Ko(e,n,r,i)}(i,e,t,n,r);if(i.isSymbolicLink())return function(e,t,n,r){let i=jo.readlinkSync(t);r.dereference&&(i=$o.resolve(process.cwd(),i));if(e){let e;try{e=jo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return jo.symlinkSync(i,n);throw e}if(r.dereference&&(e=$o.resolve(process.cwd(),e)),Vo.isSrcSubdir(i,e))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${e}'.`);if(Vo.isSrcSubdir(e,i))throw new Error(`Cannot overwrite '${e}' with '${i}'.`);return function(e,t){return jo.unlinkSync(t),jo.symlinkSync(e,t)}(i,n)}return jo.symlinkSync(i,n)}(e,t,n,r);if(i.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(i.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function Ko(e,t,n,r){return jo.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){Go(e,128|t)}(n,e);(function(e,t){const n=jo.statSync(e);Wo(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),Go(n,e.mode)}function Go(e,t){return jo.chmodSync(e,t)}function zo(e,t,n){jo.readdirSync(e).forEach((r=>function(e,t,n,r){const i=$o.join(t,e),o=$o.join(n,e);if(r.filter&&!r.filter(i,o))return;const{destStat:s}=Vo.checkPathsSync(i,o,"copy",r);return Uo(s,i,o,r)}(r,e,t,n)))}var Bo=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:i}=Vo.checkPathsSync(e,t,"copy",n);if(Vo.checkParentPathsSync(e,r,t,"copy"),n.filter&&!n.filter(e,t))return;const o=$o.dirname(t);return jo.existsSync(o)||Ho(o),Uo(i,e,t,n)};var Jo={copy:(0,Di.fromCallback)(Lo),copySync:Bo};const Xo=Bi;var Yo={remove:(0,Di.fromCallback)((function(e,t){Xo.rm(e,{recursive:!0,force:!0},t)})),removeSync:function(e){Xo.rmSync(e,{recursive:!0,force:!0})}};const Qo=Di.fromPromise,Zo=Ci,es=s,ts=uo,ns=Yo,rs=Qo((async function(e){let t;try{t=await Zo.readdir(e)}catch{return ts.mkdirs(e)}return Promise.all(t.map((t=>ns.remove(es.join(e,t)))))}));function is(e){let t;try{t=Zo.readdirSync(e)}catch{return ts.mkdirsSync(e)}t.forEach((t=>{t=es.join(e,t),ns.removeSync(t)}))}var os={emptyDirSync:is,emptydirSync:is,emptyDir:rs,emptydir:rs};const ss=Di.fromCallback,as=s,cs=Bi,us=uo;var ls={createFile:ss((function(e,t){function n(){cs.writeFile(e,"",(e=>{if(e)return t(e);t()}))}cs.stat(e,((r,i)=>{if(!r&&i.isFile())return t();const o=as.dirname(e);cs.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?us.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():cs.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=cs.statSync(e)}catch{}if(t&&t.isFile())return;const n=as.dirname(e);try{cs.statSync(n).isDirectory()||cs.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;us.mkdirsSync(n)}cs.writeFileSync(e,"")}};const hs=Di.fromCallback,ds=s,ps=Bi,fs=uo,ms=po.pathExists,{areIdentical:gs}=Eo;var ys={createLink:hs((function(e,t,n){function r(e,t){ps.link(e,t,(e=>{if(e)return n(e);n(null)}))}ps.lstat(t,((i,o)=>{ps.lstat(e,((i,s)=>{if(i)return i.message=i.message.replace("lstat","ensureLink"),n(i);if(o&&gs(s,o))return n(null);const a=ds.dirname(t);ms(a,((i,o)=>i?n(i):o?r(e,t):void fs.mkdirs(a,(i=>{if(i)return n(i);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=ps.lstatSync(t)}catch{}try{const t=ps.lstatSync(e);if(n&&gs(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=ds.dirname(t);return ps.existsSync(r)||fs.mkdirsSync(r),ps.linkSync(e,t)}};const vs=s,bs=Bi,Ss=po.pathExists;var ws={symlinkPaths:function(e,t,n){if(vs.isAbsolute(e))return bs.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=vs.dirname(t),i=vs.join(r,e);return Ss(i,((t,o)=>t?n(t):o?n(null,{toCwd:i,toDst:e}):bs.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:vs.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(vs.isAbsolute(e)){if(n=bs.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=vs.dirname(t),i=vs.join(r,e);if(n=bs.existsSync(i),n)return{toCwd:i,toDst:e};if(n=bs.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:vs.relative(r,e)}}}};const Rs=Bi;var _s={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Rs.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Rs.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=Di.fromCallback,Cs=s,Ds=Ci,Ts=uo.mkdirs,ks=uo.mkdirsSync,xs=ws.symlinkPaths,Ps=ws.symlinkPathsSync,Os=_s.symlinkType,Ns=_s.symlinkTypeSync,qs=po.pathExists,{areIdentical:Is}=Eo;function As(e,t,n,r){xs(e,t,((i,o)=>{if(i)return r(i);e=o.toDst,Os(o.toCwd,n,((n,i)=>{if(n)return r(n);const o=Cs.dirname(t);qs(o,((n,s)=>n?r(n):s?Ds.symlink(e,t,i,r):void Ts(o,(n=>{if(n)return r(n);Ds.symlink(e,t,i,r)}))))}))}))}var Ms={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ds.lstat(t,((i,o)=>{!i&&o.isSymbolicLink()?Promise.all([Ds.stat(e),Ds.stat(t)]).then((([i,o])=>{if(Is(i,o))return r(null);As(e,t,n,r)})):As(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Ds.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Ds.statSync(e),r=Ds.statSync(t);if(Is(n,r))return}const i=Ps(e,t);e=i.toDst,n=Ns(i.toCwd,n);const o=Cs.dirname(t);return Ds.existsSync(o)||ks(o),Ds.symlinkSync(e,t,n)}};const{createFile:Fs,createFileSync:Ls}=ls,{createLink:js,createLinkSync:$s}=ys,{createSymlink:Hs,createSymlinkSync:Ws}=Ms;var Vs,Us,Ks,Gs,zs,Bs,Js,Xs,Ys={createFile:Fs,createFileSync:Ls,ensureFile:Fs,ensureFileSync:Ls,createLink:js,createLinkSync:$s,ensureLink:js,ensureLinkSync:$s,createSymlink:Hs,createSymlinkSync:Ws,ensureSymlink:Hs,ensureSymlinkSync:Ws};function Qs(){if(Us)return Vs;Us=1;var e=v,t=process.cwd,n=null,r=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return n||(n=t.call(process)),n};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var i=process.chdir;process.chdir=function(e){n=null,i.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i)}return Vs=function(t){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(n,r,i){t.open(n,e.O_WRONLY|e.O_SYMLINK,r,(function(e,n){e?i&&i(e):t.fchmod(n,r,(function(e){t.close(n,(function(t){i&&i(e||t)}))}))}))},t.lchmodSync=function(n,r){var i,o=t.openSync(n,e.O_WRONLY|e.O_SYMLINK,r),s=!0;try{i=t.fchmodSync(o,r),s=!1}finally{if(s)try{t.closeSync(o)}catch(e){}else t.closeSync(o)}return i}}(t);t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")?(t.lutimes=function(n,r,i,o){t.open(n,e.O_SYMLINK,(function(e,n){e?o&&o(e):t.futimes(n,r,i,(function(e){t.close(n,(function(t){o&&o(e||t)}))}))}))},t.lutimesSync=function(n,r,i){var o,s=t.openSync(n,e.O_SYMLINK),a=!0;try{o=t.futimesSync(s,r,i),a=!1}finally{if(a)try{t.closeSync(s)}catch(e){}else t.closeSync(s)}return o}):(t.lutimes=function(e,t,n,r){r&&process.nextTick(r)},t.lutimesSync=function(){})}(t);t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=c(t.stat),t.fstat=c(t.fstat),t.lstat=c(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.lchmod||(t.lchmod=function(e,t,n){n&&process.nextTick(n)},t.lchmodSync=function(){});t.lchown||(t.lchown=function(e,t,n,r){r&&process.nextTick(r)},t.lchownSync=function(){});"win32"===r&&(t.rename=(n=t.rename,function(e,r,i){var o=Date.now(),s=0;n(e,r,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){t.stat(r,(function(t,o){t&&"ENOENT"===t.code?n(e,r,a):i(c)}))}),s),void(s<100&&(s+=10));i&&i(c)}))}));var n;function i(e){return e?function(n,r,i){return e.call(t,n,r,(function(e){l(e)&&(e=null),i&&i.apply(this,arguments)}))}:e}function o(e){return e?function(n,r){try{return e.call(t,n,r)}catch(e){if(!l(e))throw e}}:e}function s(e){return e?function(n,r,i,o){return e.call(t,n,r,i,(function(e){l(e)&&(e=null),o&&o.apply(this,arguments)}))}:e}function a(e){return e?function(n,r,i){try{return e.call(t,n,r,i)}catch(e){if(!l(e))throw e}}:e}function c(e){return e?function(n,r,i){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof r&&(i=r,r=null),r?e.call(t,n,r,o):e.call(t,n,o)}:e}function u(e){return e?function(n,r){var i=r?e.call(t,n,r):e.call(t,n);return i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296),i}:e}function l(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}t.read=function(e){function n(n,r,i,o,s,a){var c;if(a&&"function"==typeof a){var u=0;c=function(l,h,d){if(l&&"EAGAIN"===l.code&&u<10)return u++,e.call(t,n,r,i,o,s,c);a.apply(this,arguments)}}return e.call(t,n,r,i,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.read),t.readSync=(h=t.readSync,function(e,n,r,i,o){for(var s=0;;)try{return h.call(t,e,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var h},Vs}var Zs={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:i}={}){const o=n?t:"";return JSON.stringify(e,r,i).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let ea;try{ea=function(){if(Xs)return Js;Xs=1;var e,t,n=a,r=Qs(),i=function(){if(Gs)return Ks;Gs=1;var e=b.Stream;return Ks=function(t){return{ReadStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this);var o=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;a<c;a++){var u=s[a];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}null===this.fd?t.open(this.path,this.flags,this.mode,(function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()})):process.nextTick((function(){o._read()}))},WriteStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=i[c]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},Ks}(),o=function(){if(Bs)return zs;Bs=1,zs=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var n={__proto__:e(t)};else n=Object.create(null);return Object.getOwnPropertyNames(t).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})),n};var e=Object.getPrototypeOf||function(e){return e.__proto__};return zs}(),s=u;function c(t,n){Object.defineProperty(t,e,{get:function(){return n}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),t=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var l,h=function(){};if(s.debuglog?h=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(h=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!n[e]){var d=T[e]||[];c(n,d),n.close=function(e){function r(t,r){return e.call(n,t,(function(e){e||m(),"function"==typeof r&&r.apply(this,arguments)}))}return Object.defineProperty(r,t,{value:e}),r}(n.close),n.closeSync=function(e){function r(t){e.apply(n,arguments),m()}return Object.defineProperty(r,t,{value:e}),r}(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){h(n[e]),S.equal(n[e].length,0)}))}function p(e){r(e),e.gracefulify=p,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){return"function"==typeof n&&(r=n,n=null),function e(n,r,i,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):f([e,[n,r,i],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){return"function"==typeof r&&(i=r,r=null),function e(t,r,i,o,s){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):f([e,[t,r,i,o],n,s||Date.now(),Date.now()])}))}(e,t,r,i)};var o=e.appendFile;o&&(e.appendFile=function(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,s){return o(t,n,r,(function(o){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):f([e,[t,n,r,i],o,s||Date.now(),Date.now()])}))}(e,t,n,r)});var s=e.copyFile;s&&(e.copyFile=function(e,t,n,r){return"function"==typeof n&&(r=n,n=0),function e(t,n,r,i,o){return s(t,n,r,(function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):f([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)});var a=e.readdir;if(e.readdir=function(e,t,n){return"function"==typeof t&&(n=t,t=null),function e(t,n,r,i){return a(t,n,(function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof r&&r.call(this,o,s)):f([e,[t,n,r],o,i||Date.now(),Date.now()])}))}(e,t,n)},"v0.8"===process.version.substr(0,4)){var c=i(e);m=c.ReadStream,g=c.WriteStream}var u=e.ReadStream;u&&(m.prototype=Object.create(u.prototype),m.prototype.open=function(){var e=this;v(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var l=e.WriteStream;l&&(g.prototype=Object.create(l.prototype),g.prototype.open=function(){var e=this;v(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return g},set:function(e){g=e},enumerable:!0,configurable:!0});var h=m;Object.defineProperty(e,"FileReadStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0});var d=g;function m(e,t){return this instanceof m?(u.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function g(e,t){return this instanceof g?(l.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var y=e.open;function v(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,o){return y(t,n,r,(function(s,a){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):f([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=v,e}function f(t){h("ENQUEUE",t[0].name,t[1]),n[e].push(t),g()}function m(){for(var t=Date.now(),r=0;r<n[e].length;++r)n[e][r].length>2&&(n[e][r][3]=t,n[e][r][4]=t);g()}function g(){if(clearTimeout(l),l=void 0,0!==n[e].length){var t=n[e].shift(),r=t[0],i=t[1],o=t[2],s=t[3],a=t[4];if(void 0===s)h("RETRY",r.name,i),r.apply(null,i);else if(Date.now()-s>=6e4){h("TIMEOUT",r.name,i);var c=i.pop();"function"==typeof c&&c.call(null,o)}else{var u=Date.now()-a,d=Math.max(a-s,1);u>=Math.min(1.2*d,100)?(h("RETRY",r.name,i),r.apply(null,i.concat([s]))):n[e].push(t)}void 0===l&&(l=setTimeout(g,0))}}return T[e]||c(T,n[e]),Js=p(o(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(Js=p(n),n.__patched=!0),Js}()}catch(e){ea=a}const ta=Di,{stringify:na,stripBom:ra}=Zs;const ia=ta.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||ea,r=!("throws"in t)||t.throws;let i,o=await ta.fromCallback(n.readFile)(e,t);o=ra(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return i}));const oa=ta.fromPromise((async function(e,t,n={}){const r=n.fs||ea,i=na(t,n);await ta.fromCallback(r.writeFile)(e,i,n)}));const sa={readFile:ia,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||ea,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=ra(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:oa,writeFileSync:function(e,t,n={}){const r=n.fs||ea,i=na(t,n);return r.writeFileSync(e,i,n)}};var aa={readJson:sa.readFile,readJsonSync:sa.readFileSync,writeJson:sa.writeFile,writeJsonSync:sa.writeFileSync};const ca=Di.fromCallback,ua=Bi,la=s,ha=uo,da=po.pathExists;var pa={outputFile:ca((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const i=la.dirname(e);da(i,((o,s)=>o?r(o):s?ua.writeFile(e,t,n,r):void ha.mkdirs(i,(i=>{if(i)return r(i);ua.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=la.dirname(e);if(ua.existsSync(n))return ua.writeFileSync(e,...t);ha.mkdirsSync(n),ua.writeFileSync(e,...t)}};const{stringify:fa}=Zs,{outputFile:ma}=pa;var ga=async function(e,t,n={}){const r=fa(t,n);await ma(e,r,n)};const{stringify:ya}=Zs,{outputFileSync:va}=pa;var ba=function(e,t,n){const r=ya(t,n);va(e,r,n)};const Sa=Di.fromPromise,wa=aa;wa.outputJson=Sa(ga),wa.outputJsonSync=ba,wa.outputJSON=wa.outputJson,wa.outputJSONSync=wa.outputJsonSync,wa.writeJSON=wa.writeJson,wa.writeJSONSync=wa.writeJsonSync,wa.readJSON=wa.readJson,wa.readJSONSync=wa.readJsonSync;var Ra=wa;const _a=Bi,Ea=s,Ca=Jo.copy,Da=Yo.remove,Ta=uo.mkdirp,ka=po.pathExists,xa=Eo;function Pa(e,t,n,r,i){return r?Oa(e,t,n,i):n?Da(t,(r=>r?i(r):Oa(e,t,n,i))):void ka(t,((r,o)=>r?i(r):o?i(new Error("dest already exists.")):Oa(e,t,n,i)))}function Oa(e,t,n,r){_a.rename(e,t,(i=>i?"EXDEV"!==i.code?r(i):function(e,t,n,r){const i={overwrite:n,errorOnExist:!0};Ca(e,t,i,(t=>t?r(t):Da(e,r)))}(e,t,n,r):r()))}var Na=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const i=(n=n||{}).overwrite||n.clobber||!1;xa.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:s,isChangingCase:a=!1}=o;xa.checkParentPaths(e,s,t,"move",(n=>n?r(n):function(e){const t=Ea.dirname(e);return Ea.parse(t).root===t}(t)?Pa(e,t,i,a,r):void Ta(Ea.dirname(t),(n=>n?r(n):Pa(e,t,i,a,r)))))}))};const qa=Bi,Ia=s,Aa=Jo.copySync,Ma=Yo.removeSync,Fa=uo.mkdirpSync,La=Eo;function ja(e,t,n){try{qa.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Aa(e,t,r),Ma(e)}(e,t,n)}}var $a=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:i,isChangingCase:o=!1}=La.checkPathsSync(e,t,"move",n);return La.checkParentPathsSync(e,i,t,"move"),function(e){const t=Ia.dirname(e);return Ia.parse(t).root===t}(t)||Fa(Ia.dirname(t)),function(e,t,n,r){if(r)return ja(e,t,n);if(n)return Ma(t),ja(e,t,n);if(qa.existsSync(t))throw new Error("dest already exists.");return ja(e,t,n)}(e,t,r,o)};var Ha={move:(0,Di.fromCallback)(Na),moveSync:$a};const Wa={...Ci,...Jo,...os,...Ys,...Ra,...uo,...Ha,...pa,...po,...Yo},Va=(e,t,n={})=>{if(!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let r,i,o=[];return function(...s){return new Promise((a=>{const c=n.before&&!i;clearTimeout(i),i=setTimeout((()=>{i=null;const t=n.before?r:e.apply(this,s);for(a of o)a(t);o=[]}),t),c?(r=e.apply(this,s),a(r)):o.push(a)}))}};Va.promise=e=>{let t;return async function(...n){if(t)return t;try{return t=e.apply(this,n),await t}finally{t=void 0}}};var Ua={},Ka={get exports(){return Ua},set exports(e){Ua=e}};var Ga={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};var za="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n}=Ga,r=za,i=(t=e.exports={}).re=[],o=t.src=[],s=t.t={};let a=0;const c=(e,t,n)=>{const c=a++;r(e,c,t),s[e]=c,o[c]=t,i[c]=new RegExp(t,n?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${o[s.NUMERICIDENTIFIER]})\\.(${o[s.NUMERICIDENTIFIER]})\\.(${o[s.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${o[s.NUMERICIDENTIFIERLOOSE]})\\.(${o[s.NUMERICIDENTIFIERLOOSE]})\\.(${o[s.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${o[s.NUMERICIDENTIFIER]}|${o[s.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${o[s.NUMERICIDENTIFIERLOOSE]}|${o[s.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${o[s.PRERELEASEIDENTIFIER]}(?:\\.${o[s.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${o[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[s.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${o[s.BUILDIDENTIFIER]}(?:\\.${o[s.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${o[s.MAINVERSION]}${o[s.PRERELEASE]}?${o[s.BUILD]}?`),c("FULL",`^${o[s.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${o[s.MAINVERSIONLOOSE]}${o[s.PRERELEASELOOSE]}?${o[s.BUILD]}?`),c("LOOSE",`^${o[s.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${o[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${o[s.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${o[s.XRANGEIDENTIFIER]})(?:\\.(${o[s.XRANGEIDENTIFIER]})(?:\\.(${o[s.XRANGEIDENTIFIER]})(?:${o[s.PRERELEASE]})?${o[s.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${o[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[s.XRANGEIDENTIFIERLOOSE]})(?:${o[s.PRERELEASELOOSE]})?${o[s.BUILD]}?)?)?`),c("XRANGE",`^${o[s.GTLT]}\\s*${o[s.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${o[s.GTLT]}\\s*${o[s.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),c("COERCERTL",o[s.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${o[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${o[s.LONETILDE]}${o[s.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${o[s.LONETILDE]}${o[s.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${o[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${o[s.LONECARET]}${o[s.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${o[s.LONECARET]}${o[s.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${o[s.GTLT]}\\s*(${o[s.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${o[s.GTLT]}\\s*(${o[s.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${o[s.GTLT]}\\s*(${o[s.LOOSEPLAIN]}|${o[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${o[s.XRANGEPLAIN]})\\s+-\\s+(${o[s.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${o[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[s.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ka,Ua);const Ba=["includePrerelease","loose","rtl"];var Ja=e=>e?"object"!=typeof e?{loose:!0}:Ba.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{};const Xa=/^[0-9]+$/,Ya=(e,t)=>{const n=Xa.test(e),r=Xa.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var Qa={compareIdentifiers:Ya,rcompareIdentifiers:(e,t)=>Ya(t,e)};const Za=za,{MAX_LENGTH:ec,MAX_SAFE_INTEGER:tc}=Ga,{re:nc,t:rc}=Ua,ic=Ja,{compareIdentifiers:oc}=Qa;let sc=class{constructor(e,t){if(t=ic(t),e instanceof sc){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>ec)throw new TypeError(`version is longer than ${ec} characters`);Za("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?nc[rc.LOOSE]:nc[rc.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>tc||this.major<0)throw new TypeError("Invalid major version");if(this.minor>tc||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>tc||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<tc)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Za("SemVer.compare",this.version,this.options,e),!(e instanceof sc)){if("string"==typeof e&&e===this.version)return 0;e=new sc(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof sc||(e=new sc(e,this.options)),oc(this.major,e.major)||oc(this.minor,e.minor)||oc(this.patch,e.patch)}comparePre(e){if(e instanceof sc||(e=new sc(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(Za("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return oc(n,r)}while(++t)}compareBuild(e){e instanceof sc||(e=new sc(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(Za("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return oc(n,r)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(0===oc(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};var ac=sc;const{MAX_LENGTH:cc}=Ga,{re:uc,t:lc}=Ua,hc=ac,dc=Ja;var pc=(e,t)=>{if(t=dc(t),e instanceof hc)return e;if("string"!=typeof e)return null;if(e.length>cc)return null;if(!(t.loose?uc[lc.LOOSE]:uc[lc.FULL]).test(e))return null;try{return new hc(e,t)}catch(e){return null}};const fc=pc;var mc=(e,t)=>{const n=fc(e,t);return n?n.version:null};const gc=pc;var yc=(e,t)=>{const n=gc(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};const vc=ac;var bc=(e,t,n,r)=>{"string"==typeof n&&(r=n,n=void 0);try{return new vc(e instanceof vc?e.version:e,n).inc(t,r).version}catch(e){return null}};const Sc=ac;var wc=(e,t,n)=>new Sc(e,n).compare(new Sc(t,n));const Rc=wc;var _c=(e,t,n)=>0===Rc(e,t,n);const Ec=pc,Cc=_c;var Dc=(e,t)=>{if(Cc(e,t))return null;{const n=Ec(e),r=Ec(t),i=n.prerelease.length||r.prerelease.length,o=i?"pre":"",s=i?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==r[e])return o+e;return s}};const Tc=ac;var kc=(e,t)=>new Tc(e,t).major;const xc=ac;var Pc=(e,t)=>new xc(e,t).minor;const Oc=ac;var Nc=(e,t)=>new Oc(e,t).patch;const qc=pc;var Ic=(e,t)=>{const n=qc(e,t);return n&&n.prerelease.length?n.prerelease:null};const Ac=wc;var Mc=(e,t,n)=>Ac(t,e,n);const Fc=wc;var Lc=(e,t)=>Fc(e,t,!0);const jc=ac;var $c=(e,t,n)=>{const r=new jc(e,n),i=new jc(t,n);return r.compare(i)||r.compareBuild(i)};const Hc=$c;var Wc=(e,t)=>e.sort(((e,n)=>Hc(e,n,t)));const Vc=$c;var Uc=(e,t)=>e.sort(((e,n)=>Vc(n,e,t)));const Kc=wc;var Gc=(e,t,n)=>Kc(e,t,n)>0;const zc=wc;var Bc=(e,t,n)=>zc(e,t,n)<0;const Jc=wc;var Xc=(e,t,n)=>0!==Jc(e,t,n);const Yc=wc;var Qc=(e,t,n)=>Yc(e,t,n)>=0;const Zc=wc;var eu=(e,t,n)=>Zc(e,t,n)<=0;const tu=_c,nu=Xc,ru=Gc,iu=Qc,ou=Bc,su=eu;var au=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return tu(e,n,r);case"!=":return nu(e,n,r);case">":return ru(e,n,r);case">=":return iu(e,n,r);case"<":return ou(e,n,r);case"<=":return su(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const cu=ac,uu=pc,{re:lu,t:hu}=Ua;var du,pu,fu,mu,gu,yu,vu,bu,Su,wu,Ru=(e,t)=>{if(e instanceof cu)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=lu[hu.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),lu[hu.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;lu[hu.COERCERTL].lastIndex=-1}else n=e.match(lu[hu.COERCE]);return null===n?null:uu(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function _u(){if(mu)return fu;function e(t){var n=this;if(n instanceof e||(n=new e),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){n.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)n.push(arguments[r]);return n}function t(e,t,n){var r=t===e.head?new i(n,null,t,e):new i(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function n(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function r(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,n,r){if(!(this instanceof i))return new i(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}mu=1,fu=e,e.Node=i,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},e.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},e.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},e.prototype.map=function(t,n){n=n||this;for(var r=new e,i=this.head;null!==i;)r.push(t.call(n,i.value,this)),i=i.next;return r},e.prototype.mapReverse=function(t,n){n=n||this;for(var r=new e,i=this.tail;null!==i;)r.push(t.call(n,i.value,this)),i=i.prev;return r},e.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},e.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},e.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=0,o=this.head;null!==o&&i<t;i++)o=o.next;for(;null!==o&&i<n;i++,o=o.next)r.push(o.value);return r},e.prototype.sliceReverse=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=this.length,o=this.tail;null!==o&&i>n;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},e.prototype.splice=function(e,n,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;var s=[];for(i=0;o&&i<n;i++)s.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(i=0;i<r.length;i++)o=t(this,o,r[i]);return s},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{(pu?du:(pu=1,du=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return fu}function Eu(){if(bu)return vu;bu=1;class e{constructor(t,n){if(n=r(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t,this.set=t.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!d(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&p(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=n.get(t);if(r)return r;const s=this.options.loose,p=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(p,C(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],u),o("comparator trim",e);let f=(e=(e=(e=e.replace(a[c.TILDETRIM],l)).replace(a[c.CARETTRIM],h)).split(/\s+/).join(" ")).split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));s&&(f=f.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),o("range list",f);const g=new Map,y=f.map((e=>new i(e,this.options)));for(const e of y){if(d(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const v=[...g.values()];return n.set(t,v),v}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>f(e,n)&&t.set.some((t=>f(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(D(this.set[t],e,this.options))return!0;return!1}}vu=e;const t=function(){if(yu)return gu;yu=1;const e=_u(),t=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),i=Symbol("allowStale"),o=Symbol("maxAge"),s=Symbol("dispose"),a=Symbol("noDisposeOnSet"),c=Symbol("lruList"),u=Symbol("cache"),l=Symbol("updateAgeOnGet"),h=()=>1,d=(e,t,n)=>{const r=e[u].get(t);if(r){const t=r.value;if(p(e,t)){if(m(e,r),!e[i])return}else n&&(e[l]&&(r.value.now=Date.now()),e[c].unshiftNode(r));return t.value}},p=(e,t)=>{if(!t||!t.maxAge&&!e[o])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[o]&&n>e[o]},f=e=>{if(e[n]>e[t])for(let r=e[c].tail;e[n]>e[t]&&null!==r;){const t=r.prev;m(e,r),r=t}},m=(e,t)=>{if(t){const r=t.value;e[s]&&e[s](r.key,r.value),e[n]-=r.length,e[u].delete(r.key),e[c].removeNode(t)}};class g{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const y=(e,t,n,r)=>{let o=n.value;p(e,o)&&(m(e,n),e[i]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};return gu=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const n=e.length||h;if(this[r]="function"!=typeof n?h:n,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[o]=e.maxAge||0,this[s]=e.dispose,this[a]=e.noDisposeOnSet||!1,this[l]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,f(this)}get max(){return this[t]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[o]=e,f(this)}get maxAge(){return this[o]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[r]&&(this[r]=e,this[n]=0,this[c].forEach((e=>{e.length=this[r](e.value,e.key),this[n]+=e.length}))),f(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[c].length}rforEach(e,t){t=t||this;for(let n=this[c].tail;null!==n;){const r=n.prev;y(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[c].head;null!==n;){const r=n.next;y(this,e,n,t),n=r}}keys(){return this[c].toArray().map((e=>e.key))}values(){return this[c].toArray().map((e=>e.value))}reset(){this[s]&&this[c]&&this[c].length&&this[c].forEach((e=>this[s](e.key,e.value))),this[u]=new Map,this[c]=new e,this[n]=0}dump(){return this[c].map((e=>!p(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[c]}set(e,i,l){if((l=l||this[o])&&"number"!=typeof l)throw new TypeError("maxAge must be a number");const h=l?Date.now():0,d=this[r](i,e);if(this[u].has(e)){if(d>this[t])return m(this,this[u].get(e)),!1;const r=this[u].get(e).value;return this[s]&&(this[a]||this[s](e,r.value)),r.now=h,r.maxAge=l,r.value=i,this[n]+=d-r.length,r.length=d,this.get(e),f(this),!0}const p=new g(e,i,d,h,l);return p.length>this[t]?(this[s]&&this[s](e,i),!1):(this[n]+=p.length,this[c].unshift(p),this[u].set(e,this[c].head),f(this),!0)}has(e){if(!this[u].has(e))return!1;const t=this[u].get(e).value;return!p(this,t)}get(e){return d(this,e,!0)}peek(e){return d(this,e,!1)}pop(){const e=this[c].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[u].forEach(((e,t)=>d(this,t,!1)))}},gu}(),n=new t({max:1e3}),r=Ja,i=Cu(),o=za,s=ac,{re:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=Ua,d=e=>"<0.0.0-0"===e.value,p=e=>""===e.value,f=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},m=(e,t)=>(o("comp",e,t),e=b(e,t),o("caret",e),e=y(e,t),o("tildes",e),e=w(e,t),o("xrange",e),e=_(e,t),o("stars",e),e),g=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,t)=>e.trim().split(/\s+/).map((e=>v(e,t))).join(" "),v=(e,t)=>{const n=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(n,((t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),g(n)?a="":g(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:g(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a}))},b=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{o("caret",e,t);const n=t.loose?a[c.CARETLOOSE]:a[c.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),g(n)?c="":g(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:g(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c}))},w=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>R(e,t))).join(" ")),R=(e,t)=>{e=e.trim();const n=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(n,((n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const u=g(i),l=u||g(s),h=l||g(a),d=h;return"="===r&&d&&(r=""),c=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(l&&(s=0),a=0,">"===r?(r=">=",l?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",l?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:h&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n}))},_=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),E=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),C=e=>(t,n,r,i,o,s,a,c,u,l,h,d,p)=>`${n=g(r)?"":g(i)?`>=${r}.0.0${e?"-0":""}`:g(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=g(u)?"":g(l)?`<${+u+1}.0.0-0`:g(h)?`<${u}.${+l+1}.0-0`:d?`<=${u}.${l}.${h}-${d}`:e?`<${u}.${l}.${+h+1}-0`:`<=${c}`}`.trim(),D=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return vu}function Cu(){if(wu)return Su;wu=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}s("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new c(e.value,n).test(this.value);if(""===e.operator)return""===e.value||new c(this.value,n).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),u=o(this.semver,"<",e.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),l=o(this.semver,">",e.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||s&&a||u||l}}Su=t;const n=Ja,{re:r,t:i}=Ua,o=au,s=za,a=ac,c=Eu();return Su}const Du=Eu();var Tu=(e,t,n)=>{try{t=new Du(t,n)}catch(e){return!1}return t.test(e)};const ku=Eu();var xu=(e,t)=>new ku(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const Pu=ac,Ou=Eu();var Nu=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Ou(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&-1!==i.compare(e)||(r=e,i=new Pu(r,n)))})),r};const qu=ac,Iu=Eu();var Au=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Iu(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&1!==i.compare(e)||(r=e,i=new qu(r,n)))})),r};const Mu=ac,Fu=Eu(),Lu=Gc;var ju=(e,t)=>{e=new Fu(e,t);let n=new Mu("0.0.0");if(e.test(n))return n;if(n=new Mu("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new Mu(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!Lu(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!Lu(n,i)||(n=i)}return n&&e.test(n)?n:null};const $u=Eu();var Hu=(e,t)=>{try{return new $u(e,t).range||"*"}catch(e){return null}};const Wu=ac,Vu=Cu(),{ANY:Uu}=Vu,Ku=Eu(),Gu=Tu,zu=Gc,Bu=Bc,Ju=eu,Xu=Qc;var Yu=(e,t,n,r)=>{let i,o,s,a,c;switch(e=new Wu(e,r),t=new Ku(t,r),n){case">":i=zu,o=Ju,s=Bu,a=">",c=">=";break;case"<":i=Bu,o=Xu,s=zu,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gu(e,t,r))return!1;for(let n=0;n<t.set.length;++n){const u=t.set[n];let l=null,h=null;if(u.forEach((e=>{e.semver===Uu&&(e=new Vu(">=0.0.0")),l=l||e,h=h||e,i(e.semver,l.semver,r)?l=e:s(e.semver,h.semver,r)&&(h=e)})),l.operator===a||l.operator===c)return!1;if((!h.operator||h.operator===a)&&o(e,h.semver))return!1;if(h.operator===c&&s(e,h.semver))return!1}return!0};const Qu=Yu;var Zu=(e,t,n)=>Qu(e,t,">",n);const el=Yu;var tl=(e,t,n)=>el(e,t,"<",n);const nl=Eu();var rl=(e,t,n)=>(e=new nl(e,n),t=new nl(t,n),e.intersects(t));const il=Tu,ol=wc;const sl=Eu(),al=Cu(),{ANY:cl}=al,ul=Tu,ll=wc,hl=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===cl){if(1===t.length&&t[0].semver===cl)return!0;e=n.includePrerelease?[new al(">=0.0.0-0")]:[new al(">=0.0.0")]}if(1===t.length&&t[0].semver===cl){if(n.includePrerelease)return!0;t=[new al(">=0.0.0")]}const r=new Set;let i,o,s,a,c,u,l;for(const t of e)">"===t.operator||">="===t.operator?i=dl(i,t,n):"<"===t.operator||"<="===t.operator?o=pl(o,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&o){if(s=ll(i.semver,o.semver,n),s>0)return null;if(0===s&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of r){if(i&&!ul(e,String(i),n))return null;if(o&&!ul(e,String(o),n))return null;for(const r of t)if(!ul(e,String(r),n))return!1;return!0}let h=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver,d=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;h&&1===h.prerelease.length&&"<"===o.operator&&0===h.prerelease[0]&&(h=!1);for(const e of t){if(l=l||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,i)if(d&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===d.major&&e.semver.minor===d.minor&&e.semver.patch===d.patch&&(d=!1),">"===e.operator||">="===e.operator){if(a=dl(i,e,n),a===e&&a!==i)return!1}else if(">="===i.operator&&!ul(i.semver,String(e),n))return!1;if(o)if(h&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===h.major&&e.semver.minor===h.minor&&e.semver.patch===h.patch&&(h=!1),"<"===e.operator||"<="===e.operator){if(c=pl(o,e,n),c===e&&c!==o)return!1}else if("<="===o.operator&&!ul(o.semver,String(e),n))return!1;if(!e.operator&&(o||i)&&0!==s)return!1}return!(i&&u&&!o&&0!==s)&&(!(o&&l&&!i&&0!==s)&&(!d&&!h))},dl=(e,t,n)=>{if(!e)return t;const r=ll(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},pl=(e,t,n)=>{if(!e)return t;const r=ll(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};var fl=(e,t,n={})=>{if(e===t)return!0;e=new sl(e,n),t=new sl(t,n);let r=!1;e:for(const i of e.set){for(const e of t.set){const t=hl(i,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0};const ml=Ua,gl=Ga,yl=ac,vl=Qa,bl=(e,t,n)=>{const r=[];let i=null,o=null;const s=e.sort(((e,t)=>ol(e,t,n)));for(const e of s){il(e,t,n)?(o=e,i||(i=e)):(o&&r.push([i,o]),o=null,i=null)}i&&r.push([i,null]);const a=[];for(const[e,t]of r)e===t?a.push(e):t||e!==s[0]?t?e===s[0]?a.push(`<=${t}`):a.push(`${e} - ${t}`):a.push(`>=${e}`):a.push("*");const c=a.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return c.length<u.length?c:t};var Sl,wl,Rl,_l,El,Cl,Dl,Tl,kl,xl,Pl,Ol={parse:pc,valid:mc,clean:yc,inc:bc,diff:Dc,major:kc,minor:Pc,patch:Nc,prerelease:Ic,compare:wc,rcompare:Mc,compareLoose:Lc,compareBuild:$c,sort:Wc,rsort:Uc,gt:Gc,lt:Bc,eq:_c,neq:Xc,gte:Qc,lte:eu,cmp:au,coerce:Ru,Comparator:Cu(),Range:Eu(),satisfies:Tu,toComparators:xu,maxSatisfying:Nu,minSatisfying:Au,minVersion:ju,validRange:Hu,outside:Yu,gtr:Zu,ltr:tl,intersects:rl,simplifyRange:bl,subset:fl,SemVer:yl,re:ml.re,src:ml.src,tokens:ml.t,SEMVER_SPEC_VERSION:gl.SEMVER_SPEC_VERSION,compareIdentifiers:vl.compareIdentifiers,rcompareIdentifiers:vl.rcompareIdentifiers};class Nl{static fromSimpleString(e){return new Nl(e,e,e)}static fromVersionString(e){let t=Ol.valid(e);if(!t)return new Nl("invalid version","1.0.0","1.0.0");const n=e.indexOf("-");return n>=0&&(t=t.substr(0,n)),new Nl(e,t,e)}constructor(e,t,n){this.displayName=e,this.version=t,this.fullVersionString=n}eq(e){return Ol.eq(this.version,e.version)}gte(e){return Ol.gte(this.version,e.version)}lt(e){return!this.gte(e)}}Nl.defaultVersion=Nl.fromSimpleString("1.0.0"),Nl.v240=Nl.fromSimpleString("2.4.0"),Nl.v250=Nl.fromSimpleString("2.5.0"),Nl.v260=Nl.fromSimpleString("2.6.0"),Nl.v270=Nl.fromSimpleString("2.7.0"),Nl.v280=Nl.fromSimpleString("2.8.0"),Nl.v290=Nl.fromSimpleString("2.9.0"),Nl.v291=Nl.fromSimpleString("2.9.1"),Nl.v300=Nl.fromSimpleString("3.0.0"),Nl.v310=Nl.fromSimpleString("3.1.0"),Nl.v314=Nl.fromSimpleString("3.1.4"),Nl.v320=Nl.fromSimpleString("3.2.0"),Nl.v333=Nl.fromSimpleString("3.3.3"),Nl.v340=Nl.fromSimpleString("3.4.0"),Nl.v345=Nl.fromSimpleString("3.4.5"),Nl.v350=Nl.fromSimpleString("3.5.0"),Nl.v380=Nl.fromSimpleString("3.8.0"),Nl.v381=Nl.fromSimpleString("3.8.1"),Nl.v390=Nl.fromSimpleString("3.9.0"),Nl.v400=Nl.fromSimpleString("4.0.0"),Nl.v401=Nl.fromSimpleString("4.0.1"),Nl.v420=Nl.fromSimpleString("4.2.0"),Nl.v430=Nl.fromSimpleString("4.3.0"),Nl.v440=Nl.fromSimpleString("4.4.0"),Nl.v460=Nl.fromSimpleString("4.6.0"),Nl.v470=Nl.fromSimpleString("4.7.0"),Nl.v480=Nl.fromSimpleString("4.8.0"),Nl.v490=Nl.fromSimpleString("4.9.0"),function(e){e.type=new vr.RequestType("_typescript.rename")}(Sl=Sl||(Sl={})),function(e){e.JsxClosingTag="jsxClosingTag",e.Brace="brace",e.BraceCompletion="braceCompletion",e.GetSpanOfEnclosingComment="getSpanOfEnclosingComment",e.Change="change",e.Close="close",e.Completions="completions",e.CompletionInfo="completionInfo",e.CompletionDetails="completionEntryDetails",e.CompileOnSaveAffectedFileList="compileOnSaveAffectedFileList",e.CompileOnSaveEmitFile="compileOnSaveEmitFile",e.Configure="configure",e.Definition="definition",e.DefinitionAndBoundSpan="definitionAndBoundSpan",e.EncodedSemanticClassificationsFull="encodedSemanticClassifications-full",e.Implementation="implementation",e.Exit="exit",e.FileReferences="fileReferences",e.Format="format",e.Formatonkey="formatonkey",e.Geterr="geterr",e.GeterrForProject="geterrForProject",e.SemanticDiagnosticsSync="semanticDiagnosticsSync",e.SyntacticDiagnosticsSync="syntacticDiagnosticsSync",e.SuggestionDiagnosticsSync="suggestionDiagnosticsSync",e.NavBar="navbar",e.Navto="navto",e.NavTree="navtree",e.NavTreeFull="navtree-full",e.Occurrences="occurrences",e.DocumentHighlights="documentHighlights",e.Open="open",e.Quickinfo="quickinfo",e.References="references",e.Reload="reload",e.Rename="rename",e.Saveto="saveto",e.SignatureHelp="signatureHelp",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.UpdateOpen="updateOpen",e.GetOutliningSpans="getOutliningSpans",e.TodoComments="todoComments",e.Indentation="indentation",e.DocCommentTemplate="docCommentTemplate",e.CompilerOptionsForInferredProjects="compilerOptionsForInferredProjects",e.GetCodeFixes="getCodeFixes",e.GetCombinedCodeFix="getCombinedCodeFix",e.ApplyCodeActionCommand="applyCodeActionCommand",e.GetSupportedCodeFixes="getSupportedCodeFixes",e.GetApplicableRefactors="getApplicableRefactors",e.GetEditsForRefactor="getEditsForRefactor",e.OrganizeImports="organizeImports",e.GetEditsForFileRename="getEditsForFileRename",e.ConfigurePlugin="configurePlugin",e.SelectionRange="selectionRange",e.ToggleLineComment="toggleLineComment",e.ToggleMultilineComment="toggleMultilineComment",e.CommentSelection="commentSelection",e.UncommentSelection="uncommentSelection",e.PrepareCallHierarchy="prepareCallHierarchy",e.ProvideCallHierarchyIncomingCalls="provideCallHierarchyIncomingCalls",e.ProvideCallHierarchyOutgoingCalls="provideCallHierarchyOutgoingCalls",e.ProvideInlayHints="provideInlayHints"}(wl=wl||(wl={})),function(e){e.none="none",e.definition="definition",e.reference="reference",e.writtenReference="writtenReference"}(Rl=Rl||(Rl={})),function(e){e.None="None",e.Preserve="Preserve",e.ReactNative="ReactNative",e.React="React"}(_l=_l||(_l={})),function(e){e.None="None",e.CommonJS="CommonJS",e.AMD="AMD",e.UMD="UMD",e.System="System",e.ES6="ES6",e.ES2015="ES2015",e.ESNext="ESNext"}(El=El||(El={})),function(e){e.Classic="Classic",e.Node="Node"}(Cl=Cl||(Cl={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove"}(Dl=Dl||(Dl={})),function(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.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"}(Tl=Tl||(Tl={})),function(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"}(kl=kl||(kl={})),function(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.ESNext="ESNext"}(xl=xl||(xl={})),function(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"}(Pl=Pl||(Pl={}));class ql{}ql.optional="optional",ql.deprecated="deprecated",ql.dtsFile=".d.ts",ql.tsFile=".ts",ql.tsxFile=".tsx",ql.jsFile=".js",ql.jsxFile=".jsx",ql.jsonFile=".json",ql.fileExtensionKindModifiers=[ql.dtsFile,ql.tsFile,ql.tsxFile,ql.jsFile,ql.jsxFile,ql.jsonFile];const Il={aliasName:0,className:1,enumName:2,fieldName:3,interfaceName:4,keyword:5,lineBreak:6,numericLiteral:7,stringLiteral:8,localName:9,methodName:10,moduleName:11,operator:12,parameterName:13,propertyName:14,punctuation:15,space:16,text:17,typeParameterName:18,enumMemberName:19,functionName:20,regularExpressionLiteral:21,link:22,linkName:23,linkText:24};function Al(e){return Il[e]}var Ml,Fl;!function(e){e.Syntax="syntax",e.Semantic="semantic"}(Ml=Ml||(Ml={})),function(e){e.Cancelled=class{constructor(e){this.reason=e,this.type="cancelled"}},e.NoContent={type:"noContent"},e.NoServer={type:"noServer"}}(Fl=Fl||(Fl={}));class Ll extends Error{static create(e,t,n){const r=Ll.parseErrorText(n);return new Ll(e,t,n,r?.message,r?.stack)}constructor(e,t,n,r,i){super(`<${e}> TypeScript Server Error (${t.versionString})\n${r}\n${i}`),this.serverId=e,this.version=t,this.response=n,this.serverMessage=r,this.serverStack=i}get serverErrorText(){return this.response.message}get serverCommand(){return this.response.command}static parseErrorText(e){const t=e.message;if(t){const e="Error processing request. ";if(t.startsWith(e)){const n=t.substr(e.length),r=n.indexOf("\n");if(r>=0){const e=n.substring(r+1);return{message:n.substring(0,r),stack:e}}}}}}const jl=l(d.randomBytes),$l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""),Hl="0123456789".split(""),Wl="CDEHKMPRTUWXY012458".split(""),Vl="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""),Ul="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Kl=new Set([void 0,"hex","base64","url-safe","numeric","distinguishable","ascii-printable","alphanumeric"]),Gl=(e,t)=>({length:n,type:r,characters:i})=>{if(!(n>=0&&Number.isFinite(n)))throw new TypeError("Expected a `length` to be a non-negative finite number");if(void 0!==r&&void 0!==i)throw new TypeError("Expected either `type` or `characters`");if(void 0!==i&&"string"!=typeof i)throw new TypeError("Expected `characters` to be string");if(!Kl.has(r))throw new TypeError(`Unknown type: ${r}`);if(void 0===r&&void 0===i&&(r="hex"),"hex"===r||void 0===r&&void 0===i)return t(Math.ceil(.5*n),"hex",n);if("base64"===r)return t(Math.ceil(.75*n),"base64",n);if("url-safe"===r)return e(n,$l);if("numeric"===r)return e(n,Hl);if("distinguishable"===r)return e(n,Wl);if("ascii-printable"===r)return e(n,Vl);if("alphanumeric"===r)return e(n,Ul);if(0===i.length)throw new TypeError("Expected `characters` string length to be greater than or equal to 1");if(i.length>65536)throw new TypeError("Expected `characters` string length to be less or equal to 65536");return e(n,i.split(""))},zl=Gl(((e,t)=>{const n=t.length,r=Math.floor(65536/n)*n-1,i=2*Math.ceil(1.1*e);let o="",s=0;for(;s<e;){const a=d.randomBytes(i);let c=0;for(;c<i&&s<e;){const e=a.readUInt16LE(c);c+=2,e>r||(o+=t[e%n],s++)}}return o}),((e,t,n)=>d.randomBytes(e).toString(t).slice(0,n)));zl.async=Gl((async(e,t)=>{const n=t.length,r=Math.floor(65536/n)*n-1,i=2*Math.ceil(1.1*e);let o="",s=0;for(;s<e;){const a=await jl(i);let c=0;for(;c<i&&s<e;){const e=a.readUInt16LE(c);c+=2,e>r||(o+=t[e%n],s++)}}return o}),(async(e,t,n)=>(await jl(e)).toString(t).slice(0,n)));const Bl=a,Jl=h,Xl=Symbol.for("__RESOLVED_TEMP_DIRECTORY__");T[Xl]||Object.defineProperty(T,Xl,{value:Bl.realpathSync(Jl.tmpdir())});var Yl=T[Xl];R(w.pipeline);const Ql=(e="")=>g.join(Yl,e+zl({length:32}));function Zl({name:t,extension:n}={}){if(t){if(null!=n)throw new Error("The `name` and `extension` options are mutually exclusive");return g.join(function({prefix:t=""}={}){const n=Ql(t);return e.mkdirSync(n),n}(),t)}return Ql()+(null==n?"":"."+n.replace(/^\./,""))}class eh{constructor(e,t){this._serverId=e,this._tracer=t,this.cancellationPipeName=Zl({name:"tscancellation"})}tryCancelOngoingRequest(t){if(!this.cancellationPipeName)return!1;this._tracer.logTrace(this._serverId,`TypeScript Server: trying to cancel ongoing request with sequence number ${t}`);try{e.writeFileSync(this.cancellationPipeName+String(t),"")}catch{}return!0}}const th=new class{create(e,t){return new eh(e,t)}};var nh,rh;!function(e){e[e.Normal=1]="Normal",e[e.LowPriority=2]="LowPriority",e[e.Fence=3]="Fence"}(nh=nh||(nh={}));class ih{constructor(){this.queue=[],this.sequenceNumber=0}get length(){return this.queue.length}enqueue(e){if(e.queueingType===nh.Normal){let t=this.queue.length-1;for(;t>=0&&this.queue[t].queueingType===nh.LowPriority;)--t;this.queue.splice(t+1,0,e)}else this.queue.push(e)}dequeue(){return this.queue.shift()}tryDeletePendingRequest(e){for(let t=0;t<this.queue.length;t++)if(this.queue[t].request.seq===e)return this.queue.splice(t,1),!0;return!1}createRequest(e,t){return{seq:this.sequenceNumber++,type:"request",command:e,arguments:t}}}class oh{constructor(){this._callbacks=new Map,this._asyncCallbacks=new Map}destroy(e){const t=new Fl.Cancelled(e);for(const e of this._callbacks.values())e.onSuccess(t);this._callbacks.clear();for(const e of this._asyncCallbacks.values())e.onSuccess(t);this._asyncCallbacks.clear()}add(e,t,n){n?this._asyncCallbacks.set(e,t):this._callbacks.set(e,t)}fetch(e){const t=this._callbacks.get(e)||this._asyncCallbacks.get(e);return this.delete(e),t}delete(e){this._callbacks.delete(e)||this._asyncCallbacks.delete(e)}}!function(e){e[e.Semantic=0]="Semantic",e[e.Syntax=1]="Syntax"}(rh=rh||(rh={}));class sh{constructor(e,t,n,r,i,o,s){this._serverId=e,this._serverSource=t,this._process=n,this._tsServerLogFile=r,this._requestCanceller=i,this._version=o,this._tracer=s,this._requestQueue=new ih,this._callbacks=new oh,this._pendingResponses=new Set,this._eventHandlers=new Set,this._exitHandlers=new Set,this._errorHandlers=new Set,this._stdErrHandlers=new Set,this._process.onData((e=>{this.dispatchMessage(e)})),this._process.onStdErr((e=>{this._stdErrHandlers.forEach((t=>t(e)))})),this._process.onExit(((e,t)=>{this._exitHandlers.forEach((n=>n({code:e,signal:t}))),this._callbacks.destroy("server exited")})),this._process.onError((e=>{this._errorHandlers.forEach((t=>t(e))),this._callbacks.destroy("server errored")}))}onEvent(e){this._eventHandlers.add(e)}onExit(e){this._exitHandlers.add(e)}onStdErr(e){this._stdErrHandlers.add(e)}onError(e){this._errorHandlers.add(e)}get tsServerLogFile(){return this._tsServerLogFile}write(e){this._process.write(e)}dispose(){this._callbacks.destroy("server disposed"),this._pendingResponses.clear(),this._eventHandlers.clear(),this._exitHandlers.clear(),this._errorHandlers.clear()}kill(){this.dispose(),this._process.kill()}dispatchMessage(e){try{switch(e.type){case"response":this._serverSource?this.dispatchResponse({...e}):this.dispatchResponse(e);break;case"event":{const t=e;if("requestCompleted"===t.event){const e=t.body.request_seq,n=this._callbacks.fetch(e);n&&(this._tracer.traceRequestCompleted(this._serverId,"requestCompleted",e,n),n.onSuccess(void 0))}else this._tracer.traceEvent(this._serverId,t),this._eventHandlers.forEach((e=>e(t)));break}default:throw new Error(`Unknown message type ${e.type} received`)}}finally{this.sendNextRequests()}}tryCancelRequest(e,t){try{return this._requestQueue.tryDeletePendingRequest(e)?(this.logTrace(`Canceled request with sequence number ${e}`),!0):!!this._requestCanceller.tryCancelOngoingRequest(e)||(this.logTrace(`Tried to cancel request with sequence number ${e}. But request got already delivered.`),!1)}finally{this.fetchCallback(e)?.onSuccess(new Fl.Cancelled(`Cancelled request ${e} - ${t}`))}}dispatchResponse(e){const t=this.fetchCallback(e.request_seq);t&&(this._tracer.traceResponse(this._serverId,e,t),e.success?t.onSuccess(e):"No content available."===e.message?t.onSuccess(Fl.NoContent):t.onError(Ll.create(this._serverId,this._version,e)))}executeImpl(e,t,n){const r=this._requestQueue.createRequest(e,t),i={request:r,expectsResponse:n.expectsResult,isAsync:n.isAsync,queueingType:sh.getQueueingType(e,n.lowPriority)};let o;return n.expectsResult&&(o=new Promise(((t,i)=>{this._callbacks.add(r.seq,{onSuccess:t,onError:i,queuingStartTime:Date.now(),isAsync:n.isAsync},n.isAsync),n.token&&n.token.onCancellationRequested((()=>{this.tryCancelRequest(r.seq,e)}))}))),this._requestQueue.enqueue(i),this.sendNextRequests(),[o]}sendNextRequests(){for(;0===this._pendingResponses.size&&this._requestQueue.length>0;){const e=this._requestQueue.dequeue();e&&this.sendRequest(e)}}sendRequest(e){const t=e.request;this._tracer.traceRequest(this._serverId,t,e.expectsResponse,this._requestQueue.length),e.expectsResponse&&!e.isAsync&&this._pendingResponses.add(e.request.seq);try{this.write(t)}catch(e){this.fetchCallback(t.seq)?.onError(e)}}fetchCallback(e){const t=this._callbacks.fetch(e);if(t)return this._pendingResponses.delete(e),t}logTrace(e){this._tracer.logTrace(this._serverId,e)}static getQueueingType(e,t){return sh.fenceCommands.has(e)?nh.Fence:t?nh.LowPriority:nh.Normal}}sh.fenceCommands=new Set(["change","close","open","updateOpen"]);class ah{fork(e,t,n,r){const i=e.tsServerPath,o=e.version?.gte(Nl.v490),s=[...t];o&&s.push("--useNodeIpc");const a=_.fork(i,s,{silent:!0,cwd:void 0,env:ch(process.env,i),execArgv:uh(n,r),stdio:o?["pipe","pipe","pipe","ipc"]:void 0});return o?new hh(a):new dh(a)}}function ch(e,t){const n=Object.assign({},e);return n.NODE_PATH=g.join(t,"..","..",".."),n.PATH=n.PATH||process.env.PATH,n}function uh(e,t){const n=[],r=function(e){if("syntax"===e)return;const t=lh()||process.env.TSS_DEBUG;if(t){const e=parseInt(t);if(!isNaN(e))return e}return}(e);if(r){const e=lh()?"--inspect-brk":"--inspect";n.push(`${e}=${r}`)}return t.maxTsServerMemory&&n.push(`--max-old-space-size=${t.maxTsServerMemory}`),n}function lh(){return process.env.TSS_DEBUG_BRK}class hh{constructor(e){this._process=e}write(e){this._process.send(e)}onData(e){this._process.on("message",e)}onExit(e){this._process.on("exit",e)}onStdErr(e){this._process.stderr.on("data",(t=>e(t.toString())))}onError(e){this._process.on("error",e)}kill(){this._process.kill()}}class dh{constructor(e){this._process=e,this._reader=new ph(this._process.stdout)}get reader(){return this._reader}write(e){this._process.stdin.write(`${JSON.stringify(e)}\r\n`,"utf8")}onData(e){this.reader.onData(e)}onExit(e){this._process.on("exit",e)}onStdErr(e){this._process.stderr.on("data",(t=>e(t.toString())))}onError(e){this._process.on("error",e),this.reader.onError(e)}kill(){this._process.kill(),this.reader.dispose(),this._reader=null}}class ph{constructor(e){this.buffer=new bh,this.nextMessageLength=-1,this._onError=e=>{},this._onData=e=>{},this.isDisposed=!1,e.on("data",(e=>this.onLengthData(e)))}dispose(){this.isDisposed=!0,this._onError=e=>{},this._onData=e=>{}}onError(e){this._onError=e}onData(e){this._onData=e}onLengthData(e){if(!this.isDisposed)try{for(this.buffer.append(e);;){if(-1===this.nextMessageLength&&(this.nextMessageLength=this.buffer.tryReadContentLength(),-1===this.nextMessageLength))return;const e=this.buffer.tryReadContent(this.nextMessageLength);if(null===e)return;this.nextMessageLength=-1;const t=JSON.parse(e);this._onData(t)}}catch(e){this._onError(e)}}}const fh=8192,mh=Buffer.byteLength("Content-Length: ","utf8"),gh=Buffer.from(" ","utf8")[0],yh=Buffer.from("\r","utf8")[0],vh=Buffer.from("\n","utf8")[0];class bh{constructor(){this.index=0,this.buffer=Buffer.allocUnsafe(fh)}append(e){let t=null;if(t=Buffer.isBuffer(e)?e:Buffer.from(e,"utf8"),this.buffer.length-this.index>=t.length)t.copy(this.buffer,this.index,0,t.length);else{const e=(Math.ceil((this.index+t.length)/fh)+1)*fh;0===this.index?(this.buffer=Buffer.allocUnsafe(e),t.copy(this.buffer,0,0,t.length)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),t],e)}this.index+=t.length}tryReadContentLength(){let e=-1,t=0;for(;t<this.index&&(this.buffer[t]===gh||this.buffer[t]===yh||this.buffer[t]===vh);)t++;if(this.index<t+mh)return e;t+=mh;const n=t;for(;t<this.index&&this.buffer[t]!==yh;)t++;if(t+3>=this.index||this.buffer[t+1]!==vh||this.buffer[t+2]!==yh||this.buffer[t+3]!==vh)return e;const r=this.buffer.toString("utf8",n,t);return e=parseInt(r),this.buffer=this.buffer.slice(t+4),this.index=this.index-(t+4),e}tryReadContent(e){if(this.index<e)return null;const t=this.buffer.toString("utf8",0,e);let n=e;for(;n<this.index&&(this.buffer[n]===yh||this.buffer[n]===vh);)n++;return this.buffer.copy(this.buffer,0,n),this.index=this.index-n,t}}var Sh,wh,Rh;!function(e){e[e.Off=0]="Off",e[e.Normal=1]="Normal",e[e.Terse=2]="Terse",e[e.RequestTime=3]="RequestTime",e[e.Verbose=4]="Verbose"}(Sh=Sh||(Sh={})),function(e){e.fromString=function(t){switch(t?.toLowerCase()){case"normal":return e.Normal;case"terse":return e.Terse;case"requestTime":return e.RequestTime;case"verbose":return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Normal:return"normal";case e.Terse:return"terse";case e.Verbose:return"verbose";case e.Off:default:return"off"}}}(Sh=Sh||(Sh={}));class _h{constructor(e,t,n,r){this._apiVersion=e,this._logDirectoryProvider=t,this._logger=n,this._tracer=r}spawn(e,t){const n="main",r=new ah,i=th.create(n,this._tracer),{args:o,tsServerLogFile:s}=this.getTsServerArgs("main",t,this._apiVersion,i.cancellationPipeName);this.isLoggingEnabled(t)&&(s?this._logger.logIgnoringVerbosity(bi.Info,`<${n}> Log file: ${s}`):this._logger.logIgnoringVerbosity(bi.Error,`<${n}> Could not create log directory`));const a=r.fork(e,o,"main",t);return this._logger.log("Starting tsserver"),new sh(n,this.kindToServerType(n),a,s,i,e,this._tracer)}kindToServerType(e){return"syntax"===e?Ml.Syntax:Ml.Semantic}getTsServerArgs(e,t,n,r){const i=[];let o;"syntax"===e&&(n.gte(Nl.v401)?i.push("--serverMode","partialSemantic"):i.push("--syntaxOnly")),n.gte(Nl.v250)?i.push("--useInferredProjectPerProjectRoot"):i.push("--useSingleInferredProject");const{disableAutomaticTypingAcquisition:s,globalPlugins:a,locale:c,npmLocation:u,pluginProbeLocations:l}=t;if((s||"syntax"===e||"diagnostics"===e)&&i.push("--disableAutomaticTypingAcquisition"),r&&i.push("--cancellationPipeName",`${r}*`),this.isLoggingEnabled(t)){const e=this._logDirectoryProvider.getNewLogDirectory();e&&(o=g.join(e,"tsserver.log"),i.push("--logVerbosity",Sh.toString(t.logVerbosity)),i.push("--logFile",o))}return a?.length&&i.push("--globalPlugins",a.join(",")),l?.length&&i.push("--pluginProbeLocations",l.join(",")),u&&(this._logger.info(`using npm from ${u}`),i.push("--npmLocation",`"${u}"`)),i.push("--locale",c||"en"),i.push("--validateDefaultNpmLocation"),{args:i,tsServerLogFile:o,tsServerTraceDirectory:undefined}}isLoggingEnabled(e){return e.logVerbosity!==Sh.Off}}!function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(wh=wh||(wh={})),function(e){e.fromString=function(t){switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose}}}(wh=wh||(wh={}));class Eh{constructor(e,t){this.logger=e,this.trace=t}traceRequest(e,t,n,r){if(this.trace===wh.Off)return;let i;this.trace===wh.Verbose&&t.arguments&&(i=`Arguments: ${JSON.stringify(t.arguments,null,4)}`),this.logTrace(e,`Sending request: ${t.command} (${t.seq}). Response expected: ${n?"yes":"no"}. Current queue length: ${r}`,i)}traceResponse(e,t,n){if(this.trace===wh.Off)return;let r;this.trace===wh.Verbose&&t.body&&(r=`Result: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Response received: ${t.command} (${t.request_seq}). Request took ${Date.now()-n.queuingStartTime} ms. Success: ${t.success} ${t.success?"":`. Message: ${t.message}`}`,r)}traceRequestCompleted(e,t,n,r){this.trace!==wh.Off&&this.logTrace(e,`Async response received: ${t} (${n}). Request took ${Date.now()-r.queuingStartTime} ms.`)}traceEvent(e,t){if(this.trace===wh.Off)return;let n;this.trace===wh.Verbose&&t.body&&(n=`Data: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Event received: ${t.event} (${t.seq}).`,n)}logTrace(e,t,n){this.trace!==wh.Off&&this.logger.trace("Trace",`<${e}> ${t}`,n)}}class Ch{constructor(e){this.lspClient=e}reset(){if(this._loadingProjectName&&(this._loadingProjectName=void 0,this._task)){const e=this._task;this._task=void 0,e.then((e=>e.done()))}}startedLoadingProject(e){this.reset(),this._loadingProjectName=e,this._task=this.lspClient.createProgressReporter(),this._task.then((e=>e.begin("Initializing JS/TS language features…")))}finishedLoadingProject(e){this._loadingProjectName===e&&this.reset()}}class Dh{constructor(e){this.options=e,this.primaryTsServer=null,this.apiVersion=e.typescriptVersion.version||Nl.defaultVersion,this.typescriptVersionSource=e.typescriptVersion.source,this.logger=new wi(e.logger,"[tsclient]"),this.tsserverLogger=new wi(e.logger,"[tsserver]"),this.loadingIndicator=new Ch(e.lspClient),this.tracer=new Eh(this.tsserverLogger,e.trace)}start(){const e=new _h(this.apiVersion,this.options.logDirectoryProvider,this.logger,this.tracer).spawn(this.options.typescriptVersion,this.options);return e.onExit((e=>{this.primaryTsServer=null,this.shutdown(),this.tsserverLogger.error(`Exited. Code: ${e.code}. Signal: ${e.signal}`),this.options.onExit&&this.options.onExit(e.code,e.signal)})),e.onStdErr((e=>{e&&this.logger.error(e)})),e.onError((e=>{e&&this.tsserverLogger.error("Exited with error. Error message is: {0}",e.message||e.name),this.serviceExited()})),e.onEvent((e=>this.dispatchEvent(e))),this.primaryTsServer=e,!0}serviceExited(){this.primaryTsServer=null,this.loadingIndicator.reset()}dispatchEvent(e){switch(e.event){case"syntaxDiag":case"semanticDiag":case"suggestionDiag":this.loadingIndicator.reset(),this.options.onEvent?.(e);break;case"projectLoadingStart":this.loadingIndicator.startedLoadingProject(e.body.projectName);break;case"projectLoadingFinish":this.loadingIndicator.finishedLoadingProject(e.body.projectName)}}shutdown(){this.loadingIndicator&&this.loadingIndicator.reset(),this.primaryTsServer&&this.primaryTsServer.kill()}notify(e,t){this.executeWithoutWaitingForResponse(e,t)}requestGeterr(e,t){return this.executeAsync(wl.Geterr,e,t)}request(e,t,n,r){return this.execute(e,t,n,r)}execute(e,t,n,r){let i;return i||(i=this.executeImpl(e,t,{isAsync:!1,token:n,expectsResult:!0,...r})),r?.nonRecoverable&&i[0].catch((t=>this.fatalError(e,t))),e===wl.UpdateOpen&&Promise.all(i).then((()=>{this.loadingIndicator.reset()})),i[0]}executeWithoutWaitingForResponse(e,t){this.executeImpl(e,t,{isAsync:!1,token:void 0,expectsResult:!1})}executeAsync(e,t,n){return this.executeImpl(e,t,{isAsync:!0,token:n,expectsResult:!0})[0]}executeImpl(e,t,n){return this.primaryTsServer?this.primaryTsServer.executeImpl(e,t,n):[Promise.resolve(Fl.NoServer)]}fatalError(e,t){this.tsserverLogger.error(`A non-recoverable error occurred while executing command: ${e}`),t instanceof Ll&&t.serverErrorText&&this.tsserverLogger.error(t.serverErrorText),this.primaryTsServer&&(this.logger.info("Killing TS Server"),this.primaryTsServer.kill(),t instanceof Ll&&(this.primaryTsServer=null))}}(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var c=n.length-a,u=s<c?s:c,l=-1,h=0;h<=u;++h){if(h===u){if(c>u){if(47===n.charCodeAt(a+h))return n.slice(a+h+1);if(0===h)return n.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?l=h:0===h&&(l=0));break}var d=e.charCodeAt(i+h);if(d!==n.charCodeAt(a+h))break;47===d&&(l=h)}var p="";for(h=i+l+1;h<=o;++h)h!==o&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(a+l):(a+=l,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){i=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(u===n.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=c))}return i===o?o=c:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(o=!1,i=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!o){r=a+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,u=!0,l=e.length-1,h=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===i?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=l+1;break}return-1===s||-1===c||0===h||1===h&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&o?e.slice(1,c):e.slice(a,c)):(0===a&&o?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{var e;if(n.r(r),n.d(r,{URI:()=>f,Utils:()=>C}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){var t=navigator.userAgent;e=t.indexOf("Windows")>=0}var i,o,s=(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=/^\w[\w\d+.-]*$/,c=/^\//,u=/^\/\//;function l(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(e.authority,'", path: "').concat(e.path,'", query: "').concat(e.query,'", fragment: "').concat(e.fragment,'"}'));if(e.scheme&&!a.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!c.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}var h="",d="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,f=function(){function t(e,t,n,r,i,o){void 0===o&&(o=!1),"object"==typeof e?(this.scheme=e.scheme||h,this.authority=e.authority||h,this.path=e.path||h,this.query=e.query||h,this.fragment=e.fragment||h):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||h,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==d&&(t=d+t):t=d}return t}(this.scheme,n||h),this.query=r||h,this.fragment=i||h,l(this,o))}return t.isUri=function(e){return e instanceof t||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString},Object.defineProperty(t.prototype,"fsPath",{get:function(){return S(this,!1)},enumerable:!1,configurable:!0}),t.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=h),void 0===n?n=this.authority:null===n&&(n=h),void 0===r?r=this.path:null===r&&(r=h),void 0===i?i=this.query:null===i&&(i=h),void 0===o?o=this.fragment:null===o&&(o=h),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new g(t,n,r,i,o)},t.parse=function(e,t){void 0===t&&(t=!1);var n=p.exec(e);return n?new g(n[2]||h,E(n[4]||h),E(n[5]||h),E(n[7]||h),E(n[9]||h),t):new g(h,h,h,h,h)},t.file=function(t){var n=h;if(e&&(t=t.replace(/\\/g,d)),t[0]===d&&t[1]===d){var r=t.indexOf(d,2);-1===r?(n=t.substring(2),t=d):(n=t.substring(2,r),t=t.substring(r)||d)}return new g("file",n,t,h,h)},t.from=function(e){var t=new g(e.scheme,e.authority,e.path,e.query,e.fragment);return l(t,!0),t},t.prototype.toString=function(e){return void 0===e&&(e=!1),w(this,e)},t.prototype.toJSON=function(){return this},t.revive=function(e){if(e){if(e instanceof t)return e;var n=new g(e);return n._formatted=e.external,n._fsPath=e._sep===m?e.fsPath:null,n}return e},t}(),m=e?1:void 0,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return s(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=S(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=m),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(f),y=((o={})[58]="%3A",o[47]="%2F",o[63]="%3F",o[35]="%23",o[91]="%5B",o[93]="%5D",o[64]="%40",o[33]="%21",o[36]="%24",o[38]="%26",o[39]="%27",o[40]="%28",o[41]="%29",o[42]="%2A",o[43]="%2B",o[44]="%2C",o[59]="%3B",o[61]="%3D",o[32]="%20",o);function v(e,t,n){for(var r=void 0,i=-1,o=0;o<e.length;o++){var s=e.charCodeAt(o);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s||n&&91===s||n&&93===s||n&&58===s)-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),void 0!==r&&(r+=e.charAt(o));else{void 0===r&&(r=e.substr(0,o));var a=y[s];void 0!==a?(-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),r+=a):-1===i&&(i=o)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function b(e){for(var t=void 0,n=0;n<e.length;n++){var r=e.charCodeAt(n);35===r||63===r?(void 0===t&&(t=e.substr(0,n)),t+=y[r]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function S(t,n){var r;return r=t.authority&&t.path.length>1&&"file"===t.scheme?"//".concat(t.authority).concat(t.path):47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function w(e,t){var n=t?b:v,r="",i=e.scheme,o=e.authority,s=e.path,a=e.query,c=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=d,r+=d),o){var u=o.indexOf("@");if(-1!==u){var l=o.substr(0,u);o=o.substr(u+1),-1===(u=l.lastIndexOf(":"))?r+=n(l,!1,!1):(r+=n(l.substr(0,u),!1,!1),r+=":",r+=n(l.substr(u+1),!1,!0)),r+="@"}-1===(u=(o=o.toLowerCase()).lastIndexOf(":"))?r+=n(o,!1,!0):(r+=n(o.substr(0,u),!1,!0),r+=o.substr(u))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(h=s.charCodeAt(1))>=65&&h<=90&&(s="/".concat(String.fromCharCode(h+32),":").concat(s.substr(3)));else if(s.length>=2&&58===s.charCodeAt(1)){var h;(h=s.charCodeAt(0))>=65&&h<=90&&(s="".concat(String.fromCharCode(h+32),":").concat(s.substr(2)))}r+=n(s,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),c&&(r+="#",r+=t?c:v(c,!1,!1)),r}function R(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+R(e.substr(3)):e}}var _=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(e){return e.match(_)?e.replace(_,(function(e){return R(e)})):e}var C,D=n(470),T=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},k=D.posix||D,x="/";!function(e){e.joinPath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.with({path:k.join.apply(k,T([e.path],t,!1))})},e.resolvePath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e.path,i=!1;r[0]!==x&&(r=x+r,i=!0);var o=k.resolve.apply(k,T([r],t,!1));return i&&o[0]===x&&!e.authority&&(o=o.substring(1)),e.with({path:o})},e.dirname=function(e){if(0===e.path.length||e.path===x)return e;var t=k.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return k.basename(e.path)},e.extname=function(e){return k.extname(e.path)}}(C||(C={}))})(),Rh=r})();const{URI:Th,Utils:kh}=Rh;var xh,Ph,Oh;!function(e){e.fromTextSpan=t=>e.fromLocations(t.start,t.end),e.toTextSpan=e=>({start:Ph.toLocation(e.start),end:Ph.toLocation(e.end)}),e.fromLocations=(e,t)=>Ee.Range.create(Math.max(0,e.line-1),Math.max(e.offset-1,0),Math.max(0,t.line-1),Math.max(0,t.offset-1)),e.toFileRangeRequestArgs=(e,t)=>({file:e,startLine:t.start.line+1,startOffset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1}),e.toFormattingRequestArgs=(e,t)=>({file:e,line:t.start.line+1,offset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1}),e.intersection=function(e,t){const n=Ph.Max(t.start,e.start),r=Ph.Min(t.end,e.end);if(!Ph.isAfter(n,r))return Ee.Range.create(n,r)}}(xh=xh||(xh={})),function(e){function t(e,t){return e.line<t.line||!(t.line<e.line)&&e.character<t.character}function n(e,t){return!r(e,t)}function r(e,t){return e.line<t.line||!(t.line<e.line)&&e.character<=t.character}e.fromLocation=e=>({line:Math.max(e.line-1,0),character:Math.max(e.offset-1,0)}),e.toLocation=e=>({line:e.line+1,offset:e.character+1}),e.toFileLocationRequestArgs=(e,t)=>({file:e,line:t.line+1,offset:t.character+1}),e.Min=function(...e){if(!e.length)return;let n=e.pop();for(const r of e)t(r,n)&&(n=r);return n},e.isBefore=t,e.Max=function(...e){if(!e.length)return;let t=e.pop();for(const r of e)n(r,t)&&(t=r);return t},e.isAfter=n,e.isBeforeOrEqual=r}(Ph=Ph||(Ph={})),function(e){e.fromTextSpan=(e,t)=>Ee.Location.create(e,xh.fromTextSpan(t))}(Oh=Oh||(Oh={}));const Nh=/\\/g;function qh(e){if(e.startsWith("zipfile:"))return e;const t=Th.parse(e);return"file"===t.scheme?Mh(t.fsPath):void 0}function Ih(e,t){if(e.startsWith("zipfile:"))return e;const n=Th.file(e),r=Ah(n.fsPath),i=t?.get(r);return i?i.uri:n.toString()}function Ah(e){return Mh(Th.file(e).fsPath)}function Mh(e){return e.replace(Nh,"/")}function Fh(e,t){const n=Ah(Th.file(e).fsPath),r=t?.get(n);return r?r.version:null}function Lh(e,t){return{uri:Ih(e.file,t),range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)}}}const jh={"enum member":ve.SymbolKind.Constant,"JSX attribute":ve.SymbolKind.Property,"local class":ve.SymbolKind.Class,"local function":ve.SymbolKind.Function,"local var":ve.SymbolKind.Variable,"type parameter":ve.SymbolKind.Variable,alias:ve.SymbolKind.Variable,class:ve.SymbolKind.Class,const:ve.SymbolKind.Constant,constructor:ve.SymbolKind.Constructor,enum:ve.SymbolKind.Enum,field:ve.SymbolKind.Field,file:ve.SymbolKind.File,function:ve.SymbolKind.Function,getter:ve.SymbolKind.Method,interface:ve.SymbolKind.Interface,let:ve.SymbolKind.Variable,method:ve.SymbolKind.Method,module:ve.SymbolKind.Module,parameter:ve.SymbolKind.Variable,property:ve.SymbolKind.Property,setter:ve.SymbolKind.Method,var:ve.SymbolKind.Variable};function $h(e){return jh[e]||ve.SymbolKind.Variable}function Hh(e){switch(e){case"error":default:return ve.DiagnosticSeverity.Error;case"warning":return ve.DiagnosticSeverity.Warning;case"suggestion":return ve.DiagnosticSeverity.Hint}}function Wh(e,t,n){const r={range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)},message:e.text,severity:Hh(e.category),code:e.code,source:e.source||"typescript",relatedInformation:Vh(e.relatedInformation,t)};return n.diagnosticsTagSupport&&(r.tags=function(e){const t=[];e.reportsUnnecessary&&t.push(ve.DiagnosticTag.Unnecessary);e.reportsDeprecated&&t.push(ve.DiagnosticTag.Deprecated);return t}(e)),r}function Vh(e,t){if(!e)return;const n=[];for(const r of e){const e=r.span;e&&n.push(ve.DiagnosticRelatedInformation.create(Lh(e,t),r.message))}return n}function Uh(e){return ve.SelectionRange.create(xh.fromTextSpan(e.textSpan),e.parent?Uh(e.parent):void 0)}function Kh(e){return{range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)},newText:e.newText}}function Gh(e,t){return{textDocument:{uri:Ih(e.fileName,t),version:Fh(e.fileName,t)},edits:e.textChanges.map((e=>Kh(e)))}}function zh(e){return e.highlightSpans.map((e=>({kind:Bh(e.kind),range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)}})))}function Bh(e){switch(e){case Rl.definition:return ve.DocumentHighlightKind.Write;case Rl.reference:case Rl.writtenReference:return ve.DocumentHighlightKind.Read;default:return ve.DocumentHighlightKind.Text}}class Jh{constructor(e,t,n,r){this.uri=e,this.publishDiagnostics=t,this.documents=n,this.features=r,this.diagnosticsPerKind=new Map,this.firePublishDiagnostics=Va((()=>{const e=this.getDiagnostics();this.publishDiagnostics({uri:this.uri,diagnostics:e})}),50)}update(e,t){this.diagnosticsPerKind.set(e,t),this.firePublishDiagnostics()}getDiagnostics(){const e=[];for(const t of this.diagnosticsPerKind.values())for(const n of t)e.push(Wh(n,this.documents,this.features));return e}}class Xh{constructor(e,t,n,r){this.publishDiagnostics=e,this.documents=t,this.features=n,this.logger=r,this.diagnostics=new Map,this.ignoredDiagnosticCodes=new Set}updateDiagnostics(e,t){if(!t.body)return void this.logger.error(`Received empty ${t.event} diagnostics.`);const{file:n}=t.body;let{diagnostics:r}=t.body;this.ignoredDiagnosticCodes.size&&(r=r.filter((e=>!this.isDiagnosticIgnored(e))));const i=Ih(n,this.documents),o=this.diagnostics.get(i)||new Jh(i,this.publishDiagnostics,this.documents,this.features);o.update(e,r),this.diagnostics.set(i,o)}updateIgnoredDiagnosticCodes(e){this.ignoredDiagnosticCodes=new Set(e)}getDiagnosticsForFile(e){const t=Ih(e,this.documents);return this.diagnostics.get(t)?.getDiagnostics()||[]}isDiagnosticIgnored(e){return void 0!==e.code&&this.ignoredDiagnosticCodes.has(e.code)}}var Yh,Qh=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Zh=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(t,n){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(e.isIncremental(o)){var s=nd(o.range),a=this.offsetAt(s.start),c=this.offsetAt(s.end);this._content=this._content.substring(0,a)+o.text+this._content.substring(c,this._content.length);var u=Math.max(s.start.line,0),l=Math.max(s.end.line,0),h=this._lineOffsets,d=td(o.text,!1,a);if(l-u===d.length)for(var p=0,f=d.length;p<f;p++)h[p+u+1]=d[p];else d.length<1e4?h.splice.apply(h,Qh([u+1,l-u],d,!1)):this._lineOffsets=h=h.slice(0,u+1).concat(d,h.slice(l+1));var m=o.text.length-(c-a);if(0!==m)for(p=u+1+d.length,f=h.length;p<f;p++)h[p]=h[p]+m}else{if(!e.isFull(o))throw new Error("Unknown change event received");this._content=o.text,this._lineOffsets=void 0}}this._version=n},e.prototype.getLineOffsets=function(){return void 0===this._lineOffsets&&(this._lineOffsets=td(this._content,!0)),this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return{line:0,character:e};for(;n<r;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return{line:o,character:e-t[o]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e.isIncremental=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},e.isFull=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},e}();function ed(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);ed(r,t),ed(i,t);for(var o=0,s=0,a=0;o<r.length&&s<i.length;){var c=t(r[o],i[s]);e[a++]=c<=0?r[o++]:i[s++]}for(;o<r.length;)e[a++]=r[o++];for(;s<i.length;)e[a++]=i[s++];return e}function td(e,t,n){void 0===n&&(n=0);for(var r=t?[n]:[],i=0;i<e.length;i++){var o=e.charCodeAt(i);13!==o&&10!==o||(13===o&&i+1<e.length&&10===e.charCodeAt(i+1)&&i++,r.push(n+i+1))}return r}function nd(e){var t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function rd(e){var t=nd(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new Zh(e,t,n,r)},e.update=function(e,t,n){if(e instanceof Zh)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){for(var n=e.getText(),r=ed(t.map(rd),(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),i=0,o=[],s=0,a=r;s<a.length;s++){var c=a[s],u=e.offsetAt(c.range.start);if(u<i)throw new Error("Overlapping edit");u>i&&o.push(n.substring(i,u)),c.newText.length&&o.push(c.newText),i=e.offsetAt(c.range.end)}return o.push(n.substr(i)),o.join("")}}(Yh||(Yh={}));class id{constructor(e){const{uri:t,languageId:n,version:r,text:i}=e;this.document=Yh.create(t,n,r,i)}get uri(){return this.document.uri}get languageId(){return this.document.languageId}get version(){return this.document.version}getText(e){return this.document.getText(e)}positionAt(e){return this.document.positionAt(e)}offsetAt(e){return this.document.offsetAt(e)}get lineCount(){return this.document.lineCount}getLine(e){const t=this.getLineRange(e);return this.getText(t)}getLineRange(e){const t=this.getLineStart(e),n=this.getLineEnd(e);return ve.Range.create(t,n)}getLineEnd(e){const t=this.getLineOffset(e+1);return this.positionAt(t-1)}getLineOffset(e){const t=this.getLineStart(e);return this.offsetAt(t)}getLineStart(e){return ve.Position.create(e,0)}applyEdit(e,t){const n=this.getText();let r=t.text;if(ve.TextDocumentContentChangeEvent.isIncremental(t)){const e=this.offsetAt(t.range.start),i=this.offsetAt(t.range.end);r=n.substr(0,e)+t.text+n.substr(i)}this.document=Yh.create(this.uri,this.languageId,e,r)}}class od{constructor(){this._files=[],this.documents=new Map}get files(){return this._files}get(e){const t=this.documents.get(e);if(t)return this.files[0]!==e&&(this._files.splice(this._files.indexOf(e),1),this._files.unshift(e)),t}open(e,t){return!this.documents.has(e)&&(this.documents.set(e,new id(t)),this._files.unshift(e),!0)}close(e){const t=this.documents.get(e);if(t)return this.documents.delete(e),this._files.splice(this._files.indexOf(e),1),t}toResource(e){const t=this.documents.get(e);return t?Th.parse(t.uri):Th.file(e)}}class sd{static async execute(e,t,n,r,i,o,s){if(r.apiVersion.lt(sd.minVersion))return void i.showErrorMessage("Go to Source Definition failed. Requires TypeScript 4.7+.");if(!t||"number"!=typeof t.character||"number"!=typeof t.line)return void i.showErrorMessage("Go to Source Definition failed. Invalid position.");let a;if(!e||"string"!=typeof e||!(a=qh(e)))return void i.showErrorMessage("Go to Source Definition failed. No resource provided.");if(!n.get(a))return void i.showErrorMessage("Go to Source Definition failed. File not opened in the editor.");const c=Ph.toFileLocationRequestArgs(a,t);return await i.withProgress({message:"Finding source definitions…",reporter:o},(async()=>{const e=await r.request(wl.FindSourceDefinition,c,s);if("response"===e.type&&e.body)return e.body.map((e=>Lh(e,n)));i.showErrorMessage("No source definitions found.")}))}}sd.id="_typescript.goToSourceDefinition",sd.minVersion=Nl.v470;const ad={APPLY_WORKSPACE_EDIT:"_typescript.applyWorkspaceEdit",APPLY_CODE_ACTION:"_typescript.applyCodeAction",APPLY_REFACTORING:"_typescript.applyRefactoring",CONFIGURE_PLUGIN:"_typescript.configurePlugin",ORGANIZE_IMPORTS:"_typescript.organizeImports",APPLY_RENAME_FILE:"_typescript.applyRenameFile",APPLY_COMPLETION_CODE_ACTION:"_typescript.applyCompletionCodeAction",SELECT_REFACTORING:"_typescript.selectRefactoring",SOURCE_DEFINITION:sd.id},cd=new ve.NotificationType("$/typescriptVersion");class ud{constructor(e=""){this.value=e}appendText(e,t=0){var n;return this.value+=(n=e,n.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}toMarkupContent(){return{kind:"markdown",value:this.value}}}function ld(e){return function(e){return e.replace(/\{@(link|linkplain|linkcode) (https?:\/\/[^ |}]+?)(?:[| ]([^{}\n]+?))?\}/gi,((e,t,n,r)=>"linkcode"===t?`[\`${r?r.trim():n}\`](${n})`:`[${r?r.trim():n}](${n})`))}(e)}function hd(e,t){switch(e.name){case"augments":case"extends":case"param":case"template":{const n=pd(e.text,t).split(/^(\S+)\s*-?\s*/);if(3===n?.length){const t=n[1],r=n[2],i=`*@${e.name}* \`${t}\``;return r?i+(r.match(/\r\n|\n/g)?" \n"+ld(r):` — ${ld(r)}`):i}}}const n=`*@${e.name}*`,r=function(e,t){if(!e.text)return;function n(e){return/^\s*[~`]{3}/m.test(e)?e:"```\n"+e+"\n```"}const r=pd(e.text,t);switch(e.name){case"example":{const e=r.match(/<caption>(.*?)<\/caption>\s*(\r\n|\n)/);return e&&0===e.index?e[1]+"\n"+n(r.substring(e[0].length)):n(r)}case"author":{const e=r.match(/(.+)\s<([-.\w]+@[-.\w]+)>/);return null===e?r:`${e[1]} ${e[2]}`}case"default":return n(r)}return ld(r)}(e,t);return r?n+(r.match(/\r\n|\n/g)?" \n"+r:` — ${r}`):n}function dd(e,t){return ld(pd(e,t))}function pd(e,t){if(!e)return"";if("string"==typeof e)return e;const n=[];let r;for(const i of e)switch(i.kind){case"link":if(r){if(r.target){const e=t.toResource(r.target.file).with({fragment:`L${r.target.start.line},${r.target.start.offset}`}),i=r.text?r.text:gd(r.name??"");n.push(`[${r.linkcode?"`"+i+"`":i}](${e.toString()})`)}else{const e=r.text??r.name;if(e)if(/^https?:/.test(e)){const t=e.split(" ");if(1===t.length)n.push(t[0]);else if(t.length>1){const e=gd(t.slice(1).join(" "));n.push(`[${r.linkcode?"`"+e+"`":e}](${t[0]})`)}}else n.push(gd(e))}r=void 0}else r={linkcode:"{@linkcode "===i.text};break;case"linkName":r&&(r.name=i.text,r.target=i.target);break;case"linkText":r&&(r.text=i.text);break;default:n.push(i.text)}return ld(n.join(""))}function fd(e,t,n){const r=new ud;return md(r,e,t,n),r.value?r.toMarkupContent():void 0}function md(e,t,n,r){if(t&&e.appendMarkdown(dd(t,r)),n){const t=function(e,t){return e.map((e=>hd(e,t))).join(" \n\n")}(n,r);t&&e.appendMarkdown("\n\n"+t)}return e}function gd(e){return e.replace(/`/g,"\\$&")}class yd{static isSnippetString(e){return e instanceof yd||!!e&&"string"==typeof e.value}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=yd._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,t=this._tabstop++){if("function"==typeof e){const t=new yd;t._tabstop=this._tabstop,e(t),this._tabstop=t._tabstop,e=t.value}else e=yd._escape(e);return this.value+="${",this.value+=t,this.value+=":",this.value+=e,this.value+="}",this}appendVariable(e,t){if("function"==typeof t){const e=new yd;e._tabstop=this._tabstop,t(e),this._tabstop=e._tabstop,t=e.value}else"string"==typeof t&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}}function vd(e,t,n,r,i,o,s,a){const c={label:e.name,...a.completionLabelDetails?{labelDetails:e.labelDetails}:{},kind:Sd(e.kind),sortText:e.sortText,commitCharacters:wd(e.kind),preselect:e.isRecommended,data:{file:n,line:r.line+1,offset:r.character+1,entryNames:[e.source||e.data?{name:e.name,source:e.source,data:e.data}:e.name]}};e.source&&e.hasAction&&(c.sortText=`${e.sortText}`);const{isSnippet:u,replacementSpan:l,sourceDisplay:h}=e;if(u&&!a.completionSnippets)return null;a.completionSnippets&&(u||_d(c.kind,s))&&(c.insertTextFormat=ve.InsertTextFormat.Snippet),h&&(c.detail=dd(h,o));let{insertText:d}=e;if(e.kindModifiers){const t=new Set(e.kindModifiers.split(/,|\s+/g));if(t.has(ql.optional)&&(d||(d=c.label),c.filterText||(c.filterText=c.label),c.label+="?"),t.has(ql.deprecated)&&(c.tags=[ve.CompletionItemTag.Deprecated]),e.kind===Tl.scriptElement)for(const n of ql.fileExtensionKindModifiers)if(t.has(n)){e.name.toLowerCase().endsWith(n)?c.detail=e.name:c.detail=e.name+n;break}}const p=function(e,t,n,r,i){if(e)return{replace:bd(xh.fromTextSpan(e),r)};if(i.completionInsertReplaceSupport&&t){const e=bd(xh.fromTextSpan(t),r);return{insert:ve.Range.create(e.start,n),replace:bd(e,r)}}}(l,t,r,i,a);return p?c.textEdit=p.insert?ve.InsertReplaceEdit.create(d||c.label,p.insert,p.replace):ve.TextEdit.replace(p.replace,d||c.label):c.insertText=d,c}function bd(e,t){return e.start.line!==e.end.line?ve.Range.create(e.start,t.getLineEnd(e.start.line)):e}function Sd(e){switch(e){case Tl.primitiveType:case Tl.keyword:return ve.CompletionItemKind.Keyword;case Tl.constElement:return ve.CompletionItemKind.Constant;case Tl.letElement:case Tl.variableElement:case Tl.localVariableElement:case Tl.alias:return ve.CompletionItemKind.Variable;case Tl.memberVariableElement:case Tl.memberGetAccessorElement:case Tl.memberSetAccessorElement:return ve.CompletionItemKind.Field;case Tl.functionElement:return ve.CompletionItemKind.Function;case Tl.memberFunctionElement:case Tl.constructSignatureElement:case Tl.callSignatureElement:case Tl.indexSignatureElement:return ve.CompletionItemKind.Method;case Tl.enumElement:return ve.CompletionItemKind.Enum;case Tl.moduleElement:case Tl.externalModuleName:return ve.CompletionItemKind.Module;case Tl.classElement:case Tl.typeElement:return ve.CompletionItemKind.Class;case Tl.interfaceElement:return ve.CompletionItemKind.Interface;case Tl.warning:case Tl.scriptElement:return ve.CompletionItemKind.File;case Tl.directory:return ve.CompletionItemKind.Folder;case Tl.string:return ve.CompletionItemKind.Constant}return ve.CompletionItemKind.Property}function wd(e){const t=[];switch(e){case Tl.memberGetAccessorElement:case Tl.memberSetAccessorElement:case Tl.constructSignatureElement:case Tl.callSignatureElement:case Tl.indexSignatureElement:case Tl.enumElement:case Tl.interfaceElement:t.push(".");break;case Tl.moduleElement:case Tl.alias:case Tl.constElement:case Tl.letElement:case Tl.variableElement:case Tl.localVariableElement:case Tl.memberVariableElement:case Tl.classElement:case Tl.functionElement:case Tl.memberFunctionElement:t.push(".",","),t.push("(")}return 0===t.length?void 0:t}async function Rd(e,t,n,r,i,o,s){e.detail=function({displayParts:e,sourceDisplay:t,source:n},r){const i=[],o=t||n;o&&i.push(`Auto import from '${dd(o,r)}'`);const s=dd(e,r);s&&i.push(s);return i.join("\n")}(t,i);const{documentation:a,tags:c}=t;e.documentation=fd(a,c,i);const u=Ah(e.data.file);if(t.codeActions?.length&&(e.additionalTextEdits=function(e,t){const n=[];for(const r of e)if(r.changes)for(const e of r.changes)if(e.fileName===t)for(const t of e.textChanges)n.push(Kh(t));return n.length?n:void 0}(t.codeActions,u),e.command=function(e,t){let n=!1;for(const r of e){if(r.commands){n=!0;break}if(r.changes)for(const e of r.changes)if(e.fileName!==t){n=!0;break}}if(n)return{title:"",command:ad.APPLY_COMPLETION_CODE_ACTION,arguments:[t,e.map((e=>({commands:e.commands,description:e.description,changes:e.changes.filter((e=>e.fileName!==t))})))]}}(t.codeActions,e.data.file)),n&&s.completionSnippets&&_d(e.kind,o)){const{line:i,offset:o}=e.data,s=Ph.fromLocation({line:i,offset:o}),a=await async function(e,t,n,r){try{const r=Ph.toFileLocationRequestArgs(e,t),i=await n.request(wl.Quickinfo,r);if("response"===i.type&&i.body)switch(i.body.kind){case"var":case"let":case"const":case"alias":return!1}}catch{}const i=r.getLine(t.line).slice(t.character);return null===i.match(/^[a-z_$0-9]*\s*\(/gi)}(u,s,r,n);a&&function(e,t){const{displayParts:n}=t,r=function(e){const t=[];let n=!1,r=!1,i=0,o=0;e:for(let s=0;s<e.length;++s){const a=e[s];switch(Al(a.kind)){case Pl.methodName:case Pl.functionName:case Pl.text:case Pl.propertyName:0===i&&0===o&&(n=!0);break;case Pl.parameterName:if(1===i&&0===o&&n){const n=e[s+1],i=n&&"?"===n.text,o="this"===a.text;i||o||t.push(a),r=r||i}break;case Pl.punctuation:if("("===a.text)++i;else if(")"===a.text){if(--i,i<=0&&n)break e}else{if("..."===a.text&&1===i){r=!0;break e}"{"===a.text?++o:"}"===a.text&&--o}}}return{hasOptionalParameters:r,parts:t}}(n),i=new yd;i.appendText(`${e.insertText||e.label}(`),function(e,t,n){for(let r=0;r<t.length;++r){const i=t[r];e.appendPlaceholder(i.text),r!==t.length-1&&e.appendText(n)}}(i,r.parts,", "),r.hasOptionalParameters&&i.appendTabstop();i.appendText(")"),i.appendTabstop(0),e.insertText=i.value,e.insertTextFormat=ve.InsertTextFormat.Snippet,e.textEdit&&(e.textEdit.newText=i.value)}(e,t)}return e}function _d(e,t){return!0===t.completeFunctionCalls&&(e===ve.CompletionItemKind.Function||e===ve.CompletionItemKind.Method)}function Ed(e){switch(e){case"@":case"#":case" ":case".":case'"':case"'":case"`":case"/":case"<":return e;default:return}}function Cd(e,t,n){const r=e.items.map((e=>function(e,t){const n=e.parameters.map((e=>function(e,t){const{displayParts:n,documentation:r}=e;return{label:dd(n,t),documentation:fd(r,void 0,t)}}(e,t))),r={label:dd(e.prefixDisplayParts,t),documentation:fd(e.documentation,e.tags.filter((e=>"param"!==e.name)),t),parameters:n};return r.label+=n.map((e=>e.label)).join(dd(e.separatorDisplayParts,t)),r.label+=dd(e.suffixDisplayParts,t),r}(e,n)));return{activeSignature:Dd(e,r,t),activeParameter:Td(e),signatures:r}}function Dd(e,t,n){if(void 0!==n?.activeSignatureHelp?.activeSignature){const e=n.activeSignatureHelp.signatures[n.activeSignatureHelp.activeSignature];if(e&&n.isRetrigger){const n=t.findIndex((t=>t.label===e.label));if(-1!==n)return n}}return e.selectedItemIndex}function Td(e){const t=e.items[e.selectedItemIndex];return t?.isVariadic?Math.min(e.argumentIndex,t.parameters.length-1):e.argumentIndex}function kd(e){switch(e.triggerKind){case ve.SignatureHelpTriggerKind.TriggerCharacter:return e.triggerCharacter?e.isRetrigger?{kind:"retrigger",triggerCharacter:e.triggerCharacter}:{kind:"characterTyped",triggerCharacter:e.triggerCharacter}:{kind:"invoked"};case ve.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case ve.SignatureHelpTriggerKind.Invoked:default:return{kind:"invoked"}}}function xd(e,t){return ve.CodeAction.create(e.description,ve.Command.create(e.description,ad.SELECT_REFACTORING,e,t),ve.CodeActionKind.Refactor)}function Pd(e,t,n){const r=ve.CodeAction.create(e.description,function(e){if(e.name.startsWith("function_"))return`${ve.CodeActionKind.RefactorExtract}.function`;if(e.name.startsWith("constant_"))return`${ve.CodeActionKind.RefactorExtract}.constant`;if(e.name.startsWith("Move"))return`${ve.CodeActionKind.Refactor}.move`;return ve.CodeActionKind.Refactor}(t));return e.notApplicableReason?r.disabled={reason:e.notApplicableReason}:r.command=ve.Command.create(e.description,ad.APPLY_REFACTORING,{...n,refactor:t.name,action:e.name}),r}class Od{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||e.value.startsWith(this.value+Od.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Od(this.value+Od.sep+e)}}function Nd(e,t){return qd(e,t,{start:xh.fromTextSpan(e.spans[0]).start,end:xh.fromTextSpan(e.spans[e.spans.length-1]).end})}function qd(e,t,n){let r=Ad(e);for(const i of e.spans){const o=xh.fromTextSpan(i);if(!xh.intersection(n,o))continue;const s=[];if(e.childItems)for(const t of e.childItems)if(t.spans.some((e=>!!xh.intersection(o,xh.fromTextSpan(e))))){const e=qd(t,s,o);r=r||e}let a=o;if(e.nameSpan){const t=xh.fromTextSpan(e.nameSpan);xh.intersection(o,t)&&(a=t)}r&&t.push({name:e.text,detail:"",kind:$h(e.kind),range:o,selectionRange:a,children:s})}return r}function Id(e,t,n,r){let i=Ad(t);const o=t.text;for(const s of t.spans){const a=xh.fromTextSpan(s),c=[];if(t.childItems)for(const n of t.childItems)if(n.spans.some((e=>!!xh.intersection(a,xh.fromTextSpan(e))))){const t=Id(e,n,c,o);i=i||t}i&&(n.push({name:o,kind:$h(t.kind),location:{uri:e,range:a},containerName:r}),n.push(...c))}return i}function Ad(e){return e.kind!==Tl.alias&&!(!e.text||"<function>"===e.text||"<class>"===e.text)}function Md(e,t,n){const r=function(e){return e.kind===Tl.scriptElement||e.kind===Tl.moduleElement&&1===e.selectionSpan.start.line&&1===e.selectionSpan.start.offset}(e),i=r?g.basename(e.file):e.name,o=r?n?g.relative(n,g.dirname(e.file)):g.dirname(e.file):e.containerName??"",s={kind:Fd(e.kind),name:i,detail:o,uri:Ih(e.file,t),range:xh.fromTextSpan(e.span),selectionRange:xh.fromTextSpan(e.selectionSpan)};return(e.kindModifiers?function(e){return new Set(e.split(/,|\s+/g))}(e.kindModifiers):void 0)?.has(kl.deprecatedModifier)&&(s.tags=[ve.SymbolTag.Deprecated]),s}function Fd(e){switch(e){case Tl.moduleElement:return ve.SymbolKind.Module;case Tl.classElement:return ve.SymbolKind.Class;case Tl.enumElement:return ve.SymbolKind.Enum;case Tl.enumMemberElement:return ve.SymbolKind.EnumMember;case Tl.interfaceElement:return ve.SymbolKind.Interface;case Tl.indexSignatureElement:case Tl.callSignatureElement:case Tl.memberFunctionElement:return ve.SymbolKind.Method;case Tl.memberVariableElement:case Tl.memberGetAccessorElement:case Tl.memberSetAccessorElement:return ve.SymbolKind.Property;case Tl.variableElement:case Tl.letElement:case Tl.constElement:case Tl.localVariableElement:case Tl.alias:return ve.SymbolKind.Variable;case Tl.functionElement:case Tl.localFunctionElement:return ve.SymbolKind.Function;case Tl.constructSignatureElement:case Tl.constructorImplementationElement:return ve.SymbolKind.Constructor;case Tl.typeParameterElement:return ve.SymbolKind.TypeParameter;case Tl.string:return ve.SymbolKind.String;default:return ve.SymbolKind.Variable}}Od.sep=".",Od.Empty=new Od(ve.CodeActionKind.Empty),Od.QuickFix=new Od(ve.CodeActionKind.QuickFix),Od.Refactor=new Od(ve.CodeActionKind.Refactor),Od.Source=new Od(ve.CodeActionKind.Source),Od.SourceAddMissingImportsTs=Od.Source.append("addMissingImports").append("ts"),Od.SourceRemoveUnusedTs=Od.Source.append("removeUnused").append("ts"),Od.SourceOrganizeImports=new Od(ve.CodeActionKind.SourceOrganizeImports),Od.SourceOrganizeImportsTs=Od.SourceOrganizeImports.append("ts"),Od.SourceFixAll=new Od(ve.CodeActionKind.SourceFixAll),Od.SourceFixAllTs=Od.SourceFixAll.append("ts");const Ld=new Set([6196,6133]),jd=new Set([7027]),$d=new Set([2420]),Hd=new Set([2552,2304]),Wd=new Set([1308]);async function Vd(e,t,n,r,i){const o=[];for(const s of i)for(const{codes:i,fixName:a}of e){if(!i.has(s.code))continue;const e={...xh.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(wl.GetCodeFixes,e);if("response"!==c.type||!c.body?.length)continue;const u=c.body?.find((e=>e.fixName===a));if(!u)continue;if(!u.fixId)return o.push(...u.changes.map((e=>Gh(e,r)))),o;const l={scope:{type:"file",args:{file:n}},fixId:u.fixId},h=await t.request(wl.GetCombinedCodeFix,l);return"response"===h.type&&h.body?(o.push(...h.body.changes.map((e=>Gh(e,r)))),o):o}return o}class Ud{}class Kd extends Ud{constructor(){super(...arguments),this.title="Fix all"}async build(e,t,n,r){const i=[];return i.push(...await async function(e,t,n,r,i){const o=[];for(const s of i)for(const{codes:i,fixName:a}of e){if(!i.has(s.code))continue;const e={...xh.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(wl.GetCodeFixes,e);if("response"!==c.type)continue;const u=c.body?.find((e=>e.fixName===a));if(u){o.push(...u.changes.map((e=>Gh(e,r))));break}}return o}([{codes:$d,fixName:"fixClassIncorrectlyImplementsInterface"},{codes:Wd,fixName:"fixAwaitInSyncFunction"}],e,t,n,r)),i.push(...await Vd([{codes:jd,fixName:"fixUnreachableCode"}],e,t,n,r)),i.length?ve.CodeAction.create(this.title,{documentChanges:i},Kd.kind.value):null}}Kd.kind=Od.SourceFixAllTs;class Gd extends Ud{constructor(){super(...arguments),this.title="Remove all unused code"}async build(e,t,n,r){const i=await Vd([{codes:Ld,fixName:"unusedIdentifier"}],e,t,n,r);return i.length?ve.CodeAction.create(this.title,{documentChanges:i},Gd.kind.value):null}}Gd.kind=Od.SourceRemoveUnusedTs;class zd extends Ud{constructor(){super(...arguments),this.title="Add all missing imports"}async build(e,t,n,r){const i=await Vd([{codes:Hd,fixName:"import"}],e,t,n,r);return i.length?ve.CodeAction.create(this.title,{documentChanges:i},zd.kind.value):null}}zd.kind=Od.SourceAddMissingImportsTs;class Bd{static get kinds(){return Bd.kindProviders.map((e=>e.kind))}constructor(e){this.client=e}async provideCodeActions(e,t,n,r){const i=[];for(const o of Bd.kindProviders)e.some((e=>e.contains(o.kind)))&&i.push((new o).build(this.client,t,r,n));return(await Promise.all(i)).flatMap((e=>e||[]))}}Bd.kindProviders=[Kd,Gd,zd];class Jd{static async provideInlayHints(e,t,n,r,i,o,s){if(r.apiVersion.lt(Jd.minVersion))return i.showErrorMessage("Inlay Hints request failed. Requires TypeScript 4.4+."),[];const a=qh(e);if(!a)return i.showErrorMessage("Inlay Hints request failed. No resource provided."),[];const c=n.get(a);if(!c)return i.showErrorMessage("Inlay Hints request failed. File not opened in the editor."),[];if(!function(e,t){const n=e.getPreferences(t);return"literals"===n.includeInlayParameterNameHints||"all"===n.includeInlayParameterNameHints||n.includeInlayEnumMemberValueHints||n.includeInlayFunctionLikeReturnTypeHints||n.includeInlayFunctionParameterTypeHints||n.includeInlayPropertyDeclarationTypeHints||n.includeInlayVariableTypeHints}(o,a))return[];await o.configureGloballyFromDocument(a);const u=c.offsetAt(t.start),l=c.offsetAt(t.end)-u,h=await r.request(wl.ProvideInlayHints,{file:a,start:u,length:l},s);return"response"===h.type&&h.success&&h.body?h.body.map((e=>{const t=ve.InlayHint.create(Ph.fromLocation(e.position),e.text,function(e){switch(e){case"Parameter":return ve.InlayHintKind.Parameter;case"Type":return ve.InlayHintKind.Type;default:return}}(e.kind));return e.whitespaceBefore&&(t.paddingLeft=!0),e.whitespaceAfter&&(t.paddingRight=!0),t})):[]}}var Xd,Yd,Qd,Zd,ep,tp;function np(e,t){const n=[];let r=0,i=0;for(let o=0;o<t.length;o+=3){const s=t[o],a=t[o+1],c=t[o+2],u=c&Xd.modifierMask,l=(c>>Xd.typeOffset)-1,{line:h,character:d}=e.positionAt(s),p=h-r,f=r===h?d-i:d;n.push(p,f,a,l,u),i=d,r=h}return n}Jd.minVersion=Nl.v440,function(e){e[e.typeOffset=8]="typeOffset",e[e.modifierMask=255]="modifierMask"}(Xd||(Xd={}));class rp{constructor(e){this.rootPath=e}getNewLogDirectory(){const t=this.logDirectory();if(t)try{return e.mkdtempSync(g.join(t,"tsserver-log-"))}catch(e){return}}logDirectory(){if(this.rootPath)try{return e.existsSync(this.rootPath)||e.mkdirSync(this.rootPath),this.rootPath}catch{return}}}tp="win32"===process.platform||T.TESTING_WINDOWS?function(){if(Qd)return Yd;Qd=1,Yd=n,n.sync=function(n,r){return t(e.statSync(n),n,r)};var e=a;function t(e,t,n){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var n=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}(t,n)}function n(n,r,i){e.stat(n,(function(e,o){i(e,!e&&t(o,n,r))}))}return Yd}():function(){if(ep)return Zd;ep=1,Zd=t,t.sync=function(t,r){return n(e.statSync(t),r)};var e=a;function t(t,r,i){e.stat(t,(function(e,t){i(e,!e&&n(t,r))}))}function n(e,t){return e.isFile()&&function(e,t){var n=e.mode,r=e.uid,i=e.gid,o=void 0!==t.uid?t.uid:process.getuid&&process.getuid(),s=void 0!==t.gid?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8);return n&parseInt("001",8)||n&c&&i===s||n&a&&r===o||n&(a|c)&&0===o}(e,t)}return Zd}();var ip=op;function op(e,t,n){if("function"==typeof t&&(n=t,t={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,r){op(e,t||{},(function(e,t){e?r(e):n(t)}))}))}tp(e,t||{},(function(e,r){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)}))}op.sync=function(e,t){try{return tp.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}};const sp=ip,{join:ap,delimiter:cp,sep:up,posix:lp}=s,hp="win32"===process.platform,dp=new RegExp(`[${lp.sep}${up===lp.sep?"":up}]`.replace(/(\\)/g,"\\$1")),pp=new RegExp(`^\\.${dp.source}`),fp=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),mp=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=cp})=>{const i=e.match(dp)?[""]:[...hp?[process.cwd()]:[],...(t||"").split(r)];if(hp){const t=n||[".EXE",".CMD",".BAT",".COM"].join(r),o=t.split(r);return e.includes(".")&&""!==o[0]&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:t}}return{pathEnv:i,pathExt:[""]}},gp=(e,t)=>{const n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&pp.test(t)?t.slice(0,2):"")+ap(n,t)},yp=async(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=mp(e,t),o=[];for(const s of n){const n=gp(s,e);for(const e of r){const r=n+e;if(await sp(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;o.push(r)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw fp(e)};var vp=yp;yp.sync=(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=mp(e,t),o=[];for(const s of n){const n=gp(s,e);for(const e of r){const r=n+e;if(sp.sync(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;o.push(r)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw fp(e)};const bp={directory:"isDirectory",file:"isFile"};const Sp=(e,t)=>t[bp[e]]();function wp(t,{cwd:n=D.cwd(),type:r="file",allowSymlinks:i=!0}={}){var o;!function(e){if(!Object.hasOwnProperty.call(bp,e))throw new Error(`Invalid type specified: ${e}`)}(r),n=(o=n)instanceof URL?C(o):o;const s=i?e.statSync:e.lstatSync;for(const e of t)try{const t=s(g.resolve(n,e));if(Sp(r,t))return e}catch{}}const Rp=Symbol("findUpStop");function _p(e,t={}){let n=g.resolve(((r=t.cwd)instanceof URL?C(r):r)||"");var r;const{root:i}=g.parse(n),o=t.stopAt||i,s=t.limit||Number.POSITIVE_INFINITY,a=[e].flat(),c=t=>{if("function"!=typeof e)return wp(a,t);const n=e(t.cwd);return"string"==typeof n?wp([n],t):n},u=[];for(;;){const e=c({...t,cwd:n});if(e===Rp)break;if(e&&u.push(g.resolve(n,e)),n===o||u.length>=s)break;n=g.dirname(n)}return u}function Ep({cwd:e}={}){return function(e,t={}){return _p(e,{...t,limit:1})[0]}("package.json",{cwd:e})}function Cp(e,r){if(t(e).isDirectory()){const t=r.map((t=>y(e,t))).find(n);if(t)return t}const i=y(e,"..");if(i!==e)return Cp(i,r)}class Dp{constructor(e,t,n){this.source=e,this.path=t,this.logger=n,this._api=null}get tsServerPath(){return this.path}get isValid(){return null!==this.version}get version(){return this._api||(this._api=this.getTypeScriptVersion(this.tsServerPath)),this._api}get versionString(){const e=this.version;return e?e.displayName:null}getTypeScriptVersion(t){if(this.logger.log(`Resolving TypeScript version from path "${t}"...`),!e.existsSync(t))return this.logger.log("Server path does not exist on disk"),null;const n=t.split(g.sep);if(n.length<=2)return this.logger.log("Server path is invalid (has less than two path components)."),null;const r=n.slice(0,-2).join(g.sep);let i=g.join(r,"package.json");if(e.existsSync(i)||"built"===g.basename(r)&&(i=g.join(r,"..","package.json")),!e.existsSync(i))return this.logger.log(`Failed to find package.json at path "${i}"`),null;this.logger.log(`Reading version from package.json at "${i}"`);const o=e.readFileSync(i).toString();let s=null;try{s=JSON.parse(o)}catch(e){return this.logger.log("Failed parsing contents of package.json."),null}return s?.version?(this.logger.log(`Resolved TypeScript version to "${s.version}"`),Nl.fromVersionString(s.version)):(this.logger.log("Failed reading version number from package.json."),null)}}const Tp=["node_modules/typescript/lib",".vscode/pnpify/typescript/lib",".yarn/sdks/typescript/lib"];class kp{constructor(e,t){this.userTsserverPath=e,this.logger=t}getUserSettingVersion(){if(!this.userTsserverPath)return null;this.logger.log(`Resolving user-provided tsserver path "${this.userTsserverPath}"...`);let t=this.userTsserverPath;if(!g.isAbsolute(t)){const e=vp.sync(t,{nothrow:!0});e&&(t=e),this.logger.log(`Non-absolute tsserver path resolved to "${e?t:"<failed>"}"`)}let n=e.lstatSync(t,{throwIfNoEntry:!1});if(n?.isSymbolicLink()&&(t=e.realpathSync(t),this.logger.log(`Symbolic link tsserver path resolved to "${t}"`)),n=e.lstatSync(t,{throwIfNoEntry:!1}),n?.isFile()){if("tsserver.js"===g.basename(t))return this.logger.log(`Resolved tsserver location: ${t}`),new Dp("user-setting",t,this.logger);t=g.dirname(t),this.logger.log(`Resolved directory path from a file path: ${t}`)}try{const e=Ep({cwd:t});this.logger.log(`Resolved package.json location: "${e}"`),e&&(t=g.join(g.dirname(e),"lib","tsserver.js"),this.logger.log(`Resolved tsserver location: "${t}"`))}catch{}return new Dp("user-setting",t,this.logger)}getWorkspaceVersion(e){for(const t of e){const e=Cp(t,Tp);if(e){const t=g.join(e,"tsserver.js"),n=new Dp("workspace",t,this.logger);if(n.isValid)return n}}return null}bundledVersion(){const e=E(import.meta.url);try{const t=e.resolve("typescript"),n=g.join(g.dirname(t),"tsserver.js");return new Dp("bundled",n,this.logger)}catch(e){return null}}}const xp=Object.freeze({module:El.ESNext,moduleResolution:Cl.Node,target:xl.ES2020,jsx:_l.React});function Pp(e){const t={...xp};return e.checkJs&&(t.checkJs=!0),e.experimentalDecorators&&(t.experimentalDecorators=!0),e.strictNullChecks&&(t.strictNullChecks=!0),e.strictFunctionTypes&&(t.strictFunctionTypes=!0),e.module&&(t.module=e.module),e.target&&(t.target=e.target),t.sourceMap=!0,t}var Op=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Np}(e)}(e)};var Np="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function qp(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Lp((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Ip(e,t,n){return e.concat(t).map((function(e){return qp(e,n)}))}function Ap(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function Mp(e,t){try{return t in e}catch(e){return!1}}function Fp(e,t,n){var r={};return n.isMergeableObject(e)&&Ap(e).forEach((function(t){r[t]=qp(e[t],n)})),Ap(t).forEach((function(i){(function(e,t){return Mp(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(Mp(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Lp;var n=t.customMerge(e);return"function"==typeof n?n:Lp}(i,n)(e[i],t[i],n):r[i]=qp(t[i],n))})),r}function Lp(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Ip,n.isMergeableObject=n.isMergeableObject||Op,n.cloneUnlessOtherwiseSpecified=qp;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Fp(e,t,n):qp(t,n)}Lp.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Lp(e,n,t)}),{})};var jp=Lp;const $p={allowIncompleteCompletions:!0,allowRenameOfImportPath:!0,allowTextChangesInNewFiles:!0,autoImportFileExcludePatterns:[],disableLineTextInReferences:!0,disableSuggestions:!1,displayPartsForJSDoc:!0,generateReturnInDocTemplate:!0,importModuleSpecifierEnding:"auto",importModuleSpecifierPreference:"shortest",includeAutomaticOptionalChainCompletions:!0,includeCompletionsForImportStatements:!0,includeCompletionsForModuleExports:!0,includeCompletionsWithClassMemberSnippets:!0,includeCompletionsWithInsertText:!0,includeCompletionsWithObjectLiteralMethodSnippets:!0,includeCompletionsWithSnippetText:!0,includeInlayEnumMemberValueHints:!1,includeInlayFunctionLikeReturnTypeHints:!1,includeInlayFunctionParameterTypeHints:!1,includeInlayParameterNameHints:"none",includeInlayParameterNameHintsWhenArgumentMatchesName:!1,includeInlayPropertyDeclarationTypeHints:!1,includeInlayVariableTypeHints:!1,includeInlayVariableTypeHintsWhenTypeMatchesName:!1,includePackageJsonAutoImports:"auto",jsxAttributeCompletionStyle:"auto",lazyConfiguredProjectsFromExternalProject:!1,providePrefixAndSuffixTextForRename:!0,provideRefactorNotApplicableReason:!0,quotePreference:"auto",useLabelDetailsInCompletionEntries:!0},Hp={implicitProjectConfiguration:{checkJs:!1,experimentalDecorators:!1,module:El.ESNext,strictFunctionTypes:!0,strictNullChecks:!0,target:xl.ES2020}};class Wp{constructor(e){this.documents=e,this.tsPreferences=jp({},$p),this.workspaceConfiguration=jp({},Hp),this.tspClient=null}mergeTsPreferences(e){this.tsPreferences=jp(this.tsPreferences,e)}setWorkspaceConfiguration(e){this.workspaceConfiguration=jp(Hp,e)}setAndConfigureTspClient(e,t,n){this.tspClient=t;const r={...n?{hostInfo:n}:{},formatOptions:{newLineCharacter:"\n"},preferences:{...this.tsPreferences,autoImportFileExcludePatterns:this.getAutoImportFileExcludePatternsPreference(e)}};t.executeWithoutWaitingForResponse(wl.Configure,r)}async configureGloballyFromDocument(e,t){const n={formatOptions:this.getFormattingOptions(e,t),preferences:this.getPreferences(e)};await(this.tspClient?.request(wl.Configure,n))}getPreferences(e){if(this.tspClient?.apiVersion.lt(Nl.v290))return{};const t=this.getWorkspacePreferencesForFile(e),n=Object.assign({},this.tsPreferences,t?.inlayHints||{});return{...n,quotePreference:this.getQuoteStylePreference(n)}}getFormattingOptions(e,t){const n={...this.getWorkspacePreferencesForFile(e)?.format,...t};return void 0===n.convertTabsToSpaces&&(n.convertTabsToSpaces=t?.insertSpaces),void 0===n.indentSize&&(n.indentSize=t?.tabSize),n}getQuoteStylePreference(e){switch(e.quotePreference){case"single":return"single";case"double":return"double";default:return this.tspClient?.apiVersion.gte(Nl.v333)?"auto":void 0}}getWorkspacePreferencesForFile(e){const t=this.documents.get(e)?.languageId.startsWith("typescript")?"typescript":"javascript";return this.workspaceConfiguration[t]||{}}getAutoImportFileExcludePatternsPreference(e){if(e&&0!==this.tsPreferences.autoImportFileExcludePatterns.length)return this.tsPreferences.autoImportFileExcludePatterns.map((t=>{const n=t.replace(/\\/g,"/"),r=/^\.\.?($|\/)/.test(n);return g.posix.isAbsolute(t)?t:t.startsWith("*")?`/${n}`:r?g.posix.join(e,t):`/**/${n}`}))}}class Vp{constructor(e){this.options=e,this._tspClient=null,this.hasShutDown=!1,this.initializeParams=null,this.typeScriptAutoFixProvider=null,this.features={},this.documents=new od,this.pendingDebouncedRequest=!1,this.doRequestDiagnosticsDebounced=Va((()=>this.doRequestDiagnostics()),200),this.configurationManager=new Wp(this.documents),this.logger=new wi(e.logger,"[lspserver]")}closeAll(){for(const e of[...this.documents.files])this.closeDocument(e)}shutdown(){this._tspClient&&(this._tspClient.shutdown(),this._tspClient=null,this.hasShutDown=!0)}get tspClient(){if(!this._tspClient)throw new Error('TS client not created. Did you forget to send the "initialize" request?');return this._tspClient}async initialize(e){if(this.logger.log("initialize",e),this._tspClient)throw new Error('The "initialize" request has already called before.');this.initializeParams=e;const t=this.initializeParams.capabilities;this.workspaceRoot=this.initializeParams.rootUri?qh(this.initializeParams.rootUri):this.initializeParams.rootPath||void 0;const n=this.initializeParams.initializationOptions||{},{disableAutomaticTypingAcquisition:r,hostInfo:i,maxTsServerMemory:o,npmLocation:s,locale:a,tsserver:c}=n,{plugins:u}={plugins:n.plugins||[]},l=[],h=[];for(const e of u)l.push(e.name),h.push(e.location);const d=this.findTypescriptVersion(c?.path);if(!d)throw Error('Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting.');this.options.lspClient.logMessage({type:bi.Info,message:`Using Typescript version (${d.source}) ${d.versionString} from path "${d.tsServerPath}"`}),this.configurationManager.mergeTsPreferences(n.preferences||{});const{textDocument:p}=t;if(p){const e=p.completion;this.features.codeActionDisabledSupport=p.codeAction?.disabledSupport,this.features.definitionLinkSupport=p.definition?.linkSupport&&d.version?.gte(Nl.v270),this.features.completionInsertReplaceSupport=e?.completionItem?.insertReplaceSupport,e?.completionItem&&(this.configurationManager.tsPreferences.useLabelDetailsInCompletionEntries&&e.completionItem.labelDetailsSupport&&d.version?.gte(Nl.v470)&&(this.features.completionLabelDetails=!0),e.completionItem.snippetSupport&&(this.features.completionSnippets=!0),p.publishDiagnostics?.tagSupport&&(this.features.diagnosticsTagSupport=!0))}this.configurationManager.mergeTsPreferences({useLabelDetailsInCompletionEntries:this.features.completionLabelDetails}),this.diagnosticQueue=new Xh((e=>this.options.lspClient.publishDiagnostics(e)),this.documents,this.features,this.logger);const f=c?.logVerbosity&&Sh.fromString(c?.logVerbosity);this._tspClient=new Dh({lspClient:this.options.lspClient,trace:wh.fromString(c?.trace||"off"),typescriptVersion:d,logDirectoryProvider:new rp(this.getLogDirectoryPath(n)),logVerbosity:f??this.options.tsserverLogVerbosity,disableAutomaticTypingAcquisition:r,maxTsServerMemory:o,npmLocation:s,locale:a,globalPlugins:l,pluginProbeLocations:h,logger:this.options.logger,onEvent:this.onTsEvent.bind(this),onExit:(e,t)=>{if(this.shutdown(),e)throw new Error(`tsserver process has exited (exit code: ${e}, signal: ${t}). Stopping the server.`)}});if(!this.tspClient.start())throw new Error("tsserver process has failed to start.");process.on("exit",(()=>{this.shutdown()})),process.on("SIGINT",(()=>{process.exit()})),this.typeScriptAutoFixProvider=new Bd(this.tspClient),this.configurationManager.setAndConfigureTspClient(this.workspaceRoot,this._tspClient,i),this.setCompilerOptionsForInferredProjects();const m=p?.rename?.prepareSupport&&this.tspClient.apiVersion.gte(Nl.v310),g={capabilities:{textDocumentSync:ve.TextDocumentSyncKind.Incremental,completionProvider:{triggerCharacters:[".",'"',"'","/","@","<"],resolveProvider:!0},codeActionProvider:!t.textDocument?.codeAction?.codeActionLiteralSupport||{codeActionKinds:[...Bd.kinds.map((e=>e.value)),Od.SourceOrganizeImportsTs.value,Od.QuickFix.value,Od.Refactor.value]},definitionProvider:!0,documentFormattingProvider:!0,documentRangeFormattingProvider:!0,documentHighlightProvider:!0,documentSymbolProvider:!0,executeCommandProvider:{commands:[ad.APPLY_WORKSPACE_EDIT,ad.APPLY_CODE_ACTION,ad.APPLY_REFACTORING,ad.CONFIGURE_PLUGIN,ad.ORGANIZE_IMPORTS,ad.APPLY_RENAME_FILE,ad.SOURCE_DEFINITION]},hoverProvider:!0,inlayHintProvider:!0,renameProvider:!m||{prepareProvider:!0},referencesProvider:!0,selectionRangeProvider:!0,signatureHelpProvider:{triggerCharacters:["(",",","<"],retriggerCharacters:[")"]},workspaceSymbolProvider:!0,implementationProvider:!0,typeDefinitionProvider:!0,foldingRangeProvider:!0,semanticTokensProvider:{documentSelector:null,legend:{tokenTypes:["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","member"],tokenModifiers:["declaration","static","async","readonly","defaultLibrary","local"]},full:!0,range:!0}}};return p?.callHierarchy&&d.version?.gte(Nl.v380)&&(g.capabilities.callHierarchyProvider=!0),this.logger.log("onInitialize result",g),g}initialized(e){const{apiVersion:t,typescriptVersionSource:n}=this.tspClient;this.options.lspClient.sendNotification(cd,{version:t.displayName,source:n})}findTypescriptVersion(e){const t=new kp(e||this.options.tsserverPath,this.logger),n=t.getUserSettingVersion();if(n){if(n.isValid)return n;this.logger.logIgnoringVerbosity(bi.Warning,`Typescript specified through user setting ignored due to invalid path "${n.path}"`)}if(this.workspaceRoot){const e=t.getWorkspaceVersion([this.workspaceRoot]);if(e)return e}const r=t.bundledVersion();return r?.isValid?r:null}getLogDirectoryPath(e){return e.tsserver?.logDirectory?e.tsserver.logDirectory:this.workspaceRoot?m.join(this.workspaceRoot,".log"):void 0}setCompilerOptionsForInferredProjects(){const e={options:{...Pp(this.configurationManager.workspaceConfiguration.implicitProjectConfiguration),allowJs:!0,allowNonTsExtensions:!0,allowSyntheticDefaultImports:!0,resolveJsonModule:!0}};this.tspClient.executeWithoutWaitingForResponse(wl.CompilerOptionsForInferredProjects,e)}didChangeConfiguration(e){this.configurationManager.setWorkspaceConfiguration(e.settings||{}),this.setCompilerOptionsForInferredProjects();const t=this.configurationManager.workspaceConfiguration.diagnostics?.ignoredCodes||[];this.diagnosticQueue?.updateIgnoredDiagnosticCodes(t),this.cancelDiagnostics(),this.requestDiagnostics()}interuptDiagnostics(e){if(!this.diagnosticsTokenSource)return e();this.cancelDiagnostics();const t=e();return this.requestDiagnostics(),t}async requestDiagnostics(){this.pendingDebouncedRequest=!0,await this.doRequestDiagnosticsDebounced()}async doRequestDiagnostics(){if(this.cancelDiagnostics(),this.hasShutDown)return;const e=new ve.CancellationTokenSource;this.diagnosticsTokenSource=e;const{files:t}=this.documents;try{return await this.tspClient.requestGeterr({delay:0,files:t},this.diagnosticsTokenSource.token)}finally{this.diagnosticsTokenSource===e&&(this.diagnosticsTokenSource=void 0,this.pendingDebouncedRequest=!1)}}cancelDiagnostics(){this.diagnosticsTokenSource&&(this.diagnosticsTokenSource.cancel(),this.diagnosticsTokenSource=void 0)}didOpenTextDocument(e){const t=qh(e.textDocument.uri);this.logger.log("onDidOpenTextDocument",e,t),t&&(this.documents.open(t,e.textDocument)?(this.tspClient.notify(wl.Open,{file:t,fileContent:e.textDocument.text,scriptKindName:this.getScriptKindName(e.textDocument.languageId),projectRootPath:this.workspaceRoot}),this.cancelDiagnostics(),this.requestDiagnostics()):(this.logger.log(`Cannot open already opened doc '${e.textDocument.uri}'.`),this.didChangeTextDocument({textDocument:e.textDocument,contentChanges:[{text:e.textDocument.text}]})))}getScriptKindName(e){switch(e){case"typescript":return"TS";case"typescriptreact":return"TSX";case"javascript":return"JS";case"javascriptreact":return"JSX"}}didCloseTextDocument(e){const t=qh(e.textDocument.uri);this.logger.log("onDidCloseTextDocument",e,t),t&&this.closeDocument(t)}closeDocument(e){const t=this.documents.close(e);t&&(this.tspClient.notify(wl.Close,{file:e}),this.options.lspClient.publishDiagnostics({uri:t.uri,diagnostics:[]}))}didChangeTextDocument(e){const{textDocument:t}=e,n=qh(t.uri);if(this.logger.log("onDidChangeTextDocument",e,n),!n)return;const r=this.documents.get(n);if(!r)throw this.logger.error(`Received change on non-opened document ${t.uri}`),new Error(`Received change on non-opened document ${t.uri}`);if(null===t.version)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);for(const i of e.contentChanges){let e=0,o=0,s=0,a=0;if(ve.TextDocumentContentChangeEvent.isIncremental(i))e=i.range.start.line+1,o=i.range.start.character+1,s=i.range.end.line+1,a=i.range.end.character+1;else{e=1,o=1;const t=r.positionAt(r.getText().length);s=t.line+1,a=t.character+1}this.tspClient.notify(wl.Change,{file:n,line:e,offset:o,endLine:s,endOffset:a,insertString:i.text}),r.applyEdit(t.version,i)}this.cancelDiagnostics(),this.requestDiagnostics()}didSaveTextDocument(e){}async definition(e,t){return this.getDefinition({type:this.features.definitionLinkSupport?wl.DefinitionAndBoundSpan:wl.Definition,params:e},t)}async implementation(e,t){return this.getSymbolLocations({type:wl.Implementation,params:e},t)}async typeDefinition(e,t){return this.getSymbolLocations({type:wl.TypeDefinition,params:e},t)}async getDefinition({type:e,params:t},n){const r=qh(t.textDocument.uri);if(this.logger.log(e,t,r),r){if(e===wl.DefinitionAndBoundSpan){const i=Ph.toFileLocationRequestArgs(r,t.position),o=await this.tspClient.request(e,i,n);if("response"!==o.type||!o.body)return;const s=o.body.textSpan?xh.fromTextSpan(o.body.textSpan):void 0;return o.body.definitions.map((e=>{const t=Lh(e,this.documents),n=e.contextStart&&e.contextEnd?xh.fromLocations(e.contextStart,e.contextEnd):t.range;return{originSelectionRange:s,targetRange:n,targetUri:t.uri,targetSelectionRange:t.range}}))}return this.getSymbolLocations({type:wl.Definition,params:t})}}async getSymbolLocations({type:e,params:t},n){const r=qh(t.textDocument.uri);if(this.logger.log(e,t,r),!r)return[];const i=Ph.toFileLocationRequestArgs(r,t.position),o=await this.tspClient.request(e,i,n);return"response"===o.type&&o.body?o.body.map((e=>Lh(e,this.documents))):void 0}async documentSymbol(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("symbol",e,n),!n)return[];const r=(await this.tspClient.request(wl.NavTree,{file:n},t)).body;if(!r?.childItems)return[];if(this.supportHierarchicalDocumentSymbol){const e=[];for(const t of r.childItems)Nd(t,e);return e}const i=[];for(const t of r.childItems)Id(e.textDocument.uri,t,i);return i}get supportHierarchicalDocumentSymbol(){const e=this.initializeParams?.capabilities.textDocument,t=e?.documentSymbol;return!!t&&!!t.hierarchicalDocumentSymbolSupport}async completion(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("completion",e,n),!n)return ve.CompletionList.create([]);const r=this.documents.get(n);if(!r)throw new Error(`The document should be opened for completion, file: ${n}`);const i=this.configurationManager.workspaceConfiguration.completions||{};try{const o=await this.interuptDiagnostics((()=>this.tspClient.request(wl.CompletionInfo,{file:n,line:e.position.line+1,offset:e.position.character+1,triggerCharacter:Ed(e.context?.triggerCharacter),triggerKind:e.context?.triggerKind},t))),{body:s}=o;if(!s)return ve.CompletionList.create();const{entries:a,isIncomplete:c,optionalReplacementSpan:u}=s,l=[];for(const t of a||[]){if("warning"===t.kind)continue;const o=vd(t,u,n,e.position,r,this.documents,i,this.features);o&&l.push(o)}return ve.CompletionList.create(l,c)}catch(e){if("No content available."===e.message)return this.logger.info("No content was available for completion request"),null;throw e}}async completionResolve(e,t){this.logger.log("completion/resolve",e);const n=e.data?.file?this.documents.get(e.data.file):void 0;await this.configurationManager.configureGloballyFromDocument(e.data.file);const{body:r}=await this.interuptDiagnostics((()=>this.tspClient.request(wl.CompletionDetails,e.data,t))),i=r?.length&&r[0];return i?Rd(e,i,n,this.tspClient,this.documents,this.configurationManager.workspaceConfiguration.completions||{},this.features):e}async hover(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("hover",e,n),!n)return{contents:[]};const r=await this.interuptDiagnostics((()=>this.getQuickInfo(n,e.position,t)));if(!r?.body)return{contents:[]};const i=new ud,{displayString:o,documentation:s,tags:a}=r.body;return o&&i.appendCodeblock("typescript",o),md(i,s,a,this.documents),{contents:i.toMarkupContent(),range:xh.fromTextSpan(r.body)}}async getQuickInfo(e,t,n){try{return await this.tspClient.request(wl.Quickinfo,{file:e,line:t.line+1,offset:t.character+1},n)}catch(e){return}}async prepareRename(e,t){const n=qh(e.textDocument.uri);if(!n)return null;const r=(await this.tspClient.request(wl.Rename,Ph.toFileLocationRequestArgs(n,e.position),t)).body?.info;if(!r)return null;if(!r.canRename)throw new Error(r.localizedErrorMessage);return xh.fromTextSpan(r.triggerSpan)}async rename(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("onRename",e,n),!n)return null;const r=await this.tspClient.request(wl.Rename,Ph.toFileLocationRequestArgs(n,e.position),t);if(!r.body?.info.canRename||0===r.body.locs.length)return null;const i={};return r.body.locs.forEach((t=>{const n=Ih(t.file,this.documents);i.changes||(i.changes={});const r=i.changes[n]||(i.changes[n]=[]);t.locs.forEach((t=>{r.push({newText:`${t.prefixText||""}${e.newName}${t.suffixText||""}`,range:{start:Ph.fromLocation(t.start),end:Ph.fromLocation(t.end)}})}))})),i}async references(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("onReferences",e,n),!n)return[];const r=await this.tspClient.request(wl.References,{file:n,line:e.position.line+1,offset:e.position.character+1},t);return r.body?r.body.refs.filter((t=>e.context.includeDeclaration||!t.isDefinition)).map((e=>Lh(e,this.documents))):[]}async documentFormatting(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("documentFormatting",e,n),!n)return[];const r=e.options;await this.configurationManager.configureGloballyFromDocument(n,r);const i=await this.tspClient.request(wl.Format,{file:n,line:1,offset:1,endLine:Number.MAX_SAFE_INTEGER,endOffset:Number.MAX_SAFE_INTEGER,options:r},t);return i.body?i.body.map((e=>Kh(e))):[]}async documentRangeFormatting(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("documentRangeFormatting",e,n),!n)return[];const r=e.options;await this.configurationManager.configureGloballyFromDocument(n,r);const i=await this.tspClient.request(wl.Format,{file:n,line:e.range.start.line+1,offset:e.range.start.character+1,endLine:e.range.end.line+1,endOffset:e.range.end.character+1,options:r},t);return i.body?i.body.map((e=>Kh(e))):[]}async selectionRanges(e,t){const n=qh(e.textDocument.uri);if(!n)return null;const r=await this.tspClient.request(wl.SelectionRange,{file:n,locations:e.positions.map(Ph.toLocation)},t);return"response"===r.type&&r.body?r.body.map(Uh):null}async signatureHelp(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("signatureHelp",e,n),!n)return;const r=await this.interuptDiagnostics((()=>this.getSignatureHelp(n,e,t)));return r?.body?Cd(r.body,e.context,this.documents):void 0}async getSignatureHelp(e,t,n){try{const{position:r,context:i}=t;return await this.tspClient.request(wl.SignatureHelp,{file:e,line:r.line+1,offset:r.character+1,triggerReason:i?kd(i):void 0},n)}catch(e){return}}async codeAction(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("codeAction",e,n),!n)return[];const r=xh.toFileRangeRequestArgs(n,e.range),i=[],o=e.context.only?.map((e=>new Od(e)));var s,a;if(o&&!o.some((e=>e.contains(Od.QuickFix)))||i.push(...(s=await this.getCodeFixes(r,e.context,t),a=this.documents,s?.body?s.body.map((e=>ve.CodeAction.create(e.description,{title:e.description,command:ad.APPLY_WORKSPACE_EDIT,arguments:[{documentChanges:e.changes.map((e=>Gh(e,a)))}]},ve.CodeActionKind.QuickFix))):[])),o&&!o.some((e=>e.contains(Od.Refactor)))||i.push(...function(e,t,n){if(!e?.body)return[];const r=[];for(const i of e.body)if(!1===i.inlineable)r.push(xd(i,t));else{const e=n.codeActionDisabledSupport?i.actions:i.actions.filter((e=>!e.notApplicableReason));for(const n of e)r.push(Pd(n,i,t))}return r}(await this.getRefactors(r,e.context,t),r,this.features)),o?.some((e=>e.contains(Od.SourceOrganizeImportsTs)))){const n=e.context.diagnostics.some((e=>(e.severity??0)<=2)),o=await this.getOrganizeImports({scope:{type:"file",args:r},skipDestructiveCodeActions:n},t);i.push(...function(e,t){return e&&0!==e.body.length?[ve.CodeAction.create("Organize imports",{documentChanges:e.body.map((e=>Gh(e,t)))},Od.SourceOrganizeImportsTs.value)]:[]}(o,this.documents))}if(o&&!this.pendingDebouncedRequest){const e=this.diagnosticQueue?.getDiagnosticsForFile(n)||[];e.length&&i.push(...await this.typeScriptAutoFixProvider.provideCodeActions(o,n,e,this.documents))}return i}async getCodeFixes(e,t,n){const r=t.diagnostics.map((e=>Number(e.code))),i={...e,errorCodes:r};try{return await this.tspClient.request(wl.GetCodeFixes,i,n)}catch(e){return}}async getRefactors(e,t,n){const r={...e,triggerReason:t.triggerKind===ve.CodeActionTriggerKind.Invoked?"invoked":void 0,kind:1===t.only?.length?t.only[0]:void 0};try{return await this.tspClient.request(wl.GetApplicableRefactors,r,n)}catch(e){return}}async getOrganizeImports(e,t){try{return await this.configurationManager.configureGloballyFromDocument(e.scope.args.file),await this.tspClient.request(wl.OrganizeImports,e,t)}catch(e){return}}async executeCommand(e,t,n){if(this.logger.log("executeCommand",e),e.command===ad.APPLY_WORKSPACE_EDIT&&e.arguments){const t=e.arguments[0];await this.options.lspClient.applyWorkspaceEdit({edit:t})}else if(e.command===ad.APPLY_CODE_ACTION&&e.arguments){const n=e.arguments[0];if(!await this.applyFileCodeEdits(n.changes))return;if(n.commands?.length)for(const e of n.commands)await this.tspClient.request(wl.ApplyCodeActionCommand,{command:e},t)}else if(e.command===ad.APPLY_REFACTORING&&e.arguments){const n=e.arguments[0],{body:r}=await this.tspClient.request(wl.GetEditsForRefactor,n,t);if(!r?.edits.length)return;for(const e of r.edits)await Wa.ensureFile(e.fileName);if(!await this.applyFileCodeEdits(r.edits))return;const i=r.renameLocation;i&&await this.options.lspClient.rename({textDocument:{uri:Ih(n.file,this.documents)},position:Ph.fromLocation(i)})}else if(e.command===ad.CONFIGURE_PLUGIN&&e.arguments){const[t,n]=e.arguments;this.tspClient?.apiVersion.gte(Nl.v314)&&this.tspClient.executeWithoutWaitingForResponse(wl.ConfigurePlugin,{configuration:n,pluginName:t})}else if(e.command===ad.ORGANIZE_IMPORTS&&e.arguments){const n=e.arguments[0],r=e.arguments[1]||{};await this.configurationManager.configureGloballyFromDocument(n);const{body:i}=await this.tspClient.request(wl.OrganizeImports,{scope:{type:"file",args:{file:n}},skipDestructiveCodeActions:r.skipDestructiveCodeActions},t);await this.applyFileCodeEdits(i)}else if(e.command===ad.APPLY_RENAME_FILE&&e.arguments){const{sourceUri:n,targetUri:r}=e.arguments[0];this.applyRenameFile(n,r,t)}else if(e.command===ad.APPLY_COMPLETION_CODE_ACTION&&e.arguments){const[n,r]=e.arguments;for(const e of r){if(await this.applyFileCodeEdits(e.changes),e.commands?.length)for(const n of e.commands)await this.tspClient.request(wl.ApplyCodeActionCommand,{command:n},t);break}}else{if(e.command===ad.SOURCE_DEFINITION){const[r,i]=e.arguments||[],o=await this.options.lspClient.createProgressReporter(t,n);return sd.execute(r,i,this.documents,this.tspClient,this.options.lspClient,o,t)}this.logger.error(`Unknown command ${e.command}.`)}}async applyFileCodeEdits(e){if(!e.length)return!1;const t={};for(const n of e)t[Ih(n.fileName,this.documents)]=n.textChanges.map(Kh);const{applied:n}=await this.options.lspClient.applyWorkspaceEdit({edit:{changes:t}});return n}async applyRenameFile(e,t,n){const r=await this.getEditsForFileRename(e,t,n);this.applyFileCodeEdits(r)}async getEditsForFileRename(e,t,n){const r=qh(t),i=qh(e);if(!r||!i)return[];try{const{body:e}=await this.tspClient.request(wl.GetEditsForFileRename,{oldFilePath:i,newFilePath:r},n);return e}catch(e){return[]}}async documentHighlight(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("documentHighlight",e,n),!n)return[];let r;try{r=await this.tspClient.request(wl.DocumentHighlights,{file:n,line:e.position.line+1,offset:e.position.character+1,filesToSearch:[n]},t)}catch(e){return[]}if(!r.body)return[];const i=[];for(const e of r.body)if(Ah(e.file)===n){const t=zh(e);i.push(...t)}return i}lastFileOrDummy(){return this.documents.files[0]||this.workspaceRoot}async workspaceSymbol(e,t){const n=await this.tspClient.request(wl.Navto,{file:this.lastFileOrDummy(),searchValue:e.query},t);return n.body?n.body.map((e=>({location:{uri:Ih(e.file,this.documents),range:{start:Ph.fromLocation(e.start),end:Ph.fromLocation(e.end)}},kind:$h(e.kind),name:e.name}))):[]}async foldingRanges(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("foldingRanges",e,n),!n)return;const r=this.documents.get(n);if(!r)throw new Error(`The document should be opened for foldingRanges', file: ${n}`);const{body:i}=await this.tspClient.request(wl.GetOutliningSpans,{file:n},t);if(!i)return;const o=[];for(const e of i){const t=this.asFoldingRange(e,r);t&&o.push(t)}return o}asFoldingRange(e,t){const n=xh.fromTextSpan(e.textSpan),r=this.asFoldingRangeKind(e);if("comment"===e.kind){if(t.getLine(n.start.line).match(/\/\/\s*#endregion/gi))return}return{startLine:n.start.line,endLine:n.end.character>0&&"}"===t.getText(ve.Range.create(ve.Position.create(n.end.line,n.end.character-1),n.end))?Math.max(n.end.line-1,n.start.line):n.end.line,kind:r}}asFoldingRangeKind(e){switch(e.kind){case"comment":return ve.FoldingRangeKind.Comment;case"region":return ve.FoldingRangeKind.Region;case"imports":return ve.FoldingRangeKind.Imports;default:return}}async onTsEvent(e){"semanticDiag"!==e.event&&"syntaxDiag"!==e.event&&"suggestionDiag"!==e.event||this.diagnosticQueue?.updateDiagnostics(e.event,e)}async prepareCallHierarchy(e,t){const n=qh(e.textDocument.uri);if(!n)return null;const r=Ph.toFileLocationRequestArgs(n,e.position),i=await this.tspClient.request(wl.PrepareCallHierarchy,r,t);if("response"!==i.type||!i.body)return null;return(Array.isArray(i.body)?i.body:[i.body]).map((e=>Md(e,this.documents,this.workspaceRoot)))}async callHierarchyIncomingCalls(e,t){const n=qh(e.item.uri);if(!n)return null;const r=Ph.toFileLocationRequestArgs(n,e.item.selectionRange.start),i=await this.tspClient.request(wl.ProvideCallHierarchyIncomingCalls,r,t);return"response"===i.type&&i.body?i.body.map((e=>function(e,t,n){return{from:Md(e.from,t,n),fromRanges:e.fromSpans.map(xh.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async callHierarchyOutgoingCalls(e,t){const n=qh(e.item.uri);if(!n)return null;const r=Ph.toFileLocationRequestArgs(n,e.item.selectionRange.start),i=await this.tspClient.request(wl.ProvideCallHierarchyOutgoingCalls,r,t);return"response"===i.type&&i.body?i.body.map((e=>function(e,t,n){return{to:Md(e.to,t,n),fromRanges:e.fromSpans.map(xh.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async inlayHints(e,t){return await Jd.provideInlayHints(e.textDocument.uri,e.range,this.documents,this.tspClient,this.options.lspClient,this.configurationManager,t)}async semanticTokensFull(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("semanticTokensFull",e,n),!n)return{data:[]};const r=this.documents.get(n);if(!r)return{data:[]};const i=r.offsetAt({line:0,character:0}),o=r.offsetAt({line:r.lineCount,character:0});return this.getSemanticTokens(r,n,i,o,t)}async semanticTokensRange(e,t){const n=qh(e.textDocument.uri);if(this.logger.log("semanticTokensRange",e,n),!n)return{data:[]};const r=this.documents.get(n);if(!r)return{data:[]};const i=r.offsetAt(e.range.start),o=r.offsetAt(e.range.end);return this.getSemanticTokens(r,n,i,o,t)}async getSemanticTokens(e,t,n,r,i){try{const o=await this.tspClient.request(wl.EncodedSemanticClassificationsFull,{file:t,start:n,length:r-n,format:"2020"},i);return{data:np(e,o.body?.spans??[])}}catch{return{data:[]}}}}const Up=Nr(void 0,void 0);class Kp{constructor(e){this.connection=e}async createProgressReporter(e,t){let n;return n=t&&t.constructor!==Up.constructor?t:t||await this.connection.window.createWorkDoneProgress(),n}async withProgress(e,t){const{message:n,reporter:r}=e;return r.begin(n),t(r).then((e=>(r.done(),e)))}publishDiagnostics(e){this.connection.sendDiagnostics(e)}showErrorMessage(e){this.connection.sendNotification(ve.ShowMessageNotification.type,{type:ve.MessageType.Error,message:e})}logMessage(e){this.connection.sendNotification(ve.LogMessageNotification.type,e)}async applyWorkspaceEdit(e){return this.connection.workspace.applyEdit(e)}async rename(e){return this.connection.sendRequest(Sl.type,e)}async sendNotification(e,t){await this.connection.sendNotification(e,t)}}const Gp=gi.MessageType.Info,{version:zp}=JSON.parse(r(new URL("../package.json",import.meta.url),{encoding:"utf8"})),Bp=new fe("typescript-language-server").version(zp).requiredOption("--stdio","use stdio").option("--log-level <logLevel>","A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `2`.").option("--tsserver-log-verbosity <tsserverLogVerbosity>","[deprecated] Specify a tsserver log verbosity (terse, normal, verbose). Defaults to `normal`. example: --tsserver-log-verbosity verbose").option("--tsserver-path <path>","[deprecated] Specify path to tsserver.js or the lib directory. example: --tsserver-path=/Users/me/typescript/lib/tsserver.js").parse(process.argv).opts();let Jp=Gp;Bp.logLevel&&(Jp=parseInt(Bp.logLevel,10),Jp&&(Jp<1||Jp>4)&&(console.error(`Invalid '--log-level ${Jp}'. Falling back to 'info' level.`),Jp=Gp)),function(e){const t=vi.createConnection(vi.ProposedFeatures.all),n=new Kp(t),r=new Si(n,e.showMessageLevel),i=new Vp({logger:r,lspClient:n,tsserverPath:e.cmdLineTsserverPath,tsserverLogVerbosity:e.cmdLineTsserverLogVerbosity});return t.onInitialize(i.initialize.bind(i)),t.onInitialized(i.initialized.bind(i)),t.onDidChangeConfiguration(i.didChangeConfiguration.bind(i)),t.onDidOpenTextDocument(i.didOpenTextDocument.bind(i)),t.onDidSaveTextDocument(i.didSaveTextDocument.bind(i)),t.onDidCloseTextDocument(i.didCloseTextDocument.bind(i)),t.onDidChangeTextDocument(i.didChangeTextDocument.bind(i)),t.onCodeAction(i.codeAction.bind(i)),t.onCompletion(i.completion.bind(i)),t.onCompletionResolve(i.completionResolve.bind(i)),t.onDefinition(i.definition.bind(i)),t.onImplementation(i.implementation.bind(i)),t.onTypeDefinition(i.typeDefinition.bind(i)),t.onDocumentFormatting(i.documentFormatting.bind(i)),t.onDocumentRangeFormatting(i.documentRangeFormatting.bind(i)),t.onDocumentHighlight(i.documentHighlight.bind(i)),t.onDocumentSymbol(i.documentSymbol.bind(i)),t.onExecuteCommand(i.executeCommand.bind(i)),t.onHover(i.hover.bind(i)),t.onReferences(i.references.bind(i)),t.onRenameRequest(i.rename.bind(i)),t.onPrepareRename(i.prepareRename.bind(i)),t.onSelectionRanges(i.selectionRanges.bind(i)),t.onSignatureHelp(i.signatureHelp.bind(i)),t.onWorkspaceSymbol(i.workspaceSymbol.bind(i)),t.onFoldingRanges(i.foldingRanges.bind(i)),t.languages.callHierarchy.onPrepare(i.prepareCallHierarchy.bind(i)),t.languages.callHierarchy.onIncomingCalls(i.callHierarchyIncomingCalls.bind(i)),t.languages.callHierarchy.onOutgoingCalls(i.callHierarchyOutgoingCalls.bind(i)),t.languages.inlayHint.on(i.inlayHints.bind(i)),t.languages.semanticTokens.on(i.semanticTokensFull.bind(i)),t.languages.semanticTokens.onRange(i.semanticTokensRange.bind(i)),t}({cmdLineTsserverPath:Bp.tsserverPath,cmdLineTsserverLogVerbosity:Sh.fromString(Bp.tsserverLogVerbosity),showMessageLevel:Jp}).listen();
|
|
3
3
|
//# sourceMappingURL=cli.mjs.map
|