code-server
Version:
Run VS Code on a remote server.
25 lines • 142 kB
JavaScript
/*!--------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/(function(){var ne=["require","exports","vs/base/common/strings","vs/base/common/platform","vs/base/common/path","vs/base/common/buffer","vs/base/common/lifecycle","vs/base/common/extpath","vs/base/common/network","vs/base/common/uri","vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase","vs/editor/common/core/range","vs/base/common/mime","vs/base/common/stream","vs/base/common/errors","vs/base/common/map","vs/base/common/arrays","vs/base/common/resources","vs/base/common/async","vs/base/common/event","vs/base/common/glob","vs/editor/common/core/eolCounter","vs/editor/common/core/stringBuilder","vs/editor/common/core/textChange","vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase","vs/editor/common/model","vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer","vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder","vs/platform/instantiation/common/instantiation","vs/platform/contextkey/common/contextkey","vs/workbench/contrib/notebook/common/notebookCommon","vs/base/common/types","vs/base/common/cancellation","vs/editor/common/core/position","vs/editor/common/model/textModelSearch","vs/base/common/iterator","vs/workbench/contrib/notebook/common/services/notebookSimpleWorker","vs/base/common/diff/diff","vs/base/common/hash"],ie=function(J){for(var e=[],B=0,M=J.length;B<M;B++)e[B]=ne[J[B]];return e};define(ne[12],ie([0,1,4]),function(J,e,B){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeMimeType=e.getExtensionForMimeType=e.getMediaMime=e.getMediaOrTextMime=e.Mimes=void 0,e.Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"});const M={".css":"text/css",".csv":"text/csv",".htm":"text/html",".html":"text/html",".ics":"text/calendar",".js":"text/javascript",".mjs":"text/javascript",".txt":"text/plain",".xml":"text/xml"},F={".aac":"audio/x-aac",".avi":"video/x-msvideo",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":"image/jpg",".jpeg":"image/jpg",".jpg":"image/jpg",".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};function S(I){const N=(0,B.extname)(I),_=M[N.toLowerCase()];return _!==void 0?_:R(I)}e.getMediaOrTextMime=S;function R(I){const N=(0,B.extname)(I);return F[N.toLowerCase()]}e.getMediaMime=R;function k(I){for(const N in F)if(F[N]===I)return N}e.getExtensionForMimeType=k;const A=/^(.+)\/(.+?)(;.+)?$/;function w(I,N){const _=A.exec(I);return _?`${_[1].toLowerCase()}/${_[2].toLowerCase()}${_[3]??""}`:N?void 0:I}e.normalizeMimeType=w}),define(ne[13],ie([0,1,14,6]),function(J,e,B,M){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.prefixedStream=e.prefixedReadable=e.transform=e.toReadable=e.emptyStream=e.toStream=e.peekStream=e.listenStream=e.consumeStream=e.peekReadable=e.consumeReadable=e.newWriteableStream=e.isReadableBufferedStream=e.isReadableStream=e.isReadable=void 0;function F(u){const h=u;return h?typeof h.read=="function":!1}e.isReadable=F;function S(u){const h=u;return h?[h.on,h.pause,h.resume,h.destroy].every(p=>typeof p=="function"):!1}e.isReadableStream=S;function R(u){const h=u;return h?S(h.stream)&&Array.isArray(h.buffer)&&typeof h.ended=="boolean":!1}e.isReadableBufferedStream=R;function k(u,h){return new A(u,h)}e.newWriteableStream=k;class A{constructor(h,p){this.reducer=h,this.options=p,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(h){if(!this.state.destroyed){if(this.state.flowing)this.emitData(h);else if(this.buffer.data.push(h),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(p=>this.pendingWritePromises.push(p))}}error(h){this.state.destroyed||(this.state.flowing?this.emitError(h):this.buffer.error.push(h))}end(h){this.state.destroyed||(typeof h!="undefined"&&this.write(h),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(h){this.listeners.data.slice(0).forEach(p=>p(h))}emitError(h){this.listeners.error.length===0?(0,B.onUnexpectedError)(h):this.listeners.error.slice(0).forEach(p=>p(h))}emitEnd(){this.listeners.end.slice(0).forEach(h=>h())}on(h,p){if(!this.state.destroyed)switch(h){case"data":this.listeners.data.push(p),this.resume();break;case"end":this.listeners.end.push(p),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(p),this.state.flowing&&this.flowErrors();break}}removeListener(h,p){if(this.state.destroyed)return;let y;switch(h){case"data":y=this.listeners.data;break;case"end":y=this.listeners.end;break;case"error":y=this.listeners.error;break}if(y){const v=y.indexOf(p);v>=0&&y.splice(v,1)}}flowData(){if(this.buffer.data.length>0){const h=this.reducer(this.buffer.data);this.emitData(h),this.buffer.data.length=0;const p=[...this.pendingWritePromises];this.pendingWritePromises.length=0,p.forEach(y=>y())}}flowErrors(){if(this.listeners.error.length>0){for(const h of this.buffer.error)this.emitError(h);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}}function w(u,h){const p=[];let y;for(;(y=u.read())!==null;)p.push(y);return h(p)}e.consumeReadable=w;function I(u,h,p){const y=[];let v;for(;(v=u.read())!==null&&y.length<p;)y.push(v);return v===null&&y.length>0?h(y):{read:()=>{if(y.length>0)return y.shift();if(typeof v!="undefined"){const q=v;return v=void 0,q}return u.read()}}}e.peekReadable=I;function N(u,h){return new Promise((p,y)=>{const v=[];_(u,{onData:q=>{h&&v.push(q)},onError:q=>{h?y(q):p(void 0)},onEnd:()=>{p(h?h(v):void 0)}})})}e.consumeStream=N;function _(u,h){let p=!1;return u.on("error",y=>{p||h.onError(y)}),u.on("end",()=>{p||h.onEnd()}),u.on("data",y=>{p||h.onData(y)}),(0,M.toDisposable)(()=>p=!0)}e.listenStream=_;function P(u,h){return new Promise((p,y)=>{const v=new M.DisposableStore,q=[],f=a=>{if(q.push(a),q.length>h)return v.dispose(),u.pause(),p({stream:u,buffer:q,ended:!1})},n=a=>y(a),o=()=>p({stream:u,buffer:q,ended:!0});v.add((0,M.toDisposable)(()=>u.removeListener("error",n))),u.on("error",n),v.add((0,M.toDisposable)(()=>u.removeListener("end",o))),u.on("end",o),v.add((0,M.toDisposable)(()=>u.removeListener("data",f))),u.on("data",f)})}e.peekStream=P;function b(u,h){const p=k(h);return p.end(u),p}e.toStream=b;function c(){const u=k(()=>{throw new Error("not supported")});return u.end(),u}e.emptyStream=c;function l(u){let h=!1;return{read:()=>h?null:(h=!0,u)}}e.toReadable=l;function t(u,h,p){const y=k(p);return _(u,{onData:v=>y.write(h.data(v)),onError:v=>y.error(h.error?h.error(v):v),onEnd:()=>y.end()}),y}e.transform=t;function s(u,h,p){let y=!1;return{read:()=>{const v=h.read();return y?v:(y=!0,v!==null?p([u,v]):u)}}}e.prefixedReadable=s;function r(u,h,p){let y=!1;const v=k(p);return _(h,{onData:q=>y?v.write(q):(y=!0,v.write(p([u,q]))),onError:q=>v.error(q),onEnd:()=>{y||(y=!0,v.write(u)),v.end()}}),v}e.prefixedStream=r}),define(ne[5],ie([0,1,13]),function(J,e,B){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeBase64=e.decodeBase64=e.prefixedBufferStream=e.prefixedBufferReadable=e.newWriteableBufferStream=e.streamToBufferReadableStream=e.bufferToStream=e.bufferedStreamToBuffer=e.streamToBuffer=e.bufferToReadable=e.readableToBuffer=e.writeUInt8=e.readUInt8=e.writeUInt32LE=e.readUInt32LE=e.writeUInt32BE=e.readUInt32BE=e.writeUInt16LE=e.readUInt16LE=e.VSBuffer=void 0;const M=typeof Buffer!="undefined";let F,S;class R{constructor(a){this.buffer=a,this.byteLength=this.buffer.byteLength}static alloc(a){return M?new R(Buffer.allocUnsafe(a)):new R(new Uint8Array(a))}static wrap(a){return M&&!Buffer.isBuffer(a)&&(a=Buffer.from(a.buffer,a.byteOffset,a.byteLength)),new R(a)}static fromString(a,g){return!(g?.dontUseNodeBuffer||!1)&&M?new R(Buffer.from(a)):(F||(F=new TextEncoder),new R(F.encode(a)))}static fromByteArray(a){const g=R.alloc(a.length);for(let L=0,W=a.length;L<W;L++)g.buffer[L]=a[L];return g}static concat(a,g){if(typeof g=="undefined"){g=0;for(let D=0,T=a.length;D<T;D++)g+=a[D].byteLength}const L=R.alloc(g);let W=0;for(let D=0,T=a.length;D<T;D++){const i=a[D];L.set(i,W),W+=i.byteLength}return L}clone(){const a=R.alloc(this.byteLength);return a.set(this),a}toString(){return M?this.buffer.toString():(S||(S=new TextDecoder),S.decode(this.buffer))}slice(a,g){return new R(this.buffer.subarray(a,g))}set(a,g){if(a instanceof R)this.buffer.set(a.buffer,g);else if(a instanceof Uint8Array)this.buffer.set(a,g);else if(a instanceof ArrayBuffer)this.buffer.set(new Uint8Array(a),g);else if(ArrayBuffer.isView(a))this.buffer.set(new Uint8Array(a.buffer,a.byteOffset,a.byteLength),g);else throw new Error("Unknown argument 'array'")}readUInt32BE(a){return w(this.buffer,a)}writeUInt32BE(a,g){I(this.buffer,a,g)}readUInt32LE(a){return N(this.buffer,a)}writeUInt32LE(a,g){_(this.buffer,a,g)}readUInt8(a){return P(this.buffer,a)}writeUInt8(a,g){b(this.buffer,a,g)}}e.VSBuffer=R;function k(o,a){return o[a+0]<<0>>>0|o[a+1]<<8>>>0}e.readUInt16LE=k;function A(o,a,g){o[g+0]=a&255,a=a>>>8,o[g+1]=a&255}e.writeUInt16LE=A;function w(o,a){return o[a]*2**24+o[a+1]*2**16+o[a+2]*2**8+o[a+3]}e.readUInt32BE=w;function I(o,a,g){o[g+3]=a,a=a>>>8,o[g+2]=a,a=a>>>8,o[g+1]=a,a=a>>>8,o[g]=a}e.writeUInt32BE=I;function N(o,a){return o[a+0]<<0>>>0|o[a+1]<<8>>>0|o[a+2]<<16>>>0|o[a+3]<<24>>>0}e.readUInt32LE=N;function _(o,a,g){o[g+0]=a&255,a=a>>>8,o[g+1]=a&255,a=a>>>8,o[g+2]=a&255,a=a>>>8,o[g+3]=a&255}e.writeUInt32LE=_;function P(o,a){return o[a]}e.readUInt8=P;function b(o,a,g){o[g]=a}e.writeUInt8=b;function c(o){return B.consumeReadable(o,a=>R.concat(a))}e.readableToBuffer=c;function l(o){return B.toReadable(o)}e.bufferToReadable=l;function t(o){return B.consumeStream(o,a=>R.concat(a))}e.streamToBuffer=t;async function s(o){return o.ended?R.concat(o.buffer):R.concat([...o.buffer,await t(o.stream)])}e.bufferedStreamToBuffer=s;function r(o){return B.toStream(o,a=>R.concat(a))}e.bufferToStream=r;function u(o){return B.transform(o,{data:a=>typeof a=="string"?R.fromString(a):R.wrap(a)},a=>R.concat(a))}e.streamToBufferReadableStream=u;function h(o){return B.newWriteableStream(a=>R.concat(a),o)}e.newWriteableBufferStream=h;function p(o,a){return B.prefixedReadable(o,a,g=>R.concat(g))}e.prefixedBufferReadable=p;function y(o,a){return B.prefixedStream(o,a,g=>R.concat(g))}e.prefixedBufferStream=y;function v(o){let a=0,g=0,L=0;const W=new Uint8Array(Math.floor(o.length/4*3)),D=i=>{switch(g){case 3:W[L++]=a|i,g=0;break;case 2:W[L++]=a|i>>>2,a=i<<6,g=3;break;case 1:W[L++]=a|i>>>4,a=i<<4,g=2;break;default:a=i<<2,g=1}};for(let i=0;i<o.length;i++){const m=o.charCodeAt(i);if(m>=65&&m<=90)D(m-65);else if(m>=97&&m<=122)D(m-97+26);else if(m>=48&&m<=57)D(m-48+52);else if(m===43||m===45)D(62);else if(m===47||m===95)D(63);else{if(m===61)break;throw new SyntaxError(`Unexpected base64 character ${o[i]}`)}}const T=L;for(;g>0;)D(0);return R.wrap(W).slice(0,T)}e.decodeBase64=v;const q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function n({buffer:o},a=!0,g=!1){const L=g?f:q;let W="";const D=o.byteLength%3;let T=0;for(;T<o.byteLength-D;T+=3){const i=o[T+0],m=o[T+1],C=o[T+2];W+=L[i>>>2],W+=L[(i<<4|m>>>4)&63],W+=L[(m<<2|C>>>6)&63],W+=L[C&63]}if(D===1){const i=o[T+0];W+=L[i>>>2],W+=L[i<<4&63],a&&(W+="==")}else if(D===2){const i=o[T+0],m=o[T+1];W+=L[i>>>2],W+=L[(i<<4|m>>>4)&63],W+=L[m<<2&63],a&&(W+="=")}return W}e.encodeBase64=n});var le=this&&this.__classPrivateFieldSet||function(J,e,B,M,F){if(M==="m")throw new TypeError("Private method is not writable");if(M==="a"&&!F)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?J!==e||!F:!e.has(J))throw new TypeError("Cannot write private member to an object whose class did not declare it");return M==="a"?F.call(J,B):F?F.value=B:e.set(J,B),B},ae=this&&this.__classPrivateFieldGet||function(J,e,B,M){if(B==="a"&&!M)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?J!==e||!M:!e.has(J))throw new TypeError("Cannot read private member from an object whose class did not declare it");return B==="m"?M:B==="a"?M.call(J):M?M.value:e.get(J)};define(ne[15],ie([0,1,16,2]),function(J,e,B,M){"use strict";var F,S,R,k;Object.defineProperty(e,"__esModule",{value:!0}),e.ReadonlyMapView=e.LRUCache=e.LinkedMap=e.Touch=e.ResourceSet=e.ResourceMap=e.TernarySearchTree=e.UriIterator=e.PathIterator=e.ConfigKeysIterator=e.StringIterator=e.setToString=e.mapToString=e.getOrSet=void 0;function A(f,n,o){let a=f.get(n);return a===void 0&&(a=o,f.set(n,a)),a}e.getOrSet=A;function w(f){const n=[];return f.forEach((o,a)=>{n.push(`${a} => ${o}`)}),`Map(${f.size}) {${n.join(", ")}}`}e.mapToString=w;function I(f){const n=[];return f.forEach(o=>{n.push(o)}),`Set(${f.size}) {${n.join(", ")}}`}e.setToString=I;class N{constructor(){this._value="",this._pos=0}reset(n){return this._value=n,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(n){const o=n.charCodeAt(0),a=this._value.charCodeAt(this._pos);return o-a}value(){return this._value[this._pos]}}e.StringIterator=N;class _{constructor(n=!0){this._caseSensitive=n}reset(n){return this._value=n,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let n=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(n)this._from++;else break;else n=!1;return this}cmp(n){return this._caseSensitive?(0,M.compareSubstring)(n,this._value,0,n.length,this._from,this._to):(0,M.compareSubstringIgnoreCase)(n,this._value,0,n.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}e.ConfigKeysIterator=_;class P{constructor(n=!0,o=!0){this._splitOnBackslash=n,this._caseSensitive=o}reset(n){this._from=0,this._to=0,this._value=n,this._valueLen=n.length;for(let o=n.length-1;o>=0;o--,this._valueLen--){const a=this._value.charCodeAt(o);if(!(a===47||this._splitOnBackslash&&a===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let n=!0;for(;this._to<this._valueLen;this._to++){const o=this._value.charCodeAt(this._to);if(o===47||this._splitOnBackslash&&o===92)if(n)this._from++;else break;else n=!1}return this}cmp(n){return this._caseSensitive?(0,M.compareSubstring)(n,this._value,0,n.length,this._from,this._to):(0,M.compareSubstringIgnoreCase)(n,this._value,0,n.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}e.PathIterator=P;var b;(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"})(b||(b={}));class c{constructor(n,o){this._ignorePathCasing=n,this._ignoreQueryAndFragment=o,this._states=[],this._stateIdx=0}reset(n){return this._value=n,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new P(!1,!this._ignorePathCasing(n)),this._pathIterator.reset(n.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(n)||(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(n){if(this._states[this._stateIdx]===1)return(0,M.compareIgnoreCase)(n,this._value.scheme);if(this._states[this._stateIdx]===2)return(0,M.compareIgnoreCase)(n,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(n);if(this._states[this._stateIdx]===4)return(0,M.compare)(n,this._value.query);if(this._states[this._stateIdx]===5)return(0,M.compare)(n,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=c;class l{constructor(){this.height=1}isEmpty(){return!this.left&&!this.mid&&!this.right&&!this.value}rotateLeft(){const n=this.right;return this.right=n.left,n.left=this,this.updateHeight(),n.updateHeight(),n}rotateRight(){const n=this.left;return this.left=n.right,n.right=this,this.updateHeight(),n.updateHeight(),n}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 t;(function(f){f[f.Left=-1]="Left",f[f.Mid=0]="Mid",f[f.Right=1]="Right"})(t||(t={}));class s{constructor(n){this._iter=n}static forUris(n=()=>!1,o=()=>!1){return new s(new c(n,o))}static forPaths(n=!1){return new s(new P(void 0,!n))}static forStrings(){return new s(new N)}static forConfigKeys(){return new s(new _)}clear(){this._root=void 0}fill(n,o){if(o){const a=o.slice(0);(0,B.shuffle)(a);for(const g of a)this.set(g,n)}else{const a=n.slice(0);(0,B.shuffle)(a);for(const g of a)this.set(g[0],g[1])}}set(n,o){const a=this._iter.reset(n);let g;this._root||(this._root=new l,this._root.segment=a.value());const L=[];for(g=this._root;;){const D=a.cmp(g.segment);if(D>0)g.left||(g.left=new l,g.left.segment=a.value()),L.push([-1,g]),g=g.left;else if(D<0)g.right||(g.right=new l,g.right.segment=a.value()),L.push([1,g]),g=g.right;else if(a.hasNext())a.next(),g.mid||(g.mid=new l,g.mid.segment=a.value()),L.push([0,g]),g=g.mid;else break}const W=g.value;g.value=o,g.key=n;for(let D=L.length-1;D>=0;D--){const T=L[D][1];T.updateHeight();const i=T.balanceFactor();if(i<-1||i>1){const m=L[D][0],C=L[D+1][0];if(m===1&&C===1)L[D][1]=T.rotateLeft();else if(m===-1&&C===-1)L[D][1]=T.rotateRight();else if(m===1&&C===-1)T.right=L[D+1][1]=L[D+1][1].rotateRight(),L[D][1]=T.rotateLeft();else if(m===-1&&C===1)T.left=L[D+1][1]=L[D+1][1].rotateLeft(),L[D][1]=T.rotateRight();else throw new Error;if(D>0)switch(L[D-1][0]){case-1:L[D-1][1].left=L[D][1];break;case 1:L[D-1][1].right=L[D][1];break;case 0:L[D-1][1].mid=L[D][1];break}else this._root=L[0][1]}}return W}get(n){return this._getNode(n)?.value}_getNode(n){const o=this._iter.reset(n);let a=this._root;for(;a;){const g=o.cmp(a.segment);if(g>0)a=a.left;else if(g<0)a=a.right;else if(o.hasNext())o.next(),a=a.mid;else break}return a}has(n){const o=this._getNode(n);return!(o?.value===void 0&&o?.mid===void 0)}delete(n){return this._delete(n,!1)}deleteSuperstr(n){return this._delete(n,!0)}_delete(n,o){const a=this._iter.reset(n),g=[];let L=this._root;for(;L;){const W=a.cmp(L.segment);if(W>0)g.push([-1,L]),L=L.left;else if(W<0)g.push([1,L]),L=L.right;else if(a.hasNext())a.next(),g.push([0,L]),L=L.mid;else break}if(!!L){if(o?(L.left=void 0,L.mid=void 0,L.right=void 0,L.height=1):(L.key=void 0,L.value=void 0),!L.mid&&!L.value)if(L.left&&L.right){const W=this._min(L.right),{key:D,value:T,segment:i}=W;this._delete(W.key,!1),L.key=D,L.value=T,L.segment=i}else{const W=L.left??L.right;if(g.length>0){const[D,T]=g[g.length-1];switch(D){case-1:T.left=W;break;case 0:T.mid=W;break;case 1:T.right=W;break}}else this._root=W}for(let W=g.length-1;W>=0;W--){const D=g[W][1];D.updateHeight();const T=D.balanceFactor();if(T>1?(D.right.balanceFactor()>=0||(D.right=D.right.rotateRight()),g[W][1]=D.rotateLeft()):T<-1&&(D.left.balanceFactor()<=0||(D.left=D.left.rotateLeft()),g[W][1]=D.rotateRight()),W>0)switch(g[W-1][0]){case-1:g[W-1][1].left=g[W][1];break;case 1:g[W-1][1].right=g[W][1];break;case 0:g[W-1][1].mid=g[W][1];break}else this._root=g[0][1]}}}_min(n){for(;n.left;)n=n.left;return n}findSubstr(n){const o=this._iter.reset(n);let a=this._root,g;for(;a;){const L=o.cmp(a.segment);if(L>0)a=a.left;else if(L<0)a=a.right;else if(o.hasNext())o.next(),g=a.value||g,a=a.mid;else break}return a&&a.value||g}findSuperstr(n){const o=this._iter.reset(n);let a=this._root;for(;a;){const g=o.cmp(a.segment);if(g>0)a=a.left;else if(g<0)a=a.right;else if(o.hasNext())o.next(),a=a.mid;else return a.mid?this._entries(a.mid):void 0}}forEach(n){for(const[o,a]of this)n(a,o)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(n){const o=[];return this._dfsEntries(n,o),o[Symbol.iterator]()}_dfsEntries(n,o){!n||(n.left&&this._dfsEntries(n.left,o),n.value&&o.push([n.key,n.value]),n.mid&&this._dfsEntries(n.mid,o),n.right&&this._dfsEntries(n.right,o))}_isBalanced(){const n=o=>{if(!o)return!0;const a=o.balanceFactor();return a<-1||a>1?!1:n(o.left)&&n(o.right)};return n(this._root)}}e.TernarySearchTree=s;class r{constructor(n,o){this.uri=n,this.value=o}}class u{constructor(n,o){this[F]="ResourceMap",n instanceof u?(this.map=new Map(n.map),this.toKey=o??u.defaultToKey):(this.map=new Map,this.toKey=n??u.defaultToKey)}set(n,o){return this.map.set(this.toKey(n),new r(n,o)),this}get(n){return this.map.get(this.toKey(n))?.value}has(n){return this.map.has(this.toKey(n))}get size(){return this.map.size}clear(){this.map.clear()}delete(n){return this.map.delete(this.toKey(n))}forEach(n,o){typeof o!="undefined"&&(n=n.bind(o));for(const[a,g]of this.map)n(g.value,g.uri,this)}*values(){for(const n of this.map.values())yield n.value}*keys(){for(const n of this.map.values())yield n.uri}*entries(){for(const n of this.map.values())yield[n.uri,n.value]}*[(F=Symbol.toStringTag,Symbol.iterator)](){for(const[,n]of this.map)yield[n.uri,n.value]}}e.ResourceMap=u,u.defaultToKey=f=>f.toString();class h{constructor(n,o){this[S]="ResourceSet",!n||typeof n=="function"?this._map=new u(n):(this._map=new u(o),n.forEach(this.add,this))}get size(){return this._map.size}add(n){return this._map.set(n,n),this}clear(){this._map.clear()}delete(n){return this._map.delete(n)}forEach(n,o){this._map.forEach((a,g)=>n.call(o,g,g,this))}has(n){return this._map.has(n)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(S=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}}e.ResourceSet=h;var p;(function(f){f[f.None=0]="None",f[f.AsOld=1]="AsOld",f[f.AsNew=2]="AsNew"})(p=e.Touch||(e.Touch={}));class y{constructor(){this[R]="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(n){return this._map.has(n)}get(n,o=0){const a=this._map.get(n);if(!!a)return o!==0&&this.touch(a,o),a.value}set(n,o,a=0){let g=this._map.get(n);if(g)g.value=o,a!==0&&this.touch(g,a);else{switch(g={key:n,value:o,next:void 0,previous:void 0},a){case 0:this.addItemLast(g);break;case 1:this.addItemFirst(g);break;case 2:this.addItemLast(g);break;default:this.addItemLast(g);break}this._map.set(n,g),this._size++}return this}delete(n){return!!this.remove(n)}remove(n){const o=this._map.get(n);if(!!o)return this._map.delete(n),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const n=this._head;return this._map.delete(n.key),this.removeItem(n),this._size--,n.value}forEach(n,o){const a=this._state;let g=this._head;for(;g;){if(o?n.bind(o)(g.value,g.key,this):n(g.value,g.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");g=g.next}}keys(){const n=this,o=this._state;let a=this._head;const g={[Symbol.iterator](){return g},next(){if(n._state!==o)throw new Error("LinkedMap got modified during iteration.");if(a){const L={value:a.key,done:!1};return a=a.next,L}else return{value:void 0,done:!0}}};return g}values(){const n=this,o=this._state;let a=this._head;const g={[Symbol.iterator](){return g},next(){if(n._state!==o)throw new Error("LinkedMap got modified during iteration.");if(a){const L={value:a.value,done:!1};return a=a.next,L}else return{value:void 0,done:!0}}};return g}entries(){const n=this,o=this._state;let a=this._head;const g={[Symbol.iterator](){return g},next(){if(n._state!==o)throw new Error("LinkedMap got modified during iteration.");if(a){const L={value:[a.key,a.value],done:!1};return a=a.next,L}else return{value:void 0,done:!0}}};return g}[(R=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(n){if(n>=this.size)return;if(n===0){this.clear();return}let o=this._head,a=this.size;for(;o&&a>n;)this._map.delete(o.key),o=o.next,a--;this._head=o,this._size=a,o&&(o.previous=void 0),this._state++}addItemFirst(n){if(!this._head&&!this._tail)this._tail=n;else if(this._head)n.next=this._head,this._head.previous=n;else throw new Error("Invalid list");this._head=n,this._state++}addItemLast(n){if(!this._head&&!this._tail)this._head=n;else if(this._tail)n.previous=this._tail,this._tail.next=n;else throw new Error("Invalid list");this._tail=n,this._state++}removeItem(n){if(n===this._head&&n===this._tail)this._head=void 0,this._tail=void 0;else if(n===this._head){if(!n.next)throw new Error("Invalid list");n.next.previous=void 0,this._head=n.next}else if(n===this._tail){if(!n.previous)throw new Error("Invalid list");n.previous.next=void 0,this._tail=n.previous}else{const o=n.next,a=n.previous;if(!o||!a)throw new Error("Invalid list");o.previous=a,a.next=o}n.next=void 0,n.previous=void 0,this._state++}touch(n,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==1&&o!==2)){if(o===1){if(n===this._head)return;const a=n.next,g=n.previous;n===this._tail?(g.next=void 0,this._tail=g):(a.previous=g,g.next=a),n.previous=void 0,n.next=this._head,this._head.previous=n,this._head=n,this._state++}else if(o===2){if(n===this._tail)return;const a=n.next,g=n.previous;n===this._head?(a.previous=void 0,this._head=a):(a.previous=g,g.next=a),n.next=void 0,n.previous=this._tail,this._tail.next=n,this._tail=n,this._state++}}}toJSON(){const n=[];return this.forEach((o,a)=>{n.push([a,o])}),n}fromJSON(n){this.clear();for(const[o,a]of n)this.set(o,a)}}e.LinkedMap=y;class v extends y{constructor(n,o=1){super();this._limit=n,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(n){this._limit=n,this.checkTrim()}get ratio(){return this._ratio}set ratio(n){this._ratio=Math.min(Math.max(0,n),1),this.checkTrim()}get(n,o=2){return super.get(n,o)}peek(n){return super.get(n,0)}set(n,o){return super.set(n,o,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}e.LRUCache=v;class q{constructor(n){k.set(this,void 0),le(this,k,n,"f")}get size(){return ae(this,k,"f").size}forEach(n,o){ae(this,k,"f").forEach(n,o)}get(n){return ae(this,k,"f").get(n)}has(n){return ae(this,k,"f").has(n)}entries(){return ae(this,k,"f").entries()}keys(){return ae(this,k,"f").keys()}values(){return ae(this,k,"f").values()}[(k=new WeakMap,Symbol.iterator)](){return ae(this,k,"f").entries()}}e.ReadonlyMapView=q}),define(ne[7],ie([0,1,4,3,2,31]),function(J,e,B,M,F,S){"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 R(f){return f===47||f===92}e.isPathSeparator=R;function k(f){return f.replace(/[\\/]/g,B.posix.sep)}e.toSlashes=k;function A(f){return f.indexOf("/")===-1&&(f=k(f)),/^[a-zA-Z]:(\/|$)/.test(f)&&(f="/"+f),f}e.toPosixPath=A;function w(f,n=B.posix.sep){if(!f)return"";const o=f.length,a=f.charCodeAt(0);if(R(a)){if(R(f.charCodeAt(1))&&!R(f.charCodeAt(2))){let L=3;const W=L;for(;L<o&&!R(f.charCodeAt(L));L++);if(W!==L&&!R(f.charCodeAt(L+1))){for(L+=1;L<o;L++)if(R(f.charCodeAt(L)))return f.slice(0,L+1).replace(/[\\/]/g,n)}}return n}else if(t(a)&&f.charCodeAt(1)===58)return R(f.charCodeAt(2))?f.slice(0,2)+n:f.slice(0,2);let g=f.indexOf("://");if(g!==-1){for(g+=3;g<o;g++)if(R(f.charCodeAt(g)))return f.slice(0,g+1)}return""}e.getRoot=w;function I(f){if(!M.isWindows||!f||f.length<5)return!1;let n=f.charCodeAt(0);if(n!==92||(n=f.charCodeAt(1),n!==92))return!1;let o=2;const a=o;for(;o<f.length&&(n=f.charCodeAt(o),n!==92);o++);return!(a===o||(n=f.charCodeAt(o+1),isNaN(n)||n===92))}e.isUNC=I;const N=/[\\/:\*\?"<>\|]/g,_=/[\\/]/g,P=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function b(f,n=M.isWindows){const o=n?N:_;return!(!f||f.length===0||/^\s+$/.test(f)||(o.lastIndex=0,o.test(f))||n&&P.test(f)||f==="."||f===".."||n&&f[f.length-1]==="."||n&&f.length!==f.trim().length||f.length>255)}e.isValidBasename=b;function c(f,n,o){const a=f===n;return!o||a?a:!f||!n?!1:(0,F.equalsIgnoreCase)(f,n)}e.isEqual=c;function l(f,n,o,a=B.sep){if(f===n)return!0;if(!f||!n||n.length>f.length)return!1;if(o){if(!(0,F.startsWithIgnoreCase)(f,n))return!1;if(n.length===f.length)return!0;let L=n.length;return n.charAt(n.length-1)===a&&L--,f.charAt(L)===a}return n.charAt(n.length-1)!==a&&(n+=a),f.indexOf(n)===0}e.isEqualOrParent=l;function t(f){return f>=65&&f<=90||f>=97&&f<=122}e.isWindowsDriveLetter=t;function s(f,n){return M.isWindows&&f.endsWith(":")&&(f+=B.sep),(0,B.isAbsolute)(f)||(f=(0,B.join)(n,f)),f=(0,B.normalize)(f),M.isWindows?(f=(0,F.rtrim)(f,B.sep),f.endsWith(":")&&(f+=B.sep)):(f=(0,F.rtrim)(f,B.sep),f||(f=B.sep)),f}e.sanitizeFilePath=s;function r(f){const n=(0,B.normalize)(f);return M.isWindows?f.length>3?!1:u(n)&&(f.length===2||n.charCodeAt(2)===92):n===B.posix.sep}e.isRootOrDriveLetter=r;function u(f,n=M.isWindows){return n?t(f.charCodeAt(0))&&f.charCodeAt(1)===58:!1}e.hasDriveLetter=u;function h(f){return u(f)?f[0]:void 0}e.getDriveLetter=h;function p(f,n,o){return n.length>f.length?-1:f===n?0:(o&&(f=f.toLowerCase(),n=n.toLowerCase()),f.indexOf(n))}e.indexOfPath=p;function y(f){const n=f.split(":");let o,a,g;for(const L of n){const W=Number(L);(0,S.isNumber)(W)?a===void 0?a=W:g===void 0&&(g=W):o=o?[o,L].join(":"):L}if(!o)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:o,line:a!==void 0?a:void 0,column:g!==void 0?g:a!==void 0?1:void 0}}e.parseLineAndColumnAware=y;const v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function q(f,n,o=8){let a="";for(let L=0;L<o;L++)a+=v.charAt(Math.floor(Math.random()*v.length));let g;return n?g=`${n}-${a}`:g=a,f?(0,B.join)(f,g):g}e.randomPath=q}),define(ne[8],ie([0,1,3,9]),function(J,e,B,M){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileAccess=e.RemoteAuthorities=e.connectionTokenQueryName=e.connectionTokenCookieName=e.Schemas=void 0;var F;(function(k){k.inMemory="inmemory",k.vscode="vscode",k.internal="private",k.walkThrough="walkThrough",k.walkThroughSnippet="walkThroughSnippet",k.http="http",k.https="https",k.file="file",k.mailto="mailto",k.untitled="untitled",k.data="data",k.command="command",k.vscodeRemote="vscode-remote",k.vscodeRemoteResource="vscode-remote-resource",k.vscodeUserData="vscode-userdata",k.vscodeCustomEditor="vscode-custom-editor",k.vscodeNotebook="vscode-notebook",k.vscodeNotebookCell="vscode-notebook-cell",k.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",k.vscodeNotebookCellOutput="vscode-notebook-cell-output",k.vscodeInteractive="vscode-interactive",k.vscodeInteractiveInput="vscode-interactive-input",k.vscodeSettings="vscode-settings",k.vscodeWorkspaceTrust="vscode-workspace-trust",k.vscodeTerminal="vscode-terminal",k.webviewPanel="webview-panel",k.vscodeWebview="vscode-webview",k.extension="extension",k.vscodeFileResource="vscode-file",k.tmp="tmp",k.vsls="vsls",k.vscodeSourceControl="vscode-scm"})(F=e.Schemas||(e.Schemas={})),e.connectionTokenCookieName="vscode-tkn",e.connectionTokenQueryName="tkn";class S{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${F.vscodeRemoteResource}`}setPreferredWebSchema(A){this._preferredWebSchema=A}setDelegate(A){this._delegate=A}setServerRootPath(A){this._remoteResourcesPath=`${A}/${F.vscodeRemoteResource}`}set(A,w,I){this._hosts[A]=w,this._ports[A]=I}setConnectionToken(A,w){this._connectionTokens[A]=w}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(A){if(this._delegate)return this._delegate(A);const w=A.authority;let I=this._hosts[w];I&&I.indexOf(":")!==-1&&(I=`[${I}]`);const N=this._ports[w],_=this._connectionTokens[w];let P=`path=${encodeURIComponent(A.path)}`;return typeof _=="string"&&(P+=`&${e.connectionTokenQueryName}=${encodeURIComponent(_)}`),M.URI.from({scheme:B.isWeb?this._preferredWebSchema:F.vscodeRemoteResource,authority:`${I}:${N}`,path:B.isWeb?(window.location.pathname+"/"+this._remoteResourcesPath).replace(/\/\/+/g,"/"):this._remoteResourcesPath,query:P})}}e.RemoteAuthorities=new S;class R{asBrowserUri(A,w){const I=this.toUri(A,w);return I.scheme===F.vscodeRemote?e.RemoteAuthorities.rewrite(I):I.scheme===F.file&&(B.isNative||B.isWebWorker&&B.globals.origin===`${F.vscodeFileResource}://${R.FALLBACK_AUTHORITY}`)?I.with({scheme:F.vscodeFileResource,authority:I.authority||R.FALLBACK_AUTHORITY,query:null,fragment:null}):I}asFileUri(A,w){const I=this.toUri(A,w);return I.scheme===F.vscodeFileResource?I.with({scheme:F.file,authority:I.authority!==R.FALLBACK_AUTHORITY?I.authority:null,query:null,fragment:null}):I}toUri(A,w){return M.URI.isUri(A)?A:M.URI.parse(w.toUrl(A))}}R.FALLBACK_AUTHORITY="vscode-app",e.FileAccess=new R}),define(ne[17],ie([0,1,7,8,4,3,2,9]),function(J,e,B,M,F,S,R,k){"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 A(P){return(0,k.uriToFsPath)(P,!0)}e.originalFSPath=A;class w{constructor(b){this._ignorePathCasing=b}compare(b,c,l=!1){return b===c?0:(0,R.compare)(this.getComparisonKey(b,l),this.getComparisonKey(c,l))}isEqual(b,c,l=!1){return b===c?!0:!b||!c?!1:this.getComparisonKey(b,l)===this.getComparisonKey(c,l)}getComparisonKey(b,c=!1){return b.with({path:this._ignorePathCasing(b)?b.path.toLowerCase():void 0,fragment:c?null:void 0}).toString()}ignorePathCasing(b){return this._ignorePathCasing(b)}isEqualOrParent(b,c,l=!1){if(b.scheme===c.scheme){if(b.scheme===M.Schemas.file)return B.isEqualOrParent(A(b),A(c),this._ignorePathCasing(b))&&b.query===c.query&&(l||b.fragment===c.fragment);if((0,e.isEqualAuthority)(b.authority,c.authority))return B.isEqualOrParent(b.path,c.path,this._ignorePathCasing(b),"/")&&b.query===c.query&&(l||b.fragment===c.fragment)}return!1}joinPath(b,...c){return k.URI.joinPath(b,...c)}basenameOrAuthority(b){return(0,e.basename)(b)||b.authority}basename(b){return F.posix.basename(b.path)}extname(b){return F.posix.extname(b.path)}dirname(b){if(b.path.length===0)return b;let c;return b.scheme===M.Schemas.file?c=k.URI.file(F.dirname(A(b))).path:(c=F.posix.dirname(b.path),b.authority&&c.length&&c.charCodeAt(0)!==47&&(console.error(`dirname("${b.toString})) resulted in a relative path`),c="/")),b.with({path:c})}normalizePath(b){if(!b.path.length)return b;let c;return b.scheme===M.Schemas.file?c=k.URI.file(F.normalize(A(b))).path:c=F.posix.normalize(b.path),b.with({path:c})}relativePath(b,c){if(b.scheme!==c.scheme||!(0,e.isEqualAuthority)(b.authority,c.authority))return;if(b.scheme===M.Schemas.file){const s=F.relative(A(b),A(c));return S.isWindows?B.toSlashes(s):s}let l=b.path||"/";const t=c.path||"/";if(this._ignorePathCasing(b)){let s=0;for(const r=Math.min(l.length,t.length);s<r&&!(l.charCodeAt(s)!==t.charCodeAt(s)&&l.charAt(s).toLowerCase()!==t.charAt(s).toLowerCase());s++);l=t.substr(0,s)+l.substr(s)}return F.posix.relative(l,t)}resolvePath(b,c){if(b.scheme===M.Schemas.file){const l=k.URI.file(F.resolve(A(b),c));return b.with({authority:l.authority,path:l.path})}return c=B.toPosixPath(c),b.with({path:F.posix.resolve(b.path,c)})}isAbsolutePath(b){return!!b.path&&b.path[0]==="/"}isEqualAuthority(b,c){return b===c||b!==void 0&&c!==void 0&&(0,R.equalsIgnoreCase)(b,c)}hasTrailingPathSeparator(b,c=F.sep){if(b.scheme===M.Schemas.file){const l=A(b);return l.length>B.getRoot(l).length&&l[l.length-1]===c}else{const l=b.path;return l.length>1&&l.charCodeAt(l.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(b.fsPath)}}removeTrailingPathSeparator(b,c=F.sep){return(0,e.hasTrailingPathSeparator)(b,c)?b.with({path:b.path.substr(0,b.path.length-1)}):b}addTrailingPathSeparator(b,c=F.sep){let l=!1;if(b.scheme===M.Schemas.file){const t=A(b);l=t!==void 0&&t.length===B.getRoot(t).length&&t[t.length-1]===c}else{c="/";const t=b.path;l=t.length===1&&t.charCodeAt(t.length-1)===47}return!l&&!(0,e.hasTrailingPathSeparator)(b,c)?b.with({path:b.path+"/"}):b}}e.ExtUri=w,e.extUri=new w(()=>!1),e.extUriBiasedIgnorePathCase=new w(P=>P.scheme===M.Schemas.file?!S.isLinux:!0),e.extUriIgnorePathCase=new w(P=>!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 I(P,b){const c=[];for(let l=0;l<P.length;l++){const t=b(P[l]);P.some((s,r)=>r===l?!1:(0,e.isEqualOrParent)(t,b(s)))||c.push(P[l])}return c}e.distinctParents=I;var N;(function(P){P.META_DATA_LABEL="label",P.META_DATA_DESCRIPTION="description",P.META_DATA_SIZE="size",P.META_DATA_MIME="mime";function b(c){const l=new Map;c.path.substring(c.path.indexOf(";")+1,c.path.lastIndexOf(";")).split(";").forEach(r=>{const[u,h]=r.split(":");u&&h&&l.set(u,h)});const s=c.path.substring(0,c.path.indexOf(";"));return s&&l.set(P.META_DATA_MIME,s),l}P.parseMetaData=b})(N=e.DataUri||(e.DataUri={}));function _(P,b,c){if(b){let l=P.path;return l&&l[0]!==F.posix.sep&&(l=F.posix.sep+l),P.with({scheme:c,authority:b,path:l})}return P.with({scheme:c})}e.toLocalResource=_}),define(ne[18],ie([0,1,32,14,19,6,17,3]),function(J,e,B,M,F,S,R,k){"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 A($){return!!$&&typeof $.then=="function"}e.isThenable=A;function w($){const d=new B.CancellationTokenSource,E=$(d.token),O=new Promise((z,x)=>{const Z=d.token.onCancellationRequested(()=>{Z.dispose(),d.dispose(),x(new M.CancellationError)});Promise.resolve(E).then(te=>{Z.dispose(),d.dispose(),z(te)},te=>{Z.dispose(),d.dispose(),x(te)})});return new class{cancel(){d.cancel()}then(z,x){return O.then(z,x)}catch(z){return this.then(void 0,z)}finally(z){return O.finally(z)}}}e.createCancelablePromise=w;function I($,d,E){return new Promise((O,z)=>{const x=d.onCancellationRequested(()=>{x.dispose(),O(E)});$.then(O,z).finally(()=>x.dispose())})}e.raceCancellation=I;function N($,d){return new Promise((E,O)=>{const z=d.onCancellationRequested(()=>{z.dispose(),O(new M.CancellationError)});$.then(E,O).finally(()=>z.dispose())})}e.raceCancellationError=N;async function _($){let d=-1;const E=$.map((z,x)=>z.then(Z=>(d=x,Z))),O=await Promise.race(E);return $.forEach((z,x)=>{x!==d&&z.cancel()}),O}e.raceCancellablePromises=_;function P($,d,E){let O;const z=setTimeout(()=>{O?.(void 0),E?.()},d);return Promise.race([$.finally(()=>clearTimeout(z)),new Promise(x=>O=x)])}e.raceTimeout=P;function b($){return new Promise((d,E)=>{const O=$();A(O)?O.then(d,E):d(O)})}e.asPromise=b;class c{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(d){if(this.activePromise){if(this.queuedPromiseFactory=d,!this.queuedPromise){const E=()=>{this.queuedPromise=null;const O=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,O};this.queuedPromise=new Promise(O=>{this.activePromise.then(E,E).then(O)})}return new Promise((E,O)=>{this.queuedPromise.then(E,O)})}return this.activePromise=d(),new Promise((E,O)=>{this.activePromise.then(z=>{this.activePromise=null,E(z)},z=>{this.activePromise=null,O(z)})})}}e.Throttler=c;class l{constructor(){this.current=Promise.resolve(null)}queue(d){return this.current=this.current.then(()=>d(),()=>d())}}e.Sequencer=l;class t{constructor(){this.promiseMap=new Map}queue(d,E){const z=(this.promiseMap.get(d)??Promise.resolve()).catch(()=>{}).then(E).finally(()=>{this.promiseMap.get(d)===z&&this.promiseMap.delete(d)});return this.promiseMap.set(d,z),z}}e.SequencerByKey=t;const s=($,d)=>{let E=!0;const O=setTimeout(()=>{E=!1,d()},$);return{isTriggered:()=>E,dispose:()=>{clearTimeout(O),E=!1}}},r=$=>{let d=!0;return queueMicrotask(()=>{d&&(d=!1,$())}),{isTriggered:()=>d,dispose:()=>{d=!1}}};e.MicrotaskDelay=Symbol("MicrotaskDelay");class u{constructor(d){this.defaultDelay=d,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(d,E=this.defaultDelay){this.task=d,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((z,x)=>{this.doResolve=z,this.doReject=x}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const z=this.task;return this.task=null,z()}}));const O=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=E===e.MicrotaskDelay?r(O):s(E,O),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new M.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}e.Delayer=u;class h{constructor(d){this.delayer=new u(d),this.throttler=new c}trigger(d,E){return this.delayer.trigger(()=>this.throttler.queue(d),E)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose()}}e.ThrottledDelayer=h;class p{constructor(){this._isOpen=!1,this._promise=new Promise((d,E)=>{this._completePromise=d})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}e.Barrier=p;class y extends p{constructor(d){super();this._timeout=setTimeout(()=>this.open(),d)}open(){clearTimeout(this._timeout),super.open()}}e.AutoOpenBarrier=y;function v($,d){return d?new Promise((E,O)=>{const z=setTimeout(()=>{x.dispose(),E()},$),x=d.onCancellationRequested(()=>{clearTimeout(z),x.dispose(),O(new M.CancellationError)})}):w(E=>v($,E))}e.timeout=v;function q($,d=0){const E=setTimeout($,d);return(0,S.toDisposable)(()=>clearTimeout(E))}e.disposableTimeout=q;function f($){const d=[];let E=0;const O=$.length;function z(){return E<O?$[E++]():null}function x(Z){Z!=null&&d.push(Z);const te=z();return te?te.then(x):Promise.resolve(d)}return Promise.resolve(null).then(x)}e.sequence=f;function n($,d=O=>!!O,E=null){let O=0;const z=$.length,x=()=>{if(O>=z)return Promise.resolve(E);const Z=$[O++];return Promise.resolve(Z()).then(re=>d(re)?Promise.resolve(re):x())};return x()}e.first=n;function o($,d=O=>!!O,E=null){if($.length===0)return Promise.resolve(E);let O=$.length;const z=()=>{O=-1;for(const x of $)x.cancel?.()};return new Promise((x,Z)=>{for(const te of $)te.then(re=>{--O>=0&&d(re)?(z(),x(re)):O===0&&x(E)}).catch(re=>{--O>=0&&(z(),Z(re))})})}e.firstParallel=o;class a{constructor(d){this._size=0,this.maxDegreeOfParalellism=d,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new F.Emitter}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(d){return this._size++,new Promise((E,O)=>{this.outstandingPromises.push({factory:d,c:E,e:O}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){const d=this.outstandingPromises.shift();this.runningPromises++;const E=d.factory();E.then(d.c,d.e),E.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._size--,this.runningPromises--,this.outstandingPromises.length>0?this.consume():this._onDrained.fire()}dispose(){this._onDrained.dispose()}}e.Limiter=a;class g extends a{constructor(){super(1)}}e.Queue=g;class L{constructor(){this.queues=new Map,this.drainers=new Set}async whenDrained(){if(this.isDrained())return;const d=new V;return this.drainers.add(d),d.p}isDrained(){for(const[,d]of this.queues)if(d.size>0)return!1;return!0}queueFor(d,E=R.extUri){const O=E.getComparisonKey(d);let z=this.queues.get(O);return z||(z=new g,F.Event.once(z.onDrained)(()=>{z?.dispose(),this.queues.delete(O),this.onDidQueueDrain()}),this.queues.set(O,z)),z}onDidQueueDrain(){!this.isDrained()||this.releaseDrainers()}releaseDrainers(){for(const d of this.drainers)d.complete();this.drainers.clear()}dispose(){for(const[,d]of this.queues)d.dispose();this.queues.clear(),this.releaseDrainers()}}e.ResourceQueue=L;class W{constructor(d,E){this._token=-1,typeof d=="function"&&typeof E=="number"&&this.setIfNotSet(d,E)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(d,E){this.cancel(),this._token=setTimeout(()=>{this._token=-1,d()},E)}setIfNotSet(d,E){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,d()},E))}}e.TimeoutTimer=W;class D{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(d,E){this.cancel(),this._token=setInterval(()=>{d()},E)}}e.IntervalTimer=D;class T{constructor(d,E){this.timeoutToken=-1,this.runner=d,this.timeout=E,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(d=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,d)}get delay(){return this.timeout}set delay(d){this.timeout=d}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner?.()}}e.RunOnceScheduler=T;class i{constructor(d,E){E%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${E}ms is not a multiple of 1000ms.`),this.runner=d,this.timeout=E,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(d=this.timeout){d%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${d}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(d/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?.())}}e.ProcessTimeRunOnceScheduler=i;class m extends T{constructor(d,E){super(d,E);this.units=[]}work(d){this.units.push(d),this.isScheduled()||this.schedule()}doRun(){const d=this.units;this.units=[],this.runner?.(d)}dispose(){this.units=[],super.dispose()}}e.RunOnceWorker=m;class C extends S.Disposable{constructor(d,E){super();this.options=d,this.handler=E,this.pendingWork=[],this.throttler=this._register(new S.MutableDisposable),this.disposed=!1}get pending(){return this.pendingWork.length}work(d){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+d.length>this.options.maxBufferedWork)return!1}else if(this.pending+d.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}return this.pendingWork.push(...d),this.throttler.value||this.doWork(),!0}doWork(){this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&(this.throttler.value=new T(()=>{this.throttler.clear(),this.doWork()},this.options.throttleDelay),this.throttler.value.schedule())}dispose(){super.dispose(),this.disposed=!0}}e.ThrottledWorker=C,function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?e.runWhenIdle=$=>{(0,k.setTimeout0)(()=>{if(d)return;const E=Date.now()+15;$(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,E-Date.now())}}))});let d=!1;return{dispose(){d||(d=!0)}}}:e.runWhenIdle=($,d)=>{const E=requestIdleCallback($,typeof d=="number"?{timeout:d}:void 0);let O=!1;return{dispose(){O||(O=!0,cancelIdleCallback(E))}}}}();class U{constructor(d){this._didRun=!1,this._executor=()=>{try{this._value=d()}catch(E){this._error=E}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=U;async function G($,d,E){let O;for(let z=0;z<E;z++)try{return await $()}catch(x){O=x,await v(d)}throw O}e.retry=G;class Y{hasPending(d){return this._pending?typeof d=="number"?this._pending.taskId===d:!!this._pending:!1}get pending(){return this._pending?this._pending.promise:void 0}cancelPending(){this._pending?.cancel()}setPending(d,E,O){return this._pending={taskId:d,cancel:()=>O?.(),promise:E},E.then(()=>this.donePending(d),()=>this.donePending(d)),E}donePending(d){this._pending&&d===this._pending.taskId&&(this._pending=void 0,this.triggerNext())}triggerNext(){if(this._next){const d=this._next;this._next=void 0,d.run().then(d.promiseResolve,d.promiseReject)}}setNext(d){if(this._next)this._next.run=d;else{let E,O;const z=new Promise((x,Z)=>{E=x,O=Z});this._next={run:d,promise:z,promiseResolve:E,promiseReject:O}}return this._next.promise}}e.TaskSequentializer=Y;class ee{constructor(d,E=()=>Date.now()){this.interval=d,this.nowFn=E,this.lastIncrementTime=0,this.value=0}increment(){const d=this.nowFn();return d-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=d,this.value=0),this.value++,this.value}}e.IntervalCounter=ee;class V{constructor(){this.rejected=!1,this.resolved=!1,this.p=new Promise((d,E)=>{this.completeCallback=d,this.errorCallback=E})}get isRejected(){return this.rejected}get isResolved(){return this.resolved}get isSettled(){return this.rejected||this.resolved}complete(d){return new Promise(E=>{this.completeCallback(d),this.resolved=!0,E()})}error(d){return new Promise(E=>{this.errorCallback(d),this.rejected=!0,E()})}cancel(){new Promise(d=>{this.errorCallback(new M.CancellationError),this.rejected=!0,d()})}}e.DeferredPromise=V;var K;(function($){async function d(O){let z;const x=await Promise.all(O.map(Z=>Z.then(te=>te,te=>{z||(z=te)})));if(typeof z!="undefined")throw z;return x}$.settled=d;function E(O){return new Promise(async(z,x)=>{try{await O(z,x)}catch(Z){x(Z)}})}$.withAsyncBody=E})(K=e.Promises||(e.Promises={}));var j;(function($){$[$.Initial=0]="Initial",$[$.DoneOK=1]="DoneOK",$[$.DoneError=2]="DoneError"})(j||(j={}));class H{constructor(d){this._state=0,this._results=[],this._error=null,this._onStateChanged=new F.Emitter,queueMicrotask(async()=>{const E={emitOne:O=>this.emitOne(O),emitMany:O=>this.emitMany(O),reject:O=>this.reject(O)};try{await Promise.resolve(d(E)),this.resolve()}catch(O){this.reject(O)}finally{E.emitOne=void 0,E.emitMany=void 0,E.reject=void 0}})}static fromArray(d){return new H(E=>{E.emitMany(d)})}static fromPromise(d){return new H(async E=>{E.emitMany(await d)})}static fromPromises(d){return new H(async E=>{await Promise.all(d.map(async O=>E.emitOne(await O)))})}static merge(d){return new H(async E=>{await Promise.all(d.map(async O=>{for await(const z of O)E.emitOne(z)}))})}[Symbol.asyncIterator](){let d=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(d<this._results.length)return{done:!1,value:this._results[d++]};if(this._state===1)return{done:!0,value:void 0};await F.Event.toPromise(this._onStateChanged.event)}while(!0)}}}static map(d,E){return new H(async O=>{for await(const z of d)O.emitOne(E(z))})}map(d){return H.map(this,d)}static filter(d,E){return new H(async O=>{for await(const z of d)E(z)&&O.emitOne(z)})}filter(d){return H.filter(this,d)}static coalesce(d){return H.filter(d,E=>!!E)}coalesce(){return H.coalesce(this)}static async toPromise(d){const E=[];for await(const O of d)E.push(O);return E}toPromise(){return H.toPromise(this)}emitOne(d){this._state===0&&(this._results.push(d),this._onStateChanged.fire())}emitMany(d){this._state===0&&(this._results=this._results.concat(d),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(d){this._state===0&&(this._state=2,this._error=d,this._onStateChanged.fire())}}e.AsyncIterableObject=H,H.EMPTY=H.fromArray([]);class Q extends H{constructor(d,E){super(E);this._source=d}cancel(){this._source.cancel()}}e.CancelableAsyncIterableObject=Q;function X($){const d=new B.CancellationTokenSource,E=$(d.token);return new Q(d,async O=>{const z=d.token.onCancellationRequested(()=>{z.dispose(),d.dispose(),O.reject(new M.CancellationError)});try{for await(const x of E){if(d.token.isCancellationRequested)return;O.emitOne(x)}z.dispose(),d.dispose()}catch(x){z.dispose(),d.dispose(),O.reject(x)}})}e.createCancelableAsyncIterable=X}),define(ne[20],ie([0,1,16,18,7,15,4,3,2]),function(J,e,B,M,F,S,R,k,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.patternsEquals=e.getPathTerms=e.getBasenameTerms=e.isRelativePattern=e.parse=e.match=e.splitGlobAware=e.GLOB_SPLIT=e.GLOBSTAR=e.getEmptyExpression=void 0;function w(){return Object.create(null)}e.getEmptyExpression=w,e.GLOBSTAR="**",e.GLOB_SPLIT="/";const I="[/\\\\]",N="[^/\\\\]",_=/\//g;function P(V,K){switch(V){case 0:return"";case 1:return`${N}*?`;default:return`(?:${I}|${N}+${I}${K?`|${I}${N}+`:""})*?`}}function b(V,K){if(!V)return[];const j=[];let H=!1,Q=!1,X="";for(const $ of V){switch($){case K:if(!H&&!Q){j.push(X),X="";continue}break;case"{":H=!0;break;case"}":H=!1;break;case"[":Q=!0;break;case"]":Q=!1;break}X+=$}return X&&j.push(X),j}e.splitGlobAware=b;function c(V){if(!V)return"";let K="";const j=b(V,e.GLOB_SPLIT);if(j.every(H=>H===e.GLOBSTAR))K=".*";else{let H=!1;j.forEach((Q,X)=>{if(Q===e.GLOBSTAR){if(H)return;K+=P(2,X===j.length-1)}else{let $=!1,d="",E=!1,O="";for(const z of Q){if(z!=="}"&&$){d+=z;continue}if(E&&(z!=="]"||!O)){let x;z==="-"?x=z:(z==="^"||z==="!")&&!O?x="^":z===e.GLOB_SPLIT?x="":x=(0,A.escapeRegExpCharacters)(z),O+=x;continue}switch(z){case"{":$=!0;continue;case"[":E=!0;continue;case"}":{K+=`(?:${b(d,",").map(te=>c(te)).join("|")})`,$=!1,d="";break}case"]":{K+="["+O+"]",E=!1,O="";break}case"?":K+=N;continue;case"*":K+=P(1);continue;default:K+=(0,A.escapeRegExpCharacters)(z)}}X<j.length-1&&(j[X+1]!==e.GLOBSTAR||X+2<j.length)&&(K+=I)}H=Q===e.GLOBSTAR})}return K}const l=/^\*\*\/\*\.[\w\.-]+$/,t=/^\*\*\/([\w\.-]+)\/?$/,s=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,r=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,u=/^\*\*((\/[\w\.-]+)+)\/?$/,h=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,p=new S.LRUCache(1e4),y=function(){return!1},v=function(){return null};function q(V,K){if(!V)return v;let j;typeof V!="string"?j=V.pattern:j=V,j=j.trim();const H=`${j}_${!!K.trimForExclusions}`;let Q=p.get(H);if(Q)return f(Q,V);let X;return l.test(j)?Q=o(j.substr(4),j):(X=t.exec(n(j,K)))?Q=a(X[1],j):(K.trimForExclusions?r:s).test(j)?Q=g(j,K):(X=u.exec(n(j,K)))?Q=L(X[1].substr(1),j,!0):(X=h.exec(n(j,K)))?Q=L(X[1],j,!1):Q=W(j),p.set(H,Q),f(Q,V)}function f(V,K){if(typeof K=="string")return V;const j=function(H,Q){return(0,F.isEqualOrParent)(H,K.base,!k.isLinux)?V(H.substr(K.base.length+1),Q):null};return j.allBasenames=V.allBasenames,j.allPaths=V.allPaths,j.basenames=V.basenames,j.patterns=V.patterns,j}function n(V,K){return K.trimForExclusions&&V.endsWith("/**")?V.substr(0,V.length-2):V}function o(V,K){return function(j,H){return typeof j=="string"&&j.endsWith(V)?K:null}}function a(V,K){const j=`/${V}`,H=`\\${V}`,Q=function($,d){return typeof $!="string"?null:d?d===V?K:null:$===V||$.endsWith(j)||$.endsWith(H)?K:null},X=[V];return Q.basenames=X,Q.patterns=[K],Q.allBasenames=X,Q}function g(V,K){const j=Y(V.slice(1,-1).split(",").map(d=>q(d,K)).filter(d=>d!==v),V),H=j.length;if(!H)return v;if(H===1)return j[0];const Q=function(d,E){for(let O=0,z=j.length;O<z;O++)if(j[O](d,E))return V;return null},X=j.find(d=>!!d.allBasenames);X&&(Q.allBasenames=X.allBasenames);const $=j.reduce((d,E)=>E.allPaths?d.concat(E.allPaths):d,[]);return $.length&&(Q.allPaths=$),Q}function L(V,K,j){const H=R.sep===R.posix.sep,Q=H?V:V.replace(_,R.sep),X=R.sep+Q,$=R.posix.sep+V;let d;return j?d=function(E,O){return typeof E=="string"&&(E===Q||E.endsWith(X)||!H&&(E===V||E.endsWith($)))?K:null}:d=function(E,O){return typeof E=="string"&&(E===Q||!H&&E===V)?K:null},d.allPaths=[(j?"*/":"./")+V],d}function W(V){try{const K=new RegExp(`^${c(V)}$`);return function(j){return K.lastIndex=0,typeof j=="string"&&K.test(j)?V:null}}catch{return v}}function D(V,K,j){return!V||typeof K!="string"?!1:T(V)(K,void 0,j)}e.match=D;function T(V,K={}){if(!V)return y;if(typeof V=="string"||i(V)){const j=q(V,K);if(j===v)return y;const H=function(Q,X){return!!j(Q,X)};return j.allBasenames&&(H.allBasenames=j.allBasenames),j.allPaths&&(H.allPaths=j.allPaths),H}return U(V,K)}e.parse=T;function i(V){const K=V;return K?typeof K.base=="string"&&typeof K.pattern=="string":!1}e.isRelativePattern=i;function m(V){return V.allBasenames||[]}e.getBasenameTerms=m;function C(V){return V.allPaths||[]}e.getPathTerms=C;function U(V,K){const j=Y(Object.getOwnPropertyNames(V).map(d=>G(d,V[d],K)).filter(d=>d!==v)),H=j.length;if(!H)return v;if(!j.some(d=>!!d.requiresSiblings)){if(H===1)return j[0];const d=function(z,x){let Z;for(let te=0,re=j.length;te<re;te++){const se=j[te](z,x);if(typeof se=="string")return se;(0,M.isThenable)(se)&&(Z||(Z=[]),Z.push(se))}return Z?(async()=>{for(const te of Z){const re=await te;if(typeof re=="string")return re}return null})():null},E=j.find(z=>!!z.allBasenames);E&&(d.allBasenames=E.allBasenames);const O=j.reduce((z,x)=>x.allPaths?z.concat(x.allPaths):z,[]);return O.length&&(d.allPaths=O),d}const Q=function(d,E,O){let z,x;for(let Z=0,te=j.length;Z<te;Z++){const re=j[Z];re.requiresSiblings&&O&&(E||(E=(0,R.basename)(d)),z||(z=E.substr(0,E.length-(0,R.extname)(d).length)));const se=re(d,E,z,O);if(typeof se=="string")return se;(0,M.isThenable)(se)&&(x||(x=[]),x.push(se))}return x?(async()=>{for(const Z of x){const te=await Z;if(typeof te=="string")return te}return null})():null},X=j.find(d=>!!d.allBasenames);X&&(Q.allBasenames=X.allBasenames);const $=j.reduce((d,E)=>E.allPaths?d.concat(E.allPaths):d,[]);return $.length&&(Q.allPaths=$),Q}function G(V,K,j){if(K===!1)return v;const H=q(V,j);if(H===v)return v;if(typeof K=="boolean")return H;if(K){const Q=K.when;if(typeof Q=="string"){const X=($,d,E,O)=>{if(!O||!H($,d))return null;const z=Q.replace("$(basename)",E),x=O(z);return(0,M.isThenable)(x)?x.then(Z=>Z?V:null):x?V:null};return X.requiresSiblings=!0,X}}return H}function Y(V,K){const j=V.filter(d=>!!d.basenames);if(j.length<2)return V;const H=j.reduce((d,E)=>{const O=E.basenames;return O?d.concat(O):d},[]);let Q;if(K){Q=[];for(let d=0,E=H.length;d<E;d++)Q.push(K)}else Q=j.reduce((d,E)=>{const O=E.patterns;return O?d.concat(O):d},[]);const X=function(d,E){if(typeof d!="string")return null;if(!E){let z;for(z=d.length;z>0;z--){const x=d.charCodeAt(z-1);if(x===47||x===92)break}E=d.substr(z)}const O=H.indexOf(E);return O!==-1?Q[O]:null};X.basenames=H,X.patterns=Q,X.allBasenames=H;const $=V.filter(d=>!d.basenames);return $.push(X),$}function ee(V,K){return(0,B.equals)(V,K,(j,H)=>typeof j=="string"&&typeof H=="string"?j===H:typeof j!="string"&&typeof H!="string"?j.base===H.base&&j.pattern===H.pattern:!1)}e.patternsEquals=ee}),define(ne[21],ie([0,1]),function(J,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.countEOL=e.StringEOL=void 0;var B;(function(F){F[F.Unknown=0]="Unknown",F[F.Invalid=3]="Invalid",F[F.LF=1]="LF",F[F.CRLF=2]="CRLF"})(B=e.StringEOL||(e.StringEOL={}));function M(F){let S=0,R=0,k=0,A=0;for(let w=0,I=F.length;w<I;w++){const N=F.charCodeAt(w);N===13?(S===0&&(R=w),S++,w+1<I&&F.charCodeAt(w+1)===10?(A|=2,w++):A|=3,k=w+1):N===10&&(A|=1,S===0&&(R=w),S++,k=w+1)}return S===0&&(R=F.length),[S,R,F.length-k,A]}e.countEOL=M}),define(ne[22],ie([0,1,2,3,5]),function(J,e,B,M,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeUTF16LE=e.createStringBuilder=e.hasTextDecoder=e.getPlatformTextDecoder=void 0;let S;function R(){return S||(S=new TextDecoder("UTF-16LE")),S}let k;function A(){return k||(k=new TextDecoder("UTF-16BE")),k}let w;function I(){return w||(w=M.isLittleEndian()?R():A()),w}e.getPlatformTextDecoder=I,e.hasTextDecoder=typeof TextDecoder!="undefined",e.hasTextDecoder?(e.createStringBuilder=c=>new P(c),e.decodeUTF16LE=N):(e.createStringBuilder=c=>new b,e.decodeUTF16LE=_);function N(c,l,t){const s=new Uint16Array(c.buffer,l,t);return t>0&&(s[0]===65279||s[0]===65534)?_(c,l,t):R().decode(s)}function _(c,l,t){const s=[];let r=0;for(let u=0;u<t;u++){const h=F.readUInt16LE(c,l);l+=2,s[r++]=String.fromCharCode(h)}return s.join("")}class P{constructor(l){this._capacity=l|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";const l=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return I().decode(l)}_flushBuffer(){const l=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[l]:this._completedStrings[this._completedStrings.length]=l}write1(l){const t=this._capacity-this._bufferLength;t<=1&&(t===0||B.isHighSurrogate(l))&&this._flushBuffer(),this._buffer[this._bufferLength++]=l}appendASCII(l){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=l}appendASCIIString(l){const t=l.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=l;return}for(let s=0;s<t;s++)this._buffer[this._bufferLength++]=l.charCodeAt(s)}}class b{constructor(){this._pieces=[],this._piecesLen=0}reset(){this._pieces=[],this._piecesLen=0}build(){return this._pieces.join("")}write1(l){this._pieces[this._piecesLen++]=String.fromCharCode(l)}appendASCII(l){this._pieces[this._piecesLen++]=String.fromCharCode(l)}appendASCIIString(l){this._pieces[this._piecesLen++]=l}}}),define(ne[23],ie([0,1,5,22]),function(J,e,B,M){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.compressConsecutiveTextChanges=e.TextChange=void 0;function F(A){return A.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class S{constructor(w,I,N,_){this.oldPosition=w,this.oldText=I,this.newPosition=N,this.newText=_}get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${F(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${F(this.oldText)}")`:`(replace@${this.oldPosition} "${F(this.oldText)}" with "${F(this.newText)}")`}static _writeStringSize(w){return 4+2*w.length}static _writeString(w,I,N){const _=I.length;B.writeUInt32BE(w,_,N),N+=4;for(let P=0;P<_;P++)B.writeUInt16LE(w,I.charCodeAt(P),N),N+=2;return N}static _readString(w,I){const N=B.readUInt32BE(w,I);return I+=4,(0,M.decodeUTF16LE)(w,I,N)}writeSize(){return 4+4+S._writeStringSize(this.oldText)+S._writeStringSize(this.newText)}write(w,I){return B.writeUInt32BE(w,this.oldPosition,I),I+=4,B.writeUInt32BE(w,this.newPosition,I),I+=4,I=S._writeString(w,this.oldText,I),I=S._writeString(w,this.newText,I),I}static read(w,I,N){const _=B.readUInt32BE(w,I);I+=4;const P=B.readUInt32BE(w,I);I+=4;const b=S._readString(w,I);I+=S._writeStringSize(b);const c=S._readString(w,I);return I+=S._writeStringSize(c),N.push(new S(_,b,P,c)),I}}e.TextChange=S;function R(A,w){return A===null||A.length===0?w:new k(A,w).compress()}e.compressConsecutiveTextChanges=R;class k{constructor(w,I){this._prevEdits=w,this._currEdits=I,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let w=0,I=0,N=this._getPrev(w),_=this._getCurr(I);for(;w<this._prevLen||I<this._currLen;){if(N===null){this._acceptCurr(_),_=this._getCurr(++I);continue}if(_===null){this._acceptPrev(N),N=this._getPrev(++w);continue}if(_.oldEnd<=N.newPosition){this._acceptCurr(_),_=this._getCurr(++I);continue}if(N.newEnd<=_.oldPosition){this._acceptPrev(N),N=this._getPrev(++w);continue}if(_.oldPosition<N.newPosition){const[t,s]=k._splitCurr(_,N.newPosition-_.oldPosition);this._acceptCurr(t),_=s;continue}if(N.newPosition<_.oldPosition){const[t,s]=k._splitPrev(N,_.oldPosition-N.newPosition);this._acceptPrev(t),N=s;continue}let c,l;if(_.oldEnd===N.newEnd)c=N,l=_,N=this._getPrev(++w),_=this._getCurr(++I);else if(_.oldEnd<N.newEnd){const[t,s]=k._splitPrev(N,_.oldLength);c=t,l=_,N=s,_=this._getCurr(++I)}else{const[t,s]=k._splitCurr(_,N.newLength);c=N,l=t,N=this._getPrev(++w),_=s}this._result[this._resultLen++]=new S(c.oldPosition,c.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=c.newLength-c.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const P=k._merge(this._result);return k._removeNoOps(P)}_acceptCurr(w){this._result[this._resultLen++]=k._rebaseCurr(this._prevDeltaOffset,w),this._currDeltaOffset+=w.newLength-w.oldLength}_getCurr(w){return w<this._currLen?this._currEdits[w]:null}_acceptPrev(w){this._result[this._resultLen++]=k._rebasePrev(this._currDeltaOffset,w),this._prevDeltaOffset+=w.newLength-w.oldLength}_getPrev(w){return w<this._prevLen?this._prevEdits[w]:null}static _rebaseCurr(w,I){return new S(I.oldPosition-w,I.oldText,I.newPosition,I.newText)}static _rebasePrev(w,I){return new S(I.oldPosition,I.oldText,I.newPosition+w,I.newText)}static _splitPrev(w,I){const N=w.newText.substr(0,I),_=w.newText.substr(I);return[new S(w.oldPosition,w.oldText,w.newPosition,N),new S(w.oldEnd,"",w.newPosition+I,_)]}static _splitCurr(w,I){const N=w.oldText.substr(0,I),_=w.oldText.substr(I);return[new S(w.oldPosition,N,w.newPosition,w.newText),new S(w.oldPosition+I,_,w.newEnd,"")]}static _merge(w){if(w.length===0)return w;const I=[];let N=0,_=w[0];for(let P=1;P<w.length;P++){const b=w[P];_.oldEnd===b.oldPosition?_=new S(_.oldPosition,_.oldText+b.oldText,_.newPosition,_.newText+b.newText):(I[N++]=_,_=b)}return I[N++]=_,I}static _removeNoOps(w){if(w.length===0)return w;const I=[];let N=0;for(let _=0;_<w.length;_++){const P=w[_];P.oldText!==P.newText&&(I[N++]=P)}return I}}}),define(ne[24],ie([0,1]),function(J,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.recomputeTreeMetadata=e.updateTreeMetadata=e.fixInsert=e.rbDelete=e.rightRotate=e.leftRotate=e.resetSentinel=e.calculateLF=e.calculateSize=e.righttest=e.leftest=e.SENTINEL=e.NodeColor=e.TreeNode=void 0;class B{constructor(l,t){this.piece=l,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==e.SENTINEL)return F(this.right);let l=this;for(;l.parent!==e.SENTINEL&&l.parent.left!==l;)l=l.parent;return l.parent===e.SENTINEL?e.SENTINEL:l.parent}prev(){if(this.left!==e.SENTINEL)return S(this.left);let l=this;for(;l.parent!==e.SENTINEL&&l.parent.right!==l;)l=l.parent;return l.parent===e.SENTINEL?e.SENTINEL:l.parent}detach(){this.parent=null,this.left=null,this.right=null}}e.TreeNode=B;var M;(function(c){c[c.Black=0]="Black",c[c.Red=1]="Red"})(M=e.NodeColor||(e.NodeColor={})),e.SENTINEL=new B(null,0),e.SENTINEL.parent=e.SENTINEL,e.SENTINEL.left=e.SENTINEL,e.SENTINEL.right=e.SENTINEL,e.SENTINEL.color=0;function F(c){for(;c.left!==e.SENTINEL;)c=c.left;return c}e.leftest=F;function S(c){for(;c.right!==e.SENTINEL;)c=c.right;return c}e.righttest=S;function R(c){return c===e.SENTINEL?0:c.size_left+c.piece.length+R(c.right)}e.calculateSize=R;function k(c){return c===e.SENTINEL?0:c.lf_left+c.piece.lineFeedCnt+k(c.right)}e.calculateLF=k;function A(){e.SENTINEL.parent=e.SENTINEL}e.resetSentinel=A;function w(c,l){const t=l.right;t.size_left+=l.size_left+(l.piece?l.piece.length:0),t.lf_left+=l.lf_left+(l.piece?l.piece.lineFeedCnt:0),l.right=t.left,t.left!==e.SENTINEL&&(t.left.parent=l),t.parent=l.parent,l.parent===e.SENTINEL?c.root=t:l.parent.left===l?l.parent.left=t:l.parent.right=t,t.left=l,l.parent=t}e.leftRotate=w;function I(c,l){const t=l.left;l.left=t.right,t.right!==e.SENTINEL&&(t.right.parent=l),t.parent=l.parent,l.size_left-=t.size_left+(t.piece?t.piece.length:0),l.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),l.parent===e.SENTINEL?c.root=t:l===l.parent.right?l.parent.right=t:l.parent.left=t,t.right=l,l.parent=t}e.rightRotate=I;function N(c,l){let t,s;if(l.left===e.SENTINEL?(s=l,t=s.right):l.right===e.SENTINEL?(s=l,t=s.left):(s=F(l.right),t=s.right),s===c.root){c.root=t,t.color=0,l.detach(),A(),c.root.parent=e.SENTINEL;return}const r=s.color===1;if(s===s.parent.left?s.parent.left=t:s.parent.right=t,s===l?(t.parent=s.parent,b(c,t)):(s.parent===l?t.parent=s:t.parent=s.parent,b(c,t),s.left=l.left,s.right=l.right,s.parent=l.parent,s.color=l.color,l===c.root?c.root=s:l===l.parent.left?l.parent.left=s:l.parent.right=s,s.left!==e.SENTINEL&&(s.left.parent=s),s.right!==e.SENTINEL&&(s.right.parent=s),s.size_left=l.size_left,s.lf_left=l.lf_left,b(c,s)),l.detach(),t.parent.left===t){const h=R(t),p=k(t);if(h!==t.parent.size_left||p!==t.parent.lf_left){const y=h-t.parent.size_left,v=p-t.parent.lf_left;t.parent.size_left=h,t.parent.lf_left=p,P(c,t.parent,y,v)}}if(b(c,t.parent),r){A();return}let u;for(;t!==c.root&&t.color===0;)t===t.parent.left?(u=t.parent.right,u.color===1&&(u.color=0,t.parent.color=1,w(c,t.parent),u=t.parent.right),u.left.color===0&&u.right.color===0?(u.color=1,t=t.parent):(u.right.color===0&&(u.left.color=0,u.color=1,I(c,u),u=t.parent.right),u.color=t.parent.color,t.parent.color=0,u.right.color=0,w(c,t.parent),t=c.root)):(u=t.parent.left,u.color===1&&(u.color=0,t.parent.color=1,I(c,t.parent),u=t.parent.left),u.left.color===0&&u.right.color===0?(u.color=1,t=t.parent):(u.left.color===0&&(u.right.color=0,u.color=1,w(c,u),u=t.parent.left),u.color=t.parent.color,t.parent.color=0,u.left.color=0,I(c,t.parent),t=c.root));t.color=0,A()}e.rbDelete=N;function _(c,l){for(b(c,l);l!==c.root&&l.parent.color===1;)if(l.parent===l.parent.parent.left){const t=l.parent.parent.right;t.color===1?(l.parent.color=0,t.color=0,l.parent.parent.color=1,l=l.parent.parent):(l===l.parent.right&&(l=l.parent,w(c,l)),l.parent.color=0,l.parent.parent.color=1,I(c,l.parent.parent))}else{const t=l.parent.parent.left;t.color===1?(l.parent.color=0,t.color=0,l.parent.parent.color=1,l=l.parent.parent):(l===l.parent.left&&(l=l.parent,I(c,l)),l.parent.color=0,l.parent.parent.color=1,w(c,l.parent.parent))}c.root.color=0}e.fixInsert=_;function P(c,l,t,s){for(;l!==c.root&&l!==e.SENTINEL;)l.parent.left===l&&(l.parent.size_left+=t,l.parent.lf_left+=s),l=l.parent}e.updateTreeMetadata=P;function b(c,l){let t=0,s=0;if(l!==c.root){for(;l!==c.root&&l===l.parent.right;)l=l.parent;if(l!==c.root)for(l=l.parent,t=R(l.left)-l.size_left,s=k(l.left)-l.lf_left,l.size_left+=t,l.lf_left+=s;l!==c.root&&(t!==0||s!==0);)l.parent.left===l&&(l.parent.size_left+=t,l.parent.lf_left+=s),l=l.parent}}e.recomputeTreeMetadata=b}),define(ne[10],ie([0,1,33,11,25,24,34]),function(J,e,B,M,F,S,R){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PieceTreeBase=e.StringBuffer=e.Piece=e.createLineStarts=e.createLineStartsFast=e.LineStarts=e.createUintArray=e.AverageBufferSize=void 0,e.AverageBufferSize=65535;function k(l){let t;return l[l.length-1]<65536?t=new Uint16Array(l.length):t=new Uint32Array(l.length),t.set(l,0),t}e.createUintArray=k;class A{constructor(t,s,r,u,h){this.lineStarts=t,this.cr=s,this.lf=r,this.crlf=u,this.isBasicASCII=h}}e.LineStarts=A;function w(l,t=!0){const s=[0];let r=1;for(let u=0,h=l.length;u<h;u++){const p=l.charCodeAt(u);p===13?u+1<h&&l.charCodeAt(u+1)===10?(s[r++]=u+2,u++):s[r++]=u+1:p===10&&(s[r++]=u+1)}return t?k(s):s}e.createLineStartsFast=w;function I(l,t){l.length=0,l[0]=0;let s=1,r=0,u=0,h=0,p=!0;for(let v=0,q=t.length;v<q;v++){const f=t.charCodeAt(v);f===13?v+1<q&&t.charCodeAt(v+1)===10?(h++,l[s++]=v+2,v++):(r++,l[s++]=v+1):f===10?(u++,l[s++]=v+1):p&&f!==9&&(f<32||f>126)&&(p=!1)}const y=new A(k(l),r,u,h,p);return l.length=0,y}e.createLineStarts=I;class N{constructor(t,s,r,u,h){this.bufferIndex=t,this.start=s,this.end=r,this.lineFeedCnt=u,this.length=h}}e.Piece=N;class _{constructor(t,s){this.buffer=t,this.lineStarts=s}}e.StringBuffer=_;class P{constructor(t,s){this._pieces=[],this._tree=t,this._BOM=s,this._index=0,t.root!==S.SENTINEL&&t.iterate(t.root,r=>(r!==S.SENTINEL&&this._pieces.push(r.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class b{constructor(t){this._limit=t,this._cache=[]}get(t){for(let s=this._cache.length-1;s>=0;s--){const r=this._cache[s];if(r.nodeStartOffset<=t&&r.nodeStartOffset+r.node.piece.length>=t)return r}return null}get2(t){for(let s=this._cache.length-1;s>=0;s--){const r=this._cache[s];if(r.nodeStartLineNumber&&r.nodeStartLineNumber<t&&r.nodeStartLineNumber+r.node.piece.lineFeedCnt>=t)return r}return null}set(t){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(t)}validate(t){let s=!1;const r=this._cache;for(let u=0;u<r.length;u++){const h=r[u];if(h.node.parent===null||h.nodeStartOffset>=t){r[u]=null,s=!0;continue}}if(s){const u=[];for(const h of r)h!==null&&u.push(h);this._cache=u}}}class c{constructor(t,s,r){this.create(t,s,r)}create(t,s,r){this._buffers=[new _("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=S.SENTINEL,this._lineCnt=1,this._length=0,this._EOL=s,this._EOLLength=s.length,this._EOLNormalized=r;let u=null;for(let h=0,p=t.length;h<p;h++)if(t[h].buffer.length>0){t[h].lineStarts||(t[h].lineStarts=w(t[h].buffer));const y=new N(h+1,{line:0,column:0},{line:t[h].lineStarts.length-1,column:t[h].buffer.length-t[h].lineStarts[t[h].lineStarts.length-1]},t[h].lineStarts.length-1,t[h].buffer.length);this._buffers.push(t[h]),u=this.rbInsertRight(u,y)}this._searchCache=new b(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(t){const s=e.AverageBufferSize,r=s-Math.floor(s/3),u=r*2;let h="",p=0;const y=[];if(this.iterate(this.root,v=>{const q=this.getNodeContent(v),f=q.length;if(p<=r||p+f<u)return h+=q,p+=f,!0;const n=h.replace(/\r\n|\r|\n/g,t);return y.push(new _(n,w(n))),h=q,p=f,!0}),p>0){const v=h.replace(/\r\n|\r|\n/g,t);y.push(new _(v,w(v)))}this.create(y,t,!0)}getEOL(){return this._EOL}setEOL(t){this._EOL=t,this._EOLLength=this._EOL.length,this.normalizeEOL(t)}createSnapshot(t){return new P(this,t)}equal(t){if(this.getLength()!==t.getLength()||this.getLineCount()!==t.getLineCount())return!1;const s=0;return this.iterate(this.root,u=>{if(u===S.SENTINEL)return!0;const h=this.getNodeContent(u),p=h.length,y=t.nodeAt(s),v=t.nodeAt(s+p),q=t.getValueInRange2(y,v);return h===q})}getOffsetAt(t,s){let r=0,u=this.root;for(;u!==S.SENTINEL;)if(u.left!==S.SENTINEL&&u.lf_left+1>=t)u=u.left;else{if(u.lf_left+u.piece.lineFeedCnt+1>=t)return r+=u.size_left,r+=this.getAccumulatedValue(u,t-u.lf_left-2)+s-1;t-=u.lf_left+u.piece.lineFeedCnt,r+=u.size_left+u.piece.length,u=u.right}return r}getPositionAt(t){t=Math.floor(t),t=Math.max(0,t);let s=this.root,r=0;const u=t;for(;s!==S.SENTINEL;)if(s.size_left!==0&&s.size_left>=t)s=s.left;else if(s.size_left+s.piece.length>=t){const h=this.getIndexOf(s,t-s.size_left);if(r+=s.lf_left+h.index,h.index===0){const p=this.getOffsetAt(r+1,1),y=u-p;return new B.Position(r+1,y+1)}return new B.Position(r+1,h.remainder+1)}else if(t-=s.size_left+s.piece.length,r+=s.lf_left+s.piece.lineFeedCnt,s.right===S.SENTINEL){const h=this.getOffsetAt(r+1,1),p=u-t-h;return new B.Position(r+1,p+1)}else s=s.right;return new B.Position(1,1)}getValueInRange(t,s){if(t.startLineNumber===t.endLineNumber&&t.startColumn===t.endColumn)return"";const r=this.nodeAt2(t.startLineNumber,t.startColumn),u=this.nodeAt2(t.endLineNumber,t.endColumn),h=this.getValueInRange2(r,u);return s?s!==this._EOL||!this._EOLNormalized?h.replace(/\r\n|\r|\n/g,s):s===this.getEOL()&&this._EOLNormalized?h:h.replace(/\r\n|\r|\n/g,s):h}getValueInRange2(t,s){if(t.node===s.node){const y=t.node,v=this._buffers[y.piece.bufferIndex].buffer,q=this.offsetInBuffer(y.piece.bufferIndex,y.piece.start);return v.substring(q+t.remainder,q+s.remainder)}let r=t.node;const u=this._buffers[r.piece.bufferIndex].buffer,h=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);let p=u.substring(h+t.remainder,h+r.piece.length);for(r=r.next();r!==S.SENTINEL;){const y=this._buffers[r.piece.bufferIndex].buffer,v=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);if(r===s.node){p+=y.substring(v,v+s.remainder);break}else p+=y.substr(v,r.piece.length);r=r.next()}return p}getLinesContent(){const t=[];let s=0,r="",u=!1;return this.iterate(this.root,h=>{if(h===S.SENTINEL)return!0;const p=h.piece;let y=p.length;if(y===0)return!0;const v=this._buffers[p.bufferIndex].buffer,q=this._buffers[p.bufferIndex].lineStarts,f=p.start.line,n=p.end.line;let o=q[f]+p.start.column;if(u&&(v.charCodeAt(o)===10&&(o++,y--),t[s++]=r,r="",u=!1,y===0))return!0;if(f===n)return!this._EOLNormalized&&v.charCodeAt(o+y-1)===13?(u=!0,r+=v.substr(o,y-1)):r+=v.substr(o,y),!0;r+=this._EOLNormalized?v.substring(o,Math.max(o,q[f+1]-this._EOLLength)):v.substring(o,q[f+1]).replace(/(\r\n|\r|\n)$/,""),t[s++]=r;for(let a=f+1;a<n;a++)r=this._EOLNormalized?v.substring(q[a],q[a+1]-this._EOLLength):v.substring(q[a],q[a+1]).replace(/(\r\n|\r|\n)$/,""),t[s++]=r;return!this._EOLNormalized&&v.charCodeAt(q[n]+p.end.column-1)===13?(u=!0,p.end.column===0?s--:r=v.substr(q[n],p.end.column-1)):r=v.substr(q[n],p.end.column),!0}),u&&(t[s++]=r,r=""),t[s++]=r,t}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(t){return this._lastVisitedLine.lineNumber===t?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=t,t===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(t):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(t,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(t).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)}_getCharCode(t){if(t.remainder===t.node.piece.length){const s=t.node.next();if(!s)return 0;const r=this._buffers[s.piece.bufferIndex],u=this.offsetInBuffer(s.piece.bufferIndex,s.piece.start);return r.buffer.charCodeAt(u)}else{const s=this._buffers[t.node.piece.bufferIndex],u=this.offsetInBuffer(t.node.piece.bufferIndex,t.node.piece.start)+t.remainder;return s.buffer.charCodeAt(u)}}getLineCharCode(t,s){const r=this.nodeAt2(t,s+1);return this._getCharCode(r)}getLineLength(t){if(t===this.getLineCount()){const s=this.getOffsetAt(t,1);return this.getLength()-s}return this.getOffsetAt(t+1,1)-this.getOffsetAt(t,1)-this._EOLLength}getCharCode(t){const s=this.nodeAt(t);return this._getCharCode(s)}findMatchesInNode(t,s,r,u,h,p,y,v,q,f,n){const o=this._buffers[t.piece.bufferIndex],a=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start),g=this.offsetInBuffer(t.piece.bufferIndex,h),L=this.offsetInBuffer(t.piece.bufferIndex,p);let W;const D={line:0,column:0};let T,i;s._wordSeparators?(T=o.buffer.substring(g,L),i=m=>m+g,s.reset(0)):(T=o.buffer,i=m=>m,s.reset(g));do if(W=s.next(T),W){if(i(W.index)>=L)return f;this.positionInBuffer(t,i(W.index)-a,D);const m=this.getLineFeedCnt(t.piece.bufferIndex,h,D),C=D.line===h.line?D.column-h.column+u:D.column+1,U=C+W[0].length;if(n[f++]=(0,R.createFindMatch)(new M.Range(r+m,C,r+m,U),W,v),i(W.index)+W[0].length>=L||f>=q)return f}while(W);return f}findMatchesLineByLine(t,s,r,u){const h=[];let p=0;const y=new R.Searcher(s.wordSeparators,s.regex);let v=this.nodeAt2(t.startLineNumber,t.startColumn);if(v===null)return[];const q=this.nodeAt2(t.endLineNumber,t.endColumn);if(q===null)return[];let f=this.positionInBuffer(v.node,v.remainder);const n=this.positionInBuffer(q.node,q.remainder);if(v.node===q.node)return this.findMatchesInNode(v.node,y,t.startLineNumber,t.startColumn,f,n,s,r,u,p,h),h;let o=t.startLineNumber,a=v.node;for(;a!==q.node;){const L=this.getLineFeedCnt(a.piece.bufferIndex,f,a.piece.end);if(L>=1){const D=this._buffers[a.piece.bufferIndex].lineStarts,T=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start),i=D[f.line+L],m=o===t.startLineNumber?t.startColumn:1;if(p=this.findMatchesInNode(a,y,o,m,f,this.positionInBuffer(a,i-T),s,r,u,p,h),p>=u)return h;o+=L}const W=o===t.startLineNumber?t.startColumn-1:0;if(o===t.endLineNumber){const D=this.getLineContent(o).substring(W,t.endColumn-1);return p=this._findMatchesInLine(s,y,D,t.endLineNumber,W,p,h,r,u),h}if(p=this._findMatchesInLine(s,y,this.getLineContent(o).substr(W),o,W,p,h,r,u),p>=u)return h;o++,v=this.nodeAt2(o,1),a=v.node,f=this.positionInBuffer(v.node,v.remainder)}if(o===t.endLineNumber){const L=o===t.startLineNumber?t.startColumn-1:0,W=this.getLineContent(o).substring(L,t.endColumn-1);return p=this._findMatchesInLine(s,y,W,t.endLineNumber,L,p,h,r,u),h}const g=o===t.startLineNumber?t.startColumn:1;return p=this.findMatchesInNode(q.node,y,o,g,f,n,s,r,u,p,h),h}_findMatchesInLine(t,s,r,u,h,p,y,v,q){const f=t.wordSeparators;if(!v&&t.simpleSearch){const o=t.simpleSearch,a=o.length,g=r.length;let L=-a;for(;(L=r.indexOf(o,L+a))!==-1;)if((!f||(0,R.isValidMatch)(f,r,g,L,a))&&(y[p++]=new F.FindMatch(new M.Range(u,L+1+h,u,L+1+a+h),null),p>=q))return p;return p}let n;s.reset(0);do if(n=s.next(r),n&&(y[p++]=(0,R.createFindMatch)(new M.Range(u,n.index+1+h,u,n.index+1+n[0].length+h),n,v),p>=q))return p;while(n);return p}insert(t,s,r=!1){if(this._EOLNormalized=this._EOLNormalized&&r,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==S.SENTINEL){const{node:u,remainder:h,nodeStartOffset:p}=this.nodeAt(t),y=u.piece,v=y.bufferIndex,q=this.positionInBuffer(u,h);if(u.piece.bufferIndex===0&&y.end.line===this._lastChangeBufferPos.line&&y.end.column===this._lastChangeBufferPos.column&&p+y.length===t&&s.length<e.AverageBufferSize){this.appendToNode(u,s),this.computeBufferMetadata();return}if(p===t)this.insertContentToNodeLeft(s,u),this._searchCache.validate(t);else if(p+u.piece.length>t){const f=[];let n=new N(y.bufferIndex,q,y.end,this.getLineFeedCnt(y.bufferIndex,q,y.end),this.offsetInBuffer(v,y.end)-this.offsetInBuffer(v,q));if(this.shouldCheckCRLF()&&this.endWithCR(s)&&this.nodeCharCodeAt(u,h)===10){const L={line:n.start.line+1,column:0};n=new N(n.bufferIndex,L,n.end,this.getLineFeedCnt(n.bufferIndex,L,n.end),n.length-1),s+=`
`}if(this.shouldCheckCRLF()&&this.startWithLF(s))if(this.nodeCharCodeAt(u,h-1)===13){const L=this.positionInBuffer(u,h-1);this.deleteNodeTail(u,L),s="\r"+s,u.piece.length===0&&f.push(u)}else this.deleteNodeTail(u,q);else this.deleteNodeTail(u,q);const o=this.createNewPieces(s);n.length>0&&this.rbInsertRight(u,n);let a=u;for(let g=0;g<o.length;g++)a=this.rbInsertRight(a,o[g]);this.deleteNodes(f)}else this.insertContentToNodeRight(s,u)}else{const u=this.createNewPieces(s);let h=this.rbInsertLeft(null,u[0]);for(let p=1;p<u.length;p++)h=this.rbInsertRight(h,u[p])}this.computeBufferMetadata()}delete(t,s){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",s<=0||this.root===S.SENTINEL)return;const r=this.nodeAt(t),u=this.nodeAt(t+s),h=r.node,p=u.node;if(h===p){const o=this.positionInBuffer(h,r.remainder),a=this.positionInBuffer(h,u.remainder);if(r.nodeStartOffset===t){if(s===h.piece.length){const g=h.next();(0,S.rbDelete)(this,h),this.validateCRLFWithPrevNode(g),this.computeBufferMetadata();return}this.deleteNodeHead(h,a),this._searchCache.validate(t),this.validateCRLFWithPrevNode(h),this.computeBufferMetadata();return}if(r.nodeStartOffset+h.piece.length===t+s){this.deleteNodeTail(h,o),this.validateCRLFWithNextNode(h),this.computeBufferMetadata();return}this.shrinkNode(h,o,a),this.computeBufferMetadata();return}const y=[],v=this.positionInBuffer(h,r.remainder);this.deleteNodeTail(h,v),this._searchCache.validate(t),h.piece.length===0&&y.push(h);const q=this.positionInBuffer(p,u.remainder);this.deleteNodeHead(p,q),p.piece.length===0&&y.push(p);const f=h.next();for(let o=f;o!==S.SENTINEL&&o!==p;o=o.next())y.push(o);const n=h.piece.length===0?h.prev():h;this.deleteNodes(y),this.validateCRLFWithNextNode(n),this.computeBufferMetadata()}insertContentToNodeLeft(t,s){const r=[];if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.startWithLF(s)){const p=s.piece,y={line:p.start.line+1,column:0},v=new N(p.bufferIndex,y,p.end,this.getLineFeedCnt(p.bufferIndex,y,p.end),p.length-1);s.piece=v,t+=`
`,(0,S.updateTreeMetadata)(this,s,-1,-1),s.piece.length===0&&r.push(s)}const u=this.createNewPieces(t);let h=this.rbInsertLeft(s,u[u.length-1]);for(let p=u.length-2;p>=0;p--)h=this.rbInsertLeft(h,u[p]);this.validateCRLFWithPrevNode(h),this.deleteNodes(r)}insertContentToNodeRight(t,s){this.adjustCarriageReturnFromNext(t,s)&&(t+=`
`);const r=this.createNewPieces(t),u=this.rbInsertRight(s,r[0]);let h=u;for(let p=1;p<r.length;p++)h=this.rbInsertRight(h,r[p]);this.validateCRLFWithPrevNode(u)}positionInBuffer(t,s,r){const u=t.piece,h=t.piece.bufferIndex,p=this._buffers[h].lineStarts,v=p[u.start.line]+u.start.column+s;let q=u.start.line,f=u.end.line,n=0,o=0,a=0;for(;q<=f&&(n=q+(f-q)/2|0,a=p[n],n!==f);)if(o=p[n+1],v<a)f=n-1;else if(v>=o)q=n+1;else break;return r?(r.line=n,r.column=v-a,null):{line:n,column:v-a}}getLineFeedCnt(t,s,r){if(r.column===0)return r.line-s.line;const u=this._buffers[t].lineStarts;if(r.line===u.length-1)return r.line-s.line;const h=u[r.line+1],p=u[r.line]+r.column;if(h>p+1)return r.line-s.line;const y=p-1;return this._buffers[t].buffer.charCodeAt(y)===13?r.line-s.line+1:r.line-s.line}offsetInBuffer(t,s){return this._buffers[t].lineStarts[s.line]+s.column}deleteNodes(t){for(let s=0;s<t.length;s++)(0,S.rbDelete)(this,t[s])}createNewPieces(t){if(t.length>e.AverageBufferSize){const f=[];for(;t.length>e.AverageBufferSize;){const o=t.charCodeAt(e.AverageBufferSize-1);let a;o===13||o>=55296&&o<=56319?(a=t.substring(0,e.AverageBufferSize-1),t=t.substring(e.AverageBufferSize-1)):(a=t.substring(0,e.AverageBufferSize),t=t.substring(e.AverageBufferSize));const g=w(a);f.push(new N(this._buffers.length,{line:0,column:0},{line:g.length-1,column:a.length-g[g.length-1]},g.length-1,a.length)),this._buffers.push(new _(a,g))}const n=w(t);return f.push(new N(this._buffers.length,{line:0,column:0},{line:n.length-1,column:t.length-n[n.length-1]},n.length-1,t.length)),this._buffers.push(new _(t,n)),f}let s=this._buffers[0].buffer.length;const r=w(t,!1);let u=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===s&&s!==0&&this.startWithLF(t)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},u=this._lastChangeBufferPos;for(let f=0;f<r.length;f++)r[f]+=s+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(r.slice(1)),this._buffers[0].buffer+="_"+t,s+=1}else{if(s!==0)for(let f=0;f<r.length;f++)r[f]+=s;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(r.slice(1)),this._buffers[0].buffer+=t}const h=this._buffers[0].buffer.length,p=this._buffers[0].lineStarts.length-1,y=h-this._buffers[0].lineStarts[p],v={line:p,column:y},q=new N(0,u,v,this.getLineFeedCnt(0,u,v),h-s);return this._lastChangeBufferPos=v,[q]}getLinesRawContent(){return this.getContentOfSubTree(this.root)}getLineRawContent(t,s=0){let r=this.root,u="";const h=this._searchCache.get2(t);if(h){r=h.node;const p=this.getAccumulatedValue(r,t-h.nodeStartLineNumber-1),y=this._buffers[r.piece.bufferIndex].buffer,v=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);if(h.nodeStartLineNumber+r.piece.lineFeedCnt===t)u=y.substring(v+p,v+r.piece.length);else{const q=this.getAccumulatedValue(r,t-h.nodeStartLineNumber);return y.substring(v+p,v+q-s)}}else{let p=0;const y=t;for(;r!==S.SENTINEL;)if(r.left!==S.SENTINEL&&r.lf_left>=t-1)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt>t-1){const v=this.getAccumulatedValue(r,t-r.lf_left-2),q=this.getAccumulatedValue(r,t-r.lf_left-1),f=this._buffers[r.piece.bufferIndex].buffer,n=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);return p+=r.size_left,this._searchCache.set({node:r,nodeStartOffset:p,nodeStartLineNumber:y-(t-1-r.lf_left)}),f.substring(n+v,n+q-s)}else if(r.lf_left+r.piece.lineFeedCnt===t-1){const v=this.getAccumulatedValue(r,t-r.lf_left-2),q=this._buffers[r.piece.bufferIndex].buffer,f=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);u=q.substring(f+v,f+r.piece.length);break}else t-=r.lf_left+r.piece.lineFeedCnt,p+=r.size_left+r.piece.length,r=r.right}for(r=r.next();r!==S.SENTINEL;){const p=this._buffers[r.piece.bufferIndex].buffer;if(r.piece.lineFeedCnt>0){const y=this.getAccumulatedValue(r,0),v=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);return u+=p.substring(v,v+y-s),u}else{const y=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);u+=p.substr(y,r.piece.length)}r=r.next()}return u}computeBufferMetadata(){let t=this.root,s=1,r=0;for(;t!==S.SENTINEL;)s+=t.lf_left+t.piece.lineFeedCnt,r+=t.size_left+t.piece.length,t=t.right;this._lineCnt=s,this._length=r,this._searchCache.validate(this._length)}getIndexOf(t,s){const r=t.piece,u=this.positionInBuffer(t,s),h=u.line-r.start.line;if(this.offsetInBuffer(r.bufferIndex,r.end)-this.offsetInBuffer(r.bufferIndex,r.start)===s){const p=this.getLineFeedCnt(t.piece.bufferIndex,r.start,u);if(p!==h)return{index:p,remainder:0}}return{index:h,remainder:u.column}}getAccumulatedValue(t,s){if(s<0)return 0;const r=t.piece,u=this._buffers[r.bufferIndex].lineStarts,h=r.start.line+s+1;return h>r.end.line?u[r.end.line]+r.end.column-u[r.start.line]-r.start.column:u[h]-u[r.start.line]-r.start.column}deleteNodeTail(t,s){const r=t.piece,u=r.lineFeedCnt,h=this.offsetInBuffer(r.bufferIndex,r.end),p=s,y=this.offsetInBuffer(r.bufferIndex,p),v=this.getLineFeedCnt(r.bufferIndex,r.start,p),q=v-u,f=y-h,n=r.length+f;t.piece=new N(r.bufferIndex,r.start,p,v,n),(0,S.updateTreeMetadata)(this,t,f,q)}deleteNodeHead(t,s){const r=t.piece,u=r.lineFeedCnt,h=this.offsetInBuffer(r.bufferIndex,r.start),p=s,y=this.getLineFeedCnt(r.bufferIndex,p,r.end),v=this.offsetInBuffer(r.bufferIndex,p),q=y-u,f=h-v,n=r.length+f;t.piece=new N(r.bufferIndex,p,r.end,y,n),(0,S.updateTreeMetadata)(this,t,f,q)}shrinkNode(t,s,r){const u=t.piece,h=u.start,p=u.end,y=u.length,v=u.lineFeedCnt,q=s,f=this.getLineFeedCnt(u.bufferIndex,u.start,q),n=this.offsetInBuffer(u.bufferIndex,s)-this.offsetInBuffer(u.bufferIndex,h);t.piece=new N(u.bufferIndex,u.start,q,f,n),(0,S.updateTreeMetadata)(this,t,n-y,f-v);const o=new N(u.bufferIndex,r,p,this.getLineFeedCnt(u.bufferIndex,r,p),this.offsetInBuffer(u.bufferIndex,p)-this.offsetInBuffer(u.bufferIndex,r)),a=this.rbInsertRight(t,o);this.validateCRLFWithPrevNode(a)}appendToNode(t,s){this.adjustCarriageReturnFromNext(s,t)&&(s+=`
`);const r=this.shouldCheckCRLF()&&this.startWithLF(s)&&this.endWithCR(t),u=this._buffers[0].buffer.length;this._buffers[0].buffer+=s;const h=w(s,!1);for(let a=0;a<h.length;a++)h[a]+=u;if(r){const a=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:u-a}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(h.slice(1));const p=this._buffers[0].lineStarts.length-1,y=this._buffers[0].buffer.length-this._buffers[0].lineStarts[p],v={line:p,column:y},q=t.piece.length+s.length,f=t.piece.lineFeedCnt,n=this.getLineFeedCnt(0,t.piece.start,v),o=n-f;t.piece=new N(t.piece.bufferIndex,t.piece.start,v,n,q),this._lastChangeBufferPos=v,(0,S.updateTreeMetadata)(this,t,s.length,o)}nodeAt(t){let s=this.root;const r=this._searchCache.get(t);if(r)return{node:r.node,nodeStartOffset:r.nodeStartOffset,remainder:t-r.nodeStartOffset};let u=0;for(;s!==S.SENTINEL;)if(s.size_left>t)s=s.left;else if(s.size_left+s.piece.length>=t){u+=s.size_left;const h={node:s,remainder:t-s.size_left,nodeStartOffset:u};return this._searchCache.set(h),h}else t-=s.size_left+s.piece.length,u+=s.size_left+s.piece.length,s=s.right;return null}nodeAt2(t,s){let r=this.root,u=0;for(;r!==S.SENTINEL;)if(r.left!==S.SENTINEL&&r.lf_left>=t-1)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt>t-1){const h=this.getAccumulatedValue(r,t-r.lf_left-2),p=this.getAccumulatedValue(r,t-r.lf_left-1);return u+=r.size_left,{node:r,remainder:Math.min(h+s-1,p),nodeStartOffset:u}}else if(r.lf_left+r.piece.lineFeedCnt===t-1){const h=this.getAccumulatedValue(r,t-r.lf_left-2);if(h+s-1<=r.piece.length)return{node:r,remainder:h+s-1,nodeStartOffset:u};s-=r.piece.length-h;break}else t-=r.lf_left+r.piece.lineFeedCnt,u+=r.size_left+r.piece.length,r=r.right;for(r=r.next();r!==S.SENTINEL;){if(r.piece.lineFeedCnt>0){const h=this.getAccumulatedValue(r,0),p=this.offsetOfNode(r);return{node:r,remainder:Math.min(s-1,h),nodeStartOffset:p}}else if(r.piece.length>=s-1){const h=this.offsetOfNode(r);return{node:r,remainder:s-1,nodeStartOffset:h}}else s-=r.piece.length;r=r.next()}return null}nodeCharCodeAt(t,s){if(t.piece.lineFeedCnt<1)return-1;const r=this._buffers[t.piece.bufferIndex],u=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start)+s;return r.buffer.charCodeAt(u)}offsetOfNode(t){if(!t)return 0;let s=t.size_left;for(;t!==this.root;)t.parent.right===t&&(s+=t.parent.size_left+t.parent.piece.length),t=t.parent;return s}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
`)}startWithLF(t){if(typeof t=="string")return t.charCodeAt(0)===10;if(t===S.SENTINEL||t.piece.lineFeedCnt===0)return!1;const s=t.piece,r=this._buffers[s.bufferIndex].lineStarts,u=s.start.line,h=r[u]+s.start.column;return u===r.length-1||r[u+1]>h+1?!1:this._buffers[s.bufferIndex].buffer.charCodeAt(h)===10}endWithCR(t){return typeof t=="string"?t.charCodeAt(t.length-1)===13:t===S.SENTINEL||t.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(t,t.piece.length-1)===13}validateCRLFWithPrevNode(t){if(this.shouldCheckCRLF()&&this.startWithLF(t)){const s=t.prev();this.endWithCR(s)&&this.fixCRLF(s,t)}}validateCRLFWithNextNode(t){if(this.shouldCheckCRLF()&&this.endWithCR(t)){const s=t.next();this.startWithLF(s)&&this.fixCRLF(t,s)}}fixCRLF(t,s){const r=[],u=this._buffers[t.piece.bufferIndex].lineStarts;let h;t.piece.end.column===0?h={line:t.piece.end.line-1,column:u[t.piece.end.line]-u[t.piece.end.line-1]-1}:h={line:t.piece.end.line,column:t.piece.end.column-1};const p=t.piece.length-1,y=t.piece.lineFeedCnt-1;t.piece=new N(t.piece.bufferIndex,t.piece.start,h,y,p),(0,S.updateTreeMetadata)(this,t,-1,-1),t.piece.length===0&&r.push(t);const v={line:s.piece.start.line+1,column:0},q=s.piece.length-1,f=this.getLineFeedCnt(s.piece.bufferIndex,v,s.piece.end);s.piece=new N(s.piece.bufferIndex,v,s.piece.end,f,q),(0,S.updateTreeMetadata)(this,s,-1,-1),s.piece.length===0&&r.push(s);const n=this.createNewPieces(`\r
`);this.rbInsertRight(t,n[0]);for(let o=0;o<r.length;o++)(0,S.rbDelete)(this,r[o])}adjustCarriageReturnFromNext(t,s){if(this.shouldCheckCRLF()&&this.endWithCR(t)){const r=s.next();if(this.startWithLF(r)){if(t+=`
`,r.piece.length===1)(0,S.rbDelete)(this,r);else{const u=r.piece,h={line:u.start.line+1,column:0},p=u.length-1,y=this.getLineFeedCnt(u.bufferIndex,h,u.end);r.piece=new N(u.bufferIndex,h,u.end,y,p),(0,S.updateTreeMetadata)(this,r,-1,-1)}return!0}}return!1}iterate(t,s){if(t===S.SENTINEL)return s(S.SENTINEL);const r=this.iterate(t.left,s);return r&&s(t)&&this.iterate(t.right,s)}getNodeContent(t){if(t===S.SENTINEL)return"";const s=this._buffers[t.piece.bufferIndex],r=t.piece,u=this.offsetInBuffer(r.bufferIndex,r.start),h=this.offsetInBuffer(r.bufferIndex,r.end);return s.buffer.substring(u,h)}getPieceContent(t){const s=this._buffers[t.bufferIndex],r=this.offsetInBuffer(t.bufferIndex,t.start),u=this.offsetInBuffer(t.bufferIndex,t.end);return s.buffer.substring(r,u)}rbInsertRight(t,s){const r=new S.TreeNode(s,1);if(r.left=S.SENTINEL,r.right=S.SENTINEL,r.parent=S.SENTINEL,r.size_left=0,r.lf_left=0,this.root===S.SENTINEL)this.root=r,r.color=0;else if(t.right===S.SENTINEL)t.right=r,r.parent=t;else{const h=(0,S.leftest)(t.right);h.left=r,r.parent=h}return(0,S.fixInsert)(this,r),r}rbInsertLeft(t,s){const r=new S.TreeNode(s,1);if(r.left=S.SENTINEL,r.right=S.SENTINEL,r.parent=S.SENTINEL,r.size_left=0,r.lf_left=0,this.root===S.SENTINEL)this.root=r,r.color=0;else if(t.left===S.SENTINEL)t.left=r,r.parent=t;else{const u=(0,S.righttest)(t.left);u.right=r,r.parent=u}return(0,S.fixInsert)(this,r),r}getContentOfSubTree(t){let s="";return this.iterate(t,r=>(s+=this.getNodeContent(r),!0)),s}}e.PieceTreeBase=c}),define(ne[26],ie([0,1,19,2,11,25,10,21,23,6]),function(J,e,B,M,F,S,R,k,A,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PieceTreeTextBuffer=void 0;class I extends w.Disposable{constructor(_,P,b,c,l,t,s){super();this._onDidChangeContent=this._register(new B.Emitter),this.onDidChangeContent=this._onDidChangeContent.event,this._BOM=P,this._mightContainNonBasicASCII=!t,this._mightContainRTL=c,this._mightContainUnusualLineTerminators=l,this._pieceTree=new R.PieceTreeBase(_,b,s)}equals(_){return!(_ instanceof I)||this._BOM!==_._BOM||this.getEOL()!==_.getEOL()?!1:this._pieceTree.equal(_._pieceTree)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(_){return this._pieceTree.createSnapshot(_?this._BOM:"")}getOffsetAt(_,P){return this._pieceTree.getOffsetAt(_,P)}getPositionAt(_){return this._pieceTree.getPositionAt(_)}getRangeAt(_,P){const b=_+P,c=this.getPositionAt(_),l=this.getPositionAt(b);return new F.Range(c.lineNumber,c.column,l.lineNumber,l.column)}getValueInRange(_,P=0){if(_.isEmpty())return"";const b=this._getEndOfLine(P);return this._pieceTree.getValueInRange(_,b)}getValueLengthInRange(_,P=0){if(_.isEmpty())return 0;if(_.startLineNumber===_.endLineNumber)return _.endColumn-_.startColumn;const b=this.getOffsetAt(_.startLineNumber,_.startColumn);return this.getOffsetAt(_.endLineNumber,_.endColumn)-b}getCharacterCountInRange(_,P=0){if(this._mightContainNonBasicASCII){let b=0;const c=_.startLineNumber,l=_.endLineNumber;for(let t=c;t<=l;t++){const s=this.getLineContent(t),r=t===c?_.startColumn-1:0,u=t===l?_.endColumn-1:s.length;for(let h=r;h<u;h++)M.isHighSurrogate(s.charCodeAt(h))?(b=b+1,h=h+1):b=b+1}return b+=this._getEndOfLine(P).length*(l-c),b}return this.getValueLengthInRange(_,P)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(_){return this._pieceTree.getLineContent(_)}getLineCharCode(_,P){return this._pieceTree.getLineCharCode(_,P)}getCharCode(_){return this._pieceTree.getCharCode(_)}getLineLength(_){return this._pieceTree.getLineLength(_)}getLineMinColumn(_){return 1}getLineMaxColumn(_){return this.getLineLength(_)+1}getLineFirstNonWhitespaceColumn(_){const P=M.firstNonWhitespaceIndex(this.getLineContent(_));return P===-1?0:P+1}getLineLastNonWhitespaceColumn(_){const P=M.lastNonWhitespaceIndex(this.getLineContent(_));return P===-1?0:P+2}_getEndOfLine(_){switch(_){case 1:return`
`;case 2:return`\r
`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(_){this._pieceTree.setEOL(_)}applyEdits(_,P,b){let c=this._mightContainRTL,l=this._mightContainUnusualLineTerminators,t=this._mightContainNonBasicASCII,s=!0,r=[];for(let f=0;f<_.length;f++){const n=_[f];s&&n._isTracked&&(s=!1);const o=n.range;if(n.text){let D=!0;t||(D=!M.isBasicASCII(n.text),t=D),!c&&D&&(c=M.containsRTL(n.text)),!l&&D&&(l=M.containsUnusualLineTerminators(n.text))}let a="",g=0,L=0,W=0;if(n.text){let D;[g,L,W,D]=(0,k.countEOL)(n.text);const T=this.getEOL();D===0||D===(T===`\r
`?2:1)?a=n.text:a=n.text.replace(/\r\n|\r|\n/g,T)}r[f]={sortIndex:f,identifier:n.identifier||null,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o),text:a,eolCount:g,firstLineLength:L,lastLineLength:W,forceMoveMarkers:Boolean(n.forceMoveMarkers),isAutoWhitespaceEdit:n.isAutoWhitespaceEdit||!1}}r.sort(I._sortOpsAscending);let u=!1;for(let f=0,n=r.length-1;f<n;f++){const o=r[f].range.getEndPosition(),a=r[f+1].range.getStartPosition();if(a.isBeforeOrEqual(o)){if(a.isBefore(o))throw new Error("Overlapping ranges are not allowed!");u=!0}}s&&(r=this._reduceOperations(r));const h=b||P?I._getInverseEditRanges(r):[],p=[];if(P)for(let f=0;f<r.length;f++){const n=r[f],o=h[f];if(n.isAutoWhitespaceEdit&&n.range.isEmpty())for(let a=o.startLineNumber;a<=o.endLineNumber;a++){let g="";a===o.startLineNumber&&(g=this.getLineContent(n.range.startLineNumber),M.firstNonWhitespaceIndex(g)!==-1)||p.push({lineNumber:a,oldContent:g})}}let y=null;if(b){let f=0;y=[];for(let n=0;n<r.length;n++){const o=r[n],a=h[n],g=this.getValueInRange(o.range),L=o.rangeOffset+f;f+=o.text.length-g.length,y[n]={sortIndex:o.sortIndex,identifier:o.identifier,range:a,text:g,textChange:new A.TextChange(o.rangeOffset,g,L,o.text)}}u||y.sort((n,o)=>n.sortIndex-o.sortIndex)}this._mightContainRTL=c,this._mightContainUnusualLineTerminators=l,this._mightContainNonBasicASCII=t;const v=this._doApplyEdits(r);let q=null;if(P&&p.length>0){p.sort((f,n)=>n.lineNumber-f.lineNumber),q=[];for(let f=0,n=p.length;f<n;f++){const o=p[f].lineNumber;if(f>0&&p[f-1].lineNumber===o)continue;const a=p[f].oldContent,g=this.getLineContent(o);g.length===0||g===a||M.firstNonWhitespaceIndex(g)!==-1||q.push(o)}}return this._onDidChangeContent.fire(),new S.ApplyEditsResult(y,v,q)}_reduceOperations(_){return _.length<1e3?_:[this._toSingleEditOperation(_)]}_toSingleEditOperation(_){let P=!1;const b=_[0].range,c=_[_.length-1].range,l=new F.Range(b.startLineNumber,b.startColumn,c.endLineNumber,c.endColumn);let t=b.startLineNumber,s=b.startColumn;const r=[];for(let v=0,q=_.length;v<q;v++){const f=_[v],n=f.range;P=P||f.forceMoveMarkers,r.push(this.getValueInRange(new F.Range(t,s,n.startLineNumber,n.startColumn))),f.text.length>0&&r.push(f.text),t=n.endLineNumber,s=n.endColumn}const u=r.join(""),[h,p,y]=(0,k.countEOL)(u);return{sortIndex:0,identifier:_[0].identifier,range:l,rangeOffset:this.getOffsetAt(l.startLineNumber,l.startColumn),rangeLength:this.getValueLengthInRange(l,0),text:u,eolCount:h,firstLineLength:p,lastLineLength:y,forceMoveMarkers:P,isAutoWhitespaceEdit:!1}}_doApplyEdits(_){_.sort(I._sortOpsDescending);const P=[];for(let b=0;b<_.length;b++){const c=_[b],l=c.range.startLineNumber,t=c.range.startColumn,s=c.range.endLineNumber,r=c.range.endColumn;if(l===s&&t===r&&c.text.length===0)continue;c.text?(this._pieceTree.delete(c.rangeOffset,c.rangeLength),this._pieceTree.insert(c.rangeOffset,c.text,!0)):this._pieceTree.delete(c.rangeOffset,c.rangeLength);const u=new F.Range(l,t,s,r);P.push({range:u,rangeLength:c.rangeLength,text:c.text,rangeOffset:c.rangeOffset,forceMoveMarkers:c.forceMoveMarkers})}return P}findMatchesLineByLine(_,P,b,c){return this._pieceTree.findMatchesLineByLine(_,P,b,c)}getPieceTree(){return this._pieceTree}static _getInverseEditRange(_,P){const b=_.startLineNumber,c=_.startColumn,[l,t,s]=(0,k.countEOL)(P);let r;if(P.length>0){const u=l+1;u===1?r=new F.Range(b,c,b,c+t):r=new F.Range(b,c,b+u-1,s+1)}else r=new F.Range(b,c,b,c);return r}static _getInverseEditRanges(_){const P=[];let b=0,c=0,l=null;for(let t=0,s=_.length;t<s;t++){const r=_[t];let u,h;l?l.range.endLineNumber===r.range.startLineNumber?(u=b,h=c+(r.range.startColumn-l.range.endColumn)):(u=b+(r.range.startLineNumber-l.range.endLineNumber),h=r.range.startColumn):(u=r.range.startLineNumber,h=r.range.startColumn);let p;if(r.text.length>0){const y=r.eolCount+1;y===1?p=new F.Range(u,h,u,h+r.firstLineLength):p=new F.Range(u,h,u+y-1,r.lastLineLength+1)}else p=new F.Range(u,h,u,h);b=p.endLineNumber,c=p.endColumn,P.push(p),l=r}return P}static _sortOpsAscending(_,P){const b=F.Range.compareRangesUsingEnds(_.range,P.range);return b===0?_.sortIndex-P.sortIndex:b}static _sortOpsDescending(_,P){const b=F.Range.compareRangesUsingEnds(_.range,P.range);return b===0?P.sortIndex-_.sortIndex:-b}}e.PieceTreeTextBuffer=I}),define(ne[27],ie([0,1,2,10,26]),function(J,e,B,M,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PieceTreeTextBufferBuilder=e.PieceTreeTextBufferFactory=void 0;class S{constructor(A,w,I,N,_,P,b,c,l){this._chunks=A,this._bom=w,this._cr=I,this._lf=N,this._crlf=_,this._containsRTL=P,this._containsUnusualLineTerminators=b,this._isBasicASCII=c,this._normalizeEOL=l}_getEOL(A){const w=this._cr+this._lf+this._crlf,I=this._cr+this._crlf;return w===0?A===1?`
`:`\r
`:I>w/2?`\r
`:`
`}create(A){const w=this._getEOL(A),I=this._chunks;if(this._normalizeEOL&&(w===`\r
`&&(this._cr>0||this._lf>0)||w===`
`&&(this._cr>0||this._crlf>0)))for(let _=0,P=I.length;_<P;_++){const b=I[_].buffer.replace(/\r\n|\r|\n/g,w),c=(0,M.createLineStartsFast)(b);I[_]=new M.StringBuffer(b,c)}const N=new F.PieceTreeTextBuffer(I,this._bom,w,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:N,disposable:N}}getFirstLineText(A){return this._chunks[0].buffer.substr(0,A).split(/\r\n|\r|\n/)[0]}}e.PieceTreeTextBufferFactory=S;class R{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(A){if(A.length===0)return;this.chunks.length===0&&B.startsWithUTF8BOM(A)&&(this.BOM=B.UTF8_BOM_CHARACTER,A=A.substr(1));const w=A.charCodeAt(A.length-1);w===13||w>=55296&&w<=56319?(this._acceptChunk1(A.substr(0,A.length-1),!1),this._hasPreviousChar=!0,this._previousChar=w):(this._acceptChunk1(A,!1),this._hasPreviousChar=!1,this._previousChar=w)}_acceptChunk1(A,w){!w&&A.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+A):this._acceptChunk2(A))}_acceptChunk2(A){const w=(0,M.createLineStarts)(this._tmpLineStarts,A);this.chunks.push(new M.StringBuffer(A,w.lineStarts)),this.cr+=w.cr,this.lf+=w.lf,this.crlf+=w.crlf,this.isBasicASCII&&(this.isBasicASCII=w.isBasicASCII),!this.isBasicASCII&&!this.containsRTL&&(this.containsRTL=B.containsRTL(A)),!this.isBasicASCII&&!this.containsUnusualLineTerminators&&(this.containsUnusualLineTerminators=B.containsUnusualLineTerminators(A))}finish(A=!0){return this._finish(),new S(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,A)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const A=this.chunks[this.chunks.length-1];A.buffer+=String.fromCharCode(this._previousChar);const w=(0,M.createLineStartsFast)(A.buffer);A.lineStarts=w,this._previousChar===13&&this.cr++}}}e.PieceTreeTextBufferBuilder=R}),define(ne[28],ie([0,1]),function(J,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.refineServiceDecorator=e.createDecorator=e.IInstantiationService=e._util=void 0;var B;(function(R){R.serviceIds=new Map,R.DI_TARGET="$di$target",R.DI_DEPENDENCIES="$di$dependencies";function k(A){return A[R.DI_DEPENDENCIES]||[]}R.getServiceDependencies=k})(B=e._util||(e._util={})),e.IInstantiationService=F("instantiationService");function M(R,k,A){k[B.DI_TARGET]===k?k[B.DI_DEPENDENCIES].push({id:R,index:A}):(k[B.DI_DEPENDENCIES]=[{id:R,index:A}],k[B.DI_TARGET]=k)}function F(R){if(B.serviceIds.has(R))return B.serviceIds.get(R);const k=function(A,w,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");M(k,A,I)};return k.toString=()=>R,B.serviceIds.set(R,k),k}e.createDecorator=F;function S(R){return R}e.refineServiceDecorator=S}),define(ne[29],ie([0,1,3,2,28]),function(J,e,B,M,F){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.implies=e.SET_CONTEXT_COMMAND_ID=e.IContextKeyService=e.RawContextKey=e.ContextKeyNotRegexExpr=e.ContextKeyRegexExpr=e.ContextKeySmallerEqualsExpr=e.ContextKeySmallerExpr=e.ContextKeyGreaterEqualsExpr=e.ContextKeyGreaterExpr=e.ContextKeyNotExpr=e.ContextKeyNotEqualsExpr=e.ContextKeyNotInExpr=e.ContextKeyInExpr=e.ContextKeyEqualsExpr=e.ContextKeyDefinedExpr=e.ContextKeyTrueExpr=e.ContextKeyFalseExpr=e.expressionsAreEqualWithConstantSubstitution=e.ContextKeyExpr=e.ContextKeyExprType=void 0;const S=new Map;S.set("false",!1),S.set("true",!0),S.set("isMac",B.isMacintosh),S.set("isLinux",B.isLinux),S.set("isWindows",B.isWindows),S.set("isWeb",B.isWeb),S.set("isMacNative",B.isMacintosh&&!B.isWeb),S.set("isEdge",B.isEdge),S.set("isFirefox",B.isFirefox),S.set("isChrome",B.isChrome),S.set("isSafari",B.isSafari);const R=Object.prototype.hasOwnProperty;var k;(function(T){T[T.False=0]="False",T[T.True=1]="True",T[T.Defined=2]="Defined",T[T.Not=3]="Not",T[T.Equals=4]="Equals",T[T.NotEquals=5]="NotEquals",T[T.And=6]="And",T[T.Regex=7]="Regex",T[T.NotRegex=8]="NotRegex",T[T.Or=9]="Or",T[T.In=10]="In",T[T.NotIn=11]="NotIn",T[T.Greater=12]="Greater",T[T.GreaterEquals=13]="GreaterEquals",T[T.Smaller=14]="Smaller",T[T.SmallerEquals=15]="SmallerEquals"})(k=e.ContextKeyExprType||(e.ContextKeyExprType={}));class A{static false(){return N.INSTANCE}static true(){return _.INSTANCE}static has(i){return P.create(i)}static equals(i,m){return b.create(i,m)}static notEquals(i,m){return t.create(i,m)}static regex(i,m){return v.create(i,m)}static in(i,m){return c.create(i,m)}static notIn(i,m){return l.create(i,m)}static not(i){return s.create(i)}static and(...i){return n.create(i,null)}static or(...i){return o.create(i,null,!0)}static greater(i,m){return u.create(i,m)}static greaterEquals(i,m){return h.create(i,m)}static smaller(i,m){return p.create(i,m)}static smallerEquals(i,m){return y.create(i,m)}static deserialize(i,m=!1){if(!!i)return this._deserializeOrExpression(i,m)}static _deserializeOrExpression(i,m){const C=i.split("||");return o.create(C.map(U=>this._deserializeAndExpression(U,m)),null,!0)}static _deserializeAndExpression(i,m){const C=i.split("&&");return n.create(C.map(U=>this._deserializeOne(U,m)),null)}static _deserializeOne(i,m){if(i=i.trim(),i.indexOf("!=")>=0){const C=i.split("!=");return t.create(C[0].trim(),this._deserializeValue(C[1],m))}if(i.indexOf("==")>=0){const C=i.split("==");return b.create(C[0].trim(),this._deserializeValue(C[1],m))}if(i.indexOf("=~")>=0){const C=i.split("=~");return v.create(C[0].trim(),this._deserializeRegexValue(C[1],m))}if(i.indexOf(" not in ")>=0){const C=i.split(" not in ");return l.create(C[0].trim(),C[1].trim())}if(i.indexOf(" in ")>=0){const C=i.split(" in ");return c.create(C[0].trim(),C[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(i)){const C=i.split(">=");return h.create(C[0].trim(),C[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(i)){const C=i.split(">");return u.create(C[0].trim(),C[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(i)){const C=i.split("<=");return y.create(C[0].trim(),C[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(i)){const C=i.split("<");return p.create(C[0].trim(),C[1].trim())}return/^\!\s*/.test(i)?s.create(i.substr(1).trim()):P.create(i)}static _deserializeValue(i,m){if(i=i.trim(),i==="true")return!0;if(i==="false")return!1;const C=/^'([^']*)'$/.exec(i);return C?C[1].trim():i}static _deserializeRegexValue(i,m){if((0,M.isFalsyOrWhitespace)(i)){if(m)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}const C=i.indexOf("/"),U=i.lastIndexOf("/");if(C===U||C<0){if(m)throw new Error(`bad regexp-value '${i}', missing /-enclosure`);return console.warn(`bad regexp-value '${i}', missing /-enclosure`),null}const G=i.slice(C+1,U),Y=i[U+1]==="i"?"i":"";try{return new RegExp(G,Y)}catch(ee){if(m)throw new Error(`bad regexp-value '${i}', parse error: ${ee}`);return console.warn(`bad regexp-value '${i}', parse error: ${ee}`),null}}}e.ContextKeyExpr=A;function w(T,i){const m=T?T.substituteConstants():void 0,C=i?i.substituteConstants():void 0;return!m&&!C?!0:!m||!C?!1:m.equals(C)}e.expressionsAreEqualWithConstantSubstitution=w;function I(T,i){return T.cmp(i)}class N{constructor(){this.type=0}cmp(i){return this.type-i.type}equals(i){return i.type===this.type}substituteConstants(){return this}evaluate(i){return!1}serialize(){return"false"}keys(){return[]}map(i){return this}negate(){return _.INSTANCE}}e.ContextKeyFalseExpr=N,N.INSTANCE=new N;class _{constructor(){this.type=1}cmp(i){return this.type-i.type}equals(i){return i.type===this.type}substituteConstants(){return this}evaluate(i){return!0}serialize(){return"true"}keys(){return[]}map(i){return this}negate(){return N.INSTANCE}}e.ContextKeyTrueExpr=_,_.INSTANCE=new _;class P{constructor(i,m){this.key=i,this.negated=m,this.type=2}static create(i,m=null){const C=S.get(i);return typeof C=="boolean"?C?_.INSTANCE:N.INSTANCE:new P(i,m)}cmp(i){return i.type!==this.type?this.type-i.type:g(this.key,i.key)}equals(i){return i.type===this.type?this.key===i.key:!1}substituteConstants(){const i=S.get(this.key);return typeof i=="boolean"?i?_.INSTANCE:N.INSTANCE:this}evaluate(i){return!!i.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(i){return i.mapDefined(this.key)}negate(){return this.negated||(this.negated=s.create(this.key,this)),this.negated}}e.ContextKeyDefinedExpr=P;class b{constructor(i,m,C){this.key=i,this.value=m,this.negated=C,this.type=4}static create(i,m,C=null){if(typeof m=="boolean")return m?P.create(i,C):s.create(i,C);const U=S.get(i);return typeof U=="boolean"?m===(U?"true":"false")?_.INSTANCE:N.INSTANCE:new b(i,m,C)}cmp(i){return i.type!==this.type?this.type-i.type:L(this.key,this.value,i.key,i.value)}equals(i){return i.type===this.type?this.key===i.key&&this.value===i.value:!1}substituteConstants(){const i=S.get(this.key);if(typeof i=="boolean"){const m=i?"true":"false";return this.value===m?_.INSTANCE:N.INSTANCE}return this}evaluate(i){return i.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(i){return i.mapEquals(this.key,this.value)}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}e.ContextKeyEqualsExpr=b;class c{constructor(i,m){this.key=i,this.valueKey=m,this.type=10,this.negated=null}static create(i,m){return new c(i,m)}cmp(i){return i.type!==this.type?this.type-i.type:L(this.key,this.valueKey,i.key,i.valueKey)}equals(i){return i.type===this.type?this.key===i.key&&this.valueKey===i.valueKey:!1}substituteConstants(){return this}evaluate(i){const m=i.getValue(this.valueKey),C=i.getValue(this.key);return Array.isArray(m)?m.includes(C):typeof C=="string"&&typeof m=="object"&&m!==null?R.call(m,C):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(i){return i.mapIn(this.key,this.valueKey)}negate(){return this.negated||(this.negated=l.create(this.key,this.valueKey)),this.negated}}e.ContextKeyInExpr=c;class l{constructor(i,m){this.key=i,this.valueKey=m,this.type=11,this._negated=c.create(i,m)}static create(i,m){return new l(i,m)}cmp(i){return i.type!==this.type?this.type-i.type:this._negated.cmp(i._negated)}equals(i){return i.type===this.type?this._negated.equals(i._negated):!1}substituteConstants(){return this}evaluate(i){return!this._negated.evaluate(i)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(i){return i.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}}e.ContextKeyNotInExpr=l;class t{constructor(i,m,C){this.key=i,this.value=m,this.negated=C,this.type=5}static create(i,m,C=null){if(typeof m=="boolean")return m?s.create(i,C):P.create(i,C);const U=S.get(i);return typeof U=="boolean"?m===(U?"true":"false")?N.INSTANCE:_.INSTANCE:new t(i,m,C)}cmp(i){return i.type!==this.type?this.type-i.type:L(this.key,this.value,i.key,i.value)}equals(i){return i.type===this.type?this.key===i.key&&this.value===i.value:!1}substituteConstants(){const i=S.get(this.key);if(typeof i=="boolean"){const m=i?"true":"false";return this.value===m?N.INSTANCE:_.INSTANCE}return this}evaluate(i){return i.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(i){return i.mapNotEquals(this.key,this.value)}negate(){return this.negated||(this.negated=b.create(this.key,this.value,this)),this.negated}}e.ContextKeyNotEqualsExpr=t;class s{constructor(i,m){this.key=i,this.negated=m,this.type=3}static create(i,m=null){const C=S.get(i);return typeof C=="boolean"?C?N.INSTANCE:_.INSTANCE:new s(i,m)}cmp(i){return i.type!==this.type?this.type-i.type:g(this.key,i.key)}equals(i){return i.type===this.type?this.key===i.key:!1}substituteConstants(){const i=S.get(this.key);return typeof i=="boolean"?i?N.INSTANCE:_.INSTANCE:this}evaluate(i){return!i.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(i){return i.mapNot(this.key)}negate(){return this.negated||(this.negated=P.create(this.key,this)),this.negated}}e.ContextKeyNotExpr=s;function r(T,i){if(typeof T=="string"){const m=parseFloat(T);isNaN(m)||(T=m)}return typeof T=="string"||typeof T=="number"?i(T):N.INSTANCE}class u{constructor(i,m,C){this.key=i,this.value=m,this.negated=C,this.type=12}static create(i,m,C=null){return r(m,U=>new u(i,U,C))}cmp(i){return i.type!==this.type?this.type-i.type:L(this.key,this.value,i.key,i.value)}equals(i){return i.type===this.type?this.key===i.key&&this.value===i.value:!1}substituteConstants(){return this}evaluate(i){return typeof this.value=="string"?!1:parseFloat(i.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(i){return i.mapGreater(this.key,this.value)}negate(){return this.negated||(this.negated=y.create(this.key,this.value,this)),this.negated}}e.ContextKeyGreaterExpr=u;class h{constructor(i,m,C){this.key=i,this.value=m,this.negated=C,this.type=13}static create(i,m,C=null){return r(m,U=>new h(i,U,C))}cmp(i){return i.type!==this.type?this.type-i.type:L(this.key,this.value,i.key,i.value)}equals(i){return i.type===this.type?this.key===i.key&&this.value===i.value:!1}substituteConstants(){return this}evaluate(i){return typeof this.value=="string"?!1:parseFloat(i.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(i){return i.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}e.ContextKeyGreaterEqualsExpr=h;class p{constructor(i,m,C){this.key=i,this.value=m,this.negated=C,this.type=14}static create(i,m,C=null){return r(m,U=>new p(i,U,C))}cmp(i){return i.type!==this.type?this.type-i.type:L(this.key,this.value,i.key,i.value)}equals(i){return i.type===this.type?this.key===i.key&&this.value===i.value:!1}substituteConstants(){return this}evaluate(i){return typeof this.value=="string"?!1:parseFloat(i.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(i){return i.mapSmaller(this.key,this.value)}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}e.ContextKeySmallerExpr=p;class y{constructor(i,m,C){this.key=i,this.value=m,this.negated=C,this.type=15}static create(i,m,C=null){return r(m,U=>new y(i,U,C))}cmp(i){return i.type!==this.type?this.type-i.type:L(this.key,this.value,i.key,i.value)}equals(i){return i.type===this.type?this.key===i.key&&this.value===i.value:!1}substituteConstants(){return this}evaluate(i){return typeof this.value=="string"?!1:parseFloat(i.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(i){return i.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}e.ContextKeySmallerEqualsExpr=y;class v{constructor(i,m){this.key=i,this.regexp=m,this.type=7,this.negated=null}static create(i,m){return new v(i,m)}cmp(i){if(i.type!==this.type)return this.type-i.type;if(this.key<i.key)return-1;if(this.key>i.key)return 1;const m=this.regexp?this.regexp.source:"",C=i.regexp?i.regexp.source:"";return m<C?-1:m>C?1:0}equals(i){if(i.type===this.type){const m=this.regexp?this.regexp.source:"",C=i.regexp?i.regexp.source:"";return this.key===i.key&&m===C}return!1}substituteConstants(){return this}evaluate(i){const m=i.getValue(this.key);return this.regexp?this.regexp.test(m):!1}serialize(){const i=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${i}`}keys(){return[this.key]}map(i){return i.mapRegex(this.key,this.regexp)}negate(){return this.negated||(this.negated=q.create(this)),this.negated}}e.ContextKeyRegexExpr=v;class q{constructor(i){this._actual=i,this.type=8}static create(i){return new q(i)}cmp(i){return i.type!==this.type?this.type-i.type:this._actual.cmp(i._actual)}equals(i){return i.type===this.type?this._actual.equals(i._actual):!1}substituteConstants(){return this}evaluate(i){return!this._actual.evaluate(i)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}map(i){return new q(this._actual.map(i))}negate(){return this._actual}}e.ContextKeyNotRegexExpr=q;function f(T){let i=null;for(let m=0,C=T.length;m<C;m++){const U=T[m].substituteConstants();if(T[m]!==U&&i===null){i=[];for(let G=0;G<m;G++)i[G]=T[G]}i!==null&&(i[m]=U)}return i===null?T:i}class n{constructor(i,m){this.expr=i,this.negated=m,this.type=6}static create(i,m){return n._normalizeArr(i,m)}cmp(i){if(i.type!==this.type)return this.type-i.type;if(this.expr.length<i.expr.length)return-1;if(this.expr.length>i.expr.length)return 1;for(let m=0,C=this.expr.length;m<C;m++){const U=I(this.expr[m],i.expr[m]);if(U!==0)return U}return 0}equals(i){if(i.type===this.type){if(this.expr.length!==i.expr.length)return!1;for(let m=0,C=this.expr.length;m<C;m++)if(!this.expr[m].equals(i.expr[m]))return!1;return!0}return!1}substituteConstants(){const i=f(this.expr);return i===this.expr?this:n.create(i,this.negated)}evaluate(i){for(let m=0,C=this.expr.length;m<C;m++)if(!this.expr[m].evaluate(i))return!1;return!0}static _normalizeArr(i,m){const C=[];let U=!1;for(const G of i)if(!!G){if(G.type===1){U=!0;continue}if(G.type===0)return N.INSTANCE;if(G.type===6){C.push(...G.expr);continue}C.push(G)}if(C.length===0&&U)return _.INSTANCE;if(C.length!==0){if(C.length===1)return C[0];C.sort(I);for(let G=1;G<C.length;G++)C[G-1].equals(C[G])&&(C.splice(G,1),G--);if(C.length===1)return C[0];for(;C.length>1;){const G=C[C.length-1];if(G.type!==9)break;C.pop();const Y=C.pop(),ee=C.length===0,V=o.create(G.expr.map(K=>n.create([K,Y],null)),null,ee);V&&(C.push(V),C.sort(I))}return C.length===1?C[0]:new n(C,m)}}serialize(){return this.expr.map(i=>i.serialize()).join(" && ")}keys(){const i=[];for(const m of this.expr)i.push(...m.keys());return i}map(i){return new n(this.expr.map(m=>m.map(i)),null)}negate(){if(!this.negated){const i=[];for(const m of this.expr)i.push(m.negate());this.negated=o.create(i,this,!0)}return this.negated}}class o{constructor(i,m){this.expr=i,this.negated=m,this.type=9}static create(i,m,C){return o._normalizeArr(i,m,C)}cmp(i){if(i.type!==this.type)return this.type-i.type;if(this.expr.length<i.expr.length)return-1;if(this.expr.length>i.expr.length)return 1;for(let m=0,C=this.expr.length;m<C;m++){const U=I(this.expr[m],i.expr[m]);if(U!==0)return U}return 0}equals(i){if(i.type===this.type){if(this.expr.length!==i.expr.length)return!1;for(let m=0,C=this.expr.length;m<C;m++)if(!this.expr[m].equals(i.expr[m]))return!1;return!0}return!1}substituteConstants(){const i=f(this.expr);return i===this.expr?this:o.create(i,this.negated,!1)}evaluate(i){for(let m=0,C=this.expr.length;m<C;m++)if(this.expr[m].evaluate(i))return!0;return!1}static _normalizeArr(i,m,C){let U=[],G=!1;if(i){for(let Y=0,ee=i.length;Y<ee;Y++){const V=i[Y];if(!!V){if(V.type===0){G=!0;continue}if(V.type===1)return _.INSTANCE;if(V.type===9){U=U.concat(V.expr);continue}U.push(V)}}if(U.length===0&&G)return N.INSTANCE;U.sort(I)}if(U.length!==0){if(U.length===1)return U[0];for(let Y=1;Y<U.length;Y++)U[Y-1].equals(U[Y])&&(U.splice(Y,1),Y--);if(U.length===1)return U[0];if(C){for(let Y=0;Y<U.length;Y++)for(let ee=Y+1;ee<U.length;ee++)W(U[Y],U[ee])&&(U.splice(ee,1),ee--);if(U.length===1)return U[0]}return new o(U,m)}}serialize(){return this.expr.map(i=>i.serialize()).join(" || ")}keys(){const i=[];for(const m of this.expr)i.push(...m.keys());return i}map(i){return new o(this.expr.map(m=>m.map(i)),null)}negate(){if(!this.negated){const i=[];for(const m of this.expr)i.push(m.negate());for(;i.length>1;){const m=i.shift(),C=i.shift(),U=[];for(const Y of D(m))for(const ee of D(C))U.push(n.create([Y,ee],null));const G=i.length===0;i.unshift(o.create(U,null,G))}this.negated=i[0]}return this.negated}}class a extends P{constructor(i,m,C){super(i,null);this._defaultValue=m,typeof C=="object"?a._info.push({...C,key:i}):C!==!0&&a._info.push({key:i,description:C,type:m!=null?typeof m:void 0})}static all(){return a._info.values()}bindTo(i){return i.createKey(this.key,this._defaultValue)}getValue(i){return i.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(i){return b.create(this.key,i)}notEqualsTo(i){return t.create(this.key,i)}}e.RawContextKey=a,a._info=[],e.IContextKeyService=(0,F.createDecorator)("contextKeyService"),e.SET_CONTEXT_COMMAND_ID="setContext";function g(T,i){return T<i?-1:T>i?1:0}function L(T,i,m,C){return T<m?-1:T>m?1:i<C?-1:i>C?1:0}function W(T,i){if(i.type===6&&T.type!==9&&T.type!==6){for(const U of i.expr)if(T.equals(U))return!0}const m=T.negate(),C=D(m).concat(D(i));C.sort(I);for(let U=0;U<C.length;U++){const Y=C[U].negate();for(let ee=U+1;ee<C.length;ee++){const V=C[ee];if(Y.equals(V))return!0}}return!1}e.implies=W;function D(T){return T.type===9?T.expr:[T]}}),define(ne[30],ie([0,1,5,20,35,12,8,4,3,29]),function(J,e,B,M,F,S,R,k,A,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NotebookWorkingCopyTypeIdentifier=e.CellStatusbarAlignment=e.NotebookSetting=e.notebookDocumentFilterMatch=e.isDocumentExcludePattern=e.NotebookEditorPriority=e.NOTEBOOK_EDITOR_CURSOR_BOUNDARY=e.diff=e.MimeTypeDisplayOrder=e.CellUri=e.CellEditType=e.SelectionStateType=e.NotebookCellsChangeType=e.RendererMessagingSpec=e.NotebookRendererMatch=e.NotebookCellExecutionState=e.NotebookRunState=e.RENDERER_NOT_AVAILABLE=e.RENDERER_EQUIVALENT_EXTENSIONS=e.ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER=e.NOTEBOOK_DISPLAY_ORDER=e.CellKind=e.NOTEBOOK_DIFF_EDITOR_ID=e.NOTEBOOK_EDITOR_ID=void 0,e.NOTEBOOK_EDITOR_ID="workbench.editor.notebook",e.NOTEBOOK_DIFF_EDITOR_ID="workbench.editor.notebookTextDiffEditor";var I;(function(n){n[n.Markup=1]="Markup",n[n.Code=2]="Code"})(I=e.CellKind||(e.CellKind={})),e.NOTEBOOK_DISPLAY_ORDER=["application/json","application/javascript","text/html","image/svg+xml",S.Mimes.latex,S.Mimes.markdown,"image/png","image/jpeg",S.Mimes.text],e.ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER=[S.Mimes.latex,S.Mimes.markdown,"application/json",S.Mimes.text,"text/html","image/svg+xml","image/png","image/jpeg"],e.RENDERER_EQUIVALENT_EXTENSIONS=new Map([["ms-toolsai.jupyter",new Set(["jupyter-notebook","interactive"])],["ms-toolsai.jupyter-renderers",new Set(["jupyter-notebook","interactive"])]]),e.RENDERER_NOT_AVAILABLE="_notAvailable";var N;(function(n){n[n.Running=1]="Running",n[n.Idle=2]="Idle"})(N=e.NotebookRunState||(e.NotebookRunState={}));var _;(function(n){n[n.Unconfirmed=1]="Unconfirmed",n[n.Pending=2]="Pending",n[n.Executing=3]="Executing"})(_=e.NotebookCellExecutionState||(e.NotebookCellExecutionState={}));var P;(function(n){n[n.WithHardKernelDependency=0]="WithHardKernelDependency",n[n.WithOptionalKernelDependency=1]="WithOptionalKernelDependency",n[n.Pure=2]="Pure",n[n.Never=3]="Never"})(P=e.NotebookRendererMatch||(e.NotebookRendererMatch={}));var b;(function(n){n.Always="always",n.Never="never",n.Optional="optional"})(b=e.RendererMessagingSpec||(e.RendererMessagingSpec={}));var c;(function(n){n[n.ModelChange=1]="ModelChange",n[n.Move=2]="Move",n[n.ChangeCellLanguage=5]="ChangeCellLanguage",n[n.Initialize=6]="Initialize",n[n.ChangeCellMetadata=7]="ChangeCellMetadata",n[n.Output=8]="Output",n[n.OutputItem=9]="OutputItem",n[n.ChangeCellContent=10]="ChangeCellContent",n[n.ChangeDocumentMetadata=11]="ChangeDocumentMetadata",n[n.ChangeCellInternalMetadata=12]="ChangeCellInternalMetadata",n[n.ChangeCellMime=13]="ChangeCellMime",n[n.Unknown=100]="Unknown"})(c=e.NotebookCellsChangeType||(e.NotebookCellsChangeType={}));var l;(function(n){n[n.Handle=0]="Handle",n[n.Index=1]="Index"})(l=e.SelectionStateType||(e.SelectionStateType={}));var t;(function(n){n[n.Replace=1]="Replace",n[n.Output=2]="Output",n[n.Metadata=3]="Metadata",n[n.CellLanguage=4]="CellLanguage",n[n.DocumentMetadata=5]="DocumentMetadata",n[n.Move=6]="Move",n[n.OutputItems=7]="OutputItems",n[n.PartialMetadata=8]="PartialMetadata",n[n.PartialInternalMetadata=9]="PartialInternalMetadata"})(t=e.CellEditType||(e.CellEditType={}));var s;(function(n){n.scheme=R.Schemas.vscodeNotebookCell;const o=["W","X","Y","Z","a","b","c","d","e","f"],a=new RegExp(`^[${o.join("")}]+`),g=7;function L(U,G){const Y=G.toString(g),V=`${Y.length<o.length?o[Y.length-1]:"z"}${Y}s${(0,B.encodeBase64)(B.VSBuffer.fromString(U.scheme),!0,!0)}`;return U.with({scheme:n.scheme,fragment:V})}n.generate=L;function W(U){if(U.scheme!==n.scheme)return;const G=U.fragment.indexOf("s");if(G<0)return;const Y=parseInt(U.fragment.substring(0,G).replace(a,""),g),ee=(0,B.decodeBase64)(U.fragment.substring(G+1)).toString();if(!isNaN(Y))return{handle:Y,notebook:U.with({scheme:ee,fragment:null})}}n.parse=W;const D=/^(\d{8,})(\w[\w\d+.-]*)$/;function T(U,G){return U.with({scheme:R.Schemas.vscodeNotebookCellOutput,fragment:`op${G??""},${U.scheme!==R.Schemas.file?U.scheme:""}`})}n.generateCellOutputUri=T;function i(U){if(U.scheme!==R.Schemas.vscodeNotebookCellOutput)return;const G=/^op([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?\,(.*)$/i.exec(U.fragment);if(!G)return;const Y=G[1]&&G[1]!==""?G[1]:void 0,ee=G[2];return{outputId:Y,notebook:U.with({scheme:ee||R.Schemas.file,fragment:null})}}n.parseCellOutputUri=i;function m(U,G,Y){return U.with({scheme:Y,fragment:`ch${G.toString().padStart(7,"0")}${U.scheme!==R.Schemas.file?U.scheme:""}`})}n.generateCellUri=m;function C(U,G){if(U.scheme!==G)return;const Y=D.exec(U.fragment);return Y?{handle:Number(Y[1]),notebook:U.with({scheme:U.fragment.substring(Y[0].length)||R.Schemas.file,fragment:null})}:void 0}n.parseCellUri=C})(s=e.CellUri||(e.CellUri={}));const r=n=>A.isWindows?n.replace(/\//g,"\\"):n;class u{constructor(o=[],a=e.NOTEBOOK_DISPLAY_ORDER){this.defaultOrder=a,this.order=[...new Set(o)].map(g=>({pattern:g,matches:M.parse(r(g))}))}sort(o){const a=new Map(F.Iterable.map(o,L=>[L,r(L)]));let g=[];for(const{matches:L}of this.order)for(const[W,D]of a)if(L(D)){g.push(W),a.delete(W);break}return a.size&&(g=g.concat([...a.keys()].sort((L,W)=>this.defaultOrder.indexOf(L)-this.defaultOrder.indexOf(W)))),g}prioritize(o,a){const g=this.findIndex(o);if(g===-1){this.order.unshift({pattern:o,matches:M.parse(r(o))});return}const L=new Set(a.map(D=>this.findIndex(D,g)));L.delete(-1);const W=Array.from(L).sort();this.order.splice(g+1,0,...W.map(D=>this.order[D]));for(let D=W.length-1;D>=0;D--)this.order.splice(W[D],1)}toArray(){return this.order.map(o=>o.pattern)}findIndex(o,a=this.order.length){const g=r(o);for(let L=0;L<a;L++)if(this.order[L].matches(g))return L;return-1}}e.MimeTypeDisplayOrder=u;function h(n,o,a,g=(L,W)=>L===W){const L=[];function W(i,m,C){if(m===0&&C.length===0)return;const U=L[L.length-1];U&&U.start+U.deleteCount===i?(U.deleteCount+=m,U.toInsert.push(...C)):L.push({start:i,deleteCount:m,toInsert:C})}let D=0,T=0;for(;;){if(D===n.length){W(D,0,o.slice(T));break}if(T===o.length){W(D,n.length-D,[]);break}const i=n[D],m=o[T];if(g(i,m)){D+=1,T+=1;continue}a(m)?(W(D,1,[]),D+=1):(W(D,0,[m]),T+=1)}return L}e.diff=h,e.NOTEBOOK_EDITOR_CURSOR_BOUNDARY=new w.RawContextKey("notebookEditorCursorAtBoundary","none");var p;(function(n){n.default="default",n.option="option"})(p=e.NotebookEditorPriority||(e.NotebookEditorPriority={}));function y(n){const o=n;return!!((typeof o.include=="string"||M.isRelativePattern(o.include))&&(typeof o.exclude=="string"||M.isRelativePattern(o.exclude)))}e.isDocumentExcludePattern=y;function v(n,o,a){if(Array.isArray(n.viewType)&&n.viewType.indexOf(o)>=0||n.viewType===o)return!0;if(n.filenamePattern){const g=y(n.filenamePattern)?n.filenamePattern.include:n.filenamePattern,L=y(n.filenamePattern)?n.filenamePattern.exclude:void 0;if(M.match(g,(0,k.basename)(a.fsPath).toLowerCase()))return!(L&&M.match(L,(0,k.basename)(a.fsPath).toLowerCase()))}return!1}e.notebookDocumentFilterMatch=v,e.NotebookSetting={displayOrder:"notebook.displayOrder",cellToolbarLocation:"notebook.cellToolbarLocation",cellToolbarVisibility:"notebook.cellToolbarVisibility",showCellStatusBar:"notebook.showCellStatusBar",textDiffEditorPreview:"notebook.diff.enablePreview",experimentalInsertToolbarAlignment:"notebook.experimental.insertToolbarAlignment",compactView:"notebook.compactView",focusIndicator:"notebook.cellFocusIndicator",insertToolbarLocation:"notebook.insertToolbarLocation",globalToolbar:"notebook.globalToolbar",undoRedoPerCell:"notebook.undoRedoPerCell",consolidatedOutputButton:"notebook.consolidatedOutputButton",showFoldingControls:"notebook.showFoldingControls",dragAndDropEnabled:"notebook.dragAndDropEnabled",cellEditorOptionsCustomizations:"notebook.editorOptionsCustomizations",consolidatedRunButton:"notebook.consolidatedRunButton",openGettingStarted:"notebook.experimental.openGettingStarted",textOutputLineLimit:"notebook.output.textLineLimit",globalToolbarShowLabel:"notebook.globalToolbarShowLabel",markupFontSize:"notebook.markup.fontSize",interactiveWindowCollapseCodeCells:"interactiveWindow.collapseCellInputCode",outputLineHeight:"notebook.outputLineHeight",outputFontSize:"notebook.outputFontSize",outputFontFamily:"notebook.outputFontFamily"};var q;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(q=e.CellStatusbarAlignment||(e.CellStatusbarAlignment={}));class f{static create(o){return`${f._prefix}${o}`}static parse(o){if(o.startsWith(f._prefix))return o.substring(f._prefix.length)}}e.NotebookWorkingCopyTypeIdentifier=f,f._prefix="notebook/"}),define(ne[36],ie([0,1,37,38,9,27,30,11]),function(J,e,B,M,F,S,R,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.NotebookEditorSimpleWorker=e.CellSequence=void 0;function A(b){let c=(0,M.numberHash)(104579,0);for(let l=0;l<b.buffer.length;l++)c=(0,M.doHash)(b.buffer[l],c);return c}class w{constructor(c,l,t,s,r,u,h){this.handle=c,this._source=l,this.language=t,this.cellKind=s,this.outputs=r,this.metadata=u,this.internalMetadata=h,this._primaryKey=null,this._hash=null}get textBuffer(){if(this._textBuffer)return this._textBuffer;const c=new S.PieceTreeTextBufferBuilder;c.acceptChunk(Array.isArray(this._source)?this._source.join(`
`):this._source);const l=c.finish(!0);return this._textBuffer=l.create(1).textBuffer,this._textBuffer}primaryKey(){return this._primaryKey===void 0&&(this._primaryKey=(0,M.hash)(this.getValue())),this._primaryKey}getFullModelRange(){const c=this.textBuffer.getLineCount();return new k.Range(1,1,c,this.textBuffer.getLineLength(c)+1)}getValue(){const c=this.getFullModelRange();return this.textBuffer.getEOL()===`
`?this.textBuffer.getValueInRange(c,1):this.textBuffer.getValueInRange(c,2)}getComparisonValue(){return this._primaryKey!==null?this._primaryKey:(this._hash=(0,M.hash)([(0,M.hash)(this.language),(0,M.hash)(this.getValue()),this.metadata,this.internalMetadata,this.outputs.map(c=>({outputs:c.outputs.map(l=>({mime:l.mime,data:A(l.data)})),metadata:c.metadata}))]),this._hash)}getHashValue(){return this._hash!==null?this._hash:(this._hash=(0,M.hash)([(0,M.hash)(this.getValue()),this.language,this.metadata,this.internalMetadata]),this._hash)}}class I{constructor(c,l,t){this.uri=c,this.cells=l,this.metadata=t}acceptModelChanged(c){c.rawEvents.forEach(l=>{if(l.kind===R.NotebookCellsChangeType.ModelChange)this._spliceNotebookCells(l.changes);else if(l.kind===R.NotebookCellsChangeType.Move){const t=this.cells.splice(l.index,1);this.cells.splice(l.newIdx,0,...t)}else if(l.kind===R.NotebookCellsChangeType.Output){const t=this.cells[l.index];t.outputs=l.outputs}else if(l.kind===R.NotebookCellsChangeType.ChangeCellLanguage){const t=this.cells[l.index];t.language=l.language}else if(l.kind===R.NotebookCellsChangeType.ChangeCellMetadata){const t=this.cells[l.index];t.metadata=l.metadata}else if(l.kind===R.NotebookCellsChangeType.ChangeCellInternalMetadata){const t=this.cells[l.index];t.internalMetadata=l.internalMetadata}})}_spliceNotebookCells(c){c.reverse().forEach(l=>{const s=l[2].map(r=>new w(r.handle,r.source,r.language,r.cellKind,r.outputs,r.metadata));this.cells.splice(l[0],l[1],...s)})}}class N{constructor(c){this.textModel=c}getElements(){const c=new Int32Array(this.textModel.cells.length);for(let l=0;l<this.textModel.cells.length;l++)c[l]=this.textModel.cells[l].getComparisonValue();return c}getCellHash(c){const l=Array.isArray(c.source)?c.source.join(`
`):c.source;return(0,M.hash)([(0,M.hash)(l),c.metadata])}}e.CellSequence=N;class _{constructor(){this._models=Object.create(null)}dispose(){}acceptNewModel(c,l){this._models[c]=new I(F.URI.parse(c),l.cells.map(t=>new w(t.handle,t.source,t.language,t.cellKind,t.outputs,t.metadata)),l.metadata)}acceptModelChanged(c,l){this._models[c]?.acceptModelChanged(l)}acceptRemovedModel(c){!this._models[c]||delete this._models[c]}computeDiff(c,l){const t=this._getModel(c),s=this._getModel(l);return{cellsDiff:new B.LcsDiff(new N(t),new N(s)).ComputeDiff(!1)}}_getModel(c){return this._models[c]}}e.NotebookEditorSimpleWorker=_;function P(b){return new _}e.create=P})}).call(this);
//# sourceMappingURL=notebookSimpleWorker.js.map