code-server
Version:
Run VS Code on a remote server.
27 lines (19 loc) • 1.46 MB
JavaScript
"use strict";/*!--------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/var fm=function(e,t){return fm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},fm(e,t)};export function __extends(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fm(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}export var __assign=function(){return __assign=Object.assign||function(t){for(var r,i=1,s=arguments.length;i<s;i++){r=arguments[i];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},__assign.apply(this,arguments)};export function __rest(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r}export function __decorate(e,t,r,i){var s=arguments.length,n=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(s<3?o(n):s>3?o(t,r,n):o(t,r))||n);return s>3&&n&&Object.defineProperty(t,r,n),n}export function __param(e,t){return function(r,i){t(r,i,e)}}export function __esDecorate(e,t,r,i,s,n){function o(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!t&&e?i.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,i.name):{}),h,d=!1,f=r.length-1;f>=0;f--){var g={};for(var v in i)g[v]=v==="access"?{}:i[v];for(var v in i.access)g.access[v]=i.access[v];g.addInitializer=function(x){if(d)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(x||null))};var b=(0,r[f])(a==="accessor"?{get:u.get,set:u.set}:u[c],g);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(h=o(b.get))&&(u.get=h),(h=o(b.set))&&(u.set=h),(h=o(b.init))&&s.unshift(h)}else(h=o(b))&&(a==="field"?s.unshift(h):u[c]=h)}l&&Object.defineProperty(l,i.name,u),d=!0}export function __runInitializers(e,t,r){for(var i=arguments.length>2,s=0;s<t.length;s++)r=i?t[s].call(e,r):t[s].call(e);return i?r:void 0}export function __propKey(e){return typeof e=="symbol"?e:"".concat(e)}export function __setFunctionName(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}export function __metadata(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}export function __awaiter(e,t,r,i){function s(n){return n instanceof r?n:new r(function(o){o(n)})}return new(r||(r=Promise))(function(n,o){function a(u){try{l(i.next(u))}catch(h){o(h)}}function c(u){try{l(i.throw(u))}catch(h){o(h)}}function l(u){u.done?n(u.value):s(u.value).then(a,c)}l((i=i.apply(e,t||[])).next())})}export function __generator(e,t){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(i=1,s&&(n=l[0]&2?s.return:l[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,l[1])).done)return n;switch(s=0,n&&(l=[l[0]&2,n.value]),l[0]){case 0:case 1:n=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,s=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){r.label=l[1];break}if(l[0]===6&&r.label<n[1]){r.label=n[1],n=l;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(l);break}n[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(u){l=[6,u],s=0}finally{i=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}export var __createBinding=Object.create?function(e,t,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]};export function __exportStar(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&__createBinding(t,e,r)}export function __values(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}export function __read(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),s,n=[],o;try{for(;(t===void 0||t-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return n}export function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}export function __spreadArrays(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var i=Array(e),s=0,t=0;t<r;t++)for(var n=arguments[t],o=0,a=n.length;o<a;o++,s++)i[s]=n[o];return i}export function __spreadArray(e,t,r){if(r||arguments.length===2)for(var i=0,s=t.length,n;i<s;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}export function __await(e){return this instanceof __await?(this.v=e,this):new __await(e)}export function __asyncGenerator(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,t||[]),s,n=[];return s={},a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(f){return function(g){return Promise.resolve(g).then(f,h)}}function a(f,g){i[f]&&(s[f]=function(v){return new Promise(function(b,x){n.push([f,v,b,x])>1||c(f,v)})},g&&(s[f]=g(s[f])))}function c(f,g){try{l(i[f](g))}catch(v){d(n[0][3],v)}}function l(f){f.value instanceof __await?Promise.resolve(f.value.v).then(u,h):d(n[0][2],f)}function u(f){c("next",f)}function h(f){c("throw",f)}function d(f,g){f(g),n.shift(),n.length&&c(n[0][0],n[0][1])}}export function __asyncDelegator(e){var t,r;return t={},i("next"),i("throw",function(s){throw s}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(s,n){t[s]=e[s]?function(o){return(r=!r)?{value:__await(e[s](o)),done:!1}:n?n(o):o}:n}}export function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(n){r[n]=e[n]&&function(o){return new Promise(function(a,c){o=e[n](o),s(a,c,o.done,o.value)})}}function s(n,o,a,c){Promise.resolve(c).then(function(l){n({value:l,done:a})},o)}}export function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var eP=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};export function __importStar(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return eP(t,e),t}export function __importDefault(e){return e&&e.__esModule?e:{default:e}}export function __classPrivateFieldGet(e,t,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)}export function __classPrivateFieldSet(e,t,r,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}export function __classPrivateFieldIn(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}export function __addDisposableResource(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],r&&(s=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");s&&(i=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),e.stack.push({value:t,dispose:i,async:r})}else r&&e.stack.push({async:!0});return t}var tP=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var i=new Error(r);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};export function __disposeResources(e){function t(i){e.error=e.hasError?new tP(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}function r(){for(;e.stack.length;){var i=e.stack.pop();try{var s=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(s).then(r,function(n){return t(n),r()})}catch(n){t(n)}}if(e.hasError)throw e.error}return r()}export default{__extends,__assign,__rest,__decorate,__param,__metadata,__awaiter,__generator,__createBinding,__exportStar,__values,__read,__spread,__spreadArrays,__spreadArray,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet,__classPrivateFieldIn,__addDisposableResource,__disposeResources};var rP=Object.create,pm=Object.defineProperty,iP=Object.getOwnPropertyDescriptor,A4=Object.getOwnPropertyNames,sP=Object.getPrototypeOf,nP=Object.prototype.hasOwnProperty,oP=(e,t)=>function(){return t||(0,e[A4(e)[0]])((t={exports:{}}).exports,t),t.exports},aP=(e,t)=>{for(var r in t)pm(e,r,{get:t[r],enumerable:!0})},cP=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of A4(t))!nP.call(e,s)&&s!==r&&pm(e,s,{get:()=>t[s],enumerable:!(i=iP(t,s))||i.enumerable});return e},T4=(e,t,r)=>(r=e!=null?rP(sP(e)):{},cP(t||!e||!e.__esModule?pm(r,"default",{value:e,enumerable:!0}):r,e)),R4=oP({"node_modules/minimist/index.js"(e,t){"use strict";function r(n,o){var a=n;o.slice(0,-1).forEach(function(l){a=a[l]||{}});var c=o[o.length-1];return c in a}function i(n){return typeof n=="number"||/^0x[0-9a-f]+$/i.test(n)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n)}function s(n,o){return o==="constructor"&&typeof n[o]=="function"||o==="__proto__"}t.exports=function(n,o){o||(o={});var a={bools:{},strings:{},unknownFn:null};typeof o.unknown=="function"&&(a.unknownFn=o.unknown),typeof o.boolean=="boolean"&&o.boolean?a.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach(function(M){a.bools[M]=!0});var c={};function l(M){return c[M].some(function(Q){return a.bools[Q]})}Object.keys(o.alias||{}).forEach(function(M){c[M]=[].concat(o.alias[M]),c[M].forEach(function(Q){c[Q]=[M].concat(c[M].filter(function(ke){return Q!==ke}))})}),[].concat(o.string).filter(Boolean).forEach(function(M){a.strings[M]=!0,c[M]&&[].concat(c[M]).forEach(function(Q){a.strings[Q]=!0})});var u=o.default||{},h={_:[]};function d(M,Q){return a.allBools&&/^--[^=]+$/.test(Q)||a.strings[M]||a.bools[M]||c[M]}function f(M,Q,ke){for(var re=M,it=0;it<Q.length-1;it++){var B=Q[it];if(s(re,B))return;re[B]===void 0&&(re[B]={}),(re[B]===Object.prototype||re[B]===Number.prototype||re[B]===String.prototype)&&(re[B]={}),re[B]===Array.prototype&&(re[B]=[]),re=re[B]}var _=Q[Q.length-1];s(re,_)||((re===Object.prototype||re===Number.prototype||re===String.prototype)&&(re={}),re===Array.prototype&&(re=[]),re[_]===void 0||a.bools[_]||typeof re[_]=="boolean"?re[_]=ke:Array.isArray(re[_])?re[_].push(ke):re[_]=[re[_],ke])}function g(M,Q,ke){if(!(ke&&a.unknownFn&&!d(M,ke)&&a.unknownFn(ke)===!1)){var re=!a.strings[M]&&i(Q)?Number(Q):Q;f(h,M.split("."),re),(c[M]||[]).forEach(function(it){f(h,it.split("."),re)})}}Object.keys(a.bools).forEach(function(M){g(M,u[M]===void 0?!1:u[M])});var v=[];n.indexOf("--")!==-1&&(v=n.slice(n.indexOf("--")+1),n=n.slice(0,n.indexOf("--")));for(var b=0;b<n.length;b++){var x=n[b],S,C;if(/^--.+=/.test(x)){var O=x.match(/^--([^=]+)=([\s\S]*)$/);S=O[1];var P=O[2];a.bools[S]&&(P=P!=="false"),g(S,P,x)}else if(/^--no-.+/.test(x))S=x.match(/^--no-(.+)/)[1],g(S,!1,x);else if(/^--.+/.test(x))S=x.match(/^--(.+)/)[1],C=n[b+1],C!==void 0&&!/^(-|--)[^-]/.test(C)&&!a.bools[S]&&!a.allBools&&(!c[S]||!l(S))?(g(S,C,x),b+=1):/^(true|false)$/.test(C)?(g(S,C==="true",x),b+=1):g(S,a.strings[S]?"":!0,x);else if(/^-[^-]+/.test(x)){for(var j=x.slice(1,-1).split(""),z=!1,V=0;V<j.length;V++){if(C=x.slice(V+2),C==="-"){g(j[V],C,x);continue}if(/[A-Za-z]/.test(j[V])&&C[0]==="="){g(j[V],C.slice(1),x),z=!0;break}if(/[A-Za-z]/.test(j[V])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(C)){g(j[V],C,x),z=!0;break}if(j[V+1]&&j[V+1].match(/\W/)){g(j[V],x.slice(V+2),x),z=!0;break}else g(j[V],a.strings[j[V]]?"":!0,x)}S=x.slice(-1)[0],!z&&S!=="-"&&(n[b+1]&&!/^(-|--)[^-]/.test(n[b+1])&&!a.bools[S]&&(!c[S]||!l(S))?(g(S,n[b+1],x),b+=1):n[b+1]&&/^(true|false)$/.test(n[b+1])?(g(S,n[b+1]==="true",x),b+=1):g(S,a.strings[S]?"":!0,x))}else if((!a.unknownFn||a.unknownFn(x)!==!1)&&h._.push(a.strings._||!i(x)?x:Number(x)),o.stopEarly){h._.push.apply(h._,n.slice(b+1));break}}return Object.keys(u).forEach(function(M){r(h,M.split("."))||(f(h,M.split("."),u[M]),(c[M]||[]).forEach(function(Q){f(h,Q.split("."),u[M])}))}),o["--"]?h["--"]=v.slice():v.forEach(function(M){h._.push(M)}),h}}}),lP=T4(R4(),1);import*as uP from"http";import*as hP from"net";var L4;function gm(e,t){const r=Object.create(null);for(const i of e){const s=t(i);let n=r[s];n||(n=r[s]=[]),n.push(i)}return r}function dP(e,t){const r=[],i=[];for(const s of e)t.has(s)||r.push(s);for(const s of t)e.has(s)||i.push(s);return{removed:r,added:i}}var Fq=class{static{L4=Symbol.toStringTag}constructor(e,t){this.b=t,this.a=new Map,this[L4]="SetWithKey";for(const r of e)this.add(r)}get size(){return this.a.size}add(e){const t=this.b(e);return this.a.set(t,e),this}delete(e){return this.a.delete(this.b(e))}has(e){return this.a.has(this.b(e))}*entries(){for(const e of this.a.values())yield[e,e]}keys(){return this.values()}*values(){for(const e of this.a.values())yield e}clear(){this.a.clear()}forEach(e,t){this.a.forEach(r=>e.call(t,r,r,this))}[Symbol.iterator](){return this.values()}},fP=class{constructor(){this.b=[],this.a=function(e){setTimeout(()=>{throw e.stack?fi.isErrorNoTelemetry(e)?new fi(e.message+`
`+e.stack):new Error(e.message+`
`+e.stack):e},0)}}addListener(e){return this.b.push(e),()=>{this.d(e)}}c(e){this.b.forEach(t=>{t(e)})}d(e){this.b.splice(this.b.indexOf(e),1)}setUnexpectedErrorHandler(e){this.a=e}getUnexpectedErrorHandler(){return this.a}onUnexpectedError(e){this.a(e),this.c(e)}onUnexpectedExternalError(e){this.a(e)}},zc=new fP;function mm(e){zc.setUnexpectedErrorHandler(e)}function pP(e){if(!e||typeof e!="object")return!1;const t=e;return t.code==="EPIPE"&&t.syscall?.toUpperCase()==="WRITE"}function Ih(e){zc.onUnexpectedError(e)}function at(e){Ui(e)||zc.onUnexpectedError(e)}function N4(e){Ui(e)||zc.onUnexpectedExternalError(e)}function ra(e){if(e instanceof Error){const{name:t,message:r,cause:i}=e,s=e.stacktrace||e.stack;return{$isError:!0,name:t,message:r,stack:s,noTelemetry:fi.isErrorNoTelemetry(e),cause:i?ra(i):void 0,code:e.code}}return e}function F4(e){let t;return e.noTelemetry?t=new fi:(t=new Error,t.name=e.name),t.message=e.message,t.stack=e.stack,e.code&&(t.code=e.code),e.cause&&(t.cause=F4(e.cause)),t}var Dh="Canceled";function Ui(e){return e instanceof Kt?!0:e instanceof Error&&e.name===Dh&&e.message===Dh}var Kt=class extends Error{constructor(){super(Dh),this.name=this.message}};function Vc(){const e=new Error(Dh);return e.name=e.message,e}function Ce(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function vm(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}var Un=class extends TypeError{constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};function O4(e){return e?e.message?e.message:e.stack?e.stack.split(`
`)[0]:String(e):"Error"}var gP=class extends Error{constructor(e){super("NotImplemented"),e&&(this.message=e)}},wm=class extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}},fi=class t4 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof t4)return t;const r=new t4;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},cs=class S3 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,S3.prototype)}};function Ph(e,t){const r=this;let i=!1,s;return function(){if(i)return s;if(i=!0,t)try{s=e.apply(r,arguments)}finally{t()}else s=e.apply(r,arguments);return s}}function mP(e,t,r=0,i=e.length){let s=r,n=i;for(;s<n;){const o=Math.floor((s+n)/2);t(e[o])?s=o+1:n=o}return s-1}function vP(e,t,r=0,i=e.length){let s=r,n=i;for(;s<n;){const o=Math.floor((s+n)/2);t(e[o])?n=o:s=o+1}return s}var Oq=class k3{static{this.assertInvariants=!1}constructor(t){this.e=t,this.c=0}findLastMonotonous(t){if(k3.assertInvariants){if(this.d){for(const i of this.e)if(this.d(i)&&!t(i))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this.d=t}const r=mP(this.e,t,this.c);return this.c=r+1,r===-1?void 0:this.e[r]}};function pi(e,t,r=(i,s)=>i===s){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let i=0,s=e.length;i<s;i++)if(!r(e[i],t[i]))return!1;return!0}function wP(e,t){const r=[];let i;for(const s of e.slice(0).sort(t))!i||t(i[0],s)!==0?(i=[s],r.push(i)):i.push(s);return r}function M4(e,t,r){const i=[];function s(a,c,l){if(c===0&&l.length===0)return;const u=i[i.length-1];u&&u.start+u.deleteCount===a?(u.deleteCount+=c,u.toInsert.push(...l)):i.push({start:a,deleteCount:c,toInsert:l})}let n=0,o=0;for(;;){if(n===e.length){s(n,0,t.slice(o));break}if(o===t.length){s(n,e.length-n,[]);break}const a=e[n],c=t[o],l=r(a,c);l===0?(n+=1,o+=1):l<0?(s(n,1,[]),n+=1):l>0&&(s(n,0,[c]),o+=1)}return i}function bP(e,t,r){const i=M4(e,t,r),s=[],n=[];for(const o of i)s.push(...e.slice(o.start,o.start+o.deleteCount)),n.push(...o.toInsert);return{removed:s,added:n}}function yP(e,t,r,i,s){return r===0?Promise.resolve([]):new Promise((n,o)=>{(async()=>{const a=e.length,c=e.slice(0,r).sort(t);for(let l=r,u=Math.min(r+i,a);l<a;l=u,u=Math.min(u+i,a)){if(l>r&&await new Promise(h=>setTimeout(h)),s&&s.isCancellationRequested)throw new Kt;EP(e,t,c,l,u)}return c})().then(n,o)})}function EP(e,t,r,i,s){for(const n=r.length;i<s;i++){const o=e[i];if(t(o,r[n-1])<0){r.pop();const a=vP(r,c=>t(o,c)<0);r.splice(a,0,o)}}}function yt(e){return e.filter(t=>!!t)}function xP(e){let t=0;for(let r=0;r<e.length;r++)e[r]&&(e[t]=e[r],t+=1);e.length=t}function bm(e){return!Array.isArray(e)||e.length===0}function ia(e){return Array.isArray(e)&&e.length>0}function sa(e,t=r=>r){const r=new Set;return e.filter(i=>{const s=t(i);return r.has(s)?!1:(r.add(s),!0)})}function U4(e,t){return e.push(t),()=>SP(e,t)}function SP(e,t){const r=e.indexOf(t);if(r>-1)return e.splice(r,1),t}function j4(e,t){let r;if(typeof t=="number"){let i=t;r=()=>{const s=Math.sin(i++)*179426549;return s-Math.floor(s)}}else r=Math.random;for(let i=e.length-1;i>0;i-=1){const s=Math.floor(r()*(i+1)),n=e[i];e[i]=e[s],e[s]=n}}function Ah(e,t){return Array.isArray(e)?e.map(t):t(e)}function ei(e){return Array.isArray(e)?e:[e]}var ym;(function(e){function t(n){return n<0}e.isLessThan=t;function r(n){return n<=0}e.isLessThanOrEqual=r;function i(n){return n>0}e.isGreaterThan=i;function s(n){return n===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(ym||(ym={}));function kP(e,t){return(r,i)=>t(e(r),e(i))}var $P=(e,t)=>e-t,Mq=class Qg{static{this.empty=new Qg(t=>{})}constructor(t){this.iterate=t}forEach(t){this.iterate(r=>(t(r),!0))}toArray(){const t=[];return this.iterate(r=>(t.push(r),!0)),t}filter(t){return new Qg(r=>this.iterate(i=>t(i)?r(i):!0))}map(t){return new Qg(r=>this.iterate(i=>r(t(i))))}some(t){let r=!1;return this.iterate(i=>(r=t(i),!r)),r}findFirst(t){let r;return this.iterate(i=>t(i)?(r=i,!1):!0),r}findLast(t){let r;return this.iterate(i=>(t(i)&&(r=i),!0)),r}findLastMaxBy(t){let r,i=!0;return this.iterate(s=>((i||ym.isGreaterThan(t(s,r)))&&(i=!1,r=s),!0)),r}},H4,_4,B4;function CP(e,t,r){let i=e.get(t);return i===void 0&&(i=r,e.set(t,i)),i}var IP=class{constructor(e,t){this.uri=e,this.value=t}};function DP(e){return Array.isArray(e)}var Bt=class ph{static{this.c=t=>t.toString()}constructor(t,r){if(this[H4]="ResourceMap",t instanceof ph)this.d=new Map(t.d),this.e=r??ph.c;else if(DP(t)){this.d=new Map,this.e=r??ph.c;for(const[i,s]of t)this.set(i,s)}else this.d=new Map,this.e=t??ph.c}set(t,r){return this.d.set(this.e(t),new IP(t,r)),this}get(t){return this.d.get(this.e(t))?.value}has(t){return this.d.has(this.e(t))}get size(){return this.d.size}clear(){this.d.clear()}delete(t){return this.d.delete(this.e(t))}forEach(t,r){typeof r<"u"&&(t=t.bind(r));for(const[i,s]of this.d)t(s.value,s.uri,this)}*values(){for(const t of this.d.values())yield t.value}*keys(){for(const t of this.d.values())yield t.uri}*entries(){for(const t of this.d.values())yield[t.uri,t.value]}*[(H4=Symbol.toStringTag,Symbol.iterator)](){for(const[,t]of this.d)yield[t.uri,t.value]}},W4=class{constructor(e,t){this[_4]="ResourceSet",!e||typeof e=="function"?this.c=new Bt(e):(this.c=new Bt(t),e.forEach(this.add,this))}get size(){return this.c.size}add(e){return this.c.set(e,e),this}clear(){this.c.clear()}delete(e){return this.c.delete(e)}forEach(e,t){this.c.forEach((r,i)=>e.call(t,i,i,this))}has(e){return this.c.has(e)}entries(){return this.c.entries()}keys(){return this.c.keys()}values(){return this.c.keys()}[(_4=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},z4;(function(e){e[e.None=0]="None",e[e.AsOld=1]="AsOld",e[e.AsNew=2]="AsNew"})(z4||(z4={}));var PP=class{constructor(){this[B4]="LinkedMap",this.c=new Map,this.d=void 0,this.e=void 0,this.f=0,this.g=0}clear(){this.c.clear(),this.d=void 0,this.e=void 0,this.f=0,this.g++}isEmpty(){return!this.d&&!this.e}get size(){return this.f}get first(){return this.d?.value}get last(){return this.e?.value}has(e){return this.c.has(e)}get(e,t=0){const r=this.c.get(e);if(r)return t!==0&&this.n(r,t),r.value}set(e,t,r=0){let i=this.c.get(e);if(i)i.value=t,r!==0&&this.n(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case 0:this.l(i);break;case 1:this.k(i);break;case 2:this.l(i);break;default:this.l(i);break}this.c.set(e,i),this.f++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this.c.get(e);if(t)return this.c.delete(e),this.m(t),this.f--,t.value}shift(){if(!this.d&&!this.e)return;if(!this.d||!this.e)throw new Error("Invalid list");const e=this.d;return this.c.delete(e.key),this.m(e),this.f--,e.value}forEach(e,t){const r=this.g;let i=this.d;for(;i;){if(t?e.bind(t)(i.value,i.key,this):e(i.value,i.key,this),this.g!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this,t=this.g;let r=this.d;const i={[Symbol.iterator](){return i},next(){if(e.g!==t)throw new Error("LinkedMap got modified during iteration.");if(r){const s={value:r.key,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}values(){const e=this,t=this.g;let r=this.d;const i={[Symbol.iterator](){return i},next(){if(e.g!==t)throw new Error("LinkedMap got modified during iteration.");if(r){const s={value:r.value,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}entries(){const e=this,t=this.g;let r=this.d;const i={[Symbol.iterator](){return i},next(){if(e.g!==t)throw new Error("LinkedMap got modified during iteration.");if(r){const s={value:[r.key,r.value],done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}[(B4=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}h(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this.d,r=this.size;for(;t&&r>e;)this.c.delete(t.key),t=t.next,r--;this.d=t,this.f=r,t&&(t.previous=void 0),this.g++}j(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this.e,r=this.size;for(;t&&r>e;)this.c.delete(t.key),t=t.previous,r--;this.e=t,this.f=r,t&&(t.next=void 0),this.g++}k(e){if(!this.d&&!this.e)this.e=e;else if(this.d)e.next=this.d,this.d.previous=e;else throw new Error("Invalid list");this.d=e,this.g++}l(e){if(!this.d&&!this.e)this.d=e;else if(this.e)e.previous=this.e,this.e.next=e;else throw new Error("Invalid list");this.e=e,this.g++}m(e){if(e===this.d&&e===this.e)this.d=void 0,this.e=void 0;else if(e===this.d){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this.d=e.next}else if(e===this.e){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this.e=e.previous}else{const t=e.next,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.next=t}e.next=void 0,e.previous=void 0,this.g++}n(e,t){if(!this.d||!this.e)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this.d)return;const r=e.next,i=e.previous;e===this.e?(i.next=void 0,this.e=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this.d,this.d.previous=e,this.d=e,this.g++}else if(t===2){if(e===this.e)return;const r=e.next,i=e.previous;e===this.d?(r.previous=void 0,this.d=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this.e,this.e.next=e,this.e=e,this.g++}}}toJSON(){const e=[];return this.forEach((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(const[t,r]of e)this.set(t,r)}},AP=class extends PP{constructor(e,t=1){super(),this.o=e,this.p=Math.min(Math.max(0,t),1)}get limit(){return this.o}set limit(e){this.o=e,this.q()}get ratio(){return this.p}set ratio(e){this.p=Math.min(Math.max(0,e),1),this.q()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}q(){this.size>this.o&&this.r(Math.round(this.o*this.p))}},qc=class extends AP{constructor(e,t=1){super(e,t)}r(e){this.h(e)}set(e,t){return super.set(e,t),this.q(),this}},V4=class{constructor(){this.c=new Map}add(e,t){let r=this.c.get(e);r||(r=new Set,this.c.set(e,r)),r.add(t)}delete(e,t){const r=this.c.get(e);r&&(r.delete(t),r.size===0&&this.c.delete(e))}forEach(e,t){const r=this.c.get(e);r&&r.forEach(t)}get(e){const t=this.c.get(e);return t||new Set}};function dr(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function Em(e,t="Unreachable"){throw new Error(t)}function TP(e,t="unexpected state"){if(!e)throw typeof t=="string"?new cs(`Assertion Failed: ${t}`):t}function q4(e){if(!e()){debugger;e(),at(new cs("Assertion Failed"))}}function Le(e){return typeof e=="string"}function RP(e){return Array.isArray(e)&&e.every(t=>Le(t))}function Et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function LP(e){const t=Object.getPrototypeOf(Uint8Array);return typeof e=="object"&&e instanceof t}function ti(e){return typeof e=="number"&&!isNaN(e)}function NP(e){return!!e&&typeof e[Symbol.iterator]=="function"}function G4(e){return e===!0||e===!1}function Gc(e){return typeof e>"u"}function ri(e){return!It(e)}function It(e){return Gc(e)||e===null}function J4(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function na(e){return TP(e!=null,"Argument is `undefined` or `null`."),e}var FP=Object.prototype.hasOwnProperty;function Q4(e){if(!Et(e))return!1;for(const t in e)if(FP.call(e,t))return!1;return!0}function OP(e){return typeof e=="function"}function MP(e,t){if(Le(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(OP(t)){try{if(e instanceof t)return}catch{}if(!It(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}var br;(function(e){function t(P){return P&&typeof P=="object"&&typeof P[Symbol.iterator]=="function"}e.is=t;const r=Object.freeze([]);function i(){return r}e.empty=i;function*s(P){yield P}e.single=s;function n(P){return t(P)?P:s(P)}e.wrap=n;function o(P){return P||r}e.from=o;function*a(P){for(let j=P.length-1;j>=0;j--)yield P[j]}e.reverse=a;function c(P){return!P||P[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(P){return P[Symbol.iterator]().next().value}e.first=l;function u(P,j){let z=0;for(const V of P)if(j(V,z++))return!0;return!1}e.some=u;function h(P,j){for(const z of P)if(j(z))return z}e.find=h;function*d(P,j){for(const z of P)j(z)&&(yield z)}e.filter=d;function*f(P,j){let z=0;for(const V of P)yield j(V,z++)}e.map=f;function*g(P,j){let z=0;for(const V of P)yield*j(V,z++)}e.flatMap=g;function*v(...P){for(const j of P)NP(j)?yield*j:yield j}e.concat=v;function b(P,j,z){let V=z;for(const M of P)V=j(V,M);return V}e.reduce=b;function x(P){let j=0;for(const z of P)j++;return j}e.length=x;function*S(P,j,z=P.length){for(j<-P.length&&(j=0),j<0&&(j+=P.length),z<0?z+=P.length:z>P.length&&(z=P.length);j<z;j++)yield P[j]}e.slice=S;function C(P,j=Number.POSITIVE_INFINITY){const z=[];if(j===0)return[z,P];const V=P[Symbol.iterator]();for(let M=0;M<j;M++){const Q=V.next();if(Q.done)return[z,e.empty()];z.push(Q.value)}return[z,{[Symbol.iterator](){return V}}]}e.consume=C;async function O(P){const j=[];for await(const z of P)j.push(z);return Promise.resolve(j)}e.asyncToArray=O})(br||(br={}));var UP=!1,oa=null,Uq=class $3{constructor(){this.b=new Map}static{this.a=0}c(t){let r=this.b.get(t);return r||(r={parent:null,source:null,isSingleton:!1,value:t,idx:$3.a++},this.b.set(t,r)),r}trackDisposable(t){const r=this.c(t);r.source||(r.source=new Error().stack)}setParent(t,r){const i=this.c(t);i.parent=r}markAsDisposed(t){this.b.delete(t)}markAsSingleton(t){this.c(t).isSingleton=!0}f(t,r){const i=r.get(t);if(i)return i;const s=t.parent?this.f(this.c(t.parent),r):t;return r.set(t,s),s}getTrackedDisposables(){const t=new Map;return[...this.b.entries()].filter(([,i])=>i.source!==null&&!this.f(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,r){let i;if(r)i=r;else{const c=new Map,l=[...this.b.values()].filter(h=>h.source!==null&&!this.f(h,c).isSingleton);if(l.length===0)return;const u=new Set(l.map(h=>h.value));if(i=l.filter(h=>!(h.parent&&u.has(h.parent))),i.length===0)throw new Error("There are cyclic diposable chains!")}if(!i)return;function s(c){function l(h,d){for(;h.length>0&&d.some(f=>typeof f=="string"?f===h[0]:h[0].match(f));)h.shift()}const u=c.source.split(`
`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return l(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}const n=new V4;for(const c of i){const l=s(c);for(let u=0;u<=l.length;u++)n.add(l.slice(0,u).join(`
`),c)}i.sort(kP(c=>c.idx,$P));let o="",a=0;for(const c of i.slice(0,t)){a++;const l=s(c),u=[];for(let h=0;h<l.length;h++){let d=l[h];d=`(shared with ${n.get(l.slice(0,h+1).join(`
`)).size}/${i.length} leaks) at ${d}`;const g=n.get(l.slice(0,h).join(`
`)),v=gm([...g].map(b=>s(b)[h]),b=>b);delete v[l[h]];for(const[b,x]of Object.entries(v))u.unshift(` - stacktraces of ${x.length} other leaks continue with ${b}`);u.unshift(d)}o+=`
==================== Leaking disposable ${a}/${i.length}: ${c.value.constructor.name} ====================
${u.join(`
`)}
============================================================
`}return i.length>t&&(o+=`
... and ${i.length-t} more leaking disposables
`),{leaks:i,details:o}}};function jP(e){oa=e}if(UP){const e="__is_disposable_tracked__";jP(new class{trackDisposable(t){const r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(r)},3e3)}setParent(t,r){if(t&&t!==te.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==te.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function aa(e){return oa?.trackDisposable(e),e}function ca(e){oa?.markAsDisposed(e)}function Jc(e,t){oa?.setParent(e,t)}function HP(e,t){if(oa)for(const r of e)oa.setParent(r,t)}function _P(e){return typeof e=="object"&&e!==null&&typeof e.dispose=="function"&&e.dispose.length===0}function gi(e){if(br.is(e)){const t=[];for(const r of e)if(r)try{r.dispose()}catch(i){t.push(i)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function X4(...e){const t=se(()=>gi(e));return HP(e,t),t}function se(e){const t=aa({dispose:Ph(()=>{ca(t),e()})});return t}var oe=class C3{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this.f=new Set,this.g=!1,aa(this)}dispose(){this.g||(ca(this),this.g=!0,this.clear())}get isDisposed(){return this.g}clear(){if(this.f.size!==0)try{gi(this.f)}finally{this.f.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return Jc(t,this),this.g?C3.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.f.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this.f.delete(t),t.dispose()}}deleteAndLeak(t){t&&this.f.has(t)&&(this.f.delete(t),Jc(t,null))}},te=class{static{this.None=Object.freeze({dispose(){}})}constructor(){this.q=new oe,aa(this),Jc(this.q,this)}dispose(){ca(this),this.q.dispose()}B(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this.q.add(e)}},ls=class{constructor(){this.b=!1,aa(this)}get value(){return this.b?void 0:this.a}set value(e){this.b||e===this.a||(this.a?.dispose(),e&&Jc(e,this),this.a=e)}clear(){this.value=void 0}dispose(){this.b=!0,ca(this),this.a?.dispose(),this.a=void 0}clearAndLeak(){const e=this.a;return this.a=void 0,e&&Jc(e,null),e}},Qc=class{constructor(){this.a=new Map,this.b=!1,aa(this)}dispose(){ca(this),this.b=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this.a.size)try{gi(this.a.values())}finally{this.a.clear()}}has(e){return this.a.has(e)}get size(){return this.a.size}get(e){return this.a.get(e)}set(e,t,r=!1){this.b&&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),r||this.a.get(e)?.dispose(),this.a.set(e,t)}deleteAndDispose(e){this.a.get(e)?.dispose(),this.a.delete(e)}deleteAndLeak(e){const t=this.a.get(e);return this.a.delete(e),t}keys(){return this.a.keys()}values(){return this.a.values()}[Symbol.iterator](){return this.a[Symbol.iterator]()}},Dt=class Xg{static{this.Undefined=new Xg(void 0)}constructor(t){this.element=t,this.next=Xg.Undefined,this.prev=Xg.Undefined}},Xc=class{constructor(){this.a=Dt.Undefined,this.b=Dt.Undefined,this.c=0}get size(){return this.c}isEmpty(){return this.a===Dt.Undefined}clear(){let e=this.a;for(;e!==Dt.Undefined;){const t=e.next;e.prev=Dt.Undefined,e.next=Dt.Undefined,e=t}this.a=Dt.Undefined,this.b=Dt.Undefined,this.c=0}unshift(e){return this.d(e,!1)}push(e){return this.d(e,!0)}d(e,t){const r=new Dt(e);if(this.a===Dt.Undefined)this.a=r,this.b=r;else if(t){const s=this.b;this.b=r,r.prev=s,s.next=r}else{const s=this.a;this.a=r,r.next=s,s.prev=r}this.c+=1;let i=!1;return()=>{i||(i=!0,this.e(r))}}shift(){if(this.a!==Dt.Undefined){const e=this.a.element;return this.e(this.a),e}}pop(){if(this.b!==Dt.Undefined){const e=this.b.element;return this.e(this.b),e}}e(e){if(e.prev!==Dt.Undefined&&e.next!==Dt.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Dt.Undefined&&e.next===Dt.Undefined?(this.a=Dt.Undefined,this.b=Dt.Undefined):e.next===Dt.Undefined?(this.b=this.b.prev,this.b.next=Dt.Undefined):e.prev===Dt.Undefined&&(this.a=this.a.next,this.a.prev=Dt.Undefined);this.c-=1}*[Symbol.iterator](){let e=this.a;for(;e!==Dt.Undefined;)yield e.element,e=e.next}},BP=globalThis.performance&&typeof globalThis.performance.now=="function",Nr=class I3{static create(t){return new I3(t)}constructor(t){this.c=BP&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this.a=this.c(),this.b=-1}stop(){this.b=this.c()}reset(){this.a=this.c(),this.b=-1}elapsed(){return this.b!==-1?this.b-this.a:this.c()-this.a}},Y4=!1,WP=!1,_e;(function(e){e.None=()=>te.None;function t(B){if(WP){const{onDidAddListener:_}=B,ee=xm.create();let Y=0;B.onDidAddListener=()=>{++Y===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),ee.print()),_?.()}}}function r(B,_){return f(B,()=>{},0,void 0,!0,void 0,_)}e.defer=r;function i(B){return(_,ee=null,Y)=>{let K=!1,we;return we=B(Te=>{if(!K)return we?we.dispose():K=!0,_.call(ee,Te)},null,Y),K&&we.dispose(),we}}e.once=i;function s(B,_){return e.once(e.filter(B,_))}e.onceIf=s;function n(B,_,ee){return h((Y,K=null,we)=>B(Te=>Y.call(K,_(Te)),null,we),ee)}e.map=n;function o(B,_,ee){return h((Y,K=null,we)=>B(Te=>{_(Te),Y.call(K,Te)},null,we),ee)}e.forEach=o;function a(B,_,ee){return h((Y,K=null,we)=>B(Te=>_(Te)&&Y.call(K,Te),null,we),ee)}e.filter=a;function c(B){return B}e.signal=c;function l(...B){return(_,ee=null,Y)=>{const K=X4(...B.map(we=>we(Te=>_.call(ee,Te))));return d(K,Y)}}e.any=l;function u(B,_,ee,Y){let K=ee;return n(B,we=>(K=_(K,we),K),Y)}e.reduce=u;function h(B,_){let ee;const Y={onWillAddFirstListener(){ee=B(K.fire,K)},onDidRemoveLastListener(){ee?.dispose()}};_||t(Y);const K=new D(Y);return _?.add(K),K.event}function d(B,_){return _ instanceof Array?_.push(B):_&&_.add(B),B}function f(B,_,ee=100,Y=!1,K=!1,we,Te){let xe,Ye,zt,wt=0,Yt;const ur={leakWarningThreshold:we,onWillAddFirstListener(){xe=B(os=>{wt++,Ye=_(Ye,os),Y&&!zt&&(lt.fire(Ye),Ye=void 0),Yt=()=>{const Zo=Ye;Ye=void 0,zt=void 0,(!Y||wt>1)&<.fire(Zo),wt=0},typeof ee=="number"?(clearTimeout(zt),zt=setTimeout(Yt,ee)):zt===void 0&&(zt=0,queueMicrotask(Yt))})},onWillRemoveListener(){K&&wt>0&&Yt?.()},onDidRemoveLastListener(){Yt=void 0,xe.dispose()}};Te||t(ur);const lt=new D(ur);return Te?.add(lt),lt.event}e.debounce=f;function g(B,_=0,ee){return e.debounce(B,(Y,K)=>Y?(Y.push(K),Y):[K],_,void 0,!0,void 0,ee)}e.accumulate=g;function v(B,_=(Y,K)=>Y===K,ee){let Y=!0,K;return a(B,we=>{const Te=Y||!_(we,K);return Y=!1,K=we,Te},ee)}e.latch=v;function b(B,_,ee){return[e.filter(B,_,ee),e.filter(B,Y=>!_(Y),ee)]}e.split=b;function x(B,_=!1,ee=[],Y){let K=ee.slice(),we=B(Ye=>{K?K.push(Ye):xe.fire(Ye)});Y&&Y.add(we);const Te=()=>{K?.forEach(Ye=>xe.fire(Ye)),K=null},xe=new D({onWillAddFirstListener(){we||(we=B(Ye=>xe.fire(Ye)),Y&&Y.add(we))},onDidAddFirstListener(){K&&(_?setTimeout(Te):Te())},onDidRemoveLastListener(){we&&we.dispose(),we=null}});return Y&&Y.add(xe),xe.event}e.buffer=x;function S(B,_){return(Y,K,we)=>{const Te=_(new O);return B(function(xe){const Ye=Te.evaluate(xe);Ye!==C&&Y.call(K,Ye)},void 0,we)}}e.chain=S;const C=Symbol("HaltChainable");class O{constructor(){this.f=[]}map(_){return this.f.push(_),this}forEach(_){return this.f.push(ee=>(_(ee),ee)),this}filter(_){return this.f.push(ee=>_(ee)?ee:C),this}reduce(_,ee){let Y=ee;return this.f.push(K=>(Y=_(Y,K),Y)),this}latch(_=(ee,Y)=>ee===Y){let ee=!0,Y;return this.f.push(K=>{const we=ee||!_(K,Y);return ee=!1,Y=K,we?K:C}),this}evaluate(_){for(const ee of this.f)if(_=ee(_),_===C)break;return _}}function P(B,_,ee=Y=>Y){const Y=(...xe)=>Te.fire(ee(...xe)),K=()=>B.on(_,Y),we=()=>B.removeListener(_,Y),Te=new D({onWillAddFirstListener:K,onDidRemoveLastListener:we});return Te.event}e.fromNodeEventEmitter=P;function j(B,_,ee=Y=>Y){const Y=(...xe)=>Te.fire(ee(...xe)),K=()=>B.addEventListener(_,Y),we=()=>B.removeEventListener(_,Y),Te=new D({onWillAddFirstListener:K,onDidRemoveLastListener:we});return Te.event}e.fromDOMEventEmitter=j;function z(B,_){return new Promise(ee=>i(B)(ee,null,_))}e.toPromise=z;function V(B){const _=new D;return B.then(ee=>{_.fire(ee)},()=>{_.fire(void 0)}).finally(()=>{_.dispose()}),_.event}e.fromPromise=V;function M(B,_){return B(ee=>_.fire(ee))}e.forward=M;function Q(B,_,ee){return _(ee),B(Y=>_(Y))}e.runAndSubscribe=Q;class ke{constructor(_,ee){this._observable=_,this.f=0,this.g=!1;const Y={onWillAddFirstListener:()=>{_.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{_.removeObserver(this)}};ee||t(Y),this.emitter=new D(Y),ee&&ee.add(this.emitter)}beginUpdate(_){this.f++}handlePossibleChange(_){}handleChange(_,ee){this.g=!0}endUpdate(_){this.f--,this.f===0&&(this._observable.reportChanges(),this.g&&(this.g=!1,this.emitter.fire(this._observable.get())))}}function re(B,_){return new ke(B,_).emitter.event}e.fromObservable=re;function it(B){return(_,ee,Y)=>{let K=0,we=!1;const Te={beginUpdate(){K++},endUpdate(){K--,K===0&&(B.reportChanges(),we&&(we=!1,_.call(ee)))},handlePossibleChange(){},handleChange(){we=!0}};B.addObserver(Te),B.reportChanges();const xe={dispose(){B.removeObserver(Te)}};return Y instanceof oe?Y.add(xe):Array.isArray(Y)&&Y.push(xe),xe}}e.fromObservableLight=it})(_e||(_e={}));var zP=class r4{static{this.all=new Set}static{this.f=0}constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${r4.f++}`,r4.all.add(this)}start(t){this.g=new Nr,this.listenerCount=t}stop(){if(this.g){const t=this.g.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this.g=void 0}}},Z4=-1,VP=class D3{static{this.f=1}constructor(t,r,i=(D3.f++).toString(16).padStart(3,"0")){this.j=t,this.threshold=r,this.name=i,this.h=0}dispose(){this.g?.clear()}check(t,r){const i=this.threshold;if(i<=0||r<i)return;this.g||(this.g=new Map);const s=this.g.get(t.value)||0;if(this.g.set(t.value,s+1),this.h-=1,this.h<=0){this.h=i*.5;const[n,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(n);const c=new qP(a,n);this.j(c)}return()=>{const n=this.g.get(t.value)||0;this.g.set(t.value,n-1)}}getMostFrequentStack(){if(!this.g)return;let t,r=0;for(const[i,s]of this.g)(!t||r<s)&&(t=[i,s],r=s);return t}},xm=class P3{static create(){const t=new Error;return new P3(t.stack??"")}constructor(t){this.value=t}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}},qP=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},GP=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},JP=0,Th=class{constructor(e){this.value=e,this.id=JP++}},QP=2,K4=(e,t)=>{if(e instanceof Th)t(e);else for(let r=0;r<e.length;r++){const i=e[r];i&&t(i)}},D=class{constructor(e){this.z=0,this.f=e,this.g=Z4>0||this.f?.leakWarningThreshold?new VP(e?.onListenerError??at,this.f?.leakWarningThreshold??Z4):void 0,this.j=this.f?._profName?new zP(this.f._profName):void 0,this.w=this.f?.deliveryQueue}dispose(){if(!this.m){if(this.m=!0,this.w?.current===this&&this.w.reset(),this.u){if(Y4){const e=this.u;queueMicrotask(()=>{K4(e,t=>t.stack?.print())})}this.u=void 0,this.z=0}this.f?.onDidRemoveLastListener?.(),this.g?.dispose()}}get event(){return this.q??=(e,t,r)=>{if(this.g&&this.z>this.g.threshold**2){const a=`[${this.g.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this.z} vs ${this.g.threshold})`;console.warn(a);const c=this.g.getMostFrequentStack()??["UNKNOWN stack",-1],l=new GP(`${a}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0]);return(this.f?.onListenerError||at)(l),te.None}if(this.m)return te.None;t&&(e=e.bind(t));const i=new Th(e);let s,n;this.g&&this.z>=Math.ceil(this.g.threshold*.2)&&(i.stack=xm.create(),s=this.g.check(i.stack,this.z+1)),Y4&&(i.stack=n??xm.create()),this.u?this.u instanceof Th?(this.w??=new XP,this.u=[this.u,i]):this.u.push(i):(this.f?.onWillAddFirstListener?.(this),this.u=i,this.f?.onDidAddFirstListener?.(this)),this.f?.onDidAddListener?.(this),this.z++;const o=se(()=>{s?.(),this.A(i)});return r instanceof oe?r.add(o):Array.isArray(r)&&r.push(o),o},this.q}A(e){if(this.f?.onWillRemoveListener?.(this),!this.u)return;if(this.z===1){this.u=void 0,this.f?.onDidRemoveLastListener?.(this),this.z=0;return}const t=this.u,r=t.indexOf(e);if(r===-1)throw console.log("disposed?",this.m),console.log("size?",this.z),console.log("arr?",JSON.stringify(this.u)),new Error("Attempted to dispose unknown listener");this.z--,t[r]=void 0;const i=this.w.current===this;if(this.z*QP<=t.length){let s=0;for(let n=0;n<t.length;n++)t[n]?t[s++]=t[n]:i&&s<this.w.end&&(this.w.end--,s<this.w.i&&this.w.i--);t.length=s}}B(e,t){if(!e)return;const r=this.f?.onListenerError||at;if(!r){e.value(t);return}try{e.value(t)}catch(i){r(i)}}C(e){const t=e.current.u;for(;e.i<e.end;)this.B(t[e.i++],e.value);e.reset()}fire(e){if(this.w?.current&&(this.C(this.w),this.j?.stop()),this.j?.start(this.z),this.u)if(this.u instanceof Th)this.B(this.u,e);else{const t=this.w;t.enqueue(this,e,this.u.length),this.C(t)}this.j?.stop()}hasListeners(){return this.z>0}},XP=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Yc=class extends D{async fireAsync(e,t,r){if(this.u)for(this.h||(this.h=new Xc),K4(this.u,i=>this.h.push([i.value,e]));this.h.size>0&&!t.isCancellationRequested;){const[i,s]=this.h.shift(),n=[],o={...s,token:t,waitUntil:a=>{if(Object.isFrozen(n))throw new Error("waitUntil can NOT be called asynchronous");r&&(a=r(a,i)),n.push(a)}};try{i(o)}catch(a){at(a);continue}Object.freeze(n),await Promise.allSettled(n).then(a=>{for(const c of a)c.status==="rejected"&&at(c.reason)})}}},Zc=class extends D{get isPaused(){return this.h!==0}constructor(e){super(e),this.h=0,this.s=new Xc,this.t=e?.merge}pause(){this.h++}resume(){if(this.h!==0&&--this.h===0)if(this.t){if(this.s.size>0){const e=Array.from(this.s);this.s.clear(),super.fire(this.t(e))}}else for(;!this.h&&this.s.size!==0;)super.fire(this.s.shift())}fire(e){this.z&&(this.h!==0?this.s.push(e):super.fire(e))}},YP=class extends Zc{constructor(e){super(e),this.k=e.delay??100}fire(e){this.o||(this.pause(),this.o=setTimeout(()=>{this.o=void 0,this.resume()},this.k)),super.fire(e)}},ZP=class{constructor(){this.f=!1,this.g=_e.None,this.h=te.None,this.j=new D({onDidAddFirstListener:()=>{this.f=!0,this.h=this.g(this.j.fire,this.j)},onDidRemoveLastListener:()=>{this.f=!1,this.h.dispose()}}),this.event=this.j.event}set input(e){this.g=e,this.f&&(this.h.dispose(),this.h=e(this.j.fire,this.j))}dispose(){this.h.dispose(),this.j.dispose()}},e5=Object.freeze(function(e,t){const r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),Ze;(function(e){function t(r){return r===e.None||r===e.Cancelled||r instanceof Rh?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:_e.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:e5})})(Ze||(Ze={}));var Rh=class{constructor(){this.a=!1,this.b=null}cancel(){this.a||(this.a=!0,this.b&&(this.b.fire(void 0),this.dispose()))}get isCancellationRequested(){return this.a}get onCancellationRequested(){return this.a?e5:(this.b||(this.b=new D),this.b.event)}dispose(){this.b&&(this.b.dispose(),this.b=null)}},st=class{constructor(e){this.f=void 0,this.g=void 0,this.g=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this.f||(this.f=new Rh),this.f}cancel(){this.f?this.f instanceof Rh&&this.f.cancel():this.f=Ze.Cancelled}dispose(e=!1){e&&this.cancel(),this.g?.dispose(),this.f?this.f instanceof Rh&&this.f.dispose():this.f=Ze.None}};function KP(){return globalThis._VSCODE_NLS_MESSAGES}function t5(){return globalThis._VSCODE_NLS_LANGUAGE}var e2=t5()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Lh(e,t){let r;return t.length===0?r=e:r=e.replace(/\{(\d+)\}/g,(i,s)=>{const n=s[0],o=t[n];let a=i;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),e2&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}function p(e,t,...r){return Lh(typeof e=="number"?r5(e,t):t,r)}function r5(e,t){const r=KP()?.[e];if(typeof r!="string"){if(typeof t=="string")return t;throw new Error(`!!! NLS MISSING: ${e} !!!`)}return r}function Sm(e,t,...r){let i;typeof e=="number"?i=r5(e,t):i=t;const s=Lh(i,r);return{value:s,original:t===i?s:Lh(t,r)}}var en="en",Kc=!1,el=!1,tl=!1,t2=!1,i5=!1,km=!1,r2=!1,s5=!1,n5=!1,i2=!1,Nh=void 0,Fh=en,o5=en,s2=void 0,us=void 0,hs=globalThis,Gr=void 0;typeof hs.vscode<"u"&&typeof hs.vscode.process<"u"?Gr=hs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Gr=process);var a5=typeof Gr?.versions?.electron=="string",n2=a5&&Gr?.t