/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
(function(){var e=["exports","require","vs/base/common/event","vs/base/common/lifecycle","vs/base/common/buffer","vs/base/common/errors","vs/base/common/platform","vs/base/common/functional","vs/base/parts/ipc/common/ipc","vs/base/common/cancellation","vs/base/parts/ipc/common/ipc.net","vs/base/common/async","vs/base/common/process","vs/base/common/path","vs/base/common/uuid","vs/base/common/iterator","vs/base/common/linkedList","vs/base/parts/ipc/node/ipc.net","vs/platform/instantiation/common/instantiation","os","net","vs/platform/driver/node/driver"],t=function(t){for(var n=[],s=0,i=t.length;s<i;s++)n[s]=e[t[s]];return n};define(e[4],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n="undefined"!=typeof Buffer;class s{static alloc(e){return new s(n?Buffer.allocUnsafe(e):new Uint8Array(e))}static wrap(e){return new s(e)}static fromString(e){return new s(Buffer.from(e))}static concat(e,t){if(void 0===t){t=0;for(let n=0,s=e.length;n<s;n++)t+=e[n].byteLength}
const n=s.alloc(t);let i=0;for(let t=0,s=e.length;t<s;t++){const s=e[t];n.set(s,i),i+=s.byteLength}return n}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return this.buffer.toString()}slice(e,t){return new s(this.buffer.slice(e,t))}set(e,t){this.buffer.set(e.buffer,t)}readUint32BE(e){return function(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}(this.buffer,e)}writeUint32BE(e,t){!function(e,t,n){e[n+3]=t,t>>>=8,e[n+2]=t,t>>>=8,e[n+1]=t,t>>>=8,e[n]=t}(this.buffer,e,t)}readUint8(e){return function(e,t){return e[t]}(this.buffer,e)}writeUint8(e,t){!function(e,t,n){e[n]=t}(this.buffer,e,t)}}t.VSBuffer=s}),define(e[5],t([1,0]),function(e,t){"use strict";function n(e){return e instanceof Error&&e.name===i&&e.message===i}Object.defineProperty(t,"__esModule",{value:!0});class s{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e},0)}}addListener(e){
return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}t.ErrorHandler=s,t.errorHandler=new s,t.setUnexpectedErrorHandler=function(e){t.errorHandler.setUnexpectedErrorHandler(e)},t.onUnexpectedError=function(e){n(e)||t.errorHandler.onUnexpectedError(e)},t.onUnexpectedExternalError=function(e){n(e)||t.errorHandler.onUnexpectedExternalError(e)},t.transformErrorForSerialization=function(e){if(e instanceof Error){let{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack}}return e};const i="Canceled";t.isPromiseCanceledError=n,t.canceled=function(){const e=new Error(i);return e.name=e.message,e},t.illegalArgument=function(e){
return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")},t.illegalState=function(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")},t.readonly=function(e){return e?new Error(`readonly property '${e} cannot be changed'`):new Error("readonly property cannot be changed")},t.disposed=function(e){const t=new Error(`${e} has been disposed`);return t.name="DISPOSED",t},t.getErrorMessage=function(e){return e?e.message?e.message:e.stack?e.stack.split("\n")[0]:String(e):"Error"}}),define(e[7],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.once=function(e){const t=this;let n,s=!1;return function(){return s?n:(s=!0,n=e.apply(t,arguments))}}}),define(e[15],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FIN={done:!0,value:void 0};var n;!function(e){function n(e,t){for(let n=e.next();!n.done;n=e.next())t(n.value)}const s={next:()=>t.FIN};e.empty=function(){return s},e.fromArray=function(e,n=0,s=e.length){
return{next:()=>n>=s?t.FIN:{done:!1,value:e[n++]}}},e.from=function(t){return t?Array.isArray(t)?e.fromArray(t):t:e.empty()},e.map=function(e,n){return{next(){const s=e.next();return s.done?t.FIN:{done:!1,value:n(s.value)}}}},e.filter=function(e,n){return{next(){for(;;){const s=e.next();if(s.done)return t.FIN;if(n(s.value))return{done:!1,value:s.value}}}}},e.forEach=n,e.collect=function(e){const t=[];return n(e,e=>t.push(e)),t}}(n=t.Iterator||(t.Iterator={})),t.getSequenceIterator=function(e){return Array.isArray(e)?n.fromArray(e):e};class s{constructor(e,t=0,n=e.length,s=t-1){this.items=e,this.start=t,this.end=n,this.index=s}first(){return this.index=this.start,this.current()}next(){return this.index=Math.min(this.index+1,this.end),this.current()}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}}t.ArrayIterator=s;class i extends s{constructor(e,t=0,n=e.length,s=t-1){super(e,t,n,s)}current(){return super.current()}previous(){
return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}parent(){return null}}t.ArrayNavigator=i;class r{constructor(e,t){this.iterator=e,this.fn=t}next(){return this.fn(this.iterator.next())}}t.MappedIterator=r;class o extends r{constructor(e,t){super(e,t),this.navigator=e}current(){return this.fn(this.navigator.current())}previous(){return this.fn(this.navigator.previous())}parent(){return this.fn(this.navigator.parent())}first(){return this.fn(this.navigator.first())}last(){return this.fn(this.navigator.last())}next(){return this.fn(this.navigator.next())}}t.MappedNavigator=o}),define(e[3],t([1,0,7]),function(e,t,n){"use strict";function s(e,...t){if(Array.isArray(e))return e.forEach(e=>e&&e.dispose()),[];if(0!==t.length)return s(e),s(t),[];if(e)return e.dispose(),e}Object.defineProperty(t,"__esModule",{value:!0}),t.isDisposable=function(e){
return"function"==typeof e.dispose&&0===e.dispose.length},t.dispose=s,t.combinedDisposable=function(e){return{dispose:()=>s(e)}},t.toDisposable=function(e){return{dispose(){e()}}};class i{constructor(){this._toDispose=[],this._lifecycle_disposable_isDisposed=!1}get toDispose(){return this._toDispose}dispose(){this._lifecycle_disposable_isDisposed=!0,this._toDispose=s(this._toDispose)}_register(e){return this._lifecycle_disposable_isDisposed?(console.warn("Registering disposable on object that has already been disposed."),e.dispose()):this._toDispose.push(e),e}}i.None=Object.freeze({dispose(){}}),t.Disposable=i;class r{constructor(){this.references=Object.create(null)}acquire(e){let t=this.references[e];t||(t=this.references[e]={counter:0,object:this.createReferencedObject(e)});const{object:s}=t,i=n.once(()=>{0==--t.counter&&(this.destroyReferencedObject(e,t.object),delete this.references[e])});return t.counter++,{object:s,dispose:i}}}t.ReferenceCollection=r;class o{constructor(e){this.object=e}dispose(){}}
t.ImmortalReference=o}),define(e[16],t([1,0,15]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class s{constructor(e){this.element=e}}class i{constructor(){this._size=0}get size(){return this._size}isEmpty(){return!this._first}clear(){this._first=void 0,this._last=void 0,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new s(e);if(this._first)if(t){const e=this._last;this._last=n,n.prev=e,e.next=n}else{const e=this._first;this._first=n,n.next=e,e.prev=n}else this._first=n,this._last=n;return this._size+=1,this._remove.bind(this,n)}shift(){if(this._first){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last){const e=this._last.element;return this._remove(this._last),e}}_remove(e){let t=this._first;for(;t instanceof s;){if(t===e){if(t.prev&&t.next){const e=t.prev;e.next=t.next,t.next.prev=e}else t.prev||t.next?t.next?t.prev||(this._first=this._first.next,
this._first.prev=void 0):(this._last=this._last.prev,this._last.next=void 0):(this._first=void 0,this._last=void 0);this._size-=1;break}t=t.next}}iterator(){let e,t=this._first;return{next:()=>t?(e?e.value=t.element:e={done:!1,value:t.element},t=t.next,e):n.FIN}}toArray(){const e=[];for(let t=this._first;t instanceof s;t=t.next)e.push(t.element);return e}}t.LinkedList=i});var n=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{a(s.next(e))}catch(e){r(e)}}function c(e){try{a(s.throw(e))}catch(e){r(e)}}function a(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,c)}a((s=s.apply(e,t||[])).next())})};define(e[2],t([1,0,5,7,3,16]),function(e,t,s,i,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c;!function(e){function t(e){return(t,n=null,s)=>{let i,r=!1;return i=e(e=>{if(!r)return i?i.dispose():r=!0,t.call(n,e)},null,s),r&&i.dispose(),i}}function n(e,t){return c((n,s=null,i)=>e(e=>n.call(s,t(e)),null,i))}function s(e,t){
return c((n,s=null,i)=>e(e=>{t(e),n.call(s,e)},null,i))}function i(e,t){return c((n,s=null,i)=>e(e=>t(e)&&n.call(s,e),null,i))}function o(e,t,s){let i=s;return n(e,e=>i=t(i,e))}function c(e){let t;const n=new h({onFirstListenerAdd(){t=e(n.fire,n)},onLastListenerRemove(){t.dispose()}});return n.event}function a(e){let t,n=!0;return i(e,e=>{const s=n||e!==t;return n=!1,t=e,s})}const l={dispose(){}};e.None=function(){return l},e.once=t,e.map=n,e.forEach=s,e.filter=i,e.signal=function(e){return e},e.any=function(...e){return(t,n=null,s)=>r.combinedDisposable(e.map(e=>e(e=>t.call(n,e),null,s)))},e.reduce=o,e.snapshot=c,e.debounce=function(e,t,n=100,s=!1,i){let r,o=void 0,c=void 0,a=0;const l=new h({leakWarningThreshold:i,onFirstListenerAdd(){r=e(e=>{a++,o=t(o,e),s&&!c&&l.fire(o),clearTimeout(c),c=setTimeout(()=>{const e=o;o=void 0,c=void 0,(!s||a>1)&&l.fire(e),a=0},n)})},onLastListenerRemove(){r.dispose()}});return l.event},e.stopwatch=function(e){const s=(new Date).getTime()
;return n(t(e),e=>(new Date).getTime()-s)},e.latch=a,e.buffer=function(e,t=!1,n=[]){let s=n.slice(),i=e(e=>{s?s.push(e):o.fire(e)});const r=()=>{s&&s.forEach(e=>o.fire(e)),s=null},o=new h({onFirstListenerAdd(){i||(i=e(e=>o.fire(e)))},onFirstListenerDidAdd(){s&&(t?setTimeout(r):r())},onLastListenerRemove(){i&&i.dispose(),i=null}});return o.event},e.echo=function(e,t=!1,n=[]){n=n.slice(),e(e=>{n.push(e),i.fire(e)});const s=(e,t)=>n.forEach(n=>e.call(t,n)),i=new h({onListenerDidAdd(e,n,i){t?setTimeout(()=>s(n,i)):s(n,i)}});return i.event};class u{constructor(e){this.event=e}map(e){return new u(n(this.event,e))}forEach(e){return new u(s(this.event,e))}filter(e){return new u(i(this.event,e))}reduce(e,t){return new u(o(this.event,e,t))}latch(){return new u(a(this.event))}on(e,t,n){return this.event(e,t,n)}once(e,n,s){return t(this.event)(e,n,s)}}e.chain=function(e){return new u(e)},e.fromNodeEventEmitter=function(e,t,n=(e=>e)){const s=(...e)=>i.fire(n(...e)),i=new h({onFirstListenerAdd:()=>e.on(t,s),
onLastListenerRemove:()=>e.removeListener(t,s)});return i.event},e.fromPromise=function(e){const t=new h;let n=!1;return e.then(void 0,()=>null).then(()=>{n?t.fire(void 0):setTimeout(()=>t.fire(void 0),0)}),n=!0,t.event},e.toPromise=function(e){return new Promise(n=>t(e)(n))}}(c=t.Event||(t.Event={}));let a=-1;t.setGlobalLeakWarningThreshold=function(e){const t=a;return a=e,{dispose(){a=t}}};class l{constructor(e,t=Math.random().toString(18).slice(2,5)){this.customThreshold=e,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(e){let t=a;if("number"==typeof this.customThreshold&&(t=this.customThreshold),t<=0||e<t)return;this._stacks||(this._stacks=new Map);const n=(new Error).stack.split("\n").slice(3).join("\n"),s=this._stacks.get(n)||0;if(this._stacks.set(n,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=.5*t;let n,s=0;this._stacks.forEach((e,t)=>{(!n||s<e)&&(n=t,s=e)}),
console.warn(`[${this.name}] potential listener LEAK detected, having ${e} listeners already. MOST frequent listener (${s}):`),console.warn(n)}return()=>{const e=this._stacks.get(n)||0;this._stacks.set(n,e-1)}}}class h{constructor(e){this._disposed=!1,this._options=e,this._leakageMon=a>0?new l(this._options&&this._options.leakWarningThreshold):void 0}get event(){return this._event||(this._event=((e,t,n)=>{this._listeners||(this._listeners=new o.LinkedList);const s=this._listeners.isEmpty();s&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(t?[e,t]:e);s&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);let r;this._leakageMon&&(r=this._leakageMon.check(this._listeners.size));let c;return c={dispose:()=>{if(r&&r(),c.dispose=h._noop,!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){
this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}},Array.isArray(n)&&n.push(c),c})),this._event}fire(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=[]);for(let t=this._listeners.iterator(),n=t.next();!n.done;n=t.next())this._deliveryQueue.push([n.value,e]);for(;this._deliveryQueue.length>0;){const[e,t]=this._deliveryQueue.shift();try{"function"==typeof e?e.call(void 0,t):e[0].call(e[1],t)}catch(e){s.onUnexpectedError(e)}}}}dispose(){this._listeners&&(this._listeners=void 0),this._deliveryQueue&&(this._deliveryQueue.length=0),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0}}h._noop=function(){},t.Emitter=h;class u extends h{fireAsync(e){return n(this,void 0,void 0,function*(){if(this._listeners){this._asyncDeliveryQueue||(this._asyncDeliveryQueue=[]);for(let t=this._listeners.iterator(),n=t.next();!n.done;n=t.next()){const t=[];this._asyncDeliveryQueue.push([n.value,e(t,"function"==typeof n.value?n.value:n.value[0]),t])}
for(;this._asyncDeliveryQueue.length>0;){const[e,t,n]=this._asyncDeliveryQueue.shift();try{"function"==typeof e?e.call(void 0,t):e[0].call(e[1],t)}catch(e){s.onUnexpectedError(e);continue}Object.freeze(n),yield Promise.all(n)}}})}}t.AsyncEmitter=u;class d{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new h({onFirstListenerAdd:()=>this.onFirstListenerAdd(),onLastListenerRemove:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};this.events.push(t),this.hasListeners&&this.hook(t);return r.toDisposable(i.once(()=>{this.hasListeners&&this.unhook(t);const e=this.events.indexOf(t);this.events.splice(e,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(e=>this.emitter.fire(e))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}t.EventMultiplexer=d;class f{
constructor(){this.buffers=[]}wrapEvent(e){return(t,n,s)=>e(e=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(n,e)):t.call(n,e)},void 0,s)}bufferEvents(e){const t=[];this.buffers.push(t);const n=e();return this.buffers.pop(),t.forEach(e=>e()),n}}t.EventBufferer=f;class p{constructor(){this.listening=!1,this.inputEvent=c.None,this.inputEventListener=r.Disposable.None,this.emitter=new h({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}t.Relay=p}),define(e[9],t([1,0,2]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=Object.freeze(function(e,t){
const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}});var i;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||t instanceof r||!(!t||"object"!=typeof t)&&"boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:s})}(i=t.CancellationToken||(t.CancellationToken={}));class r{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?s:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class o{get token(){return this._token||(this._token=new r),this._token}cancel(){
this._token?this._token instanceof r&&this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof r&&this._token.dispose():this._token=i.None}}t.CancellationTokenSource=o}),define(e[11],t([1,0,9,5,2,3]),function(e,t,s,i,r,o){"use strict";function c(e){return e&&"function"==typeof e.then}function a(e){const t=new s.CancellationTokenSource,n=e(t.token),r=new Promise((e,s)=>{t.token.onCancellationRequested(()=>{s(i.canceled())}),Promise.resolve(n).then(n=>{t.dispose(),e(n)},e=>{t.dispose(),s(e)})});return new class{cancel(){t.cancel()}then(e,t){return r.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return r.finally(e)}}}function l(e,t){return t?new Promise((n,s)=>{const r=setTimeout(n,e);t.onCancellationRequested(()=>{clearTimeout(r),s(i.canceled())})}):a(t=>l(e,t))}function h(e){function t(r){void 0!==r&&null!==r&&n.push(r);const o=s<i?e[s++]():null;return o?o.then(t):Promise.resolve(n)}const n=[];let s=0;const i=e.length;return Promise.resolve(null).then(t)}
Object.defineProperty(t,"__esModule",{value:!0}),t.isThenable=c,t.createCancelablePromise=a,t.asPromise=function(e){return new Promise((t,n)=>{const s=e();c(s)?s.then(t,n):t(s)})};class u{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{this.queuedPromise=null;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise(t=>{this.activePromise.then(e,e).then(t)})}return new Promise((e,t)=>{this.queuedPromise.then(e,t)})}return this.activePromise=e(),new Promise((e,t)=>{this.activePromise.then(t=>{this.activePromise=null,e(t)},e=>{this.activePromise=null,t(e)})})}}t.Throttler=u;class d{constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e())}}t.Sequencer=d;class f{constructor(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,
this.task=null}trigger(e,t=this.defaultDelay){return this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((e,t)=>{this.doResolve=e,this.doReject=t}).then(()=>{this.completionPromise=null,this.doResolve=null;const e=this.task;return this.task=null,e()})),this.timeout=setTimeout(()=>{this.timeout=null,this.doResolve(null)},t),this.completionPromise}isTriggered(){return null!==this.timeout}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject(i.canceled()),this.completionPromise=null)}cancelTimeout(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancelTimeout()}}t.Delayer=f;class p{constructor(e){this.delayer=new f(e),this.throttler=new u}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose()}}t.ThrottledDelayer=p;class m{constructor(){this._isOpen=!1,this._promise=new Promise((e,t)=>{
this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}t.Barrier=m,t.timeout=l,t.disposableTimeout=function(e,t=0){const n=setTimeout(e,t);return o.toDisposable(()=>clearTimeout(n))},t.ignoreErrors=function(e){return e.then(void 0,e=>void 0)},t.sequence=h,t.first=function(e,t=(e=>!!e),n=null){let s=0;const i=e.length,r=()=>{if(s>=i)return Promise.resolve(n);const o=e[s++];return Promise.resolve(o()).then(e=>t(e)?Promise.resolve(e):r())};return r()};class g{constructor(e){this._size=0,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onFinished=new r.Emitter}get onFinished(){return this._onFinished.event}get size(){return this._size}queue(e){return this._size++,new Promise((t,n)=>{this.outstandingPromises.push({factory:e,c:t,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){const e=this.outstandingPromises.shift()
;this.runningPromises++;const t=e.factory();t.then(e.c,e.e),t.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._size--,this.runningPromises--,this.outstandingPromises.length>0?this.consume():this._onFinished.fire()}dispose(){this._onFinished.dispose()}}t.Limiter=g;class _ extends g{constructor(){super(1)}}t.Queue=_;class v{constructor(){this.queues=Object.create(null)}queueFor(e){const t=e.toString();if(!this.queues[t]){const e=new _;e.onFinished(()=>{e.dispose(),delete this.queues[t]}),this.queues[t]=e}return this.queues[t]}}t.ResourceQueue=v;class w extends o.Disposable{constructor(e,t){super(),this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel(),super.dispose()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}t.TimeoutTimer=w
;class k extends o.Disposable{constructor(){super(),this._token=-1}dispose(){this.cancel(),super.dispose()}cancel(){-1!==this._token&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}t.IntervalTimer=k;class C{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}isScheduled(){return-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner&&this.runner()}}t.RunOnceScheduler=C;class b extends C{constructor(e,t){super(e,t),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){const e=this.units;this.units=[],this.runner&&this.runner(e)}dispose(){this.units=[],super.dispose()}}t.RunOnceWorker=b,
t.nfcall=function(e,...t){return new Promise((n,s)=>e(...t,(e,t)=>e?s(e):n(t)))},t.ninvoke=function(e,t,...n){return new Promise((s,i)=>t.call(e,...n,(e,t)=>e?i(e):s(t)))},function(){if("function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback){const e=Object.freeze({didTimeout:!0,timeRemaining:()=>15});t.runWhenIdle=(t=>{const n=setTimeout(()=>t(e));let s=!1;return{dispose(){s||(s=!0,clearTimeout(n))}}})}else t.runWhenIdle=((e,t)=>{const n=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0);let s=!1;return{dispose(){s||(s=!0,cancelIdleCallback(n))}}})}();class y{constructor(e){this._didRun=!1,this._executor=(()=>{try{this._value=e()}catch(e){this._error=e}finally{this._didRun=!0}}),this._handle=t.runWhenIdle(()=>this._executor())}dispose(){this._handle.dispose()}getValue(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}}t.IdleValue=y,t.retry=function(e,t,s){return n(this,void 0,void 0,function*(){let n
;for(let i=0;i<s;i++)try{return yield e()}catch(e){n=e,yield l(t)}return Promise.reject(n)})}}),define(e[6],t([1,0]),function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=!1,s=!1,i=!1,r=!1,o=!1,c=void 0,a="en",l=void 0;const h="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.electron&&"renderer"===process.type;if("object"!=typeof navigator||h){if("object"==typeof process){n="win32"===process.platform,s="darwin"===process.platform,i="linux"===process.platform,c="en",a="en";const e=process.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),n=t.availableLanguages["*"];c=t.locale,a=n||"en",l=t._translationsConfigFile}catch(e){}r=!0}}else{const e=navigator.userAgent;n=e.indexOf("Windows")>=0,s=e.indexOf("Macintosh")>=0,i=e.indexOf("Linux")>=0,o=!0,a=c=navigator.language}!function(e){e[e.Web=0]="Web",e[e.Mac=1]="Mac",e[e.Linux=2]="Linux",e[e.Windows=3]="Windows"}(t.Platform||(t.Platform={})),t.PlatformToString=function(e){switch(e){case 0:return"Web"
;case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}};let u=0;r&&(s?u=1:n?u=3:i&&(u=2)),t.isWindows=n,t.isMacintosh=s,t.isLinux=i,t.isNative=r,t.isWeb=o,t.platform=u,t.isRootUser=function(){return r&&!n&&0===process.getuid()},t.language=a;!function(e){e.value=function(){return t.language},e.isDefaultVariant=function(){return 2===t.language.length?"en"===t.language:t.language.length>=3&&"e"===t.language[0]&&"n"===t.language[1]&&"-"===t.language[2]},e.isDefault=function(){return"en"===t.language}}(t.Language||(t.Language={})),t.locale=c,t.translationsConfigFile=l;const d="object"==typeof self?self:"object"==typeof global?global:{};t.globals=d;let f=null;t.setImmediate=function(e){return null===f&&(f=t.globals.setImmediate?t.globals.setImmediate.bind(t.globals):"undefined"!=typeof process&&"function"==typeof process.nextTick?process.nextTick.bind(process):t.globals.setTimeout.bind(t.globals)),f(e)};!function(e){e[e.Windows=1]="Windows",e[e.Macintosh=2]="Macintosh",e[e.Linux=3]="Linux"
}(t.OperatingSystem||(t.OperatingSystem={})),t.OS=s?2:n?1:3}),define(e[12],t([1,0,6]),function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s="undefined"==typeof process?{cwd:()=>"/",env:Object.create(null),get platform(){return n.isWindows?"win32":n.isMacintosh?"darwin":"linux"},nextTick:e=>n.setImmediate(e)}:process;t.cwd=s.cwd,t.env=s.env,t.platform=s.platform,t.nextTick=s.nextTick}),define(e[13],t([1,0,12]),function(e,t,n){"use strict";function s(e,t){if("string"!=typeof e)throw new g(t,"string",e)}function i(e){return e===p||e===m}function r(e){return e===p}function o(e){return e>=l&&e<=u||e>=h&&e<=d}function c(e,t,n,s){let i,r="",o=0,c=-1,a=0;for(let l=0;l<=e.length;++l){if(l<e.length)i=e.charCodeAt(l);else{if(s(i))break;i=p}if(s(i)){if(c===l-1||1===a);else if(c!==l-1&&2===a){if(r.length<2||2!==o||r.charCodeAt(r.length-1)!==f||r.charCodeAt(r.length-2)!==f){if(r.length>2){const e=r.lastIndexOf(n);-1===e?(r="",o=0):o=(r=r.slice(0,e)).length-1-r.lastIndexOf(n),c=l,a=0;continue
}if(2===r.length||1===r.length){r="",o=0,c=l,a=0;continue}}t&&(r.length>0?r+=`${n}..`:r="..",o=2)}else r.length>0?r+=n+e.slice(c+1,l):r=e.slice(c+1,l),o=l-c-1;c=l,a=0}else i===f&&-1!==a?++a:a=-1}return r}function a(e,t){const n=t.dir||t.root,s=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+s:n+e+s:s}Object.defineProperty(t,"__esModule",{value:!0});const l=65,h=97,u=90,d=122,f=46,p=47,m=92;class g extends Error{constructor(e,t,n){let s;"string"==typeof t&&0===t.indexOf("not ")?(s="must not be",t=t.replace(/^not /,"")):s="must be";let i=`The "${e}" ${-1!==e.indexOf(".")?"property":"argument"} ${s} of type ${t}`;super(i+=`. Received type ${typeof n}`)}}t.win32={resolve(...e){let t="",r="",a=!1;for(let c=e.length-1;c>=-1;c--){let l;if(c>=0?l=e[c]:t?void 0!==(l=n.env["="+t]||n.cwd())&&l.slice(0,3).toLowerCase()===t.toLowerCase()+"\\"||(l=t+"\\"):l=n.cwd(),s(l,"path"),0===l.length)continue;const h=l.length;let u=0,d="",f=!1;const p=l.charCodeAt(0);if(h>1)if(i(p))if(f=!0,i(l.charCodeAt(1))){let e=2,t=e
;for(;e<h&&!i(l.charCodeAt(e));++e);if(e<h&&e!==t){const n=l.slice(t,e);for(t=e;e<h&&i(l.charCodeAt(e));++e);if(e<h&&e!==t){for(t=e;e<h&&!i(l.charCodeAt(e));++e);e===h?(d="\\\\"+n+"\\"+l.slice(t),u=e):e!==t&&(d="\\\\"+n+"\\"+l.slice(t,e),u=e)}}}else u=1;else o(p)&&58===l.charCodeAt(1)&&(d=l.slice(0,2),u=2,h>2&&i(l.charCodeAt(2))&&(f=!0,u=3));else i(p)&&(u=1,f=!0);if(!(d.length>0&&t.length>0&&d.toLowerCase()!==t.toLowerCase())&&(0===t.length&&d.length>0&&(t=d),a||(r=l.slice(u)+"\\"+r,a=f),t.length>0&&a))break}return r=c(r,!a,"\\",i),t+(a?"\\":"")+r||"."},normalize(e){s(e,"path");const t=e.length;if(0===t)return".";let n,r=0,a=!1;const l=e.charCodeAt(0);if(t>1)if(i(l))if(a=!0,i(e.charCodeAt(1))){let s=2,o=s;for(;s<t&&!i(e.charCodeAt(s));++s);if(s<t&&s!==o){const c=e.slice(o,s);for(o=s;s<t&&i(e.charCodeAt(s));++s);if(s<t&&s!==o){for(o=s;s<t&&!i(e.charCodeAt(s));++s);if(s===t)return"\\\\"+c+"\\"+e.slice(o)+"\\";s!==o&&(n="\\\\"+c+"\\"+e.slice(o,s),r=s)}}}else r=1;else o(l)&&58===e.charCodeAt(1)&&(n=e.slice(0,2),
r=2,t>2&&i(e.charCodeAt(2))&&(a=!0,r=3));else if(i(l))return"\\";let h;return 0!==(h=r<t?c(e.slice(r),!a,"\\",i):"").length||a||(h="."),h.length>0&&i(e.charCodeAt(t-1))&&(h+="\\"),void 0===n?a?h.length>0?"\\"+h:"\\":h.length>0?h:"":a?h.length>0?n+"\\"+h:n+"\\":h.length>0?n+h:n},isAbsolute(e){s(e,"path");const t=e.length;if(0===t)return!1;const n=e.charCodeAt(0);return!!i(n)||!!(o(n)&&t>2&&58===e.charCodeAt(1)&&i(e.charCodeAt(2)))},join(...e){if(0===e.length)return".";let n,r;for(let t=0;t<e.length;++t){const i=e[t];s(i,"path"),i.length>0&&(void 0===n?n=r=i:n+="\\"+i)}if(void 0===n)return".";let o=!0,c=0;if("string"==typeof r&&i(r.charCodeAt(0))){++c;const e=r.length;e>1&&i(r.charCodeAt(1))&&(++c,e>2&&(i(r.charCodeAt(2))?++c:o=!1))}if(o){for(;c<n.length&&i(n.charCodeAt(c));++c);c>=2&&(n="\\"+n.slice(c))}return t.win32.normalize(n)},relative(e,n){if(s(e,"from"),s(n,"to"),e===n)return"";const i=t.win32.resolve(e),r=t.win32.resolve(n);if(i===r)return"";if(e=i.toLowerCase(),n=r.toLowerCase(),e===n)return"";let o=0
;for(;o<e.length&&e.charCodeAt(o)===m;++o);let c=e.length;for(;c-1>o&&e.charCodeAt(c-1)===m;--c);const a=c-o;let l=0;for(;l<n.length&&n.charCodeAt(l)===m;++l);let h=n.length;for(;h-1>l&&n.charCodeAt(h-1)===m;--h);const u=h-l,d=a<u?a:u;let f=-1,p=0;for(;p<=d;++p){if(p===d){if(u>d){if(n.charCodeAt(l+p)===m)return r.slice(l+p+1);if(2===p)return r.slice(l+p)}a>d&&(e.charCodeAt(o+p)===m?f=p:2===p&&(f=3));break}const t=e.charCodeAt(o+p);if(t!==n.charCodeAt(l+p))break;t===m&&(f=p)}if(p!==d&&-1===f)return r;let g="";for(-1===f&&(f=0),p=o+f+1;p<=c;++p)p!==c&&e.charCodeAt(p)!==m||(0===g.length?g+="..":g+="\\..");return g.length>0?g+r.slice(l+f,h):(l+=f,r.charCodeAt(l)===m&&++l,r.slice(l,h))},toNamespacedPath(e){if("string"!=typeof e)return e;if(0===e.length)return"";const n=t.win32.resolve(e);if(n.length>=3)if(n.charCodeAt(0)===m){if(n.charCodeAt(1)===m){const e=n.charCodeAt(2);if(63!==e&&e!==f)return"\\\\?\\UNC\\"+n.slice(2)}}else if(o(n.charCodeAt(0))&&58===n.charCodeAt(1)&&n.charCodeAt(2)===m)return"\\\\?\\"+n
;return e},dirname(e){s(e,"path");const t=e.length;if(0===t)return".";let n=-1,r=-1,c=!0,a=0;const l=e.charCodeAt(0);if(t>1)if(i(l)){if(n=a=1,i(e.charCodeAt(1))){let s=2,r=s;for(;s<t&&!i(e.charCodeAt(s));++s);if(s<t&&s!==r){for(r=s;s<t&&i(e.charCodeAt(s));++s);if(s<t&&s!==r){for(r=s;s<t&&!i(e.charCodeAt(s));++s);if(s===t)return e;s!==r&&(n=a=s+1)}}}}else o(l)&&58===e.charCodeAt(1)&&(n=a=2,t>2&&i(e.charCodeAt(2))&&(n=a=3));else if(i(l))return e;for(let n=t-1;n>=a;--n)if(i(e.charCodeAt(n))){if(!c){r=n;break}}else c=!1;if(-1===r){if(-1===n)return".";r=n}return e.slice(0,r)},basename(e,t){void 0!==t&&s(t,"ext"),s(e,"path");let n,r=0,c=-1,a=!0;if(e.length>=2){o(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(r=2)}if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let s=t.length-1,o=-1;for(n=e.length-1;n>=r;--n){const l=e.charCodeAt(n);if(i(l)){if(!a){r=n+1;break}}else-1===o&&(a=!1,o=n+1),s>=0&&(l===t.charCodeAt(s)?-1==--s&&(c=n):(s=-1,c=o))}return r===c?c=o:-1===c&&(c=e.length),
e.slice(r,c)}for(n=e.length-1;n>=r;--n)if(i(e.charCodeAt(n))){if(!a){r=n+1;break}}else-1===c&&(a=!1,c=n+1);return-1===c?"":e.slice(r,c)},extname(e){s(e,"path");let t=0,n=-1,r=0,c=-1,a=!0,l=0;e.length>=2&&58===e.charCodeAt(1)&&o(e.charCodeAt(0))&&(t=r=2);for(let s=e.length-1;s>=t;--s){const t=e.charCodeAt(s);if(i(t)){if(!a){r=s+1;break}}else-1===c&&(a=!1,c=s+1),t===f?-1===n?n=s:1!==l&&(l=1):-1!==n&&(l=-1)}return-1===n||-1===c||0===l||1===l&&n===c-1&&n===r+1?"":e.slice(n,c)},format(e){if(null===e||"object"!=typeof e)throw new g("pathObject","Object",e);return a("\\",e)},parse(e){s(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=e.length;let r=0,c=e.charCodeAt(0);if(n>1){if(i(c)){if(r=1,i(e.charCodeAt(1))){let t=2,s=t;for(;t<n&&!i(e.charCodeAt(t));++t);if(t<n&&t!==s){for(s=t;t<n&&i(e.charCodeAt(t));++t);if(t<n&&t!==s){for(s=t;t<n&&!i(e.charCodeAt(t));++t);t===n?r=t:t!==s&&(r=t+1)}}}}else if(o(c)&&58===e.charCodeAt(1)){if(r=2,!(n>2))return t.root=t.dir=e,t
;if(i(e.charCodeAt(2))){if(3===n)return t.root=t.dir=e,t;r=3}}}else if(i(c))return t.root=t.dir=e,t;r>0&&(t.root=e.slice(0,r));let a=-1,l=r,h=-1,u=!0,d=e.length-1,p=0;for(;d>=r;--d)if(c=e.charCodeAt(d),i(c)){if(!u){l=d+1;break}}else-1===h&&(u=!1,h=d+1),c===f?-1===a?a=d:1!==p&&(p=1):-1!==a&&(p=-1);return-1===a||-1===h||0===p||1===p&&a===h-1&&a===l+1?-1!==h&&(t.base=t.name=e.slice(l,h)):(t.name=e.slice(l,a),t.base=e.slice(l,h),t.ext=e.slice(a,h)),t.dir=l>0&&l!==r?e.slice(0,l-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},t.posix={resolve(...e){let t="",i=!1;for(let r=e.length-1;r>=-1&&!i;r--){let o;s(o=r>=0?e[r]:n.cwd(),"path"),0!==o.length&&(t=o+"/"+t,i=o.charCodeAt(0)===p)}return t=c(t,!i,"/",r),i?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize(e){if(s(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===p,n=e.charCodeAt(e.length-1)===p;return 0!==(e=c(e,!t,"/",r)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:e=>(s(e,"path"),e.length>0&&e.charCodeAt(0)===p),join(...e){
if(0===e.length)return".";let n;for(let t=0;t<e.length;++t){const e=arguments[t];s(e,"path"),e.length>0&&(void 0===n?n=e:n+="/"+e)}return void 0===n?".":t.posix.normalize(n)},relative(e,n){if(s(e,"from"),s(n,"to"),e===n)return"";if(e=t.posix.resolve(e),n=t.posix.resolve(n),e===n)return"";let i=1;for(;i<e.length&&e.charCodeAt(i)===p;++i);const r=e.length,o=r-i;let c=1;for(;c<n.length&&n.charCodeAt(c)===p;++c);const a=n.length-c,l=o<a?o:a;let h=-1,u=0;for(;u<=l;++u){if(u===l){if(a>l){if(n.charCodeAt(c+u)===p)return n.slice(c+u+1);if(0===u)return n.slice(c+u)}else o>l&&(e.charCodeAt(i+u)===p?h=u:0===u&&(h=0));break}const t=e.charCodeAt(i+u);if(t!==n.charCodeAt(c+u))break;t===p&&(h=u)}let d="";for(u=i+h+1;u<=r;++u)u!==r&&e.charCodeAt(u)!==p||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(c+h):(c+=h,n.charCodeAt(c)===p&&++c,n.slice(c))},toNamespacedPath:e=>e,dirname(e){if(s(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===p;let n=-1,i=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===p){
if(!i){n=t;break}}else i=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)},basename(e,t){void 0!==t&&s(t,"ext"),s(e,"path");let n,i=0,r=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let s=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){const a=e.charCodeAt(n);if(a===p){if(!o){i=n+1;break}}else-1===c&&(o=!1,c=n+1),s>=0&&(a===t.charCodeAt(s)?-1==--s&&(r=n):(s=-1,r=c))}return i===r?r=c:-1===r&&(r=e.length),e.slice(i,r)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===p){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":e.slice(i,r)},extname(e){s(e,"path");let t=-1,n=0,i=-1,r=!0,o=0;for(let s=e.length-1;s>=0;--s){const c=e.charCodeAt(s);if(c!==p)-1===i&&(r=!1,i=s+1),c===f?-1===t?t=s:1!==o&&(o=1):-1!==t&&(o=-1);else if(!r){n=s+1;break}}return-1===t||-1===i||0===o||1===o&&t===i-1&&t===n+1?"":e.slice(t,i)},format(e){if(null===e||"object"!=typeof e)throw new g("pathObject","Object",e);return a("/",e)},parse(e){s(e,"path");const t={root:"",dir:"",base:"",ext:"",
name:""};if(0===e.length)return t;const n=e.charCodeAt(0)===p;let i;n?(t.root="/",i=1):i=0;let r=-1,o=0,c=-1,a=!0,l=e.length-1,h=0;for(;l>=i;--l){const t=e.charCodeAt(l);if(t!==p)-1===c&&(a=!1,c=l+1),t===f?-1===r?r=l:1!==h&&(h=1):-1!==r&&(h=-1);else if(!a){o=l+1;break}}return-1===r||-1===c||0===h||1===h&&r===c-1&&r===o+1?-1!==c&&(t.base=t.name=0===o&&n?e.slice(1,c):e.slice(o,c)):(0===o&&n?(t.name=e.slice(1,r),t.base=e.slice(1,c)):(t.name=e.slice(o,r),t.base=e.slice(o,c)),t.ext=e.slice(r,c)),o>0?t.dir=e.slice(0,o-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null},t.posix.win32=t.win32.win32=t.win32,t.posix.posix=t.win32.posix=t.posix,t.normalize="win32"===n.platform?t.win32.normalize:t.posix.normalize,t.isAbsolute="win32"===n.platform?t.win32.isAbsolute:t.posix.isAbsolute,t.join="win32"===n.platform?t.win32.join:t.posix.join,t.resolve="win32"===n.platform?t.win32.resolve:t.posix.resolve,t.relative="win32"===n.platform?t.win32.relative:t.posix.relative,
t.dirname="win32"===n.platform?t.win32.dirname:t.posix.dirname,t.basename="win32"===n.platform?t.win32.basename:t.posix.basename,t.extname="win32"===n.platform?t.win32.extname:t.posix.extname,t.format="win32"===n.platform?t.win32.format:t.posix.format,t.parse="win32"===n.platform?t.win32.parse:t.posix.parse,t.toNamespacedPath="win32"===n.platform?t.win32.toNamespacedPath:t.posix.toNamespacedPath,t.sep="win32"===n.platform?t.win32.sep:t.posix.sep,t.delimiter="win32"===n.platform?t.win32.delimiter:t.posix.delimiter}),define(e[14],t([1,0]),function(e,t){"use strict";function n(){return new r}function s(e){return o.test(e)}Object.defineProperty(t,"__esModule",{value:!0});class i{constructor(e){this._value=e}asHex(){return this._value}}class r extends i{constructor(){
super([r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-","4",r._randomHex(),r._randomHex(),r._randomHex(),"-",r._oneOf(r._timeHighBits),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return r._oneOf(r._chars)}}r._chars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r._timeHighBits=["8","9","a","b"],t.v4=n;const o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;t.isUUID=s,t.parse=function(e){if(!s(e))throw new Error("invalid uuid");return new i(e)},t.generateUuid=function(){return n().asHex()}}),define(e[8],t([1,0,2,3,11,9,5,4]),function(e,t,s,i,r,o,c,a){"use strict"
;function l(e){const t=a.VSBuffer.alloc(4);return t.writeUint32BE(e,0),t}function h(e){return e.read(4).readUint32BE(0)}function u(e){const t=a.VSBuffer.alloc(1);return t.writeUint8(e,0),t}function d(e,t){if(void 0===t)e.write(w.Undefined);else if("string"==typeof t){const n=a.VSBuffer.fromString(t);e.write(w.String),e.write(l(n.byteLength)),e.write(n)}else if(k&&Buffer.isBuffer(t)){const n=a.VSBuffer.wrap(t);e.write(w.Buffer),e.write(l(n.byteLength)),e.write(n)}else if(t instanceof a.VSBuffer)e.write(w.VSBuffer),e.write(l(t.byteLength)),e.write(t);else if(Array.isArray(t)){e.write(w.Array),e.write(l(t.length));for(const n of t)d(e,n)}else{const n=a.VSBuffer.fromString(JSON.stringify(t));e.write(w.Object),e.write(l(n.byteLength)),e.write(n)}}function f(e){switch(e.read(1).readUint8(0)){case v.Undefined:return;case v.String:return e.read(h(e)).toString();case v.Buffer:return e.read(h(e)).buffer;case v.VSBuffer:return e.read(h(e));case v.Array:{const t=h(e),n=[];for(let s=0;s<t;s++)n.push(f(e));return n}
case v.Object:return JSON.parse(e.read(h(e)).toString())}}function p(e){return{call:(t,n,s)=>e.then(e=>e.call(t,n,s)),listen(t,n){const i=new s.Relay;return e.then(e=>i.input=e.listen(t,n)),i.event}}}Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.Promise=100]="Promise",e[e.PromiseCancel=101]="PromiseCancel",e[e.EventListen=102]="EventListen",e[e.EventDispose=103]="EventDispose"}(t.RequestType||(t.RequestType={}));!function(e){e[e.Initialize=200]="Initialize",e[e.PromiseSuccess=201]="PromiseSuccess",e[e.PromiseError=202]="PromiseError",e[e.PromiseErrorObj=203]="PromiseErrorObj",e[e.EventFire=204]="EventFire"}(t.ResponseType||(t.ResponseType={}));var m;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Idle=1]="Idle"}(m||(m={}));class g{constructor(e){this.buffer=e,this.pos=0}read(e){const t=this.buffer.slice(this.pos,this.pos+e);return this.pos+=t.byteLength,t}}class _{constructor(){this.buffers=[]}get buffer(){return a.VSBuffer.concat(this.buffers)}write(e){this.buffers.push(e)}}var v
;!function(e){e[e.Undefined=0]="Undefined",e[e.String=1]="String",e[e.Buffer=2]="Buffer",e[e.VSBuffer=3]="VSBuffer",e[e.Array=4]="Array",e[e.Object=5]="Object"}(v||(v={}));const w={Undefined:u(v.Undefined),String:u(v.String),Buffer:u(v.Buffer),VSBuffer:u(v.VSBuffer),Array:u(v.Array),Object:u(v.Object)},k="undefined"!=typeof Buffer;class C{constructor(e,t){this.protocol=e,this.ctx=t,this.channels=new Map,this.activeRequests=new Map,this.protocolListener=this.protocol.onMessage(e=>this.onRawMessage(e)),this.sendResponse({type:200})}registerChannel(e,t){this.channels.set(e,t)}sendResponse(e){switch(e.type){case 200:return this.send([e.type]);case 201:case 202:case 204:case 203:return this.send([e.type,e.id],e.data)}}send(e,t){const n=new _;d(n,e),d(n,t),this.sendBuffer(n.buffer)}sendBuffer(e){try{this.protocol.send(e)}catch(e){}}onRawMessage(e){const t=new g(e),n=f(t),s=f(t),i=n[0];switch(i){case 100:return this.onPromise({type:i,id:n[1],channelName:n[2],name:n[3],arg:s});case 102:return this.onEventListen({
type:i,id:n[1],channelName:n[2],name:n[3],arg:s});case 101:case 103:return this.disposeActiveRequest({type:i,id:n[1]})}}onPromise(e){const t=this.channels.get(e.channelName);if(!t)throw new Error("Unknown channel");const n=new o.CancellationTokenSource;let s;try{s=t.call(this.ctx,e.name,e.arg,n.token)}catch(e){s=Promise.reject(e)}const r=e.id;s.then(t=>{this.sendResponse({id:r,data:t,type:201}),this.activeRequests.delete(e.id)},t=>{t instanceof Error?this.sendResponse({id:r,data:{message:t.message,name:t.name,stack:t.stack?t.stack.split?t.stack.split("\n"):t.stack:void 0},type:202}):this.sendResponse({id:r,data:t,type:203}),this.activeRequests.delete(e.id)});const c=i.toDisposable(()=>n.cancel());this.activeRequests.set(e.id,c)}onEventListen(e){const t=this.channels.get(e.channelName);if(!t)throw new Error("Unknown channel");const n=e.id,s=t.listen(this.ctx,e.name,e.arg)(e=>this.sendResponse({id:n,data:e,type:204}));this.activeRequests.set(e.id,s)}disposeActiveRequest(e){const t=this.activeRequests.get(e.id)
;t&&(t.dispose(),this.activeRequests.delete(e.id))}dispose(){this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),this.activeRequests.forEach(e=>e.dispose()),this.activeRequests.clear()}}t.ChannelServer=C;class b{constructor(e){this.protocol=e,this.state=m.Uninitialized,this.activeRequests=new Set,this.handlers=new Map,this.lastRequestId=0,this._onDidInitialize=new s.Emitter,this.onDidInitialize=this._onDidInitialize.event,this.protocolListener=this.protocol.onMessage(e=>this.onBuffer(e))}getChannel(e){const t=this;return{call:(n,s,i)=>t.requestPromise(e,n,s,i),listen:(n,s)=>t.requestEvent(e,n,s)}}requestPromise(e,t,n,s=o.CancellationToken.None){const a=this.lastRequestId++,l={id:a,type:100,channelName:e,name:t,arg:n};if(s.isCancellationRequested)return Promise.reject(c.canceled());let h;return new Promise((e,t)=>{if(s.isCancellationRequested)return t(c.canceled());let n=r.createCancelablePromise(e=>this.whenInitialized());n.then(()=>{n=null;this.handlers.set(a,n=>{
switch(n.type){case 201:this.handlers.delete(a),e(n.data);break;case 202:this.handlers.delete(a);const s=new Error(n.data.message);s.stack=n.data.stack,s.name=n.data.name,t(s);break;case 203:this.handlers.delete(a),t(n.data)}}),this.sendRequest(l)});const o=()=>{n?(n.cancel(),n=null):this.sendRequest({id:a,type:101}),t(c.canceled())},u=s.onCancellationRequested(o);h=i.combinedDisposable([i.toDisposable(o),u]),this.activeRequests.add(h)}).finally(()=>this.activeRequests.delete(h))}requestEvent(e,t,n){const i=this.lastRequestId++,o={id:i,type:102,channelName:e,name:t,arg:n};let c=null;const a=new s.Emitter({onFirstListenerAdd:()=>{(c=r.createCancelablePromise(e=>this.whenInitialized())).then(()=>{c=null,this.activeRequests.add(a),this.sendRequest(o)})},onLastListenerRemove:()=>{c?(c.cancel(),c=null):(this.activeRequests.delete(a),this.sendRequest({id:i,type:103}))}});return this.handlers.set(i,e=>a.fire(e.data)),a.event}sendRequest(e){switch(e.type){case 100:case 102:
return this.send([e.type,e.id,e.channelName,e.name],e.arg);case 101:case 103:return this.send([e.type,e.id])}}send(e,t){const n=new _;d(n,e),d(n,t),this.sendBuffer(n.buffer)}sendBuffer(e){try{this.protocol.send(e)}catch(e){}}onBuffer(e){const t=new g(e),n=f(t),s=f(t);switch(n[0]){case 200:return this.onResponse({type:n[0]});case 201:case 202:case 204:case 203:return this.onResponse({type:n[0],id:n[1],data:s})}}onResponse(e){if(200===e.type)return this.state=m.Idle,void this._onDidInitialize.fire();const t=this.handlers.get(e.id);t&&t(e)}whenInitialized(){return this.state===m.Idle?Promise.resolve():s.Event.toPromise(this.onDidInitialize)}dispose(){this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),this.activeRequests.forEach(e=>e.dispose()),this.activeRequests.clear()}}t.ChannelClient=b;class y{constructor(e){this.channels=new Map,this._connections=new Set,this._onDidChangeConnections=new s.Emitter,this.onDidChangeConnections=this._onDidChangeConnections.event,
e(({protocol:e,onDidClientDisconnect:t})=>{s.Event.once(e.onMessage)(n=>{const s=f(new g(n)),i=new C(e,s),r=new b(e);this.channels.forEach((e,t)=>i.registerChannel(t,e));const o={channelClient:r,ctx:s};this._connections.add(o),this._onDidChangeConnections.fire(o),t(()=>{i.dispose(),r.dispose(),this._connections.delete(o)})})})}get connections(){const e=[];return this._connections.forEach(t=>e.push(t)),e}getChannel(e,t){const n=this;return{call:(s,i,r)=>p(t.routeCall(n,s,i).then(t=>t.channelClient.getChannel(e))).call(s,i,r),listen:(s,i)=>p(t.routeEvent(n,s,i).then(t=>t.channelClient.getChannel(e))).listen(s,i)}}registerChannel(e,t){this.channels.set(e,t)}dispose(){this.channels.clear(),this._connections.clear(),this._onDidChangeConnections.dispose()}}t.IPCServer=y;class A{constructor(e,t){const n=new _;d(n,t),e.send(n.buffer),this.channelClient=new b(e),this.channelServer=new C(e,t)}getChannel(e){return this.channelClient.getChannel(e)}registerChannel(e,t){this.channelServer.registerChannel(e,t)}dispose(){
this.channelClient.dispose(),this.channelServer.dispose()}}t.IPCClient=A,t.getDelayedChannel=p,t.getNextTickChannel=function(e){let t=!1;return{call:(n,s,i)=>t?e.call(n,s,i):r.timeout(0).then(()=>t=!0).then(()=>e.call(n,s,i)),listen(n,i){if(t)return e.listen(n,i);const o=new s.Relay;return r.timeout(0).then(()=>t=!0).then(()=>o.input=e.listen(n,i)),o.event}}};class E{constructor(e){this.fn=e}routeCall(e){return this.route(e)}routeEvent(e){return this.route(e)}route(e){return n(this,void 0,void 0,function*(){for(const t of e.connections)if(yield Promise.resolve(this.fn(t.ctx)))return Promise.resolve(t);return yield s.Event.toPromise(e.onDidChangeConnections),yield this.route(e)})}}t.StaticRouter=E}),define(e[10],t([1,0,2,8,3,4,6]),function(e,t,n,s,i,r,o){"use strict";function c(){return l||(l=r.VSBuffer.alloc(0)),l}function a(e){let t,s=!1,i=!1,r=[];const c=()=>{if(!i){for(i=!0;s&&r.length>0;)t.fire(r.shift());i=!1}};return e(e=>{r.push(e),c()}),(t=new n.Emitter({onFirstListenerAdd:()=>{s=!0,
"undefined"!=typeof process?process.nextTick(c):o.setImmediate(c)},onLastListenerRemove:()=>{s=!1}})).event}Object.defineProperty(t,"__esModule",{value:!0});let l=null;class h{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(e){this._chunks.push(e),this._totalLength+=e.byteLength}read(e){if(0===e)return c();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const t=this._chunks.shift();return this._totalLength-=e,t}if(this._chunks[0].byteLength>e){const t=this._chunks[0].slice(0,e);return this._chunks[0]=this._chunks[0].slice(e),this._totalLength-=e,t}let t=r.VSBuffer.alloc(e),n=0;for(;e>0;){const s=this._chunks[0];if(s.byteLength>e){this._chunks[0]=s.slice(e);const i=s.slice(0,e);t.set(i,n),n+=e,this._totalLength-=e,e-=e}else this._chunks.shift(),t.set(s,n),n+=s.byteLength,this._totalLength-=s.byteLength,e-=s.byteLength}return t}}var u;!function(e){e[e.None=0]="None",e[e.Regular=1]="Regular",
e[e.Control=2]="Control",e[e.Ack=3]="Ack",e[e.KeepAlive=4]="KeepAlive"}(u||(u={}));!function(e){e[e.HeaderLength=13]="HeaderLength",e[e.AcknowledgeTime=2e3]="AcknowledgeTime",e[e.AcknowledgeTimeoutTime=1e4]="AcknowledgeTimeoutTime",e[e.KeepAliveTime=3e4]="KeepAliveTime",e[e.KeepAliveTimeoutTime=6e4]="KeepAliveTimeoutTime",e[e.ReconnectionGraceTime=36e5]="ReconnectionGraceTime"}(t.ProtocolConstants||(t.ProtocolConstants={}));class d{constructor(e,t,n,s){this.type=e,this.id=t,this.ack=n,this.data=s,this.writtenTime=0}get size(){return this.data.byteLength}}class f extends i.Disposable{constructor(e){super(),this._onMessage=new n.Emitter,this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:13,messageType:0,id:0,ack:0},this._socket=e,this._isDisposed=!1,this._incomingData=new h,this._register(this._socket.onData(e=>this.acceptChunk(e))),this.lastReadTime=Date.now()}acceptChunk(e){if(e&&0!==e.byteLength)for(this.lastReadTime=Date.now(),
this._incomingData.acceptChunk(e);this._incomingData.byteLength>=this._state.readLen;){const e=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=e.readUint32BE(9),this._state.messageType=e.readUint8(0),this._state.id=e.readUint32BE(1),this._state.ack=e.readUint32BE(5);else{const t=this._state.messageType,n=this._state.id,s=this._state.ack;if(this._state.readHead=!0,this._state.readLen=13,this._state.messageType=0,this._state.id=0,this._state.ack=0,this._onMessage.fire(new d(t,n,s,e)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class p{constructor(e){this._isDisposed=!1,this._socket=e,this._data=[],this._totalLength=0,this.lastWriteTime=0}dispose(){this.flush(),this._isDisposed=!0}flush(){this._writeNow()}write(e){if(this._isDisposed)return console.warn("Cannot write message in a disposed ProtocolWriter"),void console.warn(e)
;e.writtenTime=Date.now(),this.lastWriteTime=Date.now();const t=r.VSBuffer.alloc(13);t.writeUint8(e.type,0),t.writeUint32BE(e.id,1),t.writeUint32BE(e.ack,5),t.writeUint32BE(e.data.byteLength,9),this._writeSoon(t,e.data)}_bufferAdd(e,t){const n=0===this._totalLength;return this._data.push(e,t),this._totalLength+=e.byteLength+t.byteLength,n}_bufferTake(){const e=r.VSBuffer.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,e}_writeSoon(e,t){this._bufferAdd(e,t)&&o.setImmediate(()=>{this._writeNow()})}_writeNow(){0!==this._totalLength&&this._socket.write(this._bufferTake())}}class m extends i.Disposable{constructor(e){super(),this._onMessage=new n.Emitter,this.onMessage=this._onMessage.event,this._onClose=new n.Emitter,this.onClose=this._onClose.event,this._socket=e,this._socketWriter=this._register(new p(this._socket)),this._socketReader=this._register(new f(this._socket)),this._register(this._socketReader.onMessage(e=>{1===e.type&&this._onMessage.fire(e.data)})),
this._register(this._socket.onClose(()=>this._onClose.fire()))}getSocket(){return this._socket}send(e){this._socketWriter.write(new d(1,0,0,e))}}t.Protocol=m;class g extends s.IPCClient{constructor(e,t){super(e,t),this.protocol=e}static fromSocket(e,t){return new g(new m(e),t)}get onClose(){return this.protocol.onClose}dispose(){super.dispose();const e=this.protocol.getSocket();this.protocol.dispose(),e.end()}}t.Client=g;class _{constructor(e){this.data=e,this.next=null}}class v{constructor(){this._first=null,this._last=null}peek(){return this._first?this._first.data:null}toArray(){let e=[],t=0,n=this._first;for(;n;)e[t++]=n.data,n=n.next;return e}pop(){if(this._first)return this._first===this._last?(this._first=null,void(this._last=null)):void(this._first=this._first.next)}push(e){const t=new _(e);if(!this._first)return this._first=t,void(this._last=t);this._last.next=t,this._last=t}}class w{constructor(e,t=null){this._onControlMessage=new n.Emitter,this.onControlMessage=a(this._onControlMessage.event),
this._onMessage=new n.Emitter,this.onMessage=a(this._onMessage.event),this._onClose=new n.Emitter,this.onClose=a(this._onClose.event),this._onSocketClose=new n.Emitter,this.onSocketClose=a(this._onSocketClose.event),this._onSocketTimeout=new n.Emitter,this.onSocketTimeout=a(this._onSocketTimeout.event),this._isReconnecting=!1,this._outgoingUnackMsg=new v,this._outgoingMsgId=0,this._outgoingAckId=0,this._outgoingAckTimeout=null,this._incomingMsgId=0,this._incomingAckId=0,this._incomingMsgLastTime=0,this._incomingAckTimeout=null,this._outgoingKeepAliveTimeout=null,this._incomingKeepAliveTimeout=null,this._socketDisposables=[],this._socket=e,this._socketWriter=new p(this._socket),this._socketDisposables.push(this._socketWriter),this._socketReader=new f(this._socket),this._socketDisposables.push(this._socketReader),this._socketDisposables.push(this._socketReader.onMessage(e=>this._receiveMessage(e))),this._socketDisposables.push(this._socket.onClose(()=>this._onSocketClose.fire())),
this._socketDisposables.push(this._socket.onEnd(()=>this._onClose.fire())),t&&this._socketReader.acceptChunk(t),this._sendKeepAliveCheck(),this._recvKeepAliveCheck()}get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}dispose(){this._outgoingAckTimeout&&(clearTimeout(this._outgoingAckTimeout),this._outgoingAckTimeout=null),this._incomingAckTimeout&&(clearTimeout(this._incomingAckTimeout),this._incomingAckTimeout=null),this._outgoingKeepAliveTimeout&&(clearTimeout(this._outgoingKeepAliveTimeout),this._outgoingKeepAliveTimeout=null),this._incomingKeepAliveTimeout&&(clearTimeout(this._incomingKeepAliveTimeout),this._incomingKeepAliveTimeout=null),this._socketDisposables=i.dispose(this._socketDisposables)}_sendKeepAliveCheck(){if(this._outgoingKeepAliveTimeout)return;const e=Date.now()-this._socketWriter.lastWriteTime;if(e>=3e4){const e=new d(4,0,0,c());return this._socketWriter.write(e),void this._sendKeepAliveCheck()}this._outgoingKeepAliveTimeout=setTimeout(()=>{
this._outgoingKeepAliveTimeout=null,this._sendKeepAliveCheck()},3e4-e+5)}_recvKeepAliveCheck(){if(this._incomingKeepAliveTimeout)return;const e=Date.now()-this._socketReader.lastReadTime;e>=6e4?this._onSocketTimeout.fire(void 0):this._incomingKeepAliveTimeout=setTimeout(()=>{this._incomingKeepAliveTimeout=null,this._recvKeepAliveCheck()},6e4-e+5)}getSocket(){return this._socket}beginAcceptReconnection(e,t){this._isReconnecting=!0,this._socketDisposables=i.dispose(this._socketDisposables),this._socket=e,this._socketWriter=new p(this._socket),this._socketDisposables.push(this._socketWriter),this._socketReader=new f(this._socket),this._socketDisposables.push(this._socketReader),this._socketDisposables.push(this._socketReader.onMessage(e=>this._receiveMessage(e))),this._socketDisposables.push(this._socket.onClose(()=>this._onSocketClose.fire())),this._socketDisposables.push(this._socket.onEnd(()=>this._onClose.fire())),this._socketReader.acceptChunk(t)}endAcceptReconnection(){this._isReconnecting=!1
;const e=this._outgoingUnackMsg.toArray();for(let t=0,n=e.length;t<n;t++)this._socketWriter.write(e[t]);this._recvAckCheck(),this._sendKeepAliveCheck(),this._recvKeepAliveCheck()}_receiveMessage(e){if(e.ack>this._outgoingAckId)for(this._outgoingAckId=e.ack;;){const t=this._outgoingUnackMsg.peek();if(!(t&&t.id<=e.ack))break;this._outgoingUnackMsg.pop()}1===e.type?e.id>this._incomingMsgId&&(e.id!==this._incomingMsgId+1&&console.error(`PROTOCOL CORRUPTION, LAST SAW MSG ${this._incomingMsgId} AND HAVE NOW RECEIVED MSG ${e.id}`),this._incomingMsgId=e.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(e.data)):2===e.type&&this._onControlMessage.fire(e.data)}readEntireBuffer(){return this._socketReader.readEntireBuffer()}flush(){this._socketWriter.flush()}send(e){const t=++this._outgoingMsgId;this._incomingAckId=this._incomingMsgId;const n=new d(1,t,this._incomingAckId,e);this._outgoingUnackMsg.push(n),this._isReconnecting||(this._socketWriter.write(n),this._recvAckCheck())}
sendControl(e){const t=new d(2,0,0,e);this._socketWriter.write(t)}_sendAckCheck(){if(this._incomingMsgId<=this._incomingAckId)return;if(this._incomingAckTimeout)return;const e=Date.now()-this._incomingMsgLastTime;e>=2e3?this._sendAck():this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},2e3-e+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId)return;if(this._outgoingAckTimeout)return;const e=this._outgoingUnackMsg.peek(),t=Date.now()-e.writtenTime;t>=1e4?this._onSocketTimeout.fire(void 0):this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},1e4-t+5)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const e=new d(3,0,this._incomingAckId,c());this._socketWriter.write(e)}}t.PersistentProtocol=w}),define(e[17],t([1,0,20,2,8,13,19,14,4,10]),function(e,t,n,s,i,r,o,c,a,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class h{constructor(e){this.socket=e}
onData(e){const t=t=>e(a.VSBuffer.wrap(t));return this.socket.on("data",t),{dispose:()=>this.socket.off("data",t)}}onClose(e){return this.socket.on("close",e),{dispose:()=>this.socket.off("close",e)}}onEnd(e){return this.socket.on("end",e),{dispose:()=>this.socket.off("end",e)}}write(e){this.socket.destroyed||this.socket.write(e.buffer)}end(){this.socket.end()}}t.NodeSocket=h,t.generateRandomPipeName=function(){const e=c.generateUuid();return"win32"===process.platform?`\\\\.\\pipe\\vscode-ipc-${e}-sock`:r.join(o.tmpdir(),`vscode-ipc-${e}.sock`)};class u extends i.IPCServer{static toClientConnectionEvent(e){const t=s.Event.fromNodeEventEmitter(e,"connection");return s.Event.map(t,e=>({protocol:new l.Protocol(new h(e)),onDidClientDisconnect:s.Event.once(s.Event.fromNodeEventEmitter(e,"close"))}))}constructor(e){super(u.toClientConnectionEvent(e)),this.server=e}dispose(){super.dispose(),this.server&&(this.server.close(),this.server=null)}}t.Server=u,t.serve=function(e){return new Promise((t,s)=>{
const i=n.createServer();i.on("error",s),i.listen(e,()=>{i.removeListener("error",s),t(new u(i))})})},t.connect=function(e,t){return new Promise((s,i)=>{const r=n.createConnection(e,()=>{r.removeListener("error",i),s(l.Client.fromSocket(new h(r),t))});r.once("error",i)})}}),define(e[18],t([1,0]),function(e,t){"use strict";function n(e,t,n,s){t[i.DI_TARGET]===t?t[i.DI_DEPENDENCIES].push({id:e,index:n,optional:s}):(t[i.DI_DEPENDENCIES]=[{id:e,index:n,optional:s}],t[i.DI_TARGET]=t)}function s(e){if(i.serviceIds.has(e))return i.serviceIds.get(e);const t=function(e,s,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");n(t,e,i,!1)};return t.toString=(()=>e),i.serviceIds.set(e,t),t}Object.defineProperty(t,"__esModule",{value:!0});var i;!function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(i=t._util||(t._util={})),
t.IInstantiationService=s("instantiationService"),t.createDecorator=s,t.optional=function(e){return function(t,s,i){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");n(e,t,i,!0)}}}),define(e[21],t([1,0,17,18]),function(e,t,s,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ID="driverService",t.IDriver=i.createDecorator(t.ID);class r{constructor(e){this.driver=e}listen(e,t){throw new Error("No event found")}call(e,t,n){switch(t){case"getWindowIds":return this.driver.getWindowIds();case"capturePage":return this.driver.capturePage(n);case"reloadWindow":return this.driver.reloadWindow(n);case"exitApplication":return this.driver.exitApplication();case"dispatchKeybinding":return this.driver.dispatchKeybinding(n[0],n[1]);case"click":return this.driver.click(n[0],n[1],n[2],n[3]);case"doubleClick":return this.driver.doubleClick(n[0],n[1]);case"setValue":return this.driver.setValue(n[0],n[1],n[2]);case"getTitle":return this.driver.getTitle(n[0])
;case"isActiveElement":return this.driver.isActiveElement(n[0],n[1]);case"getElements":return this.driver.getElements(n[0],n[1],n[2]);case"typeInEditor":return this.driver.typeInEditor(n[0],n[1],n[2]);case"getTerminalBuffer":return this.driver.getTerminalBuffer(n[0],n[1]);case"writeInTerminal":return this.driver.writeInTerminal(n[0],n[1],n[2])}throw new Error(`Call not found: ${t}`)}}t.DriverChannel=r;class o{constructor(e){this.channel=e}getWindowIds(){return this.channel.call("getWindowIds")}capturePage(e){return this.channel.call("capturePage",e)}reloadWindow(e){return this.channel.call("reloadWindow",e)}exitApplication(){return this.channel.call("exitApplication")}dispatchKeybinding(e,t){return this.channel.call("dispatchKeybinding",[e,t])}click(e,t,n,s){return this.channel.call("click",[e,t,n,s])}doubleClick(e,t){return this.channel.call("doubleClick",[e,t])}setValue(e,t,n){return this.channel.call("setValue",[e,t,n])}getTitle(e){return this.channel.call("getTitle",[e])}isActiveElement(e,t){
return this.channel.call("isActiveElement",[e,t])}getElements(e,t,n){return this.channel.call("getElements",[e,t,n])}typeInEditor(e,t,n){return this.channel.call("typeInEditor",[e,t,n])}getTerminalBuffer(e,t){return this.channel.call("getTerminalBuffer",[e,t])}writeInTerminal(e,t,n){return this.channel.call("writeInTerminal",[e,t,n])}}t.DriverChannelClient=o;class c{constructor(e){this.registry=e}listen(e,t){throw new Error(`Event not found: ${t}`)}call(e,t,n){switch(t){case"registerWindowDriver":return this.registry.registerWindowDriver(n);case"reloadWindowDriver":return this.registry.reloadWindowDriver(n)}throw new Error(`Call not found: ${t}`)}}t.WindowDriverRegistryChannel=c;class a{constructor(e){this.channel=e}registerWindowDriver(e){return this.channel.call("registerWindowDriver",e)}reloadWindowDriver(e){return this.channel.call("reloadWindowDriver",e)}}t.WindowDriverRegistryChannelClient=a;class l{constructor(e){this.driver=e}listen(e,t){throw new Error(`No event found: ${t}`)}call(e,t,n){switch(t){
case"click":return this.driver.click(n[0],n[1],n[2]);case"doubleClick":return this.driver.doubleClick(n);case"setValue":return this.driver.setValue(n[0],n[1]);case"getTitle":return this.driver.getTitle();case"isActiveElement":return this.driver.isActiveElement(n);case"getElements":return this.driver.getElements(n[0],n[1]);case"typeInEditor":return this.driver.typeInEditor(n[0],n[1]);case"getTerminalBuffer":return this.driver.getTerminalBuffer(n);case"writeInTerminal":return this.driver.writeInTerminal(n[0],n[1])}throw new Error(`Call not found: ${t}`)}}t.WindowDriverChannel=l;class h{constructor(e){this.channel=e}click(e,t,n){return this.channel.call("click",[e,t,n])}doubleClick(e){return this.channel.call("doubleClick",e)}setValue(e,t){return this.channel.call("setValue",[e,t])}getTitle(){return this.channel.call("getTitle")}isActiveElement(e){return this.channel.call("isActiveElement",e)}getElements(e,t){return this.channel.call("getElements",[e,t])}typeInEditor(e,t){
return this.channel.call("typeInEditor",[e,t])}getTerminalBuffer(e){return this.channel.call("getTerminalBuffer",e)}writeInTerminal(e,t){return this.channel.call("writeInTerminal",[e,t])}}t.WindowDriverChannelClient=h,t.connect=function(e){return n(this,void 0,void 0,function*(){const t=yield s.connect(e,"driverClient"),n=t.getChannel("driver");return{client:t,driver:new o(n)}})}})}).call(this);
//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/51b0b28134d51361cf996d2f0a1c698247aeabd8/core/vs\platform\driver\node\driver.js.map
