UNPKG

code-server

Version:

Run VS Code on a remote server.

400 lines (353 loc) • 594 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 gg=Object.defineProperty;var mg=Object.getOwnPropertyDescriptor;var O=(i,t,e,n)=>{for(var r=n>1?void 0:n?mg(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(n?s(t,e,r):s(r))||r);return n&&r&&gg(t,e,r),r},K=(i,t)=>(e,n)=>t(e,n,i);function hg(i,t,e=0,n=i.length){let r=e,o=n;for(;r<o;){let s=Math.floor((r+o)/2);t(i[s])?r=s+1:o=s}return r-1}var $c=class i{constructor(t){this._array=t;this._findLastMonotonousLastIdx=0}static{this.assertInvariants=!1}findLastMonotonous(t){if(i.assertInvariants){if(this._prevFindLastPredicate){for(let n of this._array)if(this._prevFindLastPredicate(n)&&!t(n))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let e=hg(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=e+1,e===-1?void 0:this._array[e]}};var Sa=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?vt.isErrorNoTelemetry(t)?new vt(t.message+` `+t.stack):new Error(t.message+` `+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},qc=new Sa;function Jt(i){qc.onUnexpectedError(i)}function fe(i){vg(i)||qc.onUnexpectedError(i)}var Zi="Canceled";function vg(i){return i instanceof Ae?!0:i instanceof Error&&i.name===Zi&&i.message===Zi}var Ae=class extends Error{constructor(){super(Zi),this.name=this.message}},Vc=class i extends Error{static{this._name="PendingMigrationError"}static is(t){return t instanceof i||t instanceof Error&&t.name===i._name}constructor(t){super(t),this.name=i._name}};function eo(){let i=new Error(Zi);return i.name=i.message,i}function to(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}var vt=class i extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof i)return t;let e=new i;return e.message=t.message,e.stack=t.stack,e}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},ae=class i extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,i.prototype)}};function Jr(i,t,e=(n,r)=>n===r){if(i===t)return!0;if(!i||!t||i.length!==t.length)return!1;for(let n=0,r=i.length;n<r;n++)if(!e(i[n],t[n]))return!1;return!0}function no(i){return i.filter(t=>!!t)}function Ta(i,t){return i.push(t),()=>bg(i,t)}function bg(i,t){let e=i.indexOf(t);if(e>-1)return i.splice(e,1),t}function xa(i,t){let e;if(typeof t=="number"){let n=t;e=()=>{let r=Math.sin(n++)*179426549;return r-Math.floor(r)}}else e=Math.random;for(let n=i.length-1;n>0;n-=1){let r=Math.floor(e()*(n+1)),o=i[n];i[n]=i[r],i[r]=o}}function jc(i){return i[Math.floor(Math.random()*i.length)]}var Hc;(a=>{function i(l){return l<0}a.isLessThan=i;function t(l){return l<=0}a.isLessThanOrEqual=t;function e(l){return l>0}a.isGreaterThan=e;function n(l){return l===0}a.isNeitherLessOrGreaterThan=n,a.greaterThan=1,a.lessThan=-1,a.neitherLessOrGreaterThan=0})(Hc||={});function Gc(i,t){return(e,n)=>t(i(e),i(n))}var Jc=(i,t)=>i-t;var zc=class i{constructor(t){this.iterate=t}static{this.empty=new i(t=>{})}forEach(t){this.iterate(e=>(t(e),!0))}toArray(){let t=[];return this.iterate(e=>(t.push(e),!0)),t}filter(t){return new i(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new i(e=>this.iterate(n=>e(t(n))))}some(t){let e=!1;return this.iterate(n=>(e=t(n),!e)),e}findFirst(t){let e;return this.iterate(n=>t(n)?(e=n,!1):!0),e}findLast(t){let e;return this.iterate(n=>(t(n)&&(e=n),!0)),e}findLastMaxBy(t){let e,n=!0;return this.iterate(r=>((n||Hc.isGreaterThan(t(r,e)))&&(n=!1,e=r),!0)),e}};function ed(i,t){let e=Object.create(null);for(let n of i){let r=t(n),o=e[r];o||(o=e[r]=[]),o.push(n)}return e}var Xc,Zc,Yc=class{constructor(t,e){this.toKey=e;this._map=new Map;this[Xc]="SetWithKey";for(let n of t)this.add(n)}get size(){return this._map.size}add(t){let e=this.toKey(t);return this._map.set(e,t),this}delete(t){return this._map.delete(this.toKey(t))}has(t){return this._map.has(this.toKey(t))}*entries(){for(let t of this._map.values())yield[t,t]}keys(){return this.values()}*values(){for(let t of this._map.values())yield t}clear(){this._map.clear()}forEach(t,e){this._map.forEach(n=>t.call(e,n,n,this))}[(Zc=Symbol.iterator,Xc=Symbol.toStringTag,Zc)](){return this.values()}};function zn(i,t){let e=this,n=!1,r;return function(){if(n)return r;if(n=!0,t)try{r=i.apply(e,arguments)}finally{t()}else r=i.apply(e,arguments);return r}}var _a=class{constructor(t,e){this.uri=t;this.value=e}};function yg(i){return Array.isArray(i)}var nd,ut=class i{constructor(t,e){this[nd]="ResourceMap";if(t instanceof i)this.map=new Map(t.map),this.toKey=e??i.defaultToKey;else if(yg(t)){this.map=new Map,this.toKey=e??i.defaultToKey;for(let[n,r]of t)this.set(n,r)}else this.map=new Map,this.toKey=t??i.defaultToKey}static{this.defaultToKey=t=>t.toString()}set(t,e){return this.map.set(this.toKey(t),new _a(t,e)),this}get(t){return this.map.get(this.toKey(t))?.value}has(t){return this.map.has(this.toKey(t))}get size(){return this.map.size}clear(){this.map.clear()}delete(t){return this.map.delete(this.toKey(t))}forEach(t,e){typeof e<"u"&&(t=t.bind(e));for(let[n,r]of this.map)t(r.value,r.uri,this)}*values(){for(let t of this.map.values())yield t.value}*keys(){for(let t of this.map.values())yield t.uri}*entries(){for(let t of this.map.values())yield[t.uri,t.value]}*[(nd=Symbol.toStringTag,Symbol.iterator)](){for(let[,t]of this.map)yield[t.uri,t.value]}},rd,td=class{constructor(t,e){this[rd]="ResourceSet";!t||typeof t=="function"?this._map=new ut(t):(this._map=new ut(e),t.forEach(this.add,this))}get size(){return this._map.size}add(t){return this._map.set(t,t),this}clear(){this._map.clear()}delete(t){return this._map.delete(t)}forEach(t,e){this._map.forEach((n,r)=>t.call(e,r,r,this))}has(t){return this._map.has(t)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(rd=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var id,Ea=class{constructor(){this[id]="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(t){return this._map.has(t)}get(t,e=0){let n=this._map.get(t);if(n)return e!==0&&this.touch(n,e),n.value}set(t,e,n=0){let r=this._map.get(t);if(r)r.value=e,n!==0&&this.touch(r,n);else{switch(r={key:t,value:e,next:void 0,previous:void 0},n){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(t,r),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let e=this._map.get(t);if(e)return this._map.delete(t),this.removeItem(e),this._size--,e.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,e){let n=this._state,r=this._head;for(;r;){if(e?t.bind(e)(r.value,r.key,this):t(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let t=this,e=this._state,n=this._head,r={[Symbol.iterator](){return r},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let o={value:n.key,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}values(){let t=this,e=this._state,n=this._head,r={[Symbol.iterator](){return r},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let o={value:n.value,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}entries(){let t=this,e=this._state,n=this._head,r={[Symbol.iterator](){return r},next(){if(t._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let o={value:[n.key,n.value],done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return r}[(id=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._head,n=this.size;for(;e&&n>t;)this._map.delete(e.key),e=e.next,n--;this._head=e,this._size=n,e&&(e.previous=void 0),this._state++}trimNew(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this._tail,n=this.size;for(;e&&n>t;)this._map.delete(e.key),e=e.previous,n--;this._tail=e,this._size=n,e&&(e.next=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let e=t.next,n=t.previous;if(!e||!n)throw new Error("Invalid list");e.previous=n,n.next=e}t.next=void 0,t.previous=void 0,this._state++}touch(t,e){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(e!==1&&e!==2)){if(e===1){if(t===this._head)return;let n=t.next,r=t.previous;t===this._tail?(r.next=void 0,this._tail=r):(n.previous=r,r.next=n),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(e===2){if(t===this._tail)return;let n=t.next,r=t.previous;t===this._head?(n.previous=void 0,this._head=n):(n.previous=r,r.next=n),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((e,n)=>{t.push([n,e])}),t}fromJSON(t){this.clear();for(let[e,n]of t)this.set(e,n)}},Ca=class extends Ea{constructor(t,e=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,e),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,e=2){return super.get(t,e)}peek(t){return super.get(t,0)}set(t,e){return super.set(t,e,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},bt=class extends Ca{constructor(t,e=1){super(t,e)}trim(t){this.trimOld(t)}set(t,e){return super.set(t,e),this.checkTrim(),this}};var ro=class{constructor(){this.map=new Map}add(t,e){let n=this.map.get(t);n||(n=new Set,this.map.set(t,n)),n.add(e)}delete(t,e){let n=this.map.get(t);n&&(n.delete(e),n.size===0&&this.map.delete(t))}forEach(t,e){let n=this.map.get(t);n&&n.forEach(e)}get(t){let e=this.map.get(t);return e||new Set}};function io(i,t){if(!i)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function oo(i,t="unexpected state"){if(!i)throw typeof t=="string"?new ae(`Assertion Failed: ${t}`):t}function Qr(i){if(!i()){debugger;i(),fe(new ae("Assertion Failed"))}}function Me(i){return typeof i=="string"}function so(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function Yr(i){return typeof i=="number"&&!isNaN(i)}function od(i){return!!i&&typeof i[Symbol.iterator]=="function"}function Sg(i){return typeof i>"u"}function jn(i){return!Xr(i)}function Xr(i){return Sg(i)||i===null}function sd(i,t){if(!i)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function Zr(i){return typeof i=="function"}function We(i,t){for(let e in t)if(!(e in i))return!1;return!0}var ei;(rt=>{function i(P){return!!P&&typeof P=="object"&&typeof P[Symbol.iterator]=="function"}rt.is=i;let t=Object.freeze([]);function e(){return t}rt.empty=e;function*n(P){yield P}rt.single=n;function r(P){return i(P)?P:n(P)}rt.wrap=r;function o(P){return P??t}rt.from=o;function*s(P){for(let F=P.length-1;F>=0;F--)yield P[F]}rt.reverse=s;function a(P){return!P||P[Symbol.iterator]().next().done===!0}rt.isEmpty=a;function l(P){return P[Symbol.iterator]().next().value}rt.first=l;function c(P,F){let A=0;for(let Z of P)if(F(Z,A++))return!0;return!1}rt.some=c;function p(P,F){let A=0;for(let Z of P)if(!F(Z,A++))return!1;return!0}rt.every=p;function u(P,F){for(let A of P)if(F(A))return A}rt.find=u;function*f(P,F){for(let A of P)F(A)&&(yield A)}rt.filter=f;function*m(P,F){let A=0;for(let Z of P)yield F(Z,A++)}rt.map=m;function*v(P,F){let A=0;for(let Z of P)yield*F(Z,A++)}rt.flatMap=v;function*h(...P){for(let F of P)od(F)?yield*F:yield F}rt.concat=h;function I(P,F,A){let Z=A;for(let ie of P)Z=F(Z,ie);return Z}rt.reduce=I;function y(P){let F=0;for(let A of P)F++;return F}rt.length=y;function*S(P,F,A=P.length){for(F<-P.length&&(F=0),F<0&&(F+=P.length),A<0?A+=P.length:A>P.length&&(A=P.length);F<A;F++)yield P[F]}rt.slice=S;function C(P,F=Number.POSITIVE_INFINITY){let A=[];if(F===0)return[A,P];let Z=P[Symbol.iterator]();for(let ie=0;ie<F;ie++){let Ue=Z.next();if(Ue.done)return[A,rt.empty()];A.push(Ue.value)}return[A,{[Symbol.iterator](){return Z}}]}rt.consume=C;async function X(P){let F=[];for await(let A of P)F.push(A);return F}rt.asyncToArray=X;async function Fe(P){let F=[];for await(let A of P)F=F.concat(A);return F}rt.asyncToArrayFlat=Fe})(ei||={});var Tg=!1,Hn=null;var ad=class i{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(t){let e=this.livingDisposables.get(t);return e||(e={parent:null,source:null,isSingleton:!1,value:t,idx:i.idx++},this.livingDisposables.set(t,e)),e}trackDisposable(t){let e=this.getDisposableData(t);e.source||(e.source=new Error().stack)}setParent(t,e){let n=this.getDisposableData(t);n.parent=e}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,e){let n=e.get(t);if(n)return n;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),e):t;return e.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,t).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(t=10,e){let n;if(e)n=e;else{let l=new Map,c=[...this.livingDisposables.values()].filter(u=>u.source!==null&&!this.getRootParent(u,l).isSingleton);if(c.length===0)return;let p=new Set(c.map(u=>u.value));if(n=c.filter(u=>!(u.parent&&p.has(u.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function r(l){function c(u,f){for(;u.length>0&&f.some(m=>typeof m=="string"?m===u[0]:u[0].match(m));)u.shift()}let p=l.source.split(` `).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return c(p,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),p.reverse()}let o=new ro;for(let l of n){let c=r(l);for(let p=0;p<=c.length;p++)o.add(c.slice(0,p).join(` `),l)}n.sort(Gc(l=>l.idx,Jc));let s="",a=0;for(let l of n.slice(0,t)){a++;let c=r(l),p=[];for(let u=0;u<c.length;u++){let f=c[u];f=`(shared with ${o.get(c.slice(0,u+1).join(` `)).size}/${n.length} leaks) at ${f}`;let v=o.get(c.slice(0,u).join(` `)),h=ed([...v].map(I=>r(I)[u]),I=>I);delete h[c[u]];for(let[I,y]of Object.entries(h))y&&p.unshift(` - stacktraces of ${y.length} other leaks continue with ${I}`);p.unshift(f)}s+=` ==================== Leaking disposable ${a}/${n.length}: ${l.value.constructor.name} ==================== ${p.join(` `)} ============================================================ `}return n.length>t&&(s+=` ... and ${n.length-t} more leaking disposables `),{leaks:n,details:s}}};function xg(i){Hn=i}if(Tg){let i="__is_disposable_tracked__";xg(new class{trackDisposable(t){let e=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[i]||console.log(e)},3e3)}setParent(t,e){if(t&&t!==L.None)try{t[i]=!0}catch{}}markAsDisposed(t){if(t&&t!==L.None)try{t[i]=!0}catch{}}markAsSingleton(t){}})}function Yt(i){return Hn?.trackDisposable(i),i}function Xt(i){Hn?.markAsDisposed(i)}function bn(i,t){Hn?.setParent(i,t)}function _g(i,t){if(Hn)for(let e of i)Hn.setParent(e,t)}function lo(i){return typeof i=="object"&&i!==null&&typeof i.dispose=="function"&&i.dispose.length===0}function Ke(i){if(ei.is(i)){let t=[];for(let e of i)if(e)try{e.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function ld(...i){let t=w(()=>Ke(i));return _g(i,t),t}var wa=class{constructor(t){this._isDisposed=!1,this._fn=t,Yt(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,Xt(this),this._fn()}}};function w(i){return new wa(i)}var N=class i{constructor(){this._toDispose=new Set;this._isDisposed=!1;Yt(this)}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(Xt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ke(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t||t===L.None)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return bn(t,this),this._isDisposed?i.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.delete(t)&&bn(t,null)}assertNotDisposed(){this._isDisposed&&fe(new ae("Object disposed"))}},L=class{constructor(){this._store=new N;Yt(this),bn(this._store,this)}static{this.None=Object.freeze({dispose(){}})}dispose(){Xt(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}},Qt=class{constructor(){this._isDisposed=!1;Yt(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),t&&bn(t,this),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Xt(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t&&bn(t,null),t}};var ao=class{constructor(){this.references=new Map}acquire(t,...e){let n=this.references.get(t);n||(n={counter:0,object:this.createReferencedObject(t,...e)},this.references.set(t,n));let{object:r}=n,o=zn(()=>{--n.counter===0&&(this.destroyReferencedObject(t,n.object),this.references.delete(t))});return n.counter++,{object:r,dispose:o}}};var it=class{constructor(t=new Map){this._isDisposed=!1;this._store=t,Yt(this)}dispose(){Xt(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Ke(this._store.values())}finally{this._store.clear()}}has(t){return this._store.has(t)}get size(){return this._store.size}get(t){return this._store.get(t)}set(t,e,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(t)?.dispose(),this._store.set(t,e),bn(e,this)}deleteAndDispose(t){this._store.get(t)?.dispose(),this._store.delete(t)}deleteAndLeak(t){let e=this._store.get(t);return e&&bn(e,null),this._store.delete(t),e}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};function cd(i,t){return i.then(e=>(t.isDisposed?e.dispose():t.add(e),e))}var le=class i{static{this.Undefined=new i(void 0)}constructor(t){this.element=t,this.next=i.Undefined,this.prev=i.Undefined}},ti=class{constructor(){this._first=le.Undefined;this._last=le.Undefined;this._size=0}get size(){return this._size}isEmpty(){return this._first===le.Undefined}clear(){let t=this._first;for(;t!==le.Undefined;){let e=t.next;t.prev=le.Undefined,t.next=le.Undefined,t=e}this._first=le.Undefined,this._last=le.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){let n=new le(t);if(this._first===le.Undefined)this._first=n,this._last=n;else if(e){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==le.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==le.Undefined){let t=this._last.element;return this._remove(this._last),t}}peek(){if(this._last!==le.Undefined)return this._last.element}_remove(t){if(t.prev!==le.Undefined&&t.next!==le.Undefined){let e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===le.Undefined&&t.next===le.Undefined?(this._first=le.Undefined,this._last=le.Undefined):t.next===le.Undefined?(this._last=this._last.prev,this._last.next=le.Undefined):t.prev===le.Undefined&&(this._first=this._first.next,this._first.prev=le.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==le.Undefined;)yield t.element,t=t.next}};function Eg(){return globalThis._VSCODE_NLS_MESSAGES}function Pa(){return globalThis._VSCODE_NLS_LANGUAGE}var Cg=Pa()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function dd(i,t){let e;return t.length===0?e=i:e=i.replace(/\{(\d+)\}/g,(n,r)=>{let o=r[0],s=t[o],a=n;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),Cg&&(e="\uFF3B"+e.replace(/[aouei]/g,"$&$&")+"\uFF3D"),e}function g(i,t,...e){return dd(typeof i=="number"?Rg(i,t):t,e)}function Rg(i,t){let e=Eg()?.[i];if(typeof e!="string"){if(typeof t=="string")return t;throw new Error(`!!! NLS MISSING: ${i} !!!`)}return e}var yn="en",ri=!1,ii=!1,ni=!1,wg=!1,pd=!1,Da=!1,Pg=!1,fd=!1,Ag=!1,kg=!1,co,uo=yn,ud=yn,Dg,wt,Pt=globalThis,Ge;typeof Pt.vscode<"u"&&typeof Pt.vscode.process<"u"?Ge=Pt.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Ge=process);var gd=typeof Ge?.versions?.electron=="string",Og=gd&&Ge?.type==="renderer";if(typeof Ge=="object"){ri=Ge.platform==="win32",ii=Ge.platform==="darwin",ni=Ge.platform==="linux",wg=ni&&!!Ge.env.SNAP&&!!Ge.env.SNAP_REVISION,Pg=gd,Ag=!!Ge.env.CI||!!Ge.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!Ge.env.GITHUB_WORKSPACE,co=yn,uo=yn;let i=Ge.env.VSCODE_NLS_CONFIG;if(i)try{let t=JSON.parse(i);co=t.userLocale,ud=t.osLocale,uo=t.resolvedLanguage||yn,Dg=t.languagePack?.translationsConfigFile}catch{}pd=!0}else typeof navigator=="object"&&!Og?(wt=navigator.userAgent,ri=wt.indexOf("Windows")>=0,ii=wt.indexOf("Macintosh")>=0,fd=(wt.indexOf("Macintosh")>=0||wt.indexOf("iPad")>=0||wt.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ni=wt.indexOf("Linux")>=0,kg=wt?.indexOf("Mobi")>=0,Da=!0,uo=Pa()||yn,co=navigator.language.toLowerCase(),ud=co):console.error("Unable to resolve platform.");var ka=0;ii?ka=1:ri?ka=3:ni&&(ka=2);var B=ri,Je=ii,ve=ni;var md=pd;var In=Da,Lg=Da&&typeof Pt.importScripts=="function",hd=Lg?Pt.origin:void 0;var yt=wt,Zt=uo,Fg;(n=>{function i(){return Zt}n.value=i;function t(){return Zt.length===2?Zt==="en":Zt.length>=3?Zt[0]==="e"&&Zt[1]==="n"&&Zt[2]==="-":!1}n.isDefaultVariant=t;function e(){return Zt==="en"}n.isDefault=e})(Fg||={});var Ug=typeof Pt.postMessage=="function"&&!Pt.importScripts,vd=(()=>{if(Ug){let i=[];Pt.addEventListener("message",e=>{if(e.data&&e.data.vscodeScheduleAsyncWork)for(let n=0,r=i.length;n<r;n++){let o=i[n];if(o.id===e.data.vscodeScheduleAsyncWork){i.splice(n,1),o.callback();return}}});let t=0;return e=>{let n=++t;i.push({id:n,callback:e}),Pt.postMessage({vscodeScheduleAsyncWork:n},"*")}}return i=>setTimeout(i)})();var po=ii||fd?2:ri?1:3;var Oa=!!(yt&&yt.indexOf("Chrome")>=0),bd=!!(yt&&yt.indexOf("Firefox")>=0),yd=!!(!Oa&&yt&&yt.indexOf("Safari")>=0),Id=!!(yt&&yt.indexOf("Edg/")>=0),ny=!!(yt&&yt.indexOf("Android")>=0);var Sn,La=globalThis.vscode;if(typeof La<"u"&&typeof La.process<"u"){let i=La.process;Sn={get platform(){return i.platform},get arch(){return i.arch},get env(){return i.env},cwd(){return i.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?Sn={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Sn={get platform(){return B?"win32":Je?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var Gn=Sn.cwd,be=Sn.env,go=Sn.platform,oy=Sn.arch;var Ng=globalThis.performance.now.bind(globalThis.performance),mo=class i{static create(t){return new i(t)}constructor(t){this._now=t===!1?Date.now:Ng,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};var Sd=!1,Mg=!1,Wg=100,Td=6e4;function xd(){return!!be.VSCODE_DEV}var Q;(hn=>{hn.None=()=>L.None;function t(k){if(Mg){let{onDidAddListener:T}=k,E=Qn.create(),R=0;k.onDidAddListener=()=>{++R===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),E.print()),T?.()}}}function e(k,T,E){return m(k,()=>{},0,void 0,T??!0,void 0,E)}hn.defer=e;function n(k){return(T,E=null,R)=>{let D=!1,U;return U=k($=>{if(!D)return U?U.dispose():D=!0,T.call(E,$)},null,R),D&&U.dispose(),U}}hn.once=n;function r(k,T){return hn.once(hn.filter(k,T))}hn.onceIf=r;function o(k,T,E){return u((R,D=null,U)=>k($=>R.call(D,T($)),null,U),E)}hn.map=o;function s(k,T,E){return u((R,D=null,U)=>k($=>{T($),R.call(D,$)},null,U),E)}hn.forEach=s;function a(k,T,E){return u((R,D=null,U)=>k($=>T($)&&R.call(D,$),null,U),E)}hn.filter=a;function l(k){return k}hn.signal=l;function c(...k){return(T,E=null,R)=>{let D=ld(...k.map(U=>U($=>T.call(E,$))));return f(D,R)}}hn.any=c;function p(k,T,E,R){let D=E;return o(k,U=>(D=T(D,U),D),R)}hn.reduce=p;function u(k,T){let E,R={onWillAddFirstListener(){E=k(D.fire,D)},onDidRemoveLastListener(){E?.dispose()}};T||t(R);let D=new x(R);return T?.add(D),D.event}function f(k,T){return T instanceof Array?T.push(k):T&&T.add(k),k}function m(k,T,E=100,R=!1,D=!1,U,$){let we,oe,Ne,Pe=0,qe,Rt={leakWarningThreshold:U,onWillAddFirstListener(){we=k(Wc=>{Pe++,oe=T(oe,Wc),R&&!Ne&&(vn.fire(oe),oe=void 0),qe=()=>{let Bc=oe;oe=void 0,Ne=void 0,(!R||Pe>1)&&vn.fire(Bc),Pe=0},typeof E=="number"?(Ne&&clearTimeout(Ne),Ne=setTimeout(qe,E)):Ne===void 0&&(Ne=null,queueMicrotask(qe))})},onWillRemoveListener(){D&&Pe>0&&qe?.()},onDidRemoveLastListener(){qe=void 0,we.dispose()}};$||t(Rt);let vn=new x(Rt);return $?.add(vn),vn.event}hn.debounce=m;function v(k,T=0,E,R){return hn.debounce(k,(D,U)=>D?(D.push(U),D):[U],T,void 0,E??!0,void 0,R)}hn.accumulate=v;function h(k,T,E=100,R=!0,D=!0,U,$){let we,oe,Ne,Pe=0,qe={leakWarningThreshold:U,onWillAddFirstListener(){we=k(vn=>{Pe++,oe=T(oe,vn),Ne===void 0&&(R&&(Rt.fire(oe),oe=void 0,Pe=0),typeof E=="number"?Ne=setTimeout(()=>{D&&Pe>0&&Rt.fire(oe),oe=void 0,Ne=void 0,Pe=0},E):(Ne=0,queueMicrotask(()=>{D&&Pe>0&&Rt.fire(oe),oe=void 0,Ne=void 0,Pe=0})))})},onDidRemoveLastListener(){we.dispose()}};$||t(qe);let Rt=new x(qe);return $?.add(Rt),Rt.event}hn.throttle=h;function I(k,T=(R,D)=>R===D,E){let R=!0,D;return a(k,U=>{let $=R||!T(U,D);return R=!1,D=U,$},E)}hn.latch=I;function y(k,T,E){return[hn.filter(k,T,E),hn.filter(k,R=>!T(R),E)]}hn.split=y;function S(k,T,E=!1,R=[],D){let U=R.slice(),$;xd()&&($={stack:Qn.create(),timerId:setTimeout(()=>{U&&U.length>0&&$&&!$.warned&&($.warned=!0,console.warn(`[Event.buffer][${T}] potential LEAK detected: ${U.length} events buffered for ${Td/1e3}s without being consumed. Buffered here:`),$.stack.print())},Td),warned:!1},D&&D.add(w(()=>clearTimeout($.timerId))));let we=()=>{$&&clearTimeout($.timerId)},oe=k(qe=>{U?(U.push(qe),xd()&&$&&!$.warned&&U.length>=Wg&&($.warned=!0,console.warn(`[Event.buffer][${T}] potential LEAK detected: ${U.length} events buffered without being consumed. Buffered here:`),$.stack.print())):Pe.fire(qe)});D&&D.add(oe);let Ne=()=>{U?.forEach(qe=>Pe.fire(qe)),U=null,we()},Pe=new x({onWillAddFirstListener(){oe||(oe=k(qe=>Pe.fire(qe)),D&&D.add(oe))},onDidAddFirstListener(){U&&(E?setTimeout(Ne):Ne())},onDidRemoveLastListener(){oe&&oe.dispose(),oe=null,we()}});return D&&D.add(Pe),Pe.event}hn.buffer=S;function C(k,T){return(R,D,U)=>{let $=T(new Fe);return k(function(we){let oe=$.evaluate(we);oe!==X&&R.call(D,oe)},void 0,U)}}hn.chain=C;let X=Symbol("HaltChainable");class Fe{constructor(){this.steps=[]}map(T){return this.steps.push(T),this}forEach(T){return this.steps.push(E=>(T(E),E)),this}filter(T){return this.steps.push(E=>T(E)?E:X),this}reduce(T,E){let R=E;return this.steps.push(D=>(R=T(R,D),R)),this}latch(T=(E,R)=>E===R){let E=!0,R;return this.steps.push(D=>{let U=E||!T(D,R);return E=!1,R=D,U?D:X}),this}evaluate(T){for(let E of this.steps)if(T=E(T),T===X)break;return T}}function rt(k,T,E=R=>R){let R=(...we)=>$.fire(E(...we)),D=()=>k.on(T,R),U=()=>k.removeListener(T,R),$=new x({onWillAddFirstListener:D,onDidRemoveLastListener:U});return $.event}hn.fromNodeEventEmitter=rt;function P(k,T,E=R=>R){let R=(...we)=>$.fire(E(...we)),D=()=>k.addEventListener(T,R),U=()=>k.removeEventListener(T,R),$=new x({onWillAddFirstListener:D,onDidRemoveLastListener:U});return $.event}hn.fromDOMEventEmitter=P;function F(k,T){let E,R,D=new Promise(U=>{R=n(k)(U),Ba(R,T),E=()=>{Ed(R,T)}});return D.cancel=E,T&&D.finally(()=>Ed(R,T)),D}hn.toPromise=F;function A(k,T){return k(E=>T.fire(E))}hn.forward=A;function Z(k,T,E){return T(E),k(R=>T(R))}hn.runAndSubscribe=Z;class ie{constructor(T,E){this._observable=T;this._counter=0;this._hasChanged=!1;let R={onWillAddFirstListener:()=>{T.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{T.removeObserver(this)}};E||t(R),this.emitter=new x(R),E&&E.add(this.emitter)}beginUpdate(T){this._counter++}handlePossibleChange(T){}handleChange(T,E){this._hasChanged=!0}endUpdate(T){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Ue(k,T){return new ie(k,T).emitter.event}hn.fromObservable=Ue;function fg(k){return(T,E,R)=>{let D=0,U=!1,$={beginUpdate(){D++},endUpdate(){D--,D===0&&(k.reportChanges(),U&&(U=!1,T.call(E)))},handlePossibleChange(){},handleChange(){U=!0}};k.addObserver($),k.reportChanges();let we={dispose(){k.removeObserver($)}};return Ba(we,R),we}}hn.fromObservableLight=fg})(Q||={});var Ua=class i{constructor(t){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${t}_${i._idPool++}`,i.all.add(this)}static{this.all=new Set}static{this._idPool=0}start(t){this._stopWatch=new mo,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}},_d=-1;var Na=class i{constructor(t,e,n=(i._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t;this.threshold=e;this.name=n;this._warnCountdown=0}static{this._idPool=1}dispose(){this._stacks?.clear()}check(t,e){let n=this.threshold;if(n<=0||e<n)return;this._stacks||(this._stacks=new Map);let r=this._stacks