UNPKG

code-server

Version:

Run VS Code on a remote server.

8 lines 56.8 kB
/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/(function(){var ie=["require","exports","vs/base/common/strings","vs/base/common/platform","vs/base/common/path","vs/base/common/extpath","vs/base/common/uri","vs/base/common/resources","vs/base/common/async","vs/base/common/glob","vs/base/common/map","vs/base/common/network","vs/base/common/cancellation","vs/workbench/services/search/common/getFileResults","vs/workbench/services/search/common/ignoreFile","vs/base/common/arrays","vs/base/common/types","vs/base/common/errors","vs/base/common/event","vs/base/common/lifecycle","vs/editor/common/core/range","vs/workbench/services/search/worker/localFileSearch"],ne=function(Q){for(var e=[],k=0,p=Q.length;k<p;k++)e[k]=ie[Q[k]];return e},ae=this&&this.__classPrivateFieldSet||function(Q,e,k,p,C){if(p==="m")throw new TypeError("Private method is not writable");if(p==="a"&&!C)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?Q!==e||!C:!e.has(Q))throw new TypeError("Cannot write private member to an object whose class did not declare it");return p==="a"?C.call(Q,k):C?C.value=k:e.set(Q,k),k},re=this&&this.__classPrivateFieldGet||function(Q,e,k,p){if(k==="a"&&!p)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?Q!==e||!p:!e.has(Q))throw new TypeError("Cannot read private member from an object whose class did not declare it");return k==="m"?p:k==="a"?p.call(Q):p?p.value:e.get(Q)};define(ie[10],ne([0,1,15,2]),function(Q,e,k,p){"use strict";var C,A,T;Object.defineProperty(e,"__esModule",{value:!0}),e.ReadonlyMapView=e.LRUCache=e.LinkedMap=e.Touch=e.ResourceMap=e.TernarySearchTree=e.UriIterator=e.PathIterator=e.ConfigKeysIterator=e.StringIterator=e.setToString=e.mapToString=e.getOrSet=void 0;function _(f,i,n){let s=f.get(i);return s===void 0&&(s=n,f.set(i,s)),s}e.getOrSet=_;function E(f){const i=[];return f.forEach((n,s)=>{i.push(`${s} => ${n}`)}),`Map(${f.size}) {${i.join(", ")}}`}e.mapToString=E;function F(f){const i=[];return f.forEach(n=>{i.push(n)}),`Set(${f.size}) {${i.join(", ")}}`}e.setToString=F;class S{constructor(){this._value="",this._pos=0}reset(i){return this._value=i,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(i){const n=i.charCodeAt(0),s=this._value.charCodeAt(this._pos);return n-s}value(){return this._value[this._pos]}}e.StringIterator=S;class K{constructor(i=!0){this._caseSensitive=i}reset(i){return this._value=i,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let i=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(i)this._from++;else break;else i=!1;return this}cmp(i){return this._caseSensitive?(0,p.compareSubstring)(i,this._value,0,i.length,this._from,this._to):(0,p.compareSubstringIgnoreCase)(i,this._value,0,i.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}e.ConfigKeysIterator=K;class j{constructor(i=!0,n=!0){this._splitOnBackslash=i,this._caseSensitive=n}reset(i){this._from=0,this._to=0,this._value=i,this._valueLen=i.length;for(let n=i.length-1;n>=0;n--,this._valueLen--){const s=this._value.charCodeAt(n);if(!(s===47||this._splitOnBackslash&&s===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let i=!0;for(;this._to<this._valueLen;this._to++){const n=this._value.charCodeAt(this._to);if(n===47||this._splitOnBackslash&&n===92)if(i)this._from++;else break;else i=!1}return this}cmp(i){return this._caseSensitive?(0,p.compareSubstring)(i,this._value,0,i.length,this._from,this._to):(0,p.compareSubstringIgnoreCase)(i,this._value,0,i.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}e.PathIterator=j;var U;(function(f){f[f.Scheme=1]="Scheme",f[f.Authority=2]="Authority",f[f.Path=3]="Path",f[f.Query=4]="Query",f[f.Fragment=5]="Fragment"})(U||(U={}));class o{constructor(i){this._ignorePathCasing=i,this._states=[],this._stateIdx=0}reset(i){return this._value=i,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new j(!1,!this._ignorePathCasing(i)),this._pathIterator.reset(i.path),this._pathIterator.value()&&this._states.push(3)),this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(i){if(this._states[this._stateIdx]===1)return(0,p.compareIgnoreCase)(i,this._value.scheme);if(this._states[this._stateIdx]===2)return(0,p.compareIgnoreCase)(i,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(i);if(this._states[this._stateIdx]===4)return(0,p.compare)(i,this._value.query);if(this._states[this._stateIdx]===5)return(0,p.compare)(i,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}}e.UriIterator=o;class g{constructor(){this.height=1}isEmpty(){return!this.left&&!this.mid&&!this.right&&!this.value}rotateLeft(){const i=this.right;return this.right=i.left,i.left=this,this.updateHeight(),i.updateHeight(),i}rotateRight(){const i=this.left;return this.left=i.right,i.right=this,this.updateHeight(),i.updateHeight(),i}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}}var y;(function(f){f[f.Left=-1]="Left",f[f.Mid=0]="Mid",f[f.Right=1]="Right"})(y||(y={}));class q{constructor(i){this._iter=i}static forUris(i=()=>!1){return new q(new o(i))}static forPaths(i=!1){return new q(new j(void 0,!i))}static forStrings(){return new q(new S)}static forConfigKeys(){return new q(new K)}clear(){this._root=void 0}fill(i,n){if(n){const s=n.slice(0);(0,k.shuffle)(s);for(let a of s)this.set(a,i)}else{const s=i.slice(0);(0,k.shuffle)(s);for(let a of s)this.set(a[0],a[1])}}set(i,n){const s=this._iter.reset(i);let a;this._root||(this._root=new g,this._root.segment=s.value());const h=[];for(a=this._root;;){const w=s.cmp(a.segment);if(w>0)a.left||(a.left=new g,a.left.segment=s.value()),h.push([-1,a]),a=a.left;else if(w<0)a.right||(a.right=new g,a.right.segment=s.value()),h.push([1,a]),a=a.right;else if(s.hasNext())s.next(),a.mid||(a.mid=new g,a.mid.segment=s.value()),h.push([0,a]),a=a.mid;else break}const I=a.value;a.value=n,a.key=i;for(let w=h.length-1;w>=0;w--){const B=h[w][1];B.updateHeight();const Z=B.balanceFactor();if(Z<-1||Z>1){const Y=h[w][0],x=h[w+1][0];if(Y===1&&x===1)h[w][1]=B.rotateLeft();else if(Y===-1&&x===-1)h[w][1]=B.rotateRight();else if(Y===1&&x===-1)B.right=h[w+1][1]=h[w+1][1].rotateRight(),h[w][1]=B.rotateLeft();else if(Y===-1&&x===1)B.left=h[w+1][1]=h[w+1][1].rotateLeft(),h[w][1]=B.rotateRight();else throw new Error;if(w>0)switch(h[w-1][0]){case-1:h[w-1][1].left=h[w][1];break;case 1:h[w-1][1].right=h[w][1];break;case 0:h[w-1][1].mid=h[w][1];break}else this._root=h[0][1]}}return I}get(i){return this._getNode(i)?.value}_getNode(i){const n=this._iter.reset(i);let s=this._root;for(;s;){const a=n.cmp(s.segment);if(a>0)s=s.left;else if(a<0)s=s.right;else if(n.hasNext())n.next(),s=s.mid;else break}return s}has(i){const n=this._getNode(i);return!(n?.value===void 0&&n?.mid===void 0)}delete(i){return this._delete(i,!1)}deleteSuperstr(i){return this._delete(i,!0)}_delete(i,n){const s=this._iter.reset(i),a=[];let h=this._root;for(;h;){const I=s.cmp(h.segment);if(I>0)a.push([-1,h]),h=h.left;else if(I<0)a.push([1,h]),h=h.right;else if(s.hasNext())s.next(),a.push([0,h]),h=h.mid;else break}if(!!h){if(n?(h.left=void 0,h.mid=void 0,h.right=void 0,h.height=1):(h.key=void 0,h.value=void 0),!h.mid&&!h.value)if(h.left&&h.right){const I=this._min(h.right),{key:w,value:B,segment:Z}=I;this._delete(I.key,!1),h.key=w,h.value=B,h.segment=Z}else{const I=h.left??h.right;if(a.length>0){const[w,B]=a[a.length-1];switch(w){case-1:B.left=I;break;case 0:B.mid=I;break;case 1:B.right=I;break}}else this._root=I}for(let I=a.length-1;I>=0;I--){const w=a[I][1];w.updateHeight();const B=w.balanceFactor();if(B>1?(w.right.balanceFactor()>=0||(w.right=w.right.rotateRight()),a[I][1]=w.rotateLeft()):B<-1&&(w.left.balanceFactor()<=0||(w.left=w.left.rotateLeft()),a[I][1]=w.rotateRight()),I>0)switch(a[I-1][0]){case-1:a[I-1][1].left=a[I][1];break;case 1:a[I-1][1].right=a[I][1];break;case 0:a[I-1][1].mid=a[I][1];break}else this._root=a[0][1]}}}_min(i){for(;i.left;)i=i.left;return i}findSubstr(i){const n=this._iter.reset(i);let s=this._root,a;for(;s;){const h=n.cmp(s.segment);if(h>0)s=s.left;else if(h<0)s=s.right;else if(n.hasNext())n.next(),a=s.value||a,s=s.mid;else break}return s&&s.value||a}findSuperstr(i){const n=this._iter.reset(i);let s=this._root;for(;s;){const a=n.cmp(s.segment);if(a>0)s=s.left;else if(a<0)s=s.right;else if(n.hasNext())n.next(),s=s.mid;else return s.mid?this._entries(s.mid):void 0}}forEach(i){for(const[n,s]of this)i(s,n)}*[Symbol.iterator](){yield*this._entries(this._root)}*_entries(i){!i||(i.left&&(yield*this._entries(i.left)),i.value&&(yield[i.key,i.value]),i.mid&&(yield*this._entries(i.mid)),i.right&&(yield*this._entries(i.right)))}_isBalanced(){const i=n=>{if(!n)return!0;const s=n.balanceFactor();return s<-1||s>1?!1:i(n.left)&&i(n.right)};return i(this._root)}}e.TernarySearchTree=q;class z{constructor(i,n){this.uri=i,this.value=n}}class R{constructor(i,n){this[C]="ResourceMap",i instanceof R?(this.map=new Map(i.map),this.toKey=n??R.defaultToKey):(this.map=new Map,this.toKey=i??R.defaultToKey)}set(i,n){return this.map.set(this.toKey(i),new z(i,n)),this}get(i){return this.map.get(this.toKey(i))?.value}has(i){return this.map.has(this.toKey(i))}get size(){return this.map.size}clear(){this.map.clear()}delete(i){return this.map.delete(this.toKey(i))}forEach(i,n){typeof n!="undefined"&&(i=i.bind(n));for(let[s,a]of this.map)i(a.value,a.uri,this)}*values(){for(let i of this.map.values())yield i.value}*keys(){for(let i of this.map.values())yield i.uri}*entries(){for(let i of this.map.values())yield[i.uri,i.value]}*[(C=Symbol.toStringTag,Symbol.iterator)](){for(let[,i]of this.map)yield[i.uri,i.value]}}e.ResourceMap=R,R.defaultToKey=f=>f.toString();var W;(function(f){f[f.None=0]="None",f[f.AsOld=1]="AsOld",f[f.AsNew=2]="AsNew"})(W=e.Touch||(e.Touch={}));class V{constructor(){this[A]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(i){return this._map.has(i)}get(i,n=0){const s=this._map.get(i);if(!!s)return n!==0&&this.touch(s,n),s.value}set(i,n,s=0){let a=this._map.get(i);if(a)a.value=n,s!==0&&this.touch(a,s);else{switch(a={key:i,value:n,next:void 0,previous:void 0},s){case 0:this.addItemLast(a);break;case 1:this.addItemFirst(a);break;case 2:this.addItemLast(a);break;default:this.addItemLast(a);break}this._map.set(i,a),this._size++}return this}delete(i){return!!this.remove(i)}remove(i){const n=this._map.get(i);if(!!n)return this._map.delete(i),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const i=this._head;return this._map.delete(i.key),this.removeItem(i),this._size--,i.value}forEach(i,n){const s=this._state;let a=this._head;for(;a;){if(n?i.bind(n)(a.value,a.key,this):i(a.value,a.key,this),this._state!==s)throw new Error("LinkedMap got modified during iteration.");a=a.next}}keys(){const i=this,n=this._state;let s=this._head;const a={[Symbol.iterator](){return a},next(){if(i._state!==n)throw new Error("LinkedMap got modified during iteration.");if(s){const h={value:s.key,done:!1};return s=s.next,h}else return{value:void 0,done:!0}}};return a}values(){const i=this,n=this._state;let s=this._head;const a={[Symbol.iterator](){return a},next(){if(i._state!==n)throw new Error("LinkedMap got modified during iteration.");if(s){const h={value:s.value,done:!1};return s=s.next,h}else return{value:void 0,done:!0}}};return a}entries(){const i=this,n=this._state;let s=this._head;const a={[Symbol.iterator](){return a},next(){if(i._state!==n)throw new Error("LinkedMap got modified during iteration.");if(s){const h={value:[s.key,s.value],done:!1};return s=s.next,h}else return{value:void 0,done:!0}}};return a}[(A=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(i){if(i>=this.size)return;if(i===0){this.clear();return}let n=this._head,s=this.size;for(;n&&s>i;)this._map.delete(n.key),n=n.next,s--;this._head=n,this._size=s,n&&(n.previous=void 0),this._state++}addItemFirst(i){if(!this._head&&!this._tail)this._tail=i;else if(this._head)i.next=this._head,this._head.previous=i;else throw new Error("Invalid list");this._head=i,this._state++}addItemLast(i){if(!this._head&&!this._tail)this._head=i;else if(this._tail)i.previous=this._tail,this._tail.next=i;else throw new Error("Invalid list");this._tail=i,this._state++}removeItem(i){if(i===this._head&&i===this._tail)this._head=void 0,this._tail=void 0;else if(i===this._head){if(!i.next)throw new Error("Invalid list");i.next.previous=void 0,this._head=i.next}else if(i===this._tail){if(!i.previous)throw new Error("Invalid list");i.previous.next=void 0,this._tail=i.previous}else{const n=i.next,s=i.previous;if(!n||!s)throw new Error("Invalid list");n.previous=s,s.next=n}i.next=void 0,i.previous=void 0,this._state++}touch(i,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==1&&n!==2)){if(n===1){if(i===this._head)return;const s=i.next,a=i.previous;i===this._tail?(a.next=void 0,this._tail=a):(s.previous=a,a.next=s),i.previous=void 0,i.next=this._head,this._head.previous=i,this._head=i,this._state++}else if(n===2){if(i===this._tail)return;const s=i.next,a=i.previous;i===this._head?(s.previous=void 0,this._head=s):(s.previous=a,a.next=s),i.next=void 0,i.previous=this._tail,this._tail.next=i,this._tail=i,this._state++}}}toJSON(){const i=[];return this.forEach((n,s)=>{i.push([s,n])}),i}fromJSON(i){this.clear();for(const[n,s]of i)this.set(n,s)}}e.LinkedMap=V;class L extends V{constructor(i,n=1){super();this._limit=i,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(i){this._limit=i,this.checkTrim()}get ratio(){return this._ratio}set ratio(i){this._ratio=Math.min(Math.max(0,i),1),this.checkTrim()}get(i,n=2){return super.get(i,n)}peek(i){return super.get(i,0)}set(i,n){return super.set(i,n,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}e.LRUCache=L;class D{constructor(i){T.set(this,void 0),ae(this,T,i,"f")}get size(){return re(this,T,"f").size}forEach(i,n){re(this,T,"f").forEach(i,n)}get(i){return re(this,T,"f").get(i)}has(i){return re(this,T,"f").has(i)}entries(){return re(this,T,"f").entries()}keys(){return re(this,T,"f").keys()}values(){return re(this,T,"f").values()}[(T=new WeakMap,Symbol.iterator)](){return re(this,T,"f").entries()}}e.ReadonlyMapView=D}),define(ie[5],ne([0,1,4,3,2,16]),function(Q,e,k,p,C,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomPath=e.parseLineAndColumnAware=e.indexOfPath=e.getDriveLetter=e.hasDriveLetter=e.isRootOrDriveLetter=e.sanitizeFilePath=e.isWindowsDriveLetter=e.isEqualOrParent=e.isEqual=e.isValidBasename=e.isUNC=e.getRoot=e.toPosixPath=e.toSlashes=e.isPathSeparator=void 0;function T(n){return n===47||n===92}e.isPathSeparator=T;function _(n){return n.replace(/[\\/]/g,k.posix.sep)}e.toSlashes=_;function E(n){return n.indexOf("/")===-1&&(n=_(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}e.toPosixPath=E;function F(n,s=k.posix.sep){if(!n)return"";const a=n.length,h=n.charCodeAt(0);if(T(h)){if(T(n.charCodeAt(1))&&!T(n.charCodeAt(2))){let w=3;const B=w;for(;w<a&&!T(n.charCodeAt(w));w++);if(B!==w&&!T(n.charCodeAt(w+1))){for(w+=1;w<a;w++)if(T(n.charCodeAt(w)))return n.slice(0,w+1).replace(/[\\/]/g,s)}}return s}else if(q(h)&&n.charCodeAt(1)===58)return T(n.charCodeAt(2))?n.slice(0,2)+s:n.slice(0,2);let I=n.indexOf("://");if(I!==-1){for(I+=3;I<a;I++)if(T(n.charCodeAt(I)))return n.slice(0,I+1)}return""}e.getRoot=F;function S(n){if(!p.isWindows||!n||n.length<5)return!1;let s=n.charCodeAt(0);if(s!==92||(s=n.charCodeAt(1),s!==92))return!1;let a=2;const h=a;for(;a<n.length&&(s=n.charCodeAt(a),s!==92);a++);return!(h===a||(s=n.charCodeAt(a+1),isNaN(s)||s===92))}e.isUNC=S;const K=/[\\/:\*\?"<>\|]/g,j=/[\\/]/g,U=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function o(n,s=p.isWindows){const a=s?K:j;return!(!n||n.length===0||/^\s+$/.test(n)||(a.lastIndex=0,a.test(n))||s&&U.test(n)||n==="."||n===".."||s&&n[n.length-1]==="."||s&&n.length!==n.trim().length||n.length>255)}e.isValidBasename=o;function g(n,s,a){const h=n===s;return!a||h?h:!n||!s?!1:(0,C.equalsIgnoreCase)(n,s)}e.isEqual=g;function y(n,s,a,h=k.sep){if(n===s)return!0;if(!n||!s||s.length>n.length)return!1;if(a){if(!(0,C.startsWithIgnoreCase)(n,s))return!1;if(s.length===n.length)return!0;let w=s.length;return s.charAt(s.length-1)===h&&w--,n.charAt(w)===h}return s.charAt(s.length-1)!==h&&(s+=h),n.indexOf(s)===0}e.isEqualOrParent=y;function q(n){return n>=65&&n<=90||n>=97&&n<=122}e.isWindowsDriveLetter=q;function z(n,s){return p.isWindows&&n.endsWith(":")&&(n+=k.sep),(0,k.isAbsolute)(n)||(n=(0,k.join)(s,n)),n=(0,k.normalize)(n),p.isWindows?(n=(0,C.rtrim)(n,k.sep),n.endsWith(":")&&(n+=k.sep)):(n=(0,C.rtrim)(n,k.sep),n||(n=k.sep)),n}e.sanitizeFilePath=z;function R(n){const s=(0,k.normalize)(n);return p.isWindows?n.length>3?!1:W(s)&&(n.length===2||s.charCodeAt(2)===92):s===k.posix.sep}e.isRootOrDriveLetter=R;function W(n,s){return(s!==void 0?s:p.isWindows)?q(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}e.hasDriveLetter=W;function V(n){return W(n)?n[0]:void 0}e.getDriveLetter=V;function L(n,s,a){return s.length>n.length?-1:n===s?0:(a&&(n=n.toLowerCase(),s=s.toLowerCase()),n.indexOf(s))}e.indexOfPath=L;function D(n){const s=n.split(":");let a,h,I;for(const w of s){const B=Number(w);(0,A.isNumber)(B)?h===void 0?h=B:I===void 0&&(I=B):a=a?[a,w].join(":"):w}if(!a)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:a,line:h!==void 0?h:void 0,column:I!==void 0?I:h!==void 0?1:void 0}}e.parseLineAndColumnAware=D;const f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function i(n,s,a=8){let h="";for(let w=0;w<a;w++)h+=f.charAt(Math.floor(Math.random()*f.length));let I;return s?I=`${s}-${h}`:I=h,n?(0,k.join)(n,I):I}e.randomPath=i}),define(ie[11],ne([0,1,3,6]),function(Q,e,k,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileAccess=e.RemoteAuthorities=e.connectionTokenQueryName=e.connectionTokenCookieName=e.Schemas=void 0;var C;(function(_){_.inMemory="inmemory",_.vscode="vscode",_.internal="private",_.walkThrough="walkThrough",_.walkThroughSnippet="walkThroughSnippet",_.http="http",_.https="https",_.file="file",_.mailto="mailto",_.untitled="untitled",_.data="data",_.command="command",_.vscodeRemote="vscode-remote",_.vscodeRemoteResource="vscode-remote-resource",_.userData="vscode-userdata",_.vscodeCustomEditor="vscode-custom-editor",_.vscodeNotebook="vscode-notebook",_.vscodeNotebookCell="vscode-notebook-cell",_.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",_.vscodeNotebookCellOutput="vscode-notebook-cell-output",_.vscodeInteractive="vscode-interactive",_.vscodeInteractiveInput="vscode-interactive-input",_.vscodeSettings="vscode-settings",_.vscodeWorkspaceTrust="vscode-workspace-trust",_.vscodeTerminal="vscode-terminal",_.webviewPanel="webview-panel",_.vscodeWebview="vscode-webview",_.extension="extension",_.vscodeFileResource="vscode-file",_.tmp="tmp",_.vsls="vsls"})(C=e.Schemas||(e.Schemas={})),e.connectionTokenCookieName="vscode-tkn",e.connectionTokenQueryName="tkn";class A{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null}setPreferredWebSchema(E){this._preferredWebSchema=E}setDelegate(E){this._delegate=E}set(E,F,S){this._hosts[E]=F,this._ports[E]=S}setConnectionToken(E,F){this._connectionTokens[E]=F}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(E){if(this._delegate)return this._delegate(E);const F=E.authority;let S=this._hosts[F];S&&S.indexOf(":")!==-1&&(S=`[${S}]`);const K=this._ports[F],j=this._connectionTokens[F];let U=`path=${encodeURIComponent(E.path)}`;return typeof j=="string"&&(U+=`&${e.connectionTokenQueryName}=${encodeURIComponent(j)}`),p.URI.from({scheme:k.isWeb?this._preferredWebSchema:C.vscodeRemoteResource,authority:k.isWeb?window.location.host:`${S}:${K}`,path:k.isWeb?p.URI.joinPath(p.URI.parse(window.location.href),"/vscode-remote-resource").path:"/vscode-remote-resource",query:U})}}e.RemoteAuthorities=new A;class T{asBrowserUri(E,F){const S=this.toUri(E,F);return S.scheme===C.vscodeRemote?e.RemoteAuthorities.rewrite(S):S.scheme===C.file&&(k.isNative||k.isWebWorker&&k.globals.origin===`${C.vscodeFileResource}://${T.FALLBACK_AUTHORITY}`)?S.with({scheme:C.vscodeFileResource,authority:S.authority||T.FALLBACK_AUTHORITY,query:null,fragment:null}):S}asFileUri(E,F){const S=this.toUri(E,F);return S.scheme===C.vscodeFileResource?S.with({scheme:C.file,authority:S.authority!==T.FALLBACK_AUTHORITY?S.authority:null,query:null,fragment:null}):S}toUri(E,F){return p.URI.isUri(E)?E:p.URI.parse(F.toUrl(E))}}T.FALLBACK_AUTHORITY="vscode-app",e.FileAccess=new T}),define(ie[7],ne([0,1,5,11,4,3,2,6]),function(Q,e,k,p,C,A,T,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toLocalResource=e.DataUri=e.distinctParents=e.addTrailingPathSeparator=e.removeTrailingPathSeparator=e.hasTrailingPathSeparator=e.isEqualAuthority=e.isAbsolutePath=e.resolvePath=e.relativePath=e.normalizePath=e.joinPath=e.dirname=e.extname=e.basename=e.basenameOrAuthority=e.getComparisonKey=e.isEqualOrParent=e.isEqual=e.extUriIgnorePathCase=e.extUriBiasedIgnorePathCase=e.extUri=e.ExtUri=e.originalFSPath=void 0;function E(U){return(0,_.uriToFsPath)(U,!0)}e.originalFSPath=E;class F{constructor(o){this._ignorePathCasing=o}compare(o,g,y=!1){return o===g?0:(0,T.compare)(this.getComparisonKey(o,y),this.getComparisonKey(g,y))}isEqual(o,g,y=!1){return o===g?!0:!o||!g?!1:this.getComparisonKey(o,y)===this.getComparisonKey(g,y)}getComparisonKey(o,g=!1){return o.with({path:this._ignorePathCasing(o)?o.path.toLowerCase():void 0,fragment:g?null:void 0}).toString()}ignorePathCasing(o){return this._ignorePathCasing(o)}isEqualOrParent(o,g,y=!1){if(o.scheme===g.scheme){if(o.scheme===p.Schemas.file)return k.isEqualOrParent(E(o),E(g),this._ignorePathCasing(o))&&o.query===g.query&&(y||o.fragment===g.fragment);if((0,e.isEqualAuthority)(o.authority,g.authority))return k.isEqualOrParent(o.path,g.path,this._ignorePathCasing(o),"/")&&o.query===g.query&&(y||o.fragment===g.fragment)}return!1}joinPath(o,...g){return _.URI.joinPath(o,...g)}basenameOrAuthority(o){return(0,e.basename)(o)||o.authority}basename(o){return C.posix.basename(o.path)}extname(o){return C.posix.extname(o.path)}dirname(o){if(o.path.length===0)return o;let g;return o.scheme===p.Schemas.file?g=_.URI.file(C.dirname(E(o))).path:(g=C.posix.dirname(o.path),o.authority&&g.length&&g.charCodeAt(0)!==47&&(console.error(`dirname("${o.toString})) resulted in a relative path`),g="/")),o.with({path:g})}normalizePath(o){if(!o.path.length)return o;let g;return o.scheme===p.Schemas.file?g=_.URI.file(C.normalize(E(o))).path:g=C.posix.normalize(o.path),o.with({path:g})}relativePath(o,g){if(o.scheme!==g.scheme||!(0,e.isEqualAuthority)(o.authority,g.authority))return;if(o.scheme===p.Schemas.file){const z=C.relative(E(o),E(g));return A.isWindows?k.toSlashes(z):z}let y=o.path||"/",q=g.path||"/";if(this._ignorePathCasing(o)){let z=0;for(const R=Math.min(y.length,q.length);z<R&&!(y.charCodeAt(z)!==q.charCodeAt(z)&&y.charAt(z).toLowerCase()!==q.charAt(z).toLowerCase());z++);y=q.substr(0,z)+y.substr(z)}return C.posix.relative(y,q)}resolvePath(o,g){if(o.scheme===p.Schemas.file){const y=_.URI.file(C.resolve(E(o),g));return o.with({authority:y.authority,path:y.path})}return g=k.toPosixPath(g),o.with({path:C.posix.resolve(o.path,g)})}isAbsolutePath(o){return!!o.path&&o.path[0]==="/"}isEqualAuthority(o,g){return o===g||o!==void 0&&g!==void 0&&(0,T.equalsIgnoreCase)(o,g)}hasTrailingPathSeparator(o,g=C.sep){if(o.scheme===p.Schemas.file){const y=E(o);return y.length>k.getRoot(y).length&&y[y.length-1]===g}else{const y=o.path;return y.length>1&&y.charCodeAt(y.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(o.fsPath)}}removeTrailingPathSeparator(o,g=C.sep){return(0,e.hasTrailingPathSeparator)(o,g)?o.with({path:o.path.substr(0,o.path.length-1)}):o}addTrailingPathSeparator(o,g=C.sep){let y=!1;if(o.scheme===p.Schemas.file){const q=E(o);y=q!==void 0&&q.length===k.getRoot(q).length&&q[q.length-1]===g}else{g="/";const q=o.path;y=q.length===1&&q.charCodeAt(q.length-1)===47}return!y&&!(0,e.hasTrailingPathSeparator)(o,g)?o.with({path:o.path+"/"}):o}}e.ExtUri=F,e.extUri=new F(()=>!1),e.extUriBiasedIgnorePathCase=new F(U=>U.scheme===p.Schemas.file?!A.isLinux:!0),e.extUriIgnorePathCase=new F(U=>!0),e.isEqual=e.extUri.isEqual.bind(e.extUri),e.isEqualOrParent=e.extUri.isEqualOrParent.bind(e.extUri),e.getComparisonKey=e.extUri.getComparisonKey.bind(e.extUri),e.basenameOrAuthority=e.extUri.basenameOrAuthority.bind(e.extUri),e.basename=e.extUri.basename.bind(e.extUri),e.extname=e.extUri.extname.bind(e.extUri),e.dirname=e.extUri.dirname.bind(e.extUri),e.joinPath=e.extUri.joinPath.bind(e.extUri),e.normalizePath=e.extUri.normalizePath.bind(e.extUri),e.relativePath=e.extUri.relativePath.bind(e.extUri),e.resolvePath=e.extUri.resolvePath.bind(e.extUri),e.isAbsolutePath=e.extUri.isAbsolutePath.bind(e.extUri),e.isEqualAuthority=e.extUri.isEqualAuthority.bind(e.extUri),e.hasTrailingPathSeparator=e.extUri.hasTrailingPathSeparator.bind(e.extUri),e.removeTrailingPathSeparator=e.extUri.removeTrailingPathSeparator.bind(e.extUri),e.addTrailingPathSeparator=e.extUri.addTrailingPathSeparator.bind(e.extUri);function S(U,o){const g=[];for(let y=0;y<U.length;y++){const q=o(U[y]);U.some((z,R)=>R===y?!1:(0,e.isEqualOrParent)(q,o(z)))||g.push(U[y])}return g}e.distinctParents=S;var K;(function(U){U.META_DATA_LABEL="label",U.META_DATA_DESCRIPTION="description",U.META_DATA_SIZE="size",U.META_DATA_MIME="mime";function o(g){const y=new Map;g.path.substring(g.path.indexOf(";")+1,g.path.lastIndexOf(";")).split(";").forEach(R=>{const[W,V]=R.split(":");W&&V&&y.set(W,V)});const z=g.path.substring(0,g.path.indexOf(";"));return z&&y.set(U.META_DATA_MIME,z),y}U.parseMetaData=o})(K=e.DataUri||(e.DataUri={}));function j(U,o,g){if(o){let y=U.path;return y&&y[0]!==C.posix.sep&&(y=C.posix.sep+y),U.with({scheme:g,authority:o,path:y})}return U.with({scheme:g})}e.toLocalResource=j}),define(ie[8],ne([0,1,12,17,18,19,7,3]),function(Q,e,k,p,C,A,T,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createCancelableAsyncIterable=e.CancelableAsyncIterableObject=e.AsyncIterableObject=e.Promises=e.DeferredPromise=e.IntervalCounter=e.TaskSequentializer=e.retry=e.IdleValue=e.runWhenIdle=e.ThrottledWorker=e.RunOnceWorker=e.ProcessTimeRunOnceScheduler=e.RunOnceScheduler=e.IntervalTimer=e.TimeoutTimer=e.ResourceQueue=e.Queue=e.Limiter=e.firstParallel=e.first=e.sequence=e.disposableTimeout=e.timeout=e.AutoOpenBarrier=e.Barrier=e.ThrottledDelayer=e.Delayer=e.MicrotaskDelay=e.SequencerByKey=e.Sequencer=e.Throttler=e.asPromise=e.raceTimeout=e.raceCancellablePromises=e.raceCancellationError=e.raceCancellation=e.createCancelablePromise=e.isThenable=void 0;function E(u){return!!u&&typeof u.then=="function"}e.isThenable=E;function F(u){const t=new k.CancellationTokenSource,r=u(t.token),l=new Promise((c,b)=>{const $=t.token.onCancellationRequested(()=>{$.dispose(),t.dispose(),b(new p.CancellationError)});Promise.resolve(r).then(G=>{$.dispose(),t.dispose(),c(G)},G=>{$.dispose(),t.dispose(),b(G)})});return new class{cancel(){t.cancel()}then(c,b){return l.then(c,b)}catch(c){return this.then(void 0,c)}finally(c){return l.finally(c)}}}e.createCancelablePromise=F;function S(u,t,r){return new Promise((l,c)=>{const b=t.onCancellationRequested(()=>{b.dispose(),l(r)});u.then(l,c).finally(()=>b.dispose())})}e.raceCancellation=S;function K(u,t){return new Promise((r,l)=>{const c=t.onCancellationRequested(()=>{c.dispose(),l(new p.CancellationError)});u.then(r,l).finally(()=>c.dispose())})}e.raceCancellationError=K;async function j(u){let t=-1;const r=u.map((c,b)=>c.then($=>(t=b,$))),l=await Promise.race(r);return u.forEach((c,b)=>{b!==t&&c.cancel()}),l}e.raceCancellablePromises=j;function U(u,t,r){let l;const c=setTimeout(()=>{l?.(void 0),r?.()},t);return Promise.race([u.finally(()=>clearTimeout(c)),new Promise(b=>l=b)])}e.raceTimeout=U;function o(u){return new Promise((t,r)=>{const l=u();E(l)?l.then(t,r):t(l)})}e.asPromise=o;class g{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(t){if(this.activePromise){if(this.queuedPromiseFactory=t,!this.queuedPromise){const r=()=>{this.queuedPromise=null;const l=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,l};this.queuedPromise=new Promise(l=>{this.activePromise.then(r,r).then(l)})}return new Promise((r,l)=>{this.queuedPromise.then(r,l)})}return this.activePromise=t(),new Promise((r,l)=>{this.activePromise.then(c=>{this.activePromise=null,r(c)},c=>{this.activePromise=null,l(c)})})}}e.Throttler=g;class y{constructor(){this.current=Promise.resolve(null)}queue(t){return this.current=this.current.then(()=>t(),()=>t())}}e.Sequencer=y;class q{constructor(){this.promiseMap=new Map}queue(t,r){const c=(this.promiseMap.get(t)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(t)===c&&this.promiseMap.delete(t)});return this.promiseMap.set(t,c),c}}e.SequencerByKey=q;const z=(u,t)=>{let r=!0;const l=setTimeout(()=>{r=!1,t()},u);return{isTriggered:()=>r,dispose:()=>{clearTimeout(l),r=!1}}},R=u=>{let t=!0;return queueMicrotask(()=>{t&&(t=!1,u())}),{isTriggered:()=>t,dispose:()=>{t=!1}}};e.MicrotaskDelay=Symbol("MicrotaskDelay");class W{constructor(t){this.defaultDelay=t,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(t,r=this.defaultDelay){this.task=t,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((c,b)=>{this.doResolve=c,this.doReject=b}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const c=this.task;return this.task=null,c()}}));const l=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=r===e.MicrotaskDelay?R(l):z(r,l),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject&&this.doReject(new p.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}e.Delayer=W;class V{constructor(t){this.delayer=new W(t),this.throttler=new g}trigger(t,r){return this.delayer.trigger(()=>this.throttler.queue(t),r)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose()}}e.ThrottledDelayer=V;class L{constructor(){this._isOpen=!1,this._promise=new Promise((t,r)=>{this._completePromise=t})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}e.Barrier=L;class D extends L{constructor(t){super();this._timeout=setTimeout(()=>this.open(),t)}open(){clearTimeout(this._timeout),super.open()}}e.AutoOpenBarrier=D;function f(u,t){return t?new Promise((r,l)=>{const c=setTimeout(()=>{b.dispose(),r()},u),b=t.onCancellationRequested(()=>{clearTimeout(c),b.dispose(),l(new p.CancellationError)})}):F(r=>f(u,r))}e.timeout=f;function i(u,t=0){const r=setTimeout(u,t);return(0,A.toDisposable)(()=>clearTimeout(r))}e.disposableTimeout=i;function n(u){const t=[];let r=0;const l=u.length;function c(){return r<l?u[r++]():null}function b($){$!=null&&t.push($);const G=c();return G?G.then(b):Promise.resolve(t)}return Promise.resolve(null).then(b)}e.sequence=n;function s(u,t=l=>!!l,r=null){let l=0;const c=u.length,b=()=>{if(l>=c)return Promise.resolve(r);const $=u[l++];return Promise.resolve($()).then(te=>t(te)?Promise.resolve(te):b())};return b()}e.first=s;function a(u,t=l=>!!l,r=null){if(u.length===0)return Promise.resolve(r);let l=u.length;const c=()=>{l=-1;for(const b of u)b.cancel?.()};return new Promise((b,$)=>{for(const G of u)G.then(te=>{--l>=0&&t(te)?(c(),b(te)):l===0&&b(r)}).catch(te=>{--l>=0&&(c(),$(te))})})}e.firstParallel=a;class h{constructor(t){this._size=0,this.maxDegreeOfParalellism=t,this.outstandingPromises=[],this.runningPromises=0,this._onFinished=new C.Emitter}get onFinished(){return this._onFinished.event}get size(){return this._size}queue(t){return this._size++,new Promise((r,l)=>{this.outstandingPromises.push({factory:t,c:r,e:l}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){const t=this.outstandingPromises.shift();this.runningPromises++;const r=t.factory();r.then(t.c,t.e),r.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._size--,this.runningPromises--,this.outstandingPromises.length>0?this.consume():this._onFinished.fire()}dispose(){this._onFinished.dispose()}}e.Limiter=h;class I extends h{constructor(){super(1)}}e.Queue=I;class w{constructor(){this.queues=new Map,this.drainers=new Set}async whenDrained(){if(this.isDrained())return;const t=new d;return this.drainers.add(t),t.p}isDrained(){for(const[,t]of this.queues)if(t.size>0)return!1;return!0}queueFor(t,r=T.extUri){const l=r.getComparisonKey(t);let c=this.queues.get(l);return c||(c=new I,C.Event.once(c.onFinished)(()=>{c?.dispose(),this.queues.delete(l),this.onDidQueueFinish()}),this.queues.set(l,c)),c}onDidQueueFinish(){!this.isDrained()||this.releaseDrainers()}releaseDrainers(){for(const t of this.drainers)t.complete();this.drainers.clear()}dispose(){for(const[,t]of this.queues)t.dispose();this.queues.clear(),this.releaseDrainers()}}e.ResourceQueue=w;class B{constructor(t,r){this._token=-1,typeof t=="function"&&typeof r=="number"&&this.setIfNotSet(t,r)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(t,r){this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},r)}setIfNotSet(t,r){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},r))}}e.TimeoutTimer=B;class Z{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(t,r){this.cancel(),this._token=setInterval(()=>{t()},r)}}e.IntervalTimer=Z;class Y{constructor(t,r){this.timeoutToken=-1,this.runner=t,this.timeout=r,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(t=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,t)}get delay(){return this.timeout}set delay(t){this.timeout=t}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner&&this.runner()}}e.RunOnceScheduler=Y;class x{constructor(t,r){r%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${r}ms is not a multiple of 1000ms.`),this.runner=t,this.timeout=r,this.counter=0,this.intervalToken=-1,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=-1)}schedule(t=this.timeout){t%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${t}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(t/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==-1}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=-1,this.runner&&this.runner())}}e.ProcessTimeRunOnceScheduler=x;class J extends Y{constructor(t,r){super(t,r);this.units=[]}work(t){this.units.push(t),this.isScheduled()||this.schedule()}doRun(){const t=this.units;this.units=[],this.runner&&this.runner(t)}dispose(){this.units=[],super.dispose()}}e.RunOnceWorker=J;class se extends A.Disposable{constructor(t,r){super();this.options=t,this.handler=r,this.pendingWork=[],this.throttler=this._register(new A.MutableDisposable),this.disposed=!1}get pending(){return this.pendingWork.length}work(t){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+t.length>this.options.maxBufferedWork)return!1}else if(this.pending+t.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}return this.pendingWork.push(...t),this.throttler.value||this.doWork(),!0}doWork(){this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&(this.throttler.value=new Y(()=>{this.throttler.clear(),this.doWork()},this.options.throttleDelay),this.throttler.value.schedule())}dispose(){super.dispose(),this.disposed=!0}}e.ThrottledWorker=se,function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?e.runWhenIdle=u=>{(0,_.setTimeout0)(()=>{if(t)return;const r=Date.now()+15;u(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,r-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:e.runWhenIdle=(u,t)=>{const r=requestIdleCallback(u,typeof t=="number"?{timeout:t}:void 0);let l=!1;return{dispose(){l||(l=!0,cancelIdleCallback(r))}}}}();class N{constructor(t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(r){this._error=r}finally{this._didRun=!0}},this._handle=(0,e.runWhenIdle)(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}e.IdleValue=N;async function X(u,t,r){let l;for(let c=0;c<r;c++)try{return await u()}catch(b){l=b,await f(t)}throw l}e.retry=X;class H{hasPending(t){return this._pending?typeof t=="number"?this._pending.taskId===t:!!this._pending:!1}get pending(){return this._pending?this._pending.promise:void 0}cancelPending(){this._pending?.cancel()}setPending(t,r,l){return this._pending={taskId:t,cancel:()=>l?.(),promise:r},r.then(()=>this.donePending(t),()=>this.donePending(t)),r}donePending(t){this._pending&&t===this._pending.taskId&&(this._pending=void 0,this.triggerNext())}triggerNext(){if(this._next){const t=this._next;this._next=void 0,t.run().then(t.promiseResolve,t.promiseReject)}}setNext(t){if(this._next)this._next.run=t;else{let r,l;const c=new Promise((b,$)=>{r=b,l=$});this._next={run:t,promise:c,promiseResolve:r,promiseReject:l}}return this._next.promise}}e.TaskSequentializer=H;class ee{constructor(t,r=()=>Date.now()){this.interval=t,this.nowFn=r,this.lastIncrementTime=0,this.value=0}increment(){const t=this.nowFn();return t-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=t,this.value=0),this.value++,this.value}}e.IntervalCounter=ee;class d{constructor(){this.rejected=!1,this.resolved=!1,this.p=new Promise((t,r)=>{this.completeCallback=t,this.errorCallback=r})}get isRejected(){return this.rejected}get isResolved(){return this.resolved}get isSettled(){return this.rejected||this.resolved}complete(t){return new Promise(r=>{this.completeCallback(t),this.resolved=!0,r()})}error(t){return new Promise(r=>{this.errorCallback(t),this.rejected=!0,r()})}cancel(){new Promise(t=>{this.errorCallback(new p.CancellationError),this.rejected=!0,t()})}}e.DeferredPromise=d;var v;(function(u){async function t(l){let c;const b=await Promise.all(l.map($=>$.then(G=>G,G=>{c||(c=G)})));if(typeof c!="undefined")throw c;return b}u.settled=t;function r(l){return new Promise(async(c,b)=>{try{await l(c,b)}catch($){b($)}})}u.withAsyncBody=r})(v=e.Promises||(e.Promises={}));var m;(function(u){u[u.Initial=0]="Initial",u[u.DoneOK=1]="DoneOK",u[u.DoneError=2]="DoneError"})(m||(m={}));class P{constructor(t){this._state=0,this._results=[],this._error=null,this._onStateChanged=new C.Emitter,queueMicrotask(async()=>{const r={emitOne:l=>this.emitOne(l),emitMany:l=>this.emitMany(l),reject:l=>this.reject(l)};try{await Promise.resolve(t(r)),this.resolve()}catch(l){this.reject(l)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}static fromArray(t){return new P(r=>{r.emitMany(t)})}static fromPromise(t){return new P(async r=>{r.emitMany(await t)})}static fromPromises(t){return new P(async r=>{await Promise.all(t.map(async l=>r.emitOne(await l)))})}static merge(t){return new P(async r=>{await Promise.all(t.map(async l=>{for await(const c of l)r.emitOne(c)}))})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await C.Event.toPromise(this._onStateChanged.event)}while(!0)}}}static map(t,r){return new P(async l=>{for await(const c of t)l.emitOne(r(c))})}map(t){return P.map(this,t)}static filter(t,r){return new P(async l=>{for await(const c of t)r(c)&&l.emitOne(c)})}filter(t){return P.filter(this,t)}static coalesce(t){return P.filter(t,r=>!!r)}coalesce(){return P.coalesce(this)}static async toPromise(t){const r=[];for await(const l of t)r.push(l);return r}toPromise(){return P.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}}e.AsyncIterableObject=P,P.EMPTY=P.fromArray([]);class O extends P{constructor(t,r){super(r);this._source=t}cancel(){this._source.cancel()}}e.CancelableAsyncIterableObject=O;function M(u){const t=new k.CancellationTokenSource,r=u(t.token);return new O(t,async l=>{const c=t.token.onCancellationRequested(()=>{c.dispose(),t.dispose(),l.reject(new p.CancellationError)});try{for await(const b of r){if(t.token.isCancellationRequested)return;l.emitOne(b)}c.dispose(),t.dispose()}catch(b){c.dispose(),t.dispose(),l.reject(b)}})}e.createCancelableAsyncIterable=M}),define(ie[9],ne([0,1,8,5,10,4,3,2]),function(Q,e,k,p,C,A,T,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPathTerms=e.getBasenameTerms=e.isRelativePattern=e.hasSiblingFn=e.hasSiblingPromiseFn=e.parse=e.match=e.splitGlobAware=e.GLOB_SPLIT=e.GLOBSTAR=e.getEmptyExpression=void 0;function E(){return Object.create(null)}e.getEmptyExpression=E,e.GLOBSTAR="**",e.GLOB_SPLIT="/";const F="[/\\\\]",S="[^/\\\\]",K=/\//g;function j(d){switch(d){case 0:return"";case 1:return`${S}*?`;default:return`(?:${F}|${S}+${F}|${F}${S}+)*?`}}function U(d,v){if(!d)return[];const m=[];let P=!1,O=!1,M="";for(const u of d){switch(u){case v:if(!P&&!O){m.push(M),M="";continue}break;case"{":P=!0;break;case"}":P=!1;break;case"[":O=!0;break;case"]":O=!1;break}M+=u}return M&&m.push(M),m}e.splitGlobAware=U;function o(d){if(!d)return"";let v="";const m=U(d,e.GLOB_SPLIT);if(m.every(P=>P===e.GLOBSTAR))v=".*";else{let P=!1;m.forEach((O,M)=>{if(O===e.GLOBSTAR){P||(v+=j(2),P=!0);return}let u=!1,t="",r=!1,l="";for(const c of O){if(c!=="}"&&u){t+=c;continue}if(r&&(c!=="]"||!l)){let b;c==="-"?b=c:(c==="^"||c==="!")&&!l?b="^":c===e.GLOB_SPLIT?b="":b=(0,_.escapeRegExpCharacters)(c),l+=b;continue}switch(c){case"{":u=!0;continue;case"[":r=!0;continue;case"}":{v+=`(?:${U(t,",").map(G=>o(G)).join("|")})`,u=!1,t="";break}case"]":v+="["+l+"]",r=!1,l="";break;case"?":v+=S;continue;case"*":v+=j(1);continue;default:v+=(0,_.escapeRegExpCharacters)(c)}}M<m.length-1&&(m[M+1]!==e.GLOBSTAR||M+2<m.length)&&(v+=F),P=!1})}return v}const g=/^\*\*\/\*\.[\w\.-]+$/,y=/^\*\*\/([\w\.-]+)\/?$/,q=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,z=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,R=/^\*\*((\/[\w\.-]+)+)\/?$/,W=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,V=new C.LRUCache(1e4),L=function(){return!1},D=function(){return null};function f(d,v){if(!d)return D;let m;typeof d!="string"?m=d.pattern:m=d,m=m.trim();const P=`${m}_${!!v.trimForExclusions}`;let O=V.get(P);if(O)return i(O,d);let M;if(g.test(m)){const u=m.substr(4);O=function(t,r){return typeof t=="string"&&t.endsWith(u)?m:null}}else(M=y.exec(n(m,v)))?O=s(M[1],m):(v.trimForExclusions?z:q).test(m)?O=a(m,v):(M=R.exec(n(m,v)))?O=h(M[1].substr(1),m,!0):(M=W.exec(n(m,v)))?O=h(M[1],m,!1):O=I(m);return V.set(P,O),i(O,d)}function i(d,v){return typeof v=="string"?d:function(m,P){return(0,p.isEqualOrParent)(m,v.base,!T.isLinux)?d(m.substr(v.base.length+1),P):null}}function n(d,v){return v.trimForExclusions&&d.endsWith("/**")?d.substr(0,d.length-2):d}function s(d,v){const m=`/${d}`,P=`\\${d}`,O=function(u,t){return typeof u!="string"?null:t?t===d?v:null:u===d||u.endsWith(m)||u.endsWith(P)?v:null},M=[d];return O.basenames=M,O.patterns=[v],O.allBasenames=M,O}function a(d,v){const m=ee(d.slice(1,-1).split(",").map(t=>f(t,v)).filter(t=>t!==D),d),P=m.length;if(!P)return D;if(P===1)return m[0];const O=function(t,r){for(let l=0,c=m.length;l<c;l++)if(m[l](t,r))return d;return null},M=m.find(t=>!!t.allBasenames);M&&(O.allBasenames=M.allBasenames);const u=m.reduce((t,r)=>r.allPaths?t.concat(r.allPaths):t,[]);return u.length&&(O.allPaths=u),O}function h(d,v,m){const P=A.sep===A.posix.sep,O=P?d:d.replace(K,A.sep),M=A.sep+O,u=A.posix.sep+d,t=m?function(r,l){return typeof r=="string"&&(r===O||r.endsWith(M)||!P&&(r===d||r.endsWith(u)))?v:null}:function(r,l){return typeof r=="string"&&(r===O||!P&&r===d)?v:null};return t.allPaths=[(m?"*/":"./")+d],t}function I(d){try{const v=new RegExp(`^${o(d)}$`);return function(m){return v.lastIndex=0,typeof m=="string"&&v.test(m)?d:null}}catch{return D}}function w(d,v,m){return!d||typeof v!="string"?!1:B(d)(v,void 0,m)}e.match=w;function B(d,v={}){if(!d)return L;if(typeof d=="string"||J(d)){const m=f(d,v);if(m===D)return L;const P=function(O,M){return!!m(O,M)};return m.allBasenames&&(P.allBasenames=m.allBasenames),m.allPaths&&(P.allPaths=m.allPaths),P}return X(d,v)}e.parse=B;function Z(d){if(!d)return;let v;return m=>(v||(v=(d()||Promise.resolve([])).then(P=>P?x(P):{})),v.then(P=>!!P[m]))}e.hasSiblingPromiseFn=Z;function Y(d){if(!d)return;let v;return m=>{if(!v){const P=d();v=P?x(P):{}}return!!v[m]}}e.hasSiblingFn=Y;function x(d){const v={};for(const m of d)v[m]=!0;return v}function J(d){const v=d;return v?typeof v.base=="string"&&typeof v.pattern=="string":!1}e.isRelativePattern=J;function se(d){return d.allBasenames||[]}e.getBasenameTerms=se;function N(d){return d.allPaths||[]}e.getPathTerms=N;function X(d,v){const m=ee(Object.getOwnPropertyNames(d).map(t=>H(t,d[t],v)).filter(t=>t!==D)),P=m.length;if(!P)return D;if(!m.some(t=>!!t.requiresSiblings)){if(P===1)return m[0];const t=function(c,b){for(let $=0,G=m.length;$<G;$++){const te=m[$](c,b);if(te)return te}return null},r=m.find(c=>!!c.allBasenames);r&&(t.allBasenames=r.allBasenames);const l=m.reduce((c,b)=>b.allPaths?c.concat(b.allPaths):c,[]);return l.length&&(t.allPaths=l),t}const O=function(t,r,l){let c;for(let b=0,$=m.length;b<$;b++){const G=m[b];G.requiresSiblings&&l&&(r||(r=(0,A.basename)(t)),c||(c=r.substr(0,r.length-(0,A.extname)(t).length)));const te=G(t,r,c,l);if(te)return te}return null},M=m.find(t=>!!t.allBasenames);M&&(O.allBasenames=M.allBasenames);const u=m.reduce((t,r)=>r.allPaths?t.concat(r.allPaths):t,[]);return u.length&&(O.allPaths=u),O}function H(d,v,m){if(v===!1)return D;const P=f(d,m);if(P===D)return D;if(typeof v=="boolean")return P;if(v){const O=v.when;if(typeof O=="string"){const M=(u,t,r,l)=>{if(!l||!P(u,t))return null;const c=O.replace("$(basename)",r),b=l(c);return(0,k.isThenable)(b)?b.then($=>$?d:null):b?d:null};return M.requiresSiblings=!0,M}}return P}function ee(d,v){const m=d.filter(t=>!!t.basenames);if(m.length<2)return d;const P=m.reduce((t,r)=>{const l=r.basenames;return l?t.concat(l):t},[]);let O;if(v){O=[];for(let t=0,r=P.length;t<r;t++)O.push(v)}else O=m.reduce((t,r)=>{const l=r.patterns;return l?t.concat(l):t},[]);const M=function(t,r){if(typeof t!="string")return null;if(!r){let c;for(c=t.length;c>0;c--){const b=t.charCodeAt(c-1);if(b===47||b===92)break}r=t.substr(c)}const l=P.indexOf(r);return l!==-1?O[l]:null};M.basenames=P,M.patterns=O,M.allBasenames=P;const u=d.filter(t=>!t.basenames);return u.push(M),u}}),define(ie[13],ne([0,1,20]),function(Q,e,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFileResults=void 0;const p=(C,A,T)=>{let _;if(C[0]===255&&C[1]===254)_=new TextDecoder("utf-16le").decode(C);else if(C[0]===254&&C[1]===255)_=new TextDecoder("utf-16be").decode(C);else if(_=new TextDecoder("utf8").decode(C),_.slice(0,1e3).includes("\uFFFD")&&C.includes(0))return[];const E=[],F=[];let S=null,K=T.remainingResultQuota;for(;K>=0&&(S=A.exec(_));)F.push({matchStartIndex:S.index,matchedText:S[0]}),K--;if(F.length){const j=new Set,U=new Set,o=[],g=W=>_.slice(o[W].start,o[W].end);let y=0,q=null;const z=/\r?\n/g;for(;q=z.exec(_);)o.push({start:y,end:q.index}),y=q.index+q[0].length;y<_.length&&o.push({start:y,end:_.length});let R=0;for(const{matchStartIndex:W,matchedText:V}of F){if(K<0)break;for(;Boolean(o[R+1])&&W>o[R].end;)R++;let L=R;for(;Boolean(o[L+1])&&W+V.length>o[L].end;)L++;if(T.beforeContext)for(let a=Math.max(0,R-T.beforeContext);a<R;a++)j.add(a);let D="",f=0;for(let a=R;a<=L;a++){let h=g(a);T.previewOptions?.charsPerLine&&h.length>T.previewOptions.charsPerLine&&(f=Math.max(W-o[R].start-20,0),h=h.substr(f,T.previewOptions.charsPerLine)),D+=`${h}
`,U.add(a)}const i=new k.Range(R,W-o[R].start,L,W+V.length-o[L].start),n=new k.Range(0,W-o[R].start-f,L-R,W+V.length-o[L].start-(L===R?f:0)),s={ranges:i,preview:{text:D,matches:n}};if(E.push(s),T.afterContext)for(let a=L+1;a<=Math.min(L+T.afterContext,o.length-1);a++)j.add(a)}for(const W of j)U.has(W)||E.push({text:g(W),lineNumber:W+1})}return E};e.getFileResults=p}),define(ie[14],ne([0,1,9]),function(Q,e,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IgnoreFile=void 0;class p{constructor(A,T,_){this.isPathIgnored=this.parseIgnoreFile(A,T,_)}isPathIncludedInTraversal(A,T){if(A[0]!=="/"||A[A.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+A);return!this.isPathIgnored(A,T)}isArbitraryPathIgnored(A,T){if(A[0]!=="/"||A[A.length-1]==="/")throw Error("Unexpected path format, expectred to begin with slash and end without. got:"+A);const _=A.split("/").filter(S=>S);let E=!1,F="";for(let S=0;S<_.length;S++){const K=S===_.length-1,j=_[S];if(F=F+"/"+j,!this.isPathIncludedInTraversal(F,K?T:!0)){E=!0;break}}return E}gitignoreLinesToExpression(A,T,_){const E=A.map(S=>this.gitignoreLineToGlob(S,T)),F=Object.create(null);for(const S of E)F[S]=!0;return k.parse(F,{trimForExclusions:_})}parseIgnoreFile(A,T,_){const E=A.split(`
`).map(R=>R.trim()).filter(R=>R&&R[0]!=="#"),F=E.filter(R=>!R.endsWith("/")),S=F.filter(R=>!R.includes("!")),K=this.gitignoreLinesToExpression(S,T,!0),j=F.filter(R=>R.includes("!")).map(R=>R.replace(/!/g,"")),U=this.gitignoreLinesToExpression(j,T,!1),o=E.filter(R=>!R.includes("!")),g=this.gitignoreLinesToExpression(o,T,!0),y=E.filter(R=>R.includes("!")).map(R=>R.replace(/!/g,"")),q=this.gitignoreLinesToExpression(y,T,!1);return(R,W)=>R.startsWith(T)?W&&g(R)&&!q(R)||K(R)&&!U(R)?!0:_?_.isPathIgnored(R,W):!1:!1}gitignoreLineToGlob(A,T){const _=A.indexOf("/");return _===-1||_===A.length-1?A="**/"+A:(_===0&&(A=A.slice(1)),A=T+A),A}}e.IgnoreFile=p}),define(ie[21],ne([0,1,9,6,4,12,13,14,2,8,7]),function(Q,e,k,p,C,A,T,_,E,F,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LocalFileSearchSimpleWorker=e.create=void 0;const K=!1,j=+new Date,U={},o=async(L,D)=>{if(!K)return D();const f=Date.now(),i=(U[L]??0)+1;console.info(L,i,"starting",Math.round((f-j)*10)/1e4),U[L]=i;const n=await D(),s=Date.now();return console.info(L,i,"took",s-f),n};function g(L){return new y(L)}e.create=g;class y{constructor(D){this.host=D,this.cancellationTokens=new Map}cancelQuery(D){this.cancellationTokens.get(D)?.cancel()}registerCancellationToken(D){const f=new A.CancellationTokenSource;return this.cancellationTokens.set(D,f),f}async listDirectory(D,f,i,n,s){const a=z(i),h=new S.ExtUri(()=>n),I=this.registerCancellationToken(s),w=[];let B=!1,Z=0;const Y=f.maxResults||512,x=f.filePattern?J=>f.filePattern.split("").every(se=>J.includes(se)):J=>!0;return await o("listDirectory",()=>this.walkFolderQuery(D,R(f),a,h,J=>{if(!!x(J.name))return Z++,Y&&Z>Y&&(B=!0,I.cancel()),w.push(J.path)},I.token)),{results:w,limitHit:B}}async searchDirectory(D,f,i,n,s){const a=z(i),h=new S.ExtUri(()=>n);return o("searchInFiles",async()=>{const I=this.registerCancellationToken(s),w=[],B=q(f.contentPattern),Z=[];let Y=0,x=0,J=!1;const se=async N=>{if(I.token.isCancellationRequested)return;Y++;const X=await N.resolve();if(I.token.isCancellationRequested)return;const H=new Uint8Array(X),ee=(0,T.getFileResults)(H,B,{afterContext:f.afterContext??0,beforeContext:f.beforeContext??0,previewOptions:f.previewOptions,remainingResultQuota:f.maxResults?f.maxResults-x:1e4});if(ee.length){x+=ee.length,f.maxResults&&x>f.maxResults&&I.cancel();const d={resource:p.URI.joinPath(a.folder,N.path),results:ee};this.host.sendTextSearchMatch(d,s),w.push(d)}};return await o("walkFolderToResolve",()=>this.walkFolderQuery(D,R(f),a,h,async N=>Z.push(se(N)),I.token)),await o("resolveOngoingProcesses",()=>Promise.all(Z)),K&&console.log("Searched in",Y,"files"),{results:w,limitHit:J}})}async walkFolderQuery(D,f,i,n,s,a){const h=k.parse(i.excludePattern??{},{trimForExclusions:!0}),I=(N,X,H)=>(N=N.slice(1),!!(h(N,X,H)||W(f,N))),w=(N,X,H)=>(N=N.slice(1),!(h(N,X,H)||!V(f,p.URI.file(N),n))),B=(N,X)=>({type:"file",name:N.name,path:X,resolve:()=>N.getFile().then(ee=>ee.arrayBuffer())}),Z=N=>N.kind==="directory",Y=N=>N.kind==="file",x=async(N,X,H)=>{if(!i.disregardIgnoreFiles){const d=await Promise.all([N.getFileHandle(".gitignore").catch(v=>{}),N.getFileHandle(".ignore").catch(v=>{})]);await Promise.all(d.map(async v=>{if(!v)return;const m=new TextDecoder("utf8").decode(new Uint8Array(await(await v.getFile()).arrayBuffer()));H=new _.IgnoreFile(m,X,H)}))}const ee=F.Promises.withAsyncBody(async d=>{const v=[],m=[],P=[],O=new Set;for await(const M of N.entries())P.push(M),O.add(M[0]);for(const[M,u]of P){if(a.isCancellationRequested)break;const t=X+M;if(H&&!H.isPathIncludedInTraversal(t,u.kind==="directory"))continue;const r=l=>O.has(l);Z(u)&&!I(t,M,r)?m.push(x(u,t+"/",H)):Y(u)&&w(t,M,r)&&v.push(B(u,t))}d([...await Promise.all(m),...v])});return{type:"dir",name:N.name,entries:ee}},J=async(N,X)=>{a.isCancellationRequested||await Promise.all((await N.entries).sort((H,ee)=>-(H.type==="dir"?0:1)+(ee.type==="dir"?0:1)).map(async H=>H.type==="dir"?J(H,X):X(H)))},se=await o("process",()=>x(D,"/"));await o("resolve",()=>J(se,s))}}e.LocalFileSearchSimpleWorker=y;function q(L){return(0,E.createRegExp)(L.pattern,!!L.isRegExp,{wholeWord:L.isWordMatch,global:!0,matchCase:L.isCaseSensitive,multiline:!0,unicode:!0})}function z(L){return{...L,folder:p.URI.revive(L.folder)}}function R(L){return{...L,extraFileResources:L.extraFileResources?.map(D=>p.URI.revive(D)),folderQueries:L.folderQueries.map(D=>z(D))}}function W(L,D){return!!(L.excludePattern&&k.match(L.excludePattern,D))}function V(L,D,f){return L.excludePattern&&k.match(L.excludePattern,D.fsPath)?!1:L.includePattern||L.usingSearchPaths?L.includePattern&&k.match(L.includePattern,D.fsPath)?!0:L.usingSearchPaths?!!L.folderQueries&&L.folderQueries.some(i=>{const n=i.folder;if(f.isEqualOrParent(D,n)){const s=C.relative(n.path,D.path);return!i.includePattern||!!k.match(i.includePattern,s)}else return!1}):!1:!0}})}).call(this);

//# sourceMappingURL=localFileSearch.js.map