goview_vue/dist/static/js/editorWorker-43a98755.js

10 lines
222 KiB
JavaScript
Raw Normal View History

2023-06-06 11:55:37 +08:00
var je;const ke="en";let Be=!1,Ie=!1,Ee=!1,B1=!1,mt=!1,gt=!1,xe,De=ke,hn,J;const V=typeof self=="object"?self:typeof global=="object"?global:{};let I;typeof V.vscode!="undefined"&&typeof V.vscode.process!="undefined"?I=V.vscode.process:typeof process!="undefined"&&(I=process);const dn=typeof((je=I==null?void 0:I.versions)===null||je===void 0?void 0:je.electron)=="string",mn=dn&&(I==null?void 0:I.type)==="renderer";if(typeof navigator=="object"&&!mn)J=navigator.userAgent,Be=J.indexOf("Windows")>=0,Ie=J.indexOf("Macintosh")>=0,gt=(J.indexOf("Macintosh")>=0||J.indexOf("iPad")>=0||J.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ee=J.indexOf("Linux")>=0,mt=!0,xe=navigator.language,De=xe;else if(typeof I=="object"){Be=I.platform==="win32",Ie=I.platform==="darwin",Ee=I.platform==="linux",Ee&&I.env.SNAP&&I.env.SNAP_REVISION,I.env.CI||I.env.BUILD_ARTIFACTSTAGINGDIRECTORY,xe=ke,De=ke;const e=I.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),n=t.availableLanguages["*"];xe=t.locale,De=n||ke,hn=t._translationsConfigFile}catch(t){}B1=!0}else console.error("Unable to resolve platform.");const _e=Be,gn=Ie,gs=Ee,bs=B1,bn=mt,ws=mt&&typeof V.importScripts=="function",Cs=gt,j=J,_s=De,ps=(()=>{if(typeof V.postMessage=="function"&&!V.importScripts){let e=[];V.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let s=0,i=e.length;s<i;s++){const a=e[s];if(a.id===n.data.vscodeScheduleAsyncWork){e.splice(s,1),a.callback();return}}});let t=0;return n=>{const s=++t;e.push({id:s,callback:n}),V.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),Ls=Ie||gt?2:Be?1:3;let At=!0,yt=!1;function Ns(){if(!yt){yt=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2,At=new Uint16Array(e.buffer)[0]===512+1}return At}const wn=!!(j&&j.indexOf("Chrome")>=0),Ss=!!(j&&j.indexOf("Firefox")>=0),vs=!!(!wn&&j&&j.indexOf("Safari")>=0),As=!!(j&&j.indexOf("Edg/")>=0);j&&j.indexOf("Android")>=0;const Cn="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function _n(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const n of Cn)e.indexOf(n)>=0||(t+="\\"+n);return t+="\\s]+)",new RegExp(t,"g")}const I1=_n();function pn(e){let t=I1;if(e&&e instanceof RegExp)if(e.global)t=e;else{let n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}const Ln={maxLen:1e3,windowSize:15,timeBudget:150};function bt(e,t,n,s,i=Ln){if(n.length>i.maxLen){let u=e-i.maxLen/2;return u<0?u=0:s+=u,n=n.substring(u,e+i.maxLen/2),bt(e,t,n,s,i)}const a=Date.now(),o=e-1-s;let l=-1,c=null;for(let u=1;!(Date.now()-a>=i.timeBudget);u++){const h=o-i.windowSize*u;t.lastIndex=Math.max(0,h);const f=Nn(t,n,o,l);if(!f&&c||(c=f,h<=0))break;l=h}if(c){const u={word:c[0],startColumn:s+1+c.index,endColumn:s+1+c.index+c[0].length};return t.lastIndex=0,u}return null}function Nn(e,t,n,s){let i;for(;i=e.exec(t);){const a=i.index||0;if(a<=n&&e.lastIndex>=n)return i;if(s>0&&a>s)return null}return null}function ys(e,t=0){return e[e.length-(1+t)]}function Ms(e){if(e.length===0)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function xs(e,t,n=(s,i)=>s===i){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let s=0,i=e.length;s<i;s++)if(!n(e[s],t[s]))return!1;return!0}function Fs(e,t,n){let s=0,i=e.length-1;for(;s<=i;){const a=(s+i)/2|0,o=n(e[a],t);if(o<0)s=a+1;else if(o>0)i=a-1;else return a}return-(s+1)}function ks(e,t){let n=0,s=e.length;if(s===0)return 0;for(;n<s;){const i=Math.floor((n+s)/2);t(e[i])?s=i:n=i+1}return n}function Mt(e,t,n){if(e=e|0,e>=t.length)throw new TypeError("invalid index");let s=t[Math.floor(t.length*Math.random())],i=[],a=[],o=[];for(let l of t){const c=n(l,s);c<0?i.push(l):c>0?a.push(l):o.push(l)}return e<i.length?Mt(e,i,n):e<i.length+o.length?o[0]:Mt(e-(i.length+o.length),a,n)}function Es(e,t){const n=[];let s;for(const i of e.slice(0).sort(t))!s||t(s[0],i)!==0?(s=[i],n.push(s)):s.push(i);return n}function Ds(e){return e.filter(t=>!!t)}function Rs(e){return!Array.isArray(e)||e.length===0}function Ps(e){return Array.isArray(e)&&e.length>0}function
`+t.stack):t},0)}}emit(t){this.listeners.forEach(n=>{n(t)})}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}}const q1=new In;function Un(e){H1(e)||q1.onUnexpectedError(e)}function ai(e){H1(e)||q1.onUnexpectedExternalError(e)}function xt(e){if(e instanceof Error){let{name:t,message:n}=e;const s=e.stacktrace||e.stack;return{$isError:!0,name:t,message:n,stack:s}}return e}const Ue="Canceled";function H1(e){return e instanceof Tn?!0:e instanceof Error&&e.name===Ue&&e.message===Ue}class Tn extends Error{constructor(){super(Ue),this.name=this.message}}function oi(){const e=new Error(Ue);return e.name=e.message,e}function li(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function ui(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}class ci extends Error{constructor(t){super("NotSupported"),t&&(this.message=t)}}function Wn(e){const t=this;let n=!1,s;return function(){return n||(n=!0,s=e.apply(t,arguments)),s}}var Je;(function(e){function t(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}e.is=t;const n=Object.freeze([]);function s(){return n}e.empty=s;function*i(C){yield C}e.single=i;function a(C){return C||n}e.from=a;function o(C){return!C||C[Symbol.iterator]().next().done===!0}e.isEmpty=o;function l(C){return C[Symbol.iterator]().next().value}e.first=l;function c(C,p){for(const g of C)if(p(g))return!0;return!1}e.some=c;function u(C,p){for(const g of C)if(p(g))return g}e.find=u;function*h(C,p){for(const g of C)p(g)&&(yield g)}e.filter=h;function*f(C,p){let g=0;for(const m of C)yield p(m,g++)}e.map=f;function*d(...C){for(const p of C)for(const g of p)yield g}e.concat=d;function*w(C){for(const p of C)for(const g of p)yield g}e.concatNested=w;function S(C,p,g){let m=g;for(const L of C)m=p(m,L);return m}e.reduce=S;function*v(C,p,g=C.length){for(p<0&&(p+=C.length),g<0?g+=C.length:g>C.length&&(g=C.length);p<g;p++)yield C[p]}e.slice=v;function M(C,p=Number.POSITIVE_INFINITY){const g=[];if(p===0)return[g,C];const m=C[Symbol.iterator]();for(let L=0;L<p;L++){const _=m.next();if(_.done)return[g,e.empty()];g.push(_.value)}return[g,{[Symbol.iterator](){return m}}]}e.consume=M;function E(C,p,g=(m,L)=>m===L){const m=C[Symbol.iterator](),L=p[Symbol.iterator]();for(;;){const _=m.next(),b=L.next();if(_.done!==b.done)return!1;if(_.done)return!0;if(!g(_.value,b.value))return!1}}e.equals=E})(Je||(Je={}));function fi(e){return e}class qn extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`),this.errors=t}}function hi(e){return typeof e.dispose=="function"&&e.dispose.length===0}function z1(e){if(Je.is(e)){let t=[];for(const n of e)if(n)try{n.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new qn(t);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Hn(...e){return Te(()=>z1(e))}function Te(e){return{dispose:Wn(()=>{e()})}}class he{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){try{z1(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?he.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}}he.DISABLE_DISPOSED_WARNING=!1;class ve{constructor(){this._store=new he,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}ve.None=Object.freeze({dispose(){}});class di{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){var n;this._isDisposed||t===this._value||((n=this._value)===null||n===void 0||n.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){var t;this._isDis
`).slice(2).join(`
`))}}class $n{constructor(t,n,s){this.callback=t,this.callbackThis=n,this.stack=s,this.subscription=new zn}invoke(t){this.callback.call(this.callbackThis,t)}}class ${constructor(t){var n;this._disposed=!1,this._options=t,this._leakageMon=void 0,this._perfMon=!((n=this._options)===null||n===void 0)&&n._profName?new Ge(this._options._profName):void 0}dispose(){var t,n,s,i;this._disposed||(this._disposed=!0,this._listeners&&this._listeners.clear(),(t=this._deliveryQueue)===null||t===void 0||t.clear(),(s=(n=this._options)===null||n===void 0?void 0:n.onLastListenerRemove)===null||s===void 0||s.call(n),(i=this._leakageMon)===null||i===void 0||i.dispose())}get event(){return this._event||(this._event=(t,n,s)=>{var i,a,o;this._listeners||(this._listeners=new Xe);const l=this._listeners.isEmpty();l&&(!((i=this._options)===null||i===void 0)&&i.onFirstListenerAdd)&&this._options.onFirstListenerAdd(this);let c,u;this._leakageMon&&this._listeners.size>=30&&(u=wt.create(),c=this._leakageMon.check(u,this._listeners.size+1));const h=new $n(t,n,u),f=this._listeners.push(h);l&&(!((a=this._options)===null||a===void 0)&&a.onFirstListenerDidAdd)&&this._options.onFirstListenerDidAdd(this),!((o=this._options)===null||o===void 0)&&o.onListenerDidAdd&&this._options.onListenerDidAdd(this,t,n);const d=h.subscription.set(()=>{c&&c(),this._disposed||(f(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return s instanceof he?s.add(d):Array.isArray(s)&&s.push(d),d}),this._event}fire(t){var n,s;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Xe);for(let i of this._listeners)this._deliveryQueue.push([i,t]);for((n=this._perfMon)===null||n===void 0||n.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,a]=this._deliveryQueue.shift();try{i.invoke(a)}catch(o){Un(o)}}(s=this._perfMon)===null||s===void 0||s.stop()}}}class Gn extends ${constructor(t){super(t),this._isPaused=0,this._eventQueue=new Xe,this._mergeFn=t==null?void 0:t.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const t=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(t))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(t){this._listeners&&(this._isPaused!==0?this._eventQueue.push(t):super.fire(t))}}class gi extends Gn{constructor(t){var n;super(t),this._delay=(n=t.delay)!==null&&n!==void 0?n:100}fire(t){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(t)}}class bi{constructor(){this.buffers=[]}wrapEvent(t){return(n,s,i)=>t(a=>{const o=this.buffers[this.buffers.length-1];o?o.push(()=>n.call(s,a)):n.call(s,a)},void 0,i)}bufferEvents(t){const n=[];this.buffers.push(n);const s=t();return this.buffers.pop(),n.forEach(i=>i()),s}}class wi{constructor(){this.listening=!1,this.inputEvent=We.None,this.inputEventListener=ve.None,this.emitter=new $({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(t){this.inputEvent=t,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=t(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const O1=Object.freeze(function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}});var qe;(function(e){function t(n){return n===e.None||n===e.Cancelled||n instanceof Pe?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:We.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:O1})})(qe||(qe={}));class Pe{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._is
`)>=0;let n=null;try{n=_r(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:t,global:!0,unicode:!0})}catch(i){return null}if(!n)return null;let s=!this.isRegex&&!t;return s&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(s=this.matchCase),new Vr(n,this.wordSeparators?os(this.wordSeparators):null,s?this.searchString:null)}}function us(e){if(!e||e.length===0)return!1;for(let t=0,n=e.length;t<n;t++)if(e.charCodeAt(t)===92){if(t++,t>=n)break;const i=e.charCodeAt(t);if(i===110||i===114||i===87)return!0}return!1}function ge(e,t,n){if(!n)return new ct(e,null);const s=[];for(let i=0,a=t.length;i<a;i++)s[i]=t[i];return new ct(e,s)}class R1{constructor(t){const n=[];let s=0;for(let i=0,a=t.length;i<a;i++)t.charCodeAt(i)===10&&(n[s++]=i);this._lineFeedsOffsets=n}findLineFeedCountBeforeOffset(t){const n=this._lineFeedsOffsets;let s=0,i=n.length-1;if(i===-1||t<=n[0])return 0;for(;s<i;){const a=s+((i-s)/2>>0);n[a]>=t?i=a-1:n[a+1]>=t?(s=a,i=a):s=a+1}return s+1}}class da{static findMatches(t,n,s,i,a){const o=n.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(t,s,new we(o.wordSeparators,o.regex),i,a):this._doFindMatchesLineByLine(t,s,o,i,a):[]}static _getMultilineMatchRange(t,n,s,i,a,o){let l,c=0;i?(c=i.findLineFeedCountBeforeOffset(a),l=n+a+c):l=n+a;let u;if(i){const w=i.findLineFeedCountBeforeOffset(a+o.length)-c;u=l+o.length+w}else u=l+o.length;const h=t.getPositionAt(l),f=t.getPositionAt(u);return new k(h.lineNumber,h.column,f.lineNumber,f.column)}static _doFindMatchesMultiline(t,n,s,i,a){const o=t.getOffsetAt(n.getStartPosition()),l=t.getValueInRange(n,1),c=t.getEOL()===`\r
`?new R1(l):null,u=[];let h=0,f;for(s.reset(0);f=s.next(l);)if(u[h++]=ge(this._getMultilineMatchRange(t,o,l,c,f.index,f[0]),f,i),h>=a)return u;return u}static _doFindMatchesLineByLine(t,n,s,i,a){const o=[];let l=0;if(n.startLineNumber===n.endLineNumber){const u=t.getLineContent(n.startLineNumber).substring(n.startColumn-1,n.endColumn-1);return l=this._findMatchesInLine(s,u,n.startLineNumber,n.startColumn-1,l,o,i,a),o}const c=t.getLineContent(n.startLineNumber).substring(n.startColumn-1);l=this._findMatchesInLine(s,c,n.startLineNumber,n.startColumn-1,l,o,i,a);for(let u=n.startLineNumber+1;u<n.endLineNumber&&l<a;u++)l=this._findMatchesInLine(s,t.getLineContent(u),u,0,l,o,i,a);if(l<a){const u=t.getLineContent(n.endLineNumber).substring(0,n.endColumn-1);l=this._findMatchesInLine(s,u,n.endLineNumber,0,l,o,i,a)}return o}static _findMatchesInLine(t,n,s,i,a,o,l,c){const u=t.wordSeparators;if(!l&&t.simpleSearch){const d=t.simpleSearch,w=d.length,S=n.length;let v=-w;for(;(v=n.indexOf(d,v+w))!==-1;)if((!u||ln(u,n,S,v,w))&&(o[a++]=new ct(new k(s,v+1+i,s,v+1+w+i),null),a>=c))return a;return a}const h=new we(t.wordSeparators,t.regex);let f;h.reset(0);do if(f=h.next(n),f&&(o[a++]=ge(new k(s,f.index+1+i,s,f.index+1+f[0].length+i),f,l),a>=c))return a;while(f);return a}static findNextMatch(t,n,s,i){const a=n.parseSearchRequest();if(!a)return null;const o=new we(a.wordSeparators,a.regex);return a.regex.multiline?this._doFindNextMatchMultiline(t,s,o,i):this._doFindNextMatchLineByLine(t,s,o,i)}static _doFindNextMatchMultiline(t,n,s,i){const a=new U(n.lineNumber,1),o=t.getOffsetAt(a),l=t.getLineCount(),c=t.getValueInRange(new k(a.lineNumber,a.column,l,t.getLineMaxColumn(l)),1),u=t.getEOL()===`\r
`?new R1(c):null;s.reset(n.column-1);let h=s.next(c);return h?ge(this._getMultilineMatchRange(t,o,c,u,h.index,h[0]),h,i):n.lineNumber!==1||n.column!==1?this._doFindNextMatchMultiline(t,new U(1,1),s,i):null}static _doFindNextMatchLineByLine(t,n,s,i){const a=t.getLineCount(),o=n.lineNumber,l=t.getLineContent(o),c=this._findFirstMatchInLine(s,l,o,n.column,i);if(c)return c;for(let u=1;u<=a;u++){const h=(o+u-1)%a,f=t.getLineContent(h+1),d=this._findFirstMatchInLine(s,f,h+1,1,i);if(d)return d}return null}static _findFirstMatchInLine(t,n,s,i,a){t.reset(i-1);const o=t.next(n);return o?ge(new k(s,o.index+1,s,o.index+1+o[0].length),o,a):null}static findPreviousMatch(t,n,s,i){const a=n.parseSearchRequest();if(!a)return null;const o=new we(a.wordSeparators,a.regex);return a.regex.multiline?this._doFindPreviousMatchMultiline(t,s,o,i):this._doFindPreviousMatchLineByLine(t,s,o,i)}static _doFindPreviousMatchMultiline(t,n,s,i){const a=this._doFindMatchesMultiline(t,new k(1,1,n.lineNumber,n.column),s,i,10*ls);if(a.length>0)return a[a.length-1];const o=t.getLineCount();return n.lineNumber!==o||n.column!==t.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(t,new U(o,t.getLineMaxColumn(o)),s,i):null}static _doFindPreviousMatchLineByLine(t,n,s,i){const a=t.getLineCount(),o=n.lineNumber,l=t.getLineContent(o).substring(0,n.column-1),c=this._findLastMatchInLine(s,l,o,i);if(c)return c;for(let u=1;u<=a;u++){const h=(a+o-u-1)%a,f=t.getLineContent(h+1),d=this._findLastMatchInLine(s,f,h+1,i);if(d)return d}return null}static _findLastMatchInLine(t,n,s,i){let a=null,o;for(t.reset(0);o=t.next(n);)a=ge(new k(s,o.index+1,s,o.index+1+o[0].length),o,i);return a}}function cs(e,t,n,s,i){if(s===0)return!0;const a=t.charCodeAt(s-1);if(e.get(a)!==0||a===13||a===10)return!0;if(i>0){const o=t.charCodeAt(s);if(e.get(o)!==0)return!0}return!1}function fs(e,t,n,s,i){if(s+i===n)return!0;const a=t.charCodeAt(s+i);if(e.get(a)!==0||a===13||a===10)return!0;if(i>0){const o=t.charCodeAt(s+i-1);if(e.get(o)!==0)return!0}return!1}function ln(e,t,n,s,i){return cs(e,t,n,s,i)&&fs(e,t,n,s,i)}class we{constructor(t,n){this._wordSeparators=t,this._searchRegex=n,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(t){this._searchRegex.lastIndex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(t){const n=t.length;let s;do{if(this._prevMatchStartIndex+this._prevMatchLength===n||(s=this._searchRegex.exec(t),!s))return null;const i=s.index,a=s[0].length;if(i===this._prevMatchStartIndex&&a===this._prevMatchLength){if(a===0){tn(t,n,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=i,this._prevMatchLength=a,!this._wordSeparators||ln(this._wordSeparators,t,n,i,a))return s}while(s);return null}}class hs{static computeUnicodeHighlights(t,n,s){const i=s?s.startLineNumber:1,a=s?s.endLineNumber:t.getLineCount(),o=new P1(n),l=o.getCandidateCodePoints();let c;l==="allNonBasicAscii"?c=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):c=new RegExp(`${ds(Array.from(l))}`,"g");const u=new we(null,c),h=[];let f=!1,d,w=0,S=0,v=0;e:for(let M=i,E=a;M<=E;M++){const C=t.getLineContent(M),p=C.length;u.reset(0);do if(d=u.next(C),d){let g=d.index,m=d.index+d[0].length;if(g>0){const N=C.charCodeAt(g-1);pe(N)&&g--}if(m+1<p){const N=C.charCodeAt(m-1);pe(N)&&m++}const L=C.substring(g,m),_=bt(g+1,I1,C,0),b=o.shouldHighlightNonBasicASCII(L,_?_.word:null);if(b!==0){b===3?w++:b===2?S++:b===1?v++:Pn();const N=1e3;if(h.length>=N){f=!0;break e}h.push(new k(M,g+1,M,m+1))}}while(d)}return{ranges:h,hasMore:f,ambiguousCharacterCount:w,invisibleCharacterCount:S,nonBasicAsciiCharacterCount:v}}static computeUnicodeHighlightReason(t,n){const s=new P1(n);switch(s.shouldHighlightNonBasicASCII(t,null)){case 0:return null;case 2:return{kind:1};case 3:{const a=t.codePointAt(0),o=s.ambiguousCharacters.getPrimaryConfusable(a),l=z.getLocales().filter(c=>!z.getInstance(new Set([...n.allowedLocales,c])).isAmbiguous(a));return{kind:0,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:l}}case 1:return{kind:2}}}}function ds
`||e===" "}var se=globalThis&&globalThis.__awaiter||function(e,t,n,s){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(f){o(f)}}function c(h){try{u(s.throw(h))}catch(f){o(f)}}function u(h){h.done?a(h.value):i(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};class ms extends Kr{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(t){return this._lines[t-1]}getWordAtPosition(t,n){const s=bt(t.column,pn(n),this._lines[t.lineNumber-1],0);return s?new k(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):null}words(t){const n=this._lines,s=this._wordenize.bind(this);let i=0,a="",o=0,l=[];return{*[Symbol.iterator](){for(;;)if(o<l.length){const c=a.substring(l[o].start,l[o].end);o+=1,yield c}else if(i<n.length)a=n[i],l=s(a,t),o=0,i+=1;else break}}}getLineWords(t,n){const s=this._lines[t-1],i=this._wordenize(s,n),a=[];for(const o of i)a.push({word:s.substring(o.start,o.end),startColumn:o.start+1,endColumn:o.end+1});return a}_wordenize(t,n){const s=[];let i;for(n.lastIndex=0;(i=n.exec(t))&&i[0].length!==0;)s.push({start:i.index,end:i.index+i[0].length});return s}getValueInRange(t){if(t=this._validateRange(t),t.startLineNumber===t.endLineNumber)return this._lines[t.startLineNumber-1].substring(t.startColumn-1,t.endColumn-1);const n=this._eol,s=t.startLineNumber-1,i=t.endLineNumber-1,a=[];a.push(this._lines[s].substring(t.startColumn-1));for(let o=s+1;o<i;o++)a.push(this._lines[o]);return a.push(this._lines[i].substring(0,t.endColumn-1)),a.join(n)}offsetAt(t){return t=this._validatePosition(t),this._ensureLineStarts(),this._lineStarts.getPrefixSum(t.lineNumber-2)+(t.column-1)}positionAt(t){t=Math.floor(t),t=Math.max(0,t),this._ensureLineStarts();const n=this._lineStarts.getIndexOf(t),s=this._lines[n.index].length;return{lineNumber:1+n.index,column:1+Math.min(n.remainder,s)}}_validateRange(t){const n=this._validatePosition({lineNumber:t.startLineNumber,column:t.startColumn}),s=this._validatePosition({lineNumber:t.endLineNumber,column:t.endColumn});return n.lineNumber!==t.startLineNumber||n.column!==t.startColumn||s.lineNumber!==t.endLineNumber||s.column!==t.endColumn?{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:s.lineNumber,endColumn:s.column}:t}_validatePosition(t){if(!U.isIPosition(t))throw new Error("bad position");let{lineNumber:n,column:s}=t,i=!1;if(n<1)n=1,s=1,i=!0;else if(n>this._lines.length)n=this._lines.length,s=this._lines[n-1].length+1,i=!0;else{const a=this._lines[n-1].length+1;s<1?(s=1,i=!0):s>a&&(s=a,i=!0)}return i?{lineNumber:n,column:s}:t}}class Se{constructor(t,n){this._host=t,this._models=Object.create(null),this._foreignModuleFactory=n,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(t){return this._models[t]}_getModels(){const t=[];return Object.keys(this._models).forEach(n=>t.push(this._models[n])),t}acceptNewModel(t){this._models[t.url]=new ms(ne.parse(t.url),t.lines,t.EOL,t.versionId)}acceptModelChanged(t,n){if(!this._models[t])return;this._models[t].onEvents(n)}acceptRemovedModel(t){this._models[t]&&delete this._models[t]}computeUnicodeHighlights(t,n,s){return se(this,void 0,void 0,function*(){const i=this._getModel(t);return i?hs.computeUnicodeHighlights(i,n,s):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(t,n,s,i){return se(this,void 0,void 0,function*(){const a=this._getModel(t),o=this._getModel(n);if(!a||!o)return null;const l=a.getLinesContent(),c=o.getLinesContent(),h=new Jr(l,c,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:s,shouldMakePrettyDiff:!0,maxComputationTime:i}).computeDiff(),f=h.changes.length>0?!1:this._modelsAreIdentical(a,o);return{quitEarly:h.quitEarly,identical:f,changes:h.changes}})}_modelsAreIdentical(t,n){const s=t.getLineCount(),i=n.getLineCount();if(s!==i)return!1;for(let a=1;a<=s;a++){const