UNPKG

code-server

Version:

Run VS Code on a remote server.

400 lines (353 loc) • 183 kB
/*!-------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; export function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } export var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } export function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } export function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } export function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { var context = {}; for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; for (var p in contextIn.access) context.access[p] = contextIn.access[p]; context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; }; export function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i = 0; i < initializers.length; i++) { value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); } return useValue ? value : void 0; }; export function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); }; export function __setFunctionName(f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); }; export function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } export function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } export function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } export var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); export function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } export function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } export function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ export function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ export function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } export function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } export function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } export function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } export function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } } export function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } export function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; export function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } export function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } export function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } export function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } export function __classPrivateFieldIn(state, receiver) { if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state === "function" ? receiver === state : state.has(receiver); } export function __addDisposableResource(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose, inner; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose = value[Symbol.dispose]; if (async) inner = dispose; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; env.stack.push({ value: value, dispose: dispose, async: async }); } else if (async) { env.stack.push({ async: true }); } return value; } var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; export function __disposeResources(env) { function fail(e) { env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; env.hasError = true; } function next() { while (env.stack.length) { var rec = env.stack.pop(); try { var result = rec.dispose && rec.dispose.call(rec.value); if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); } catch (e) { fail(e); } } if (env.hasError) throw env.error; } return next(); } export default { __extends: __extends, __assign: __assign, __rest: __rest, __decorate: __decorate, __param: __param, __metadata: __metadata, __awaiter: __awaiter, __generator: __generator, __createBinding: __createBinding, __exportStar: __exportStar, __values: __values, __read: __read, __spread: __spread, __spreadArrays: __spreadArrays, __spreadArray: __spreadArray, __await: __await, __asyncGenerator: __asyncGenerator, __asyncDelegator: __asyncDelegator, __asyncValues: __asyncValues, __makeTemplateObject: __makeTemplateObject, __importStar: __importStar, __importDefault: __importDefault, __classPrivateFieldGet: __classPrivateFieldGet, __classPrivateFieldSet: __classPrivateFieldSet, __classPrivateFieldIn: __classPrivateFieldIn, __addDisposableResource: __addDisposableResource, __disposeResources: __disposeResources, }; var Hi=Object.create;var Ht=Object.defineProperty;var Qi=Object.getOwnPropertyDescriptor;var Ji=Object.getOwnPropertyNames;var Yi=Object.getPrototypeOf,Zi=Object.prototype.hasOwnProperty;var F=(t,e)=>()=>(t&&(e=t(t=0)),e);var Xi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ci=(t,e)=>{for(var n in e)Ht(t,n,{get:e[n],enumerable:!0})},es=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ji(e))!Zi.call(t,i)&&i!==n&&Ht(t,i,{get:()=>e[i],enumerable:!(r=Qi(e,i))||r.enumerable});return t};var ts=(t,e,n)=>(n=t!=null?Hi(Yi(t)):{},es(e||!t||!t.__esModule?Ht(n,"default",{value:t,enumerable:!0}):n,t));function ds(){return globalThis._VSCODE_NLS_MESSAGES}function Zt(){return globalThis._VSCODE_NLS_LANGUAGE}function tr(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(r,i)=>{let s=i[0],o=e[s],a=r;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),ps&&(n="\uFF3B"+n.replace(/[aouei]/g,"$&$&")+"\uFF3D"),n}function _(t,e,...n){return tr(typeof t=="number"?ms(t,e):e,n)}function ms(t,e){let n=ds()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}var ps,Xt=F(()=>{ps=Zt()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0});var Ve,xt,It,Ye,gs,rr,en,bs,Ts,vs,_s,_t,yt,nr,ys,de,pe,ee,ir,xs,Ct,z,Ze,wt,sr,tn,Is,or,ae,_e,ws,Es,ar,Rs,B1,W1,j1,q1,le=F(()=>{Xt();Ve="en",xt=!1,It=!1,Ye=!1,gs=!1,rr=!1,en=!1,bs=!1,Ts=!1,vs=!1,_s=!1,yt=Ve,nr=Ve,pe=globalThis;typeof pe.vscode<"u"&&typeof pe.vscode.process<"u"?ee=pe.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ee=process);ir=typeof ee?.versions?.electron=="string",xs=ir&&ee?.type==="renderer";if(typeof ee=="object"){xt=ee.platform==="win32",It=ee.platform==="darwin",Ye=ee.platform==="linux",gs=Ye&&!!ee.env.SNAP&&!!ee.env.SNAP_REVISION,bs=ir,vs=!!ee.env.CI||!!ee.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!ee.env.GITHUB_WORKSPACE,_t=Ve,yt=Ve;let t=ee.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);_t=e.userLocale,nr=e.osLocale,yt=e.resolvedLanguage||Ve,ys=e.languagePack?.translationsConfigFile}catch{}rr=!0}else typeof navigator=="object"&&!xs?(de=navigator.userAgent,xt=de.indexOf("Windows")>=0,It=de.indexOf("Macintosh")>=0,Ts=(de.indexOf("Macintosh")>=0||de.indexOf("iPad")>=0||de.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ye=de.indexOf("Linux")>=0,_s=de?.indexOf("Mobi")>=0,en=!0,yt=Zt()||Ve,_t=navigator.language.toLowerCase(),nr=_t):console.error("Unable to resolve platform.");Ct=0;It?Ct=1:xt?Ct=3:Ye&&(Ct=2);z=xt,Ze=It,wt=Ye,sr=rr,tn=en,Is=en&&typeof pe.importScripts=="function",or=Is?pe.origin:void 0,ae=de,_e=yt;(r=>{function t(){return _e}r.value=t;function e(){return _e.length===2?_e==="en":_e.length>=3?_e[0]==="e"&&_e[1]==="n"&&_e[2]==="-":!1}r.isDefaultVariant=e;function n(){return _e==="en"}r.isDefault=n})(ws||={});Es=typeof pe.postMessage=="function"&&!pe.importScripts,ar=(()=>{if(Es){let t=[];pe.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,i=t.length;r<i;r++){let s=t[r];if(s.id===n.data.vscodeScheduleAsyncWork){t.splice(r,1),s.callback();return}}});let e=0;return n=>{let r=++e;t.push({id:r,callback:n}),pe.postMessage({vscodeScheduleAsyncWork:r},"*")}}return t=>setTimeout(t)})(),Rs=!!(ae&&ae.indexOf("Chrome")>=0),B1=!!(ae&&ae.indexOf("Firefox")>=0),W1=!!(!Rs&&ae&&ae.indexOf("Safari")>=0),j1=!!(ae&&ae.indexOf("Edg/")>=0),q1=!!(ae&&ae.indexOf("Android")>=0)});var Se,nn,ye,Et,lr,H1,Rt=F(()=>{le();nn=globalThis.vscode;if(typeof nn<"u"&&typeof nn.process<"u"){let t=nn.process;Se={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?Se={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Se={get platform(){return z?"win32":Ze?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};ye=Se.cwd,Et=Se.env,lr=Se.platform,H1=Se.arch});function Us(t,e){if(t===null||typeof t!="object")throw new Pt(e,"Object",t)}function j(t,e){if(typeof t!="string")throw new Pt(e,"string",t)}function O(t){return t===J||t===te}function rn(t){return t===J}function he(t){return t>=Ds&&t<=Ss||t>=ks&&t<=Os}function At(t,e,n,r){let i="",s=0,o=-1,a=0,l=0;for(let u=0;u<=t.length;++u){if(u<t.length)l=t.charCodeAt(u);else{if(r(l))break;l=J}if(r(l)){if(!(o===u-1||a===1))if(a===2){if(i.length<2||s!==2||i.charCodeAt(i.length-1)!==Oe||i.charCodeAt(i.length-2)!==Oe){if(i.length>2){let d=i.lastIndexOf(n);d===-1?(i="",s=0):(i=i.slice(0,d),s=i.length-1-i.lastIndexOf(n)),o=u,a=0;continue}else if(i.length!==0){i="",s=0,o=u,a=0;continue}}e&&(i+=i.length>0?`${n}..`:"..",s=2)}else i.length>0?i+=`${n}${t.slice(o+1,u)}`:i=t.slice(o+1,u),s=u-o-1;o=u,a=0}else l===Oe&&a!==-1?++a:a=-1}return i}function Ns(t){return t?`${t[0]==="."?"":"."}${t}`:""}function ur(t,e){Us(e,"pathObject");let n=e.dir||e.root,r=e.base||`${e.name||""}${Ns(e.ext)}`;return n?n===e.root?`${n}${r}`:`${n}${t}${r}`:r}var Ds,ks,Ss,Os,Oe,J,te,me,Ls,Pt,ne,q,Fs,M,Ke,Ms,W,Dt,cr,$e,Vs,fr,Q1,J1,Y1,xe,Z1,Ie=F(()=>{Rt();Ds=65,ks=97,Ss=90,Os=122,Oe=46,J=47,te=92,me=58,Ls=63,Pt=class extends Error{constructor(e,n,r){let i;typeof n=="string"&&n.indexOf("not ")===0?(i="must not be",n=n.replace(/^not /,"")):i="must be";let s=e.indexOf(".")!==-1?"property":"argument",o=`The "${e}" ${s} ${i} of type ${n}`;o+=`. Received type ${typeof r}`,super(o),this.code="ERR_INVALID_ARG_TYPE"}};ne=lr==="win32";q={resolve(...t){let e="",n="",r=!1;for(let i=t.length-1;i>=-1;i--){let s;if(i>=0){if(s=t[i],j(s,`paths[${i}]`),s.length===0)continue}else e.length===0?s=ye():(s=Et[`=${e}`]||ye(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===te)&&(s=`${e}\\`));let o=s.length,a=0,l="",u=!1,d=s.charCodeAt(0);if(o===1)O(d)&&(a=1,u=!0);else if(O(d))if(u=!0,O(s.charCodeAt(1))){let c=2,f=c;for(;c<o&&!O(s.charCodeAt(c));)c++;if(c<o&&c!==f){let p=s.slice(f,c);for(f=c;c<o&&O(s.charCodeAt(c));)c++;if(c<o&&c!==f){for(f=c;c<o&&!O(s.charCodeAt(c));)c++;(c===o||c!==f)&&(l=`\\\\${p}\\${s.slice(f,c)}`,a=c)}}}else a=1;else he(d)&&s.charCodeAt(1)===me&&(l=s.slice(0,2),a=2,o>2&&O(s.charCodeAt(2))&&(u=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(r){if(e.length>0)break}else if(n=`${s.slice(a)}\\${n}`,r=u,u&&e.length>0)break}return n=At(n,!r,"\\",O),r?`${e}\\${n}`:`${e}${n}`||"."},normalize(t){j(t,"path");let e=t.length;if(e===0)return".";let n=0,r,i=!1,s=t.charCodeAt(0);if(e===1)return rn(s)?"\\":t;if(O(s))if(i=!0,O(t.charCodeAt(1))){let a=2,l=a;for(;a<e&&!O(t.charCodeAt(a));)a++;if(a<e&&a!==l){let u=t.slice(l,a);for(l=a;a<e&&O(t.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!O(t.charCodeAt(a));)a++;if(a===e)return`\\\\${u}\\${t.slice(l)}\\`;a!==l&&(r=`\\\\${u}\\${t.slice(l,a)}`,n=a)}}}else n=1;else he(s)&&t.charCodeAt(1)===me&&(r=t.slice(0,2),n=2,e>2&&O(t.charCodeAt(2))&&(i=!0,n=3));let o=n<e?At(t.slice(n),!i,"\\",O):"";if(o.length===0&&!i&&(o="."),o.length>0&&O(t.charCodeAt(e-1))&&(o+="\\"),!i&&r===void 0&&t.includes(":")){if(o.length>=2&&he(o.charCodeAt(0))&&o.charCodeAt(1)===me)return`.\\${o}`;let a=t.indexOf(":");do if(a===e-1||O(t.charCodeAt(a+1)))return`.\\${o}`;while((a=t.indexOf(":",a+1))!==-1)}return r===void 0?i?`\\${o}`:o:i?`${r}\\${o}`:`${r}${o}`},isAbsolute(t){j(t,"path");let e=t.length;if(e===0)return!1;let n=t.charCodeAt(0);return O(n)||e>2&&he(n)&&t.charCodeAt(1)===me&&O(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,n;for(let s=0;s<t.length;++s){let o=t[s];j(o,"path"),o.length>0&&(e===void 0?e=n=o:e+=`\\${o}`)}if(e===void 0)return".";let r=!0,i=0;if(typeof n=="string"&&O(n.charCodeAt(0))){++i;let s=n.length;s>1&&O(n.charCodeAt(1))&&(++i,s>2&&(O(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i<e.length&&O(e.charCodeAt(i));)i++;i>=2&&(e=`\\${e.slice(i)}`)}return q.normalize(e)},relative(t,e){if(j(t,"from"),j(e,"to"),t===e)return"";let n=q.resolve(t),r=q.resolve(e);if(n===r||(t=n.toLowerCase(),e=r.toLowerCase(),t===e))return"";if(n.length!==t.length||r.length!==e.length){let b=n.split("\\"),L=r.split("\\");b[b.length-1]===""&&b.pop(),L[L.length-1]===""&&L.pop();let g=b.length,A=L.length,N=g<A?g:A,D;for(D=0;D<N&&b[D].toLowerCase()===L[D].toLowerCase();D++);return D===0?r:D===N?A>N?L.slice(D).join("\\"):g>N?"..\\".repeat(g-1-D)+"..":"":"..\\".repeat(g-D)+L.slice(D).join("\\")}let i=0;for(;i<t.length&&t.charCodeAt(i)===te;)i++;let s=t.length;for(;s-1>i&&t.charCodeAt(s-1)===te;)s--;let o=s-i,a=0;for(;a<e.length&&e.charCodeAt(a)===te;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===te;)l--;let u=l-a,d=o<u?o:u,c=-1,f=0;for(;f<d;f++){let b=t.charCodeAt(i+f);if(b!==e.charCodeAt(a+f))break;b===te&&(c=f)}if(f!==d){if(c===-1)return r}else{if(u>d){if(e.charCodeAt(a+f)===te)return r.slice(a+f+1);if(f===2)return r.slice(a+f)}o>d&&(t.charCodeAt(i+f)===te?c=f:f===2&&(c=3)),c===-1&&(c=0)}let p="";for(f=i+c+1;f<=s;++f)(f===s||t.charCodeAt(f)===te)&&(p+=p.length===0?"..":"\\..");return a+=c,p.length>0?`${p}${r.slice(a,l)}`:(r.charCodeAt(a)===te&&++a,r.slice(a,l))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=q.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===te){if(e.charCodeAt(1)===te){let n=e.charCodeAt(2);if(n!==Ls&&n!==Oe)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(he(e.charCodeAt(0))&&e.charCodeAt(1)===me&&e.charCodeAt(2)===te)return`\\\\?\\${e}`;return e},dirname(t){j(t,"path");let e=t.length;if(e===0)return".";let n=-1,r=0,i=t.charCodeAt(0);if(e===1)return O(i)?t:".";if(O(i)){if(n=r=1,O(t.charCodeAt(1))){let a=2,l=a;for(;a<e&&!O(t.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&O(t.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!O(t.charCodeAt(a));)a++;if(a===e)return t;a!==l&&(n=r=a+1)}}}}else he(i)&&t.charCodeAt(1)===me&&(n=e>2&&O(t.charCodeAt(2))?3:2,r=n);let s=-1,o=!0;for(let a=e-1;a>=r;--a)if(O(t.charCodeAt(a))){if(!o){s=a;break}}else o=!1;if(s===-1){if(n===-1)return".";s=n}return t.slice(0,s)},basename(t,e){e!==void 0&&j(e,"suffix"),j(t,"path");let n=0,r=-1,i=!0,s;if(t.length>=2&&he(t.charCodeAt(0))&&t.charCodeAt(1)===me&&(n=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(s=t.length-1;s>=n;--s){let l=t.charCodeAt(s);if(O(l)){if(!i){n=s+1;break}}else a===-1&&(i=!1,a=s+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(r=s):(o=-1,r=a))}return n===r?r=a:r===-1&&(r=t.length),t.slice(n,r)}for(s=t.length-1;s>=n;--s)if(O(t.charCodeAt(s))){if(!i){n=s+1;break}}else r===-1&&(i=!1,r=s+1);return r===-1?"":t.slice(n,r)},extname(t){j(t,"path");let e=0,n=-1,r=0,i=-1,s=!0,o=0;t.length>=2&&t.charCodeAt(1)===me&&he(t.charCodeAt(0))&&(e=r=2);for(let a=t.length-1;a>=e;--a){let l=t.charCodeAt(a);if(O(l)){if(!s){r=a+1;break}continue}i===-1&&(s=!1,i=a+1),l===Oe?n===-1?n=a:o!==1&&(o=1):n!==-1&&(o=-1)}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?"":t.slice(n,i)},format:ur.bind(null,"\\"),parse(t){j(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let n=t.length,r=0,i=t.charCodeAt(0);if(n===1)return O(i)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(O(i)){if(r=1,O(t.charCodeAt(1))){let c=2,f=c;for(;c<n&&!O(t.charCodeAt(c));)c++;if(c<n&&c!==f){for(f=c;c<n&&O(t.charCodeAt(c));)c++;if(c<n&&c!==f){for(f=c;c<n&&!O(t.charCodeAt(c));)c++;c===n?r=c:c!==f&&(r=c+1)}}}}else if(he(i)&&t.charCodeAt(1)===me){if(n<=2)return e.root=e.dir=t,e;if(r=2,O(t.charCodeAt(2))){if(n===3)return e.root=e.dir=t,e;r=3}}r>0&&(e.root=t.slice(0,r));let s=-1,o=r,a=-1,l=!0,u=t.length-1,d=0;for(;u>=r;--u){if(i=t.charCodeAt(u),O(i)){if(!l){o=u+1;break}continue}a===-1&&(l=!1,a=u+1),i===Oe?s===-1?s=u:d!==1&&(d=1):s!==-1&&(d=-1)}return a!==-1&&(s===-1||d===0||d===1&&s===a-1&&s===o+1?e.base=e.name=t.slice(o,a):(e.name=t.slice(o,s),e.base=t.slice(o,a),e.ext=t.slice(s,a))),o>0&&o!==r?e.dir=t.slice(0,o-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Fs=(()=>{if(ne){let t=/\\/g;return()=>{let e=ye().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>ye()})(),M={resolve(...t){let e="",n=!1;for(let r=t.length-1;r>=0&&!n;r--){let i=t[r];j(i,`paths[${r}]`),i.length!==0&&(e=`${i}/${e}`,n=i.charCodeAt(0)===J)}if(!n){let r=Fs();e=`${r}/${e}`,n=r.charCodeAt(0)===J}return e=At(e,!n,"/",rn),n?`/${e}`:e.length>0?e:"."},normalize(t){if(j(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===J,n=t.charCodeAt(t.length-1)===J;return t=At(t,!e,"/",rn),t.length===0?e?"/":n?"./":".":(n&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return j(t,"path"),t.length>0&&t.charCodeAt(0)===J},join(...t){if(t.length===0)return".";let e=[];for(let n=0;n<t.length;++n){let r=t[n];j(r,"path"),r.length>0&&e.push(r)}return e.length===0?".":M.normalize(e.join("/"))},relative(t,e){if(j(t,"from"),j(e,"to"),t===e||(t=M.resolve(t),e=M.resolve(e),t===e))return"";let n=1,r=t.length,i=r-n,s=1,o=e.length-s,a=i<o?i:o,l=-1,u=0;for(;u<a;u++){let c=t.charCodeAt(n+u);if(c!==e.charCodeAt(s+u))break;c===J&&(l=u)}if(u===a)if(o>a){if(e.charCodeAt(s+u)===J)return e.slice(s+u+1);if(u===0)return e.slice(s+u)}else i>a&&(t.charCodeAt(n+u)===J?l=u:u===0&&(l=0));let d="";for(u=n+l+1;u<=r;++u)(u===r||t.charCodeAt(u)===J)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(s+l)}`},toNamespacedPath(t){return t},dirname(t){if(j(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===J,n=-1,r=!0;for(let i=t.length-1;i>=1;--i)if(t.charCodeAt(i)===J){if(!r){n=i;break}}else r=!1;return n===-1?e?"/":".":e&&n===1?"//":t.slice(0,n)},basename(t,e){e!==void 0&&j(e,"suffix"),j(t,"path");let n=0,r=-1,i=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(s=t.length-1;s>=0;--s){let l=t.charCodeAt(s);if(l===J){if(!i){n=s+1;break}}else a===-1&&(i=!1,a=s+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(r=s):(o=-1,r=a))}return n===r?r=a:r===-1&&(r=t.length),t.slice(n,r)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===J){if(!i){n=s+1;break}}else r===-1&&(i=!1,r=s+1);return r===-1?"":t.slice(n,r)},extname(t){j(t,"path");let e=-1,n=0,r=-1,i=!0,s=0;for(let o=t.length-1;o>=0;--o){let a=t[o];if(a==="/"){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),a==="."?e===-1?e=o:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||r===-1||s===0||s===1&&e===r-1&&e===n+1?"":t.slice(e,r)},format:ur.bind(null,"/"),parse(t){j(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let n=t.charCodeAt(0)===J,r;n?(e.root="/",r=1):r=0;let i=-1,s=0,o=-1,a=!0,l=t.length-1,u=0;for(;l>=r;--l){let d=t.charCodeAt(l);if(d===J){if(!a){s=l+1;break}continue}o===-1&&(a=!1,o=l+1),d===Oe?i===-1?i=l:u!==1&&(u=1):i!==-1&&(u=-1)}if(o!==-1){let d=s===0&&n?1:s;i===-1||u===0||u===1&&i===o-1&&i===s+1?e.base=e.name=t.slice(d,o):(e.name=t.slice(d,i),e.base=t.slice(d,o),e.ext=t.slice(i,o))}return s>0?e.dir=t.slice(0,s-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};M.win32=q.win32=q;M.posix=q.posix=M;Ke=ne?q.normalize:M.normalize,Ms=ne?q.isAbsolute:M.isAbsolute,W=ne?q.join:M.join,Dt=ne?q.resolve:M.resolve,cr=ne?q.relative:M.relative,$e=ne?q.dirname:M.dirname,Vs=ne?q.basename:M.basename,fr=ne?q.extname:M.extname,Q1=ne?q.format:M.format,J1=ne?q.parse:M.parse,Y1=ne?q.toNamespacedPath:M.toNamespacedPath,xe=ne?q.sep:M.sep,Z1=ne?q.delimiter:M.delimiter});function hr(t,e){let n=Object.create(null);for(let r of t){let i=e(r),s=n[i];s||(s=n[i]=[]),s.push(r)}return n}var pr,mr,dr,on=F(()=>{dr=class{constructor(e,n){this.toKey=n;this._map=new Map;this[pr]="SetWithKey";for(let r of e)this.add(r)}get size(){return this._map.size}add(e){let n=this.toKey(e);return this._map.set(n,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,n){this._map.forEach(r=>e.call(n,r,r,this))}[(mr=Symbol.iterator,pr=Symbol.toStringTag,mr)](){return this.values()}}});function ge(t){$s(t)||Ks.onUnexpectedError(t)}function $s(t){return t instanceof we?!0:t instanceof Error&&t.name===ln&&t.message===ln}var an,Ks,ln,we,gr,kt,Le,Ue=F(()=>{an=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?kt.isErrorNoTelemetry(e)?new kt(e.message+` `+e.stack):new Error(e.message+` `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(n=>{n(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},Ks=new an;ln="Canceled";we=class extends Error{constructor(){super(ln),this.name=this.message}},gr=class t extends Error{static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}},kt=class t extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let n=new t;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Le=class t extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}}});var un=F(()=>{});function Ws(t,e,n=0,r=t.length){let i=n,s=r;for(;i<s;){let o=Math.floor((i+s)/2);e(t[o])?i=o+1:s=o}return i-1}var br,Tr=F(()=>{br=class t{constructor(e){this._array=e;this._findLastMonotonousLastIdx=0}static{this.assertInvariants=!1}findLastMonotonous(e){if(t.assertInvariants){if(this._prevFindLastPredicate){for(let r of this._array)if(this._prevFindLastPredicate(r)&&!e(r))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}let n=Ws(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}}});function yr(t,e){return(n,r)=>e(t(n),t(r))}var _r,xr,vr,Ir=F(()=>{Tr();Ue();(a=>{function t(l){return l<0}a.isLessThan=t;function e(l){return l<=0}a.isLessThanOrEqual=e;function n(l){return l>0}a.isGreaterThan=n;function r(l){return l===0}a.isNeitherLessOrGreaterThan=r,a.greaterThan=1,a.lessThan=-1,a.neitherLessOrGreaterThan=0})(_r||={});xr=(t,e)=>t-e,vr=class t{constructor(e){this.iterate=e}static{this.empty=new t(e=>{})}forEach(e){this.iterate(n=>(e(n),!0))}toArray(){let e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new t(n=>this.iterate(r=>e(r)?n(r):!0))}map(e){return new t(n=>this.iterate(r=>n(e(r))))}some(e){let n=!1;return this.iterate(r=>(n=e(r),!n)),n}findFirst(e){let n;return this.iterate(r=>e(r)?(n=r,!1):!0),n}findLast(e){let n;return this.iterate(r=>(e(r)&&(n=r),!0)),n}findLastMaxBy(e){let n,r=!0;return this.iterate(i=>((r||_r.isGreaterThan(e(i,n)))&&(r=!1,n=i),!0)),n}}});function js(t){return Array.isArray(t)}var cn,Er,Xe,Rr,wr,Pr,fn,dn,Be,St,pn=F(()=>{cn=class{constructor(e,n){this.uri=e;this.value=n}};Xe=class t{constructor(e,n){this[Er]="ResourceMap";if(e instanceof t)this.map=new Map(e.map),this.toKey=n??t.defaultToKey;else if(js(e)){this.map=new Map,this.toKey=n??t.defaultToKey;for(let[r,i]of e)this.set(r,i)}else this.map=new Map,this.toKey=e??t.defaultToKey}static{this.defaultToKey=e=>e.toString()}set(e,n){return this.map.set(this.toKey(e),new cn(e,n)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,n){typeof n<"u"&&(e=e.bind(n));for(let[r,i]of this.map)e(i.value,i.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Er=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},wr=class{constructor(e,n){this[Rr]="ResourceSet";!e||typeof e=="function"?this._map=new Xe(e):(this._map=new Xe(n),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,n){this._map.forEach((r,i)=>e.call(n,i,i,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(Rr=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},fn=class{constructor(){this[Pr]="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,n=0){let r=this._map.get(e);if(r)return n!==0&&this.touch(r,n),r.value}set(e,n,r=0){let i=this._map.get(e);if(i)i.value=n,r!==0&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.key,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}values(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:r.value,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}entries(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let s={value:[r.key,r.value],done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}[(Pr=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._tail,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.previous,r--;this._tail=n,this._size=r,n&&(n.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");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{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==1&&n!==2)){if(n===1){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===2){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}},dn=class extends fn{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),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,n=2){return super.get(e,n)}peek(e){return super.get(e,0)}set(e,n){return super.set(e,n,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Be=class extends dn{constructor(e,n=1){super(e,n)}trim(e){this.trimOld(e)}set(e,n){return super.set(e,n),this.checkTrim(),this}},St=class{constructor(){this.map=new Map}add(e,n){let r=this.map.get(e);r||(r=new Set,this.map.set(e,r)),r.add(n)}delete(e,n){let r=this.map.get(e);r&&(r.delete(n),r.size===0&&this.map.delete(e))}forEach(e,n){let r=this.map.get(e);r&&r.forEach(n)}get(e){let n=this.map.get(e);return n||new Set}}});var Ar=F(()=>{Ue()});function Dr(t){return!!t&&typeof t[Symbol.iterator]=="function"}var mn=F(()=>{Ar()});var hn,kr=F(()=>{mn();(G=>{function t(m){return!!m&&typeof m=="object"&&typeof m[Symbol.iterator]=="function"}G.is=t;let e=Object.freeze([]);function n(){return e}G.empty=n;function*r(m){yield m}G.single=r;function i(m){return t(m)?m:r(m)}G.wrap=i;function s(m){return m??e}G.from=s;function*o(m){for(let w=m.length-1;w>=0;w--)yield m[w]}G.reverse=o;function a(m){return!m||m[Symbol.iterator]().next().done===!0}G.isEmpty=a;function l(m){return m[Symbol.iterator]().next().value}G.first=l;function u(m,w){let k=0;for(let B of m)if(w(B,k++))return!0;return!1}G.some=u;function d(m,w){let k=0;for(let B of m)if(!w(B,k++))return!1;return!0}G.every=d;function c(m,w){for(let k of m)if(w(k))return k}G.find=c;function*f(m,w){for(let k of m)w(k)&&(yield k)}G.filter=f;function*p(m,w){let k=0;for(let B of m)yield w(B,k++)}G.map=p;function*b(m,w){let k=0;for(let B of m)yield*w(B,k++)}G.flatMap=b;function*L(...m){for(let w of m)Dr(w)?yield*w:yield w}G.concat=L;function g(m,w,k){let B=k;for(let Ae of m)B=w(B,Ae);return B}G.reduce=g;function A(m){let w=0;for(let k of m)w++;return w}G.length=A;function*N(m,w,k=m.length){for(w<-m.length&&(w=0),w<0&&(w+=m.length),k<0?k+=m.length:k>m.length&&(k=m.length);w<k;w++)yield m[w]}G.slice=N;function D(m,w=Number.POSITIVE_INFINITY){let k=[];if(w===0)return[k,m];let B=m[Symbol.iterator]();for(let Ae=0;Ae<w;Ae++){let gt=B.next();if(gt.done)return[k,G.empty()];k.push(gt.value)}return[k,{[Symbol.iterator](){return B}}]}G.consume=D;async function I(m){let w=[];for await(let k of m)w.push(k);return w}G.asyncToArray=I;async function U(m){let w=[];for await(let k of m)w=w.concat(k);return w}G.asyncToArrayFlat=U})(hn||={})});function Gs(t){We=t}function Ot(t){return We?.trackDisposable(t),t}function Lt(t){We?.markAsDisposed(t)}function Ce(t,e){We?.setParent(t,e)}function Hs(t,e){if(We)for(let n of t)We.setParent(n,e)}function Or(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}function bn(t){if(hn.is(t)){let e=[];for(let n of t)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function Lr(...t){let e=tt(()=>bn(t));return Hs(t,e),e}function tt(t){return new gn(t)}var zs,We,Sr,gn,Ne,ue,et,Ut=F(()=>{Ir();on();pn();un();kr();Ue();zs=!1,We=null,Sr=class t{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let n=this.livingDisposables.get(e);return n||(n={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,n)),n}trackDisposable(e){let n=this.getDisposableData(e);n.source||(n.source=new Error().stack)}setParent(e,n){let r=this.getDisposableData(e);r.parent=n}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,n){let r=n.get(e);if(r)return r;let i=e.parent?this.getRootParent(this.getDisposableData(e.parent),n):e;return n.set(e,i),i}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,r])=>r.source!==null&&!this.getRootParent(r,e).isSingleton).flatMap(([r])=>r)}computeLeakingDisposables(e=10,n){let r;if(n)r=n;else{let l=new Map,u=[...this.livingDisposables.values()].filter(c=>c.source!==null&&!this.getRootParent(c,l).isSingleton);if(u.length===0)return;let d=new Set(u.map(c=>c.value));if(r=u.filter(c=>!(c.parent&&d.has(c.parent))),r.length===0)throw new Error("There are cyclic diposable chains!")}if(!r)return;function i(l){function u(c,f){for(;c.length>0&&f.some(p=>typeof p=="string"?p===c[0]:c[0].match(p));)c.shift()}let d=l.source.split(` `).map(c=>c.trim().replace("at ","")).filter(c=>c!=="");return u(d,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),d.reverse()}let s=new St;for(let l of r){let u=i(l);for(let d=0;d<=u.length;d++)s.add(u.slice(0,d).join(` `),l)}r.sort(yr(l=>l.idx,xr));let o="",a=0;for(let l of r.slice(0,e)){a++;let u=i(l),d=[];for(let c=0;c<u.length;c++){let f=u[c];f=`(shared with ${s.get(u.slice(0,c+1).join(` `)).size}/${r.length} leaks) at ${f}`;let b=s.get(u.slice(0,c).join(` `)),L=hr([...b].map(g=>i(g)[c]),g=>g);delete L[u[c]];for(let[g,A]of Object.entries(L))A&&d.unshift(` - stacktraces of ${A.length} other leaks continue with ${g}`);d.unshift(f)}o+=` ==================== Leaking disposable ${a}/${r.length}: ${l.value.constructor.name} ==================== ${d.join(` `)} ============================================================ `}return r.length>e&&(o+=` ... and ${r.length-e} more leaking disposables `),{leaks:r,details:o}}};if(zs){let t="__is_disposable_tracked__";Gs(new class{trackDisposable(e){let n=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(n)},3e3)}setParent(e,n){if(e&&e!==ue.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==ue.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}gn=class{constructor(e){this._isDisposed=!1,this._fn=e,Ot(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,Lt(this),this._fn()}}};Ne=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;Ot(this)}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(Lt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{bn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===ue.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return Ce(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&Ce(e,null)}assertNotDisposed(){this._isDisposed&&ge(new Le("Object disposed"))}},ue=class{constructor(){this._store=