monaco-editor
Version:
A browser based code editor
2 lines (1 loc) • 14.6 kB
JavaScript
define("vs/index-049xrXrp",["exports"],(function(E){"use strict";function M(...m){const o=m[0];let f,d,a;if(typeof o=="string")f=o,d=o,m.splice(0,1),a=!m||typeof m[0]!="object"?m:m[0];else if(o instanceof Array){const g=m.slice(1);if(o.length!==g.length+1)throw new Error("expected a string as the first argument to l10n.t");let b=o[0];for(let w=1;w<o.length;w++)b+=`{${w-1}}`+o[w];return M(b,...g)}else d=o.message,f=d,o.comment&&o.comment.length>0&&(f+=`/${Array.isArray(o.comment)?o.comment.join(""):o.comment}`),a=o.args??{};return Z(d,a)}var W=/{([^}]+)}/g;function Z(m,o){return Object.keys(o).length===0?m:m.replace(W,(f,d)=>o[d]??f)}class L{constructor(o,f,d,a){this._uri=o,this._languageId=f,this._version=d,this._content=a,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(o){if(o){const f=this.offsetAt(o.start),d=this.offsetAt(o.end);return this._content.substring(f,d)}return this._content}update(o,f){for(let d of o)if(L.isIncremental(d)){const a=B(d.range),g=this.offsetAt(a.start),b=this.offsetAt(a.end);this._content=this._content.substring(0,g)+d.text+this._content.substring(b,this._content.length);const w=Math.max(a.start.line,0),t=Math.max(a.end.line,0);let e=this._lineOffsets;const r=z(d.text,!1,g);if(t-w===r.length)for(let s=0,c=r.length;s<c;s++)e[s+w+1]=r[s];else r.length<1e4?e.splice(w+1,t-w,...r):this._lineOffsets=e=e.slice(0,w+1).concat(r,e.slice(t+1));const i=d.text.length-(b-g);if(i!==0)for(let s=w+1+r.length,c=e.length;s<c;s++)e[s]=e[s]+i}else if(L.isFull(d))this._content=d.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=f}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=z(this._content,!0)),this._lineOffsets}positionAt(o){o=Math.max(Math.min(o,this._content.length),0);let f=this.getLineOffsets(),d=0,a=f.length;if(a===0)return{line:0,character:o};for(;d<a;){let b=Math.floor((d+a)/2);f[b]>o?a=b:d=b+1}let g=d-1;return{line:g,character:o-f[g]}}offsetAt(o){let f=this.getLineOffsets();if(o.line>=f.length)return this._content.length;if(o.line<0)return 0;let d=f[o.line],a=o.line+1<f.length?f[o.line+1]:this._content.length;return Math.max(Math.min(d+o.character,a),d)}get lineCount(){return this.getLineOffsets().length}static isIncremental(o){let f=o;return f!=null&&typeof f.text=="string"&&f.range!==void 0&&(f.rangeLength===void 0||typeof f.rangeLength=="number")}static isFull(o){let f=o;return f!=null&&typeof f.text=="string"&&f.range===void 0&&f.rangeLength===void 0}}E.TextDocument=void 0,(function(m){function o(a,g,b,w){return new L(a,g,b,w)}m.create=o;function f(a,g,b){if(a instanceof L)return a.update(g,b),a;throw new Error("TextDocument.update: document must be created by TextDocument.create")}m.update=f;function d(a,g){let b=a.getText(),w=R(g.map(G),(r,i)=>{let s=r.range.start.line-i.range.start.line;return s===0?r.range.start.character-i.range.start.character:s}),t=0;const e=[];for(const r of w){let i=a.offsetAt(r.range.start);if(i<t)throw new Error("Overlapping edit");i>t&&e.push(b.substring(t,i)),r.newText.length&&e.push(r.newText),t=a.offsetAt(r.range.end)}return e.push(b.substr(t)),e.join("")}m.applyEdits=d})(E.TextDocument||(E.TextDocument={}));function R(m,o){if(m.length<=1)return m;const f=m.length/2|0,d=m.slice(0,f),a=m.slice(f);R(d,o),R(a,o);let g=0,b=0,w=0;for(;g<d.length&&b<a.length;)o(d[g],a[b])<=0?m[w++]=d[g++]:m[w++]=a[b++];for(;g<d.length;)m[w++]=d[g++];for(;b<a.length;)m[w++]=a[b++];return m}function z(m,o,f=0){const d=o?[f]:[];for(let a=0;a<m.length;a++){let g=m.charCodeAt(a);(g===13||g===10)&&(g===13&&a+1<m.length&&m.charCodeAt(a+1)===10&&a++,d.push(f+a+1))}return d}function B(m){const o=m.start,f=m.end;return o.line>f.line||o.line===f.line&&o.character>f.character?{start:f,end:o}:m}function G(m){const o=B(m.range);return o!==m.range?{newText:m.newText,range:o}:m}var D;(()=>{var m={470:a=>{function g(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function b(t,e){for(var r,i="",s=0,c=-1,p=0,y=0;y<=t.length;++y){if(y<t.length)r=t.charCodeAt(y);else{if(r===47)break;r=47}if(r===47){if(!(c===y-1||p===1))if(c!==y-1&&p===2){if(i.length<2||s!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var x=i.lastIndexOf("/");if(x!==i.length-1){x===-1?(i="",s=0):s=(i=i.slice(0,x)).length-1-i.lastIndexOf("/"),c=y,p=0;continue}}else if(i.length===2||i.length===1){i="",s=0,c=y,p=0;continue}}e&&(i.length>0?i+="/..":i="..",s=2)}else i.length>0?i+="/"+t.slice(c+1,y):i=t.slice(c+1,y),s=y-c-1;c=y,p=0}else r===46&&p!==-1?++p:p=-1}return i}var w={resolve:function(){for(var t,e="",r=!1,i=arguments.length-1;i>=-1&&!r;i--){var s;i>=0?s=arguments[i]:(t===void 0&&(t=process.cwd()),s=t),g(s),s.length!==0&&(e=s+"/"+e,r=s.charCodeAt(0)===47)}return e=b(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(g(t),t.length===0)return".";var e=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return(t=b(t,!e)).length!==0||e||(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return g(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];g(r),r.length>0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":w.normalize(t)},relative:function(t,e){if(g(t),g(e),t===e||(t=w.resolve(t))===(e=w.resolve(e)))return"";for(var r=1;r<t.length&&t.charCodeAt(r)===47;++r);for(var i=t.length,s=i-r,c=1;c<e.length&&e.charCodeAt(c)===47;++c);for(var p=e.length-c,y=s<p?s:p,x=-1,C=0;C<=y;++C){if(C===y){if(p>y){if(e.charCodeAt(c+C)===47)return e.slice(c+C+1);if(C===0)return e.slice(c+C)}else s>y&&(t.charCodeAt(r+C)===47?x=C:C===0&&(x=0));break}var P=t.charCodeAt(r+C);if(P!==e.charCodeAt(c+C))break;P===47&&(x=C)}var j="";for(C=r+x+1;C<=i;++C)C!==i&&t.charCodeAt(C)!==47||(j.length===0?j+="..":j+="/..");return j.length>0?j+e.slice(c+x):(c+=x,e.charCodeAt(c)===47&&++c,e.slice(c))},_makeLong:function(t){return t},dirname:function(t){if(g(t),t.length===0)return".";for(var e=t.charCodeAt(0),r=e===47,i=-1,s=!0,c=t.length-1;c>=1;--c)if((e=t.charCodeAt(c))===47){if(!s){i=c;break}}else s=!1;return i===-1?r?"/":".":r&&i===1?"//":t.slice(0,i)},basename:function(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');g(t);var r,i=0,s=-1,c=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var p=e.length-1,y=-1;for(r=t.length-1;r>=0;--r){var x=t.charCodeAt(r);if(x===47){if(!c){i=r+1;break}}else y===-1&&(c=!1,y=r+1),p>=0&&(x===e.charCodeAt(p)?--p==-1&&(s=r):(p=-1,s=y))}return i===s?s=y:s===-1&&(s=t.length),t.slice(i,s)}for(r=t.length-1;r>=0;--r)if(t.charCodeAt(r)===47){if(!c){i=r+1;break}}else s===-1&&(c=!1,s=r+1);return s===-1?"":t.slice(i,s)},extname:function(t){g(t);for(var e=-1,r=0,i=-1,s=!0,c=0,p=t.length-1;p>=0;--p){var y=t.charCodeAt(p);if(y!==47)i===-1&&(s=!1,i=p+1),y===46?e===-1?e=p:c!==1&&(c=1):e!==-1&&(c=-1);else if(!s){r=p+1;break}}return e===-1||i===-1||c===0||c===1&&e===i-1&&e===r+1?"":t.slice(e,i)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return(function(e,r){var i=r.dir||r.root,s=r.base||(r.name||"")+(r.ext||"");return i?i===r.root?i+s:i+"/"+s:s})(0,t)},parse:function(t){g(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;var r,i=t.charCodeAt(0),s=i===47;s?(e.root="/",r=1):r=0;for(var c=-1,p=0,y=-1,x=!0,C=t.length-1,P=0;C>=r;--C)if((i=t.charCodeAt(C))!==47)y===-1&&(x=!1,y=C+1),i===46?c===-1?c=C:P!==1&&(P=1):c!==-1&&(P=-1);else if(!x){p=C+1;break}return c===-1||y===-1||P===0||P===1&&c===y-1&&c===p+1?y!==-1&&(e.base=e.name=p===0&&s?t.slice(1,y):t.slice(p,y)):(p===0&&s?(e.name=t.slice(1,c),e.base=t.slice(1,y)):(e.name=t.slice(p,c),e.base=t.slice(p,y)),e.ext=t.slice(c,y)),p>0?e.dir=t.slice(0,p-1):s&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};w.posix=w,a.exports=w}},o={};function f(a){var g=o[a];if(g!==void 0)return g.exports;var b=o[a]={exports:{}};return m[a](b,b.exports,f),b.exports}f.d=(a,g)=>{for(var b in g)f.o(g,b)&&!f.o(a,b)&&Object.defineProperty(a,b,{enumerable:!0,get:g[b]})},f.o=(a,g)=>Object.prototype.hasOwnProperty.call(a,g),f.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var d={};(()=>{let a;f.r(d),f.d(d,{URI:()=>s,Utils:()=>k}),typeof process=="object"?a=process.platform==="win32":typeof navigator=="object"&&(a=navigator.userAgent.indexOf("Windows")>=0);const g=/^\w[\w\d+.-]*$/,b=/^\//,w=/^\/\//;function t(h,n){if(!h.scheme&&n)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${h.authority}", path: "${h.path}", query: "${h.query}", fragment: "${h.fragment}"}`);if(h.scheme&&!g.test(h.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(h.path){if(h.authority){if(!b.test(h.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(w.test(h.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const e="",r="/",i=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class s{static isUri(n){return n instanceof s||!!n&&typeof n.authority=="string"&&typeof n.fragment=="string"&&typeof n.path=="string"&&typeof n.query=="string"&&typeof n.scheme=="string"&&typeof n.fsPath=="string"&&typeof n.with=="function"&&typeof n.toString=="function"}scheme;authority;path;query;fragment;constructor(n,u,l,_,A,v=!1){typeof n=="object"?(this.scheme=n.scheme||e,this.authority=n.authority||e,this.path=n.path||e,this.query=n.query||e,this.fragment=n.fragment||e):(this.scheme=(function(U,I){return U||I?U:"file"})(n,v),this.authority=u||e,this.path=(function(U,I){switch(U){case"https":case"http":case"file":I?I[0]!==r&&(I=r+I):I=r}return I})(this.scheme,l||e),this.query=_||e,this.fragment=A||e,t(this,v))}get fsPath(){return P(this)}with(n){if(!n)return this;let{scheme:u,authority:l,path:_,query:A,fragment:v}=n;return u===void 0?u=this.scheme:u===null&&(u=e),l===void 0?l=this.authority:l===null&&(l=e),_===void 0?_=this.path:_===null&&(_=e),A===void 0?A=this.query:A===null&&(A=e),v===void 0?v=this.fragment:v===null&&(v=e),u===this.scheme&&l===this.authority&&_===this.path&&A===this.query&&v===this.fragment?this:new p(u,l,_,A,v)}static parse(n,u=!1){const l=i.exec(n);return l?new p(l[2]||e,q(l[4]||e),q(l[5]||e),q(l[7]||e),q(l[9]||e),u):new p(e,e,e,e,e)}static file(n){let u=e;if(a&&(n=n.replace(/\\/g,r)),n[0]===r&&n[1]===r){const l=n.indexOf(r,2);l===-1?(u=n.substring(2),n=r):(u=n.substring(2,l),n=n.substring(l)||r)}return new p("file",u,n,e,e)}static from(n){const u=new p(n.scheme,n.authority,n.path,n.query,n.fragment);return t(u,!0),u}toString(n=!1){return j(this,n)}toJSON(){return this}static revive(n){if(n){if(n instanceof s)return n;{const u=new p(n);return u._formatted=n.external,u._fsPath=n._sep===c?n.fsPath:null,u}}return n}}const c=a?1:void 0;class p extends s{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=P(this)),this._fsPath}toString(n=!1){return n?j(this,!0):(this._formatted||(this._formatted=j(this,!1)),this._formatted)}toJSON(){const n={$mid:1};return this._fsPath&&(n.fsPath=this._fsPath,n._sep=c),this._formatted&&(n.external=this._formatted),this.path&&(n.path=this.path),this.scheme&&(n.scheme=this.scheme),this.authority&&(n.authority=this.authority),this.query&&(n.query=this.query),this.fragment&&(n.fragment=this.fragment),n}}const y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function x(h,n,u){let l,_=-1;for(let A=0;A<h.length;A++){const v=h.charCodeAt(A);if(v>=97&&v<=122||v>=65&&v<=90||v>=48&&v<=57||v===45||v===46||v===95||v===126||n&&v===47||u&&v===91||u&&v===93||u&&v===58)_!==-1&&(l+=encodeURIComponent(h.substring(_,A)),_=-1),l!==void 0&&(l+=h.charAt(A));else{l===void 0&&(l=h.substr(0,A));const U=y[v];U!==void 0?(_!==-1&&(l+=encodeURIComponent(h.substring(_,A)),_=-1),l+=U):_===-1&&(_=A)}}return _!==-1&&(l+=encodeURIComponent(h.substring(_))),l!==void 0?l:h}function C(h){let n;for(let u=0;u<h.length;u++){const l=h.charCodeAt(u);l===35||l===63?(n===void 0&&(n=h.substr(0,u)),n+=y[l]):n!==void 0&&(n+=h[u])}return n!==void 0?n:h}function P(h,n){let u;return u=h.authority&&h.path.length>1&&h.scheme==="file"?`//${h.authority}${h.path}`:h.path.charCodeAt(0)===47&&(h.path.charCodeAt(1)>=65&&h.path.charCodeAt(1)<=90||h.path.charCodeAt(1)>=97&&h.path.charCodeAt(1)<=122)&&h.path.charCodeAt(2)===58?h.path[1].toLowerCase()+h.path.substr(2):h.path,a&&(u=u.replace(/\//g,"\\")),u}function j(h,n){const u=n?C:x;let l="",{scheme:_,authority:A,path:v,query:U,fragment:I}=h;if(_&&(l+=_,l+=":"),(A||_==="file")&&(l+=r,l+=r),A){let O=A.indexOf("@");if(O!==-1){const $=A.substr(0,O);A=A.substr(O+1),O=$.lastIndexOf(":"),O===-1?l+=u($,!1,!1):(l+=u($.substr(0,O),!1,!1),l+=":",l+=u($.substr(O+1),!1,!0)),l+="@"}A=A.toLowerCase(),O=A.lastIndexOf(":"),O===-1?l+=u(A,!1,!0):(l+=u(A.substr(0,O),!1,!0),l+=A.substr(O))}if(v){if(v.length>=3&&v.charCodeAt(0)===47&&v.charCodeAt(2)===58){const O=v.charCodeAt(1);O>=65&&O<=90&&(v=`/${String.fromCharCode(O+32)}:${v.substr(3)}`)}else if(v.length>=2&&v.charCodeAt(1)===58){const O=v.charCodeAt(0);O>=65&&O<=90&&(v=`${String.fromCharCode(O+32)}:${v.substr(2)}`)}l+=u(v,!0,!1)}return U&&(l+="?",l+=u(U,!1,!1)),I&&(l+="#",l+=n?I:x(I,!1,!1)),l}function F(h){try{return decodeURIComponent(h)}catch{return h.length>3?h.substr(0,3)+F(h.substr(3)):h}}const J=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function q(h){return h.match(J)?h.replace(J,(n=>F(n))):h}var N=f(470);const S=N.posix||N,T="/";var k;(function(h){h.joinPath=function(n,...u){return n.with({path:S.join(n.path,...u)})},h.resolvePath=function(n,...u){let l=n.path,_=!1;l[0]!==T&&(l=T+l,_=!0);let A=S.resolve(l,...u);return _&&A[0]===T&&!n.authority&&(A=A.substring(1)),n.with({path:A})},h.dirname=function(n){if(n.path.length===0||n.path===T)return n;let u=S.dirname(n.path);return u.length===1&&u.charCodeAt(0)===46&&(u=""),n.with({path:u})},h.basename=function(n){return S.basename(n.path)},h.extname=function(n){return S.extname(n.path)}})(k||(k={}))})(),D=d})();const{URI:H,Utils:K}=D;E.URI=H,E.Utils=K,E.t=M}));