diff --git a/docs/bundle.js b/docs/bundle.js index b1a7956956..9a6e286cf2 100644 --- a/docs/bundle.js +++ b/docs/bundle.js @@ -393,4 +393,4 @@ e.exports={graphlib:n(647),dagre:n(239),intersect:n(685),render:n(687),util:n(17 * * Date: Tue, 23 Jan 2018 15:58:45 GMT */ -!function(e){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=void 0,r=n={VERSION:[2,5,3],content:[],cache:{},snakeskinRgxp:null,symbols:null,replace:E,paste:T},i={'"':!0,"'":!0,"`":!0},o={"/":!0};for(var s in i){if(!i.hasOwnProperty(s))break;o[s]=!0}var a={"//":!0,"//*":!0,"//!":!0,"//#":!0,"//@":!0,"//$":!0},u={"/*":!0,"/**":!0,"/*!":!0,"/*#":!0,"/*@":!0,"/*$":!0},c=[],l={};for(var d in o){if(!o.hasOwnProperty(d))break;c.push(d),l[d]=!0}for(var h in a){if(!a.hasOwnProperty(h))break;c.push(h),l[h]=!0}for(var f in u){if(!u.hasOwnProperty(f))break;c.push(f),l[f]=!0}var p=[],g={g:!0,m:!0,i:!0,y:!0,u:!0};for(var m in g){if(!g.hasOwnProperty(m))break;p.push(m)}var _={"-":!0,"+":!0,"*":!0,"%":!0,"~":!0,">":!0,"<":!0,"^":!0,",":!0,";":!0,"=":!0,"|":!0,"&":!0,"!":!0,"?":!0,":":!0,"(":!0,"{":!0,"[":!0},y={return:!0,yield:!0,await:!0,typeof:!0,void:!0,instanceof:!0,delete:!0,in:!0,new:!0,of:!0};function v(e,t,n){for(var r in e){if(!e.hasOwnProperty(r))break;r in t==0&&(t[r]=n)}}var b=void 0,w=void 0,C=/[^\s/]/,S=/[a-z]/,x=/\s/,k=/[\r\n]/,L=/\${pos}/g,M={object:!0,function:!0};function E(e,r,s,d){b=b||n.symbols||"a-z",w=w||n.snakeskinRgxp||new RegExp("[!$"+b+"_]","i");var h=n,f=h.cache,m=h.content,E=Boolean(r&&M[void 0===r?"undefined":t(r)]),D=E?Object(r):{};function T(e){return D["@label"]?D["@label"].replace(L,e):"__ESCAPER_QUOT__"+e+"_"}var N=!1;"boolean"==typeof r&&(N=Boolean(r)),"@comments"in D&&(v(u,D,D["@comments"]),v(a,D,D["@comments"]),delete D["@comments"]),"@strings"in D&&(v(i,D,D["@strings"]),delete D["@strings"]),"@literals"in D&&(v(o,D,D["@literals"]),delete D["@literals"]),"@all"in D&&(v(l,D,D["@all"]),delete D["@all"]);for(var O="",A=-1;++A2&&u[B])&&(D[B]&&(U=e.substring(H,$+1),-1===D[B]?q="":(q=T(R.length),R.push(U)),e=e.substring(0,H)+q+e.substring($+1),$+=q.length-U.length),B=!1);else{if(!F){if("/"===Z&&((a[X]||u[X])&&(B=a[Q]||u[Q]?Q:X),B)){H=$;continue}_[Z]||y[G]?(Y=!0,G=""):C.test(Z)&&(Y=!1),S.test(Z)?K+=Z:(G=K,K="");var ee=!1;d&&("|"===Z&&w.test(J)?(z=!0,Y=!1,ee=!0):z&&x.test(Z)&&(z=!1,Y=!0,ee=!0)),ee||(_[Z]?Y=!0:C.test(Z)&&(Y=!1))}if("/"!==F||j||("["===Z?W=!0:"]"===Z&&(W=!1)),!F&&V&&("}"===Z?V--:"{"===Z&&V++,V||(Z="`")),"`"!==F||j||"${"!==X||(Z="`",$++,V++),!l[Z]||"/"===Z&&!Y||F){if(F&&("\\"===Z||j))j=!j;else if(l[Z]&&F===Z&&!j&&("/"!==F||!W)){if("/"===Z)for(var te=-1;++ten.unsubscribe():n}function h(e,t,n,r){if(e){const i=f(e,t,n,r);return e[0](i)}}function f(e,t,n,r){return e[1]&&r?function(e,t){for(const n in t)e[n]=t[n];return e}(n.ctx.slice(),e[1](r(t))):n.ctx}function p(e,t,n,r){return e[2]&&r?t.dirty|e[2](r(n)):t.dirty}function g(e){return null==e?"":e}new Set;function m(e,t){e.appendChild(t)}function _(e,t,n){e.insertBefore(t,n||null)}function y(e){e.parentNode.removeChild(e)}function v(e){return document.createElement(e)}function b(e){return document.createTextNode(e)}function w(){return b(" ")}function C(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function S(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function x(e,t){t=""+t,e.data!==t&&(e.data=t)}function k(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}let L;function M(e){L=e}function E(){if(!L)throw new Error("Function called outside component initialization");return L}function D(e){E().$$.on_mount.push(e)}const T=[],N=[],O=[],A=[],I=Promise.resolve();let P=!1;function R(){P||(P=!0,I.then(Y))}function F(e){O.push(e)}function Y(){const e=new Set;do{for(;T.length;){const e=T.shift();M(e),j(e.$$)}for(;N.length;)N.pop()();for(let t=0;t{B.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}"undefined"!=typeof window?window:global;new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]);let q;function K(e){e&&e.c()}function G(e,t,n){const{fragment:r,on_mount:i,on_destroy:o,after_update:a}=e.$$;r&&r.m(t,n),F(()=>{const t=i.map(s).filter(c);o?o.push(...t):u(t),e.$$.on_mount=[]}),a.forEach(F)}function $(e,t){const n=e.$$;null!==n.fragment&&(u(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Z(e,t,n,r,i,s,c=[-1]){const l=L;M(e);const d=t.props||{},h=e.$$={fragment:null,ctx:null,props:s,update:o,not_equal:i,bound:a(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:[]),callbacks:a(),dirty:c};let f=!1;var p;h.ctx=n?n(e,d,(t,n,r=n)=>(h.ctx&&i(h.ctx[t],h.ctx[t]=r)&&(h.bound[t]&&h.bound[t](r),f&&function(e,t){-1===e.$$.dirty[0]&&(T.push(e),R(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(){}});class J{$destroy(){$(this,1),this.$destroy=o}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(){}}const X=[];function Q(e,t){return{subscribe:ee(e,t).subscribe}}function ee(e,t=o){let n;const r=[];function i(t){if(l(e,t)&&(e=t,n)){const t=!X.length;for(let t=0;t{const e=r.indexOf(u);-1!==e&&r.splice(e,1),0===r.length&&(n(),n=null)}}}}function te(e,t,n){const r=!Array.isArray(e),i=r?[e]:e,s=t.length<2;return Q(n,e=>{let n=!1;const a=[];let l=0,d=o;const h=()=>{if(l)return;d();const n=t(r?a[0]:a,e);s?e(n):d=c(n)?n:o},f=i.map((e,t)=>e.subscribe(e=>{a[t]=e,l&=~(1<{l|=1<{$(e,1)}),V()}r?(K((o=new r(i(e))).$$.fragment),z(o.$$.fragment,1),G(o,t.parentNode,t)):o=null}else r&&o.$set(s)},i(e){n||(o&&z(o.$$.fragment,e),n=!0)},o(e){o&&U(o.$$.fragment,e),n=!1},d(e){e&&y(t),o&&$(o,e)}}}function ie(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let r="";return n>-1&&(r=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:r}}const oe=Q(ie(),(function(e){const t=()=>{e(ie())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}}));te(oe,e=>e.location),te(oe,e=>e.querystring);function se(e){if(!e||e.length<1||"/"!=e.charAt(0)&&0!==e.indexOf("#/"))throw Error("Invalid parameter location");setTimeout(()=>{const t=("#"==e.charAt(0)?"":"#")+e;history.replaceState(void 0,void 0,t),window.dispatchEvent(new Event("hashchange"))},0)}function ae(e){if(!e||!e.tagName||"a"!=e.tagName.toLowerCase())throw Error('Action "link" can only be used with tags');const t=e.getAttribute("href");if(!t||t.length<1||"/"!=t.charAt(0))throw Error('Invalid value for "href" attribute');e.setAttribute("href","#"+t)}function ue(e,t,n){let r,i=o;!function(e,t,n){e.$$.on_destroy.push(d(t,n))}(e,oe,e=>n(3,r=e)),e.$$.on_destroy.push(()=>i());let{routes:s={}}=t;class a{constructor(e,t){if(!t||"function"!=typeof t&&("object"!=typeof t||!0!==t._sveltesparouter))throw Error("Invalid component object");if(!e||"string"==typeof e&&(e.length<1||"/"!=e.charAt(0)&&"*"!=e.charAt(0))||"object"==typeof e&&!(e instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:n,keys:r}=ne(e);this.path=e,"object"==typeof t&&!0===t._sveltesparouter?(this.component=t.route,this.conditions=t.conditions||[]):(this.component=t,this.conditions=[]),this._pattern=n,this._keys=r}match(e){const t=this._pattern.exec(e);if(null===t)return null;if(!1===this._keys)return t;const n={};let r=0;for(;r{const r=e.$$.callbacks[t];if(r){const i=k(t,n);r.slice().forEach(t=>{t.call(e,i)})}}}(),p=(e,t)=>{setTimeout(()=>{f(e,t)},0)};return e.$set=e=>{"routes"in e&&n(2,s=e.routes)},e.$$.update=()=>{if(9&e.$$.dirty){n(0,l=null);let e=0;for(;!l&&e{let t,n;const r=window.matchMedia("(prefers-color-scheme: dark)").matches&&!1;try{let r=le.Base64.decode(e);n=JSON.parse(r),console.log("state from url",n),n.code,t=n.code}catch(e){n={code:t="graph TD\n A[Christmas] --\x3e|Get money| B(Go shopping)\n B --\x3e C{Let me think}\n C --\x3e|One| D[Laptop]\n C --\x3e|Two| E[iPhone]\n C --\x3e|Three| F[fa:fa-car Car]\n\t\t",mermaid:{theme:r?"dark":"default"}}}de.set(n)},fe=e=>{de.set(e),se("/edit/"+le.Base64.encodeURI(JSON.stringify(e)))},pe=ee(void 0);var ge=n(31),me=n.n(ge);n(377);function _e(e){let t,n,r;return{c(){t=v("div"),n=b(e[1]),S(t,"id","error"),S(t,"class",r=g(e[0])+" svelte-ardmue")},m(e,r){_(e,t,r),m(t,n)},p(e,[i]){2&i&&x(n,e[1]),1&i&&r!==(r=g(e[0])+" svelte-ardmue")&&S(t,"class",r)},i:o,o:o,d(e){e&&y(t)}}}function ye(e,t,n){D(async()=>{});let{classes:r=""}=t,{errorText:i=""}=t;return e.$set=e=>{"classes"in e&&n(0,r=e.classes),"errorText"in e&&n(1,i=e.errorText)},[r,i]}var ve=class extends J{constructor(e){super(),Z(this,e,ye,_e,l,{classes:0,errorText:1})}};const be=e=>{e.languages.register({id:"mermaid"}),e.languages.setMonarchTokensProvider("mermaid",{typeKeywords:["graph","stateDiagram","sequenceDiagram","classDiagram","pie","flowchart","gantt"],keywords:["patricipant","as"],arrows:["---","===","--\x3e","==>"],tokenizer:{root:[[/[{}]/,"delimiter.bracket"],[/[a-z_$][\w$]*/,{cases:{"@typeKeywords":"keyword","@keywords":"keyword"}}],[/[-=>ox]+/,{cases:{"@arrows":"transition"}}],[/[\[\{\(}]+.+?[\)\]\}]+/,"string"],[/\".*\"/,"string"]]},whitespace:[[/[ \t\r\n]+/,"white"],[/\%\%.*$/,"comment"]]}),e.editor.defineTheme("myCoolTheme",{base:"vs",inherit:!1,rules:[{token:"keyword",foreground:"880000",fontStyle:"bold"},{token:"custom-error",foreground:"ff0000",fontStyle:"bold"},{token:"string",foreground:"AA8500"},{token:"transition",foreground:"008800",fontStyle:"bold"},{token:"delimiter.bracket",foreground:"000000",fontStyle:"bold"}]}),e.languages.registerCompletionItemProvider("mermaid",{provideCompletionItems:()=>{return{suggestions:[{label:"simpleText",kind:e.languages.CompletionItemKind.Text,insertText:"simpleText"},{label:"testing",kind:e.languages.CompletionItemKind.Keyword,insertText:"testing(${1:condition})",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"ifelse",kind:e.languages.CompletionItemKind.Snippet,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"If-Else Statement"}]}}})};function we(e,t){for(var n=[],r=2;r=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o)-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),void 0!==n&&(n+=e.charAt(i));else{void 0===n&&(n=e.substr(0,i));var s=at[o];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),n+=s):-1===r&&(r=i)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function ct(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?e.path[1].toLowerCase()+e.path.substr(2):e.path,Ge.g&&(t=t.replace(/\//g,"\\")),t}function dt(e,t){var n=t?ct:ut,r="",i=e.scheme,o=e.authority,s=e.path,a=e.query,u=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=nt,r+=nt),o){var c=o.indexOf("@");if(-1!==c){var l=o.substr(0,c);o=o.substr(c+1),-1===(c=l.indexOf(":"))?r+=n(l,!1):(r+=n(l.substr(0,c),!1),r+=":",r+=n(l.substr(c+1),!1)),r+="@"}-1===(c=(o=o.toLowerCase()).indexOf(":"))?r+=n(o,!1):(r+=n(o.substr(0,c),!1),r+=o.substr(c))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(d=s.charCodeAt(1))>=65&&d<=90&&(s="/"+String.fromCharCode(d+32)+":"+s.substr(3));else if(s.length>=2&&58===s.charCodeAt(1)){var d;(d=s.charCodeAt(0))>=65&&d<=90&&(s=String.fromCharCode(d+32)+":"+s.substr(2))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),u&&(r+="#",r+=t?u:ut(u,!1)),r}!function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(et||(et={}));var ht=pt("instantiationService");function ft(e,t,n,r){t[et.DI_TARGET]===t?t[et.DI_DEPENDENCIES].push({id:e,index:n,optional:r}):(t[et.DI_DEPENDENCIES]=[{id:e,index:n,optional:r}],t[et.DI_TARGET]=t)}function pt(e){if(et.serviceIds.has(e))return et.serviceIds.get(e);var t=function(e,n,r){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ft(t,e,r,!1)};return t.toString=function(){return e},et.serviceIds.set(e,t),t}function gt(e){return function(t,n,r){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");ft(e,t,r,!0)}}var mt=pt("codeEditorService"),_t=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.with=function(t,n){return void 0===t&&(t=this.lineNumber),void 0===n&&(n=this.column),t===this.lineNumber&&n===this.column?this:new e(t,n)},e.prototype.delta=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=0),this.with(this.lineNumber+e,this.column+t)},e.prototype.equals=function(t){return e.equals(this,t)},e.equals=function(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column},e.prototype.isBefore=function(t){return e.isBefore(this,t)},e.isBefore=function(e,t){return e.lineNumber=n?At:{done:!1,value:e[t++]}}}},e.from=function(t){return t?Array.isArray(t)?e.fromArray(t):t:e.empty()},e.map=function(e,t){return{next:function(){var n=e.next();return n.done?At:{done:!1,value:t(n.value)}}}},e.filter=function(e,t){return{next:function(){for(;;){var n=e.next();if(n.done)return At;if(t(n.value))return{done:!1,value:n.value}}}}},e.forEach=function(e,t){for(var n=e.next();!n.done;n=e.next())t(n.value)},e.collect=function(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY);var n=[];if(0===t)return n;for(var r=0,i=e.next();!i.done&&(n.push(i.value),!(++r>=t));i=e.next());return n},e.concat=function(){for(var e=[],t=0;t=e.length)return At;var t=e[n].next();return t.done?(n++,this.next()):t}}}}(Nt||(Nt={}));var It,Pt=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===r&&(r=t.length),void 0===i&&(i=n-1),e.call(this,t,n,r,i)||this}return Ot(t,e),t.prototype.current=function(){return e.prototype.current.call(this)},t.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},t.prototype.first=function(){return this.index=this.start,this.current()},t.prototype.last=function(){return this.index=this.end-1,this.current()},t.prototype.parent=function(){return null},t}(function(){function e(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=e.length),void 0===r&&(r=t-1),this.items=e,this.start=t,this.end=n,this.index=r}return e.prototype.first=function(){return this.index=this.start,this.current()},e.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},e.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},e}()),Rt=(function(){function e(e,t){this.iterator=e,this.fn=t}e.prototype.next=function(){return this.fn(this.iterator.next())}}(),function(){function e(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}return e.Undefined=new e(void 0),e}()),Ft=function(){function e(){this._first=Rt.Undefined,this._last=Rt.Undefined,this._size=0}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return this._first===Rt.Undefined},e.prototype.clear=function(){this._first=Rt.Undefined,this._last=Rt.Undefined,this._size=0},e.prototype.unshift=function(e){return this._insert(e,!1)},e.prototype.push=function(e){return this._insert(e,!0)},e.prototype._insert=function(e,t){var n=this,r=new Rt(e);if(this._first===Rt.Undefined)this._first=r,this._last=r;else if(t){var i=this._last;this._last=r,r.prev=i,i.next=r}else{var o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;var s=!1;return function(){s||(s=!0,n._remove(r))}},e.prototype.shift=function(){if(this._first!==Rt.Undefined){var e=this._first.element;return this._remove(this._first),e}},e.prototype.pop=function(){if(this._last!==Rt.Undefined){var e=this._last.element;return this._remove(this._last),e}},e.prototype._remove=function(e){if(e.prev!==Rt.Undefined&&e.next!==Rt.Undefined){var t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Rt.Undefined&&e.next===Rt.Undefined?(this._first=Rt.Undefined,this._last=Rt.Undefined):e.next===Rt.Undefined?(this._last=this._last.prev,this._last.next=Rt.Undefined):e.prev===Rt.Undefined&&(this._first=this._first.next,this._first.prev=Rt.Undefined);this._size-=1},e.prototype.iterator=function(){var e,t=this._first;return{next:function(){return t===Rt.Undefined?At:(e?e.value=t.element:e={done:!1,value:t.element},t=t.next,e)}}},e.prototype.toArray=function(){for(var e=[],t=this._first;t!==Rt.Undefined;t=t.next)e.push(t.element);return e},e}(),Yt=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){function t(e){return function(t,n,r){void 0===n&&(n=null);var i,o=!1;return i=e((function(e){if(!o)return i?i.dispose():o=!0,t.call(n,e)}),null,r),o&&i.dispose(),i}}function n(e,t){return s((function(n,r,i){return void 0===r&&(r=null),e((function(e){return n.call(r,t(e))}),null,i)}))}function r(e,t){return s((function(n,r,i){return void 0===r&&(r=null),e((function(e){t(e),n.call(r,e)}),null,i)}))}function i(e,t){return s((function(n,r,i){return void 0===r&&(r=null),e((function(e){return t(e)&&n.call(r,e)}),null,i)}))}function o(e,t,r){var i=r;return n(e,(function(e){return i=t(i,e)}))}function s(e){var t,n=new Ht({onFirstListenerAdd:function(){t=e(n.fire,n)},onLastListenerRemove:function(){t.dispose()}});return n.event}function a(e){var t,n=!0;return i(e,(function(e){var r=n||e!==t;return n=!1,t=e,r}))}e.None=function(){return Dt.None},e.once=t,e.map=n,e.forEach=r,e.filter=i,e.signal=function(e){return e},e.any=function(){for(var e=[],t=0;t1)&&c.fire(e),u=0}),n)}))},onLastListenerRemove:function(){o.dispose()}});return c.event},e.stopwatch=function(e){var r=(new Date).getTime();return n(t(e),(function(e){return(new Date).getTime()-r}))},e.latch=a,e.buffer=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=[]);var r=n.slice(),i=e((function(e){r?r.push(e):s.fire(e)})),o=function(){r&&r.forEach((function(e){return s.fire(e)})),r=null},s=new Ht({onFirstListenerAdd:function(){i||(i=e((function(e){return s.fire(e)})))},onFirstListenerDidAdd:function(){r&&(t?setTimeout(o):o())},onLastListenerRemove:function(){i&&i.dispose(),i=null}});return s.event};var u=function(){function e(e){this.event=e}return e.prototype.map=function(t){return new e(n(this.event,t))},e.prototype.forEach=function(t){return new e(r(this.event,t))},e.prototype.filter=function(t){return new e(i(this.event,t))},e.prototype.reduce=function(t,n){return new e(o(this.event,t,n))},e.prototype.latch=function(){return new e(a(this.event))},e.prototype.on=function(e,t,n){return this.event(e,t,n)},e.prototype.once=function(e,n,r){return t(this.event)(e,n,r)},e}();e.chain=function(e){return new u(e)},e.fromNodeEventEmitter=function(e,t,n){void 0===n&&(n=function(e){return e});var r=function(){for(var e=[],t=0;t0?new Bt(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(e.prototype,"event",{get:function(){var t=this;return this._event||(this._event=function(n,r,i){t._listeners||(t._listeners=new Ft);var o=t._listeners.isEmpty();o&&t._options&&t._options.onFirstListenerAdd&&t._options.onFirstListenerAdd(t);var s,a,u=t._listeners.push(r?[n,r]:n);return o&&t._options&&t._options.onFirstListenerDidAdd&&t._options.onFirstListenerDidAdd(t),t._options&&t._options.onListenerDidAdd&&t._options.onListenerDidAdd(t,n,r),t._leakageMon&&(s=t._leakageMon.check(t._listeners.size)),a={dispose:function(){(s&&s(),a.dispose=e._noop,t._disposed)||(u(),t._options&&t._options.onLastListenerRemove&&(t._listeners&&!t._listeners.isEmpty()||t._options.onLastListenerRemove(t)))}},i instanceof Et?i.add(a):Array.isArray(i)&&i.push(a),a}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Ft);for(var t=this._listeners.iterator(),n=t.next();!n.done;n=t.next())this._deliveryQueue.push([n.value,e]);for(;this._deliveryQueue.size>0;){var r=this._deliveryQueue.shift(),i=r[0],o=r[1];try{"function"==typeof i?i.call(void 0,o):i[0].call(i[1],o)}catch(n){je(n)}}}},e.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},e._noop=function(){},e}(),Wt=function(e){function t(t){var n=e.call(this,t)||this;return n._isPaused=0,n._eventQueue=new Ft,n._mergeFn=t&&t.merge,n}return Yt(t,e),t.prototype.pause=function(){this._isPaused++},t.prototype.resume=function(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){var t=this._eventQueue.toArray();this._eventQueue.clear(),e.prototype.fire.call(this,this._mergeFn(t))}else for(;!this._isPaused&&0!==this._eventQueue.size;)e.prototype.fire.call(this,this._eventQueue.shift())},t.prototype.fire=function(t){this._listeners&&(0!==this._isPaused?this._eventQueue.push(t):e.prototype.fire.call(this,t))},t}(Ht),Vt=(function(){function e(){var e=this;this.hasListeners=!1,this.events=[],this.emitter=new Ht({onFirstListenerAdd:function(){return e.onFirstListenerAdd()},onLastListenerRemove:function(){return e.onLastListenerRemove()}})}Object.defineProperty(e.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this,n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);return Mt(function(e){var t,n=this,r=!1;return function(){return r?t:(r=!0,t=e.apply(n,arguments))}}((function(){t.hasListeners&&t.unhook(n);var e=t.events.indexOf(n);t.events.splice(e,1)})))},e.prototype.onFirstListenerAdd=function(){var e=this;this.hasListeners=!0,this.events.forEach((function(t){return e.hook(t)}))},e.prototype.onLastListenerRemove=function(){var e=this;this.hasListeners=!1,this.events.forEach((function(t){return e.unhook(t)}))},e.prototype.hook=function(e){var t=this;e.listener=e.event((function(e){return t.emitter.fire(e)}))},e.prototype.unhook=function(e){e.listener&&e.listener.dispose(),e.listener=null},e.prototype.dispose=function(){this.emitter.dispose()}}(),function(){function e(){this.buffers=[]}return e.prototype.wrapEvent=function(e){var t=this;return function(n,r,i){return e((function(e){var i=t.buffers[t.buffers.length-1];i?i.push((function(){return n.call(r,e)})):n.call(r,e)}),void 0,i)}},e.prototype.bufferEvents=function(e){var t=[];this.buffers.push(t);var n=e();return this.buffers.pop(),t.forEach((function(e){return e()})),n},e}()),zt=function(){function e(){var e=this;this.listening=!1,this.inputEvent=It.None,this.inputEventListener=Dt.None,this.emitter=new Ht({onFirstListenerDidAdd:function(){e.listening=!0,e.inputEventListener=e.inputEvent(e.emitter.fire,e.emitter)},onLastListenerRemove:function(){e.listening=!1,e.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(e.prototype,"input",{set:function(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},e}(),Ut=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(s,a)}u((r=r.apply(e,t||[])).next())}))},Kt=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length?e:t[r]}))}function Qt(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function en(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\[\]\(\)\#]/g,"\\$&")}function tn(e,t){if(!e||!t)return e;var n=t.length;if(0===n||0===e.length)return e;for(var r=0;e.indexOf(t,r)===r;)r+=n;return e.substring(r)}function nn(e,t){if(e.length0?e.indexOf(t,n)===n:0===n&&e===t}function on(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("Cannot create regex from empty string");t||(e=en(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));var r="";return n.global&&(r+="g"),n.matchCase||(r+="i"),n.multiline&&(r+="m"),n.unicode&&(r+="u"),new RegExp(e,r)}function sn(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function an(e){for(var t=0,n=e.length;t=0;n--){var r=e.charCodeAt(n);if(32!==r&&9!==r)return n}return-1}function ln(e){return e>=97&&e<=122}function dn(e){return e>=65&&e<=90}function hn(e){return ln(e)||dn(e)}function fn(e,t){return(e?e.length:0)===(t?t.length:0)&&pn(e,t)}function pn(e,t,n){if(void 0===n&&(n=e.length),"string"!=typeof e||"string"!=typeof t)return!1;for(var r=0;re.length)&&pn(e,t,n)}function mn(e){return 55296<=e&&e<=56319}function _n(e){return 56320<=e&&e<=57343}var yn=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function vn(e){return yn.test(e)}var bn=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEF8]|\uD83E[\uDD00-\uDDE6])/;var wn=/^[\t\n\r\x20-\x7E]*$/;function Cn(e){return wn.test(e)}function Sn(e){return(e=+e)>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}var xn=String.fromCharCode(65279);function kn(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Ln(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}var Mn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),En=function(){function e(){}return e.has=function(e){return Tn.create(e)},e.equals=function(e,t){return Nn.create(e,t)},e.regex=function(e,t){return In.create(e,t)},e.not=function(e){return An.create(e)},e.and=function(){for(var e=[],t=0;t=0){var n=e.split("!=");return On.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("==")>=0){n=e.split("==");return Nn.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("=~")>=0){n=e.split("=~");return In.create(n[0].trim(),this._deserializeRegexValue(n[1],t))}return/^\!\s*/.test(e)?An.create(e.substr(1).trim()):Tn.create(e)},e._deserializeValue=function(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;var n=/^'([^']*)'$/.exec(e);return n?n[1].trim():e},e._deserializeRegexValue=function(e,t){if(!(n=e)||"string"!=typeof n||0===n.trim().length){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var n,r=e.indexOf("/"),i=e.lastIndexOf("/");if(r===i||r<0){if(t)throw new Error("bad regexp-value '"+e+"', missing /-enclosure");return console.warn("bad regexp-value '"+e+"', missing /-enclosure"),null}var o=e.slice(r+1,i),s="i"===e[i+1]?"i":"";try{return new RegExp(o,s)}catch(n){if(t)throw new Error("bad regexp-value '"+e+"', parse error: "+n);return console.warn("bad regexp-value '"+e+"', parse error: "+n),null}},e}();function Dn(e,t){var n=e.getType(),r=t.getType();if(n!==r)return n-r;switch(n){case 1:case 2:case 3:case 4:case 6:case 7:case 5:return e.cmp(t);default:throw new Error("Unknown ContextKeyExpr!")}}var Tn=function(){function e(e){this.key=e}return e.create=function(t){return new e(t)},e.prototype.getType=function(){return 1},e.prototype.cmp=function(e){return this.keye.key?1:0},e.prototype.equals=function(t){return t instanceof e&&this.key===t.key},e.prototype.evaluate=function(e){return!!e.getValue(this.key)},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return An.create(this.key)},e}(),Nn=function(){function e(e,t){this.key=e,this.value=t}return e.create=function(t,n){return"boolean"==typeof n?n?Tn.create(t):An.create(t):new e(t,n)},e.prototype.getType=function(){return 3},e.prototype.cmp=function(e){return this.keye.key?1:this.valuee.value?1:0},e.prototype.equals=function(t){return t instanceof e&&(this.key===t.key&&this.value===t.value)},e.prototype.evaluate=function(e){return e.getValue(this.key)==this.value},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return On.create(this.key,this.value)},e}(),On=function(){function e(e,t){this.key=e,this.value=t}return e.create=function(t,n){return"boolean"==typeof n?n?An.create(t):Tn.create(t):new e(t,n)},e.prototype.getType=function(){return 4},e.prototype.cmp=function(e){return this.keye.key?1:this.valuee.value?1:0},e.prototype.equals=function(t){return t instanceof e&&(this.key===t.key&&this.value===t.value)},e.prototype.evaluate=function(e){return e.getValue(this.key)!=this.value},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return Nn.create(this.key,this.value)},e}(),An=function(){function e(e){this.key=e}return e.create=function(t){return new e(t)},e.prototype.getType=function(){return 2},e.prototype.cmp=function(e){return this.keye.key?1:0},e.prototype.equals=function(t){return t instanceof e&&this.key===t.key},e.prototype.evaluate=function(e){return!e.getValue(this.key)},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return Tn.create(this.key)},e}(),In=function(){function e(e,t){this.key=e,this.regexp=t}return e.create=function(t,n){return new e(t,n)},e.prototype.getType=function(){return 6},e.prototype.cmp=function(e){if(this.keye.key)return 1;var t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0},e.prototype.equals=function(t){if(t instanceof e){var n=this.regexp?this.regexp.source:"",r=t.regexp?t.regexp.source:"";return this.key===t.key&&n===r}return!1},e.prototype.evaluate=function(e){var t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return Pn.create(this)},e}(),Pn=function(){function e(e){this._actual=e}return e.create=function(t){return new e(t)},e.prototype.getType=function(){return 7},e.prototype.cmp=function(e){return this._actual.cmp(e._actual)},e.prototype.equals=function(t){return t instanceof e&&this._actual.equals(t._actual)},e.prototype.evaluate=function(e){return!this._actual.evaluate(e)},e.prototype.keys=function(){return this._actual.keys()},e.prototype.negate=function(){return this._actual},e}(),Rn=function(){function e(e){this.expr=e}return e.create=function(t){var n=e._normalizeArr(t);if(0!==n.length)return 1===n.length?n[0]:new e(n)},e.prototype.getType=function(){return 5},e.prototype.cmp=function(e){if(this.expr.lengthe.expr.length)return 1;for(var t=0,n=this.expr.length;t1;){for(var s=t.shift(),a=t.shift(),u=[],c=0,l=o(s);c0)n.left||(n.left=new Un,n.left.segment=r.value()),n=n.left;else if(i<0)n.right||(n.right=new Un,n.right.segment=r.value()),n=n.right;else{if(!r.hasNext())break;r.next(),n.mid||(n.mid=new Un,n.mid.segment=r.value()),n=n.mid}}var o=n.value;return n.value=t,n.key=e,o},e.prototype.get=function(e){for(var t=this._iter.reset(e),n=this._root;n;){var r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else{if(!t.hasNext())break;t.next(),n=n.mid}}return n?n.value:void 0},e.prototype.findSubstr=function(e){for(var t=this._iter.reset(e),n=this._root,r=void 0;n;){var i=t.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else{if(!t.hasNext())break;t.next(),r=n.value||r,n=n.mid}}return n&&n.value||r},e.prototype.forEach=function(e){this._forEach(this._root,e)},e.prototype._forEach=function(e,t){e&&(this._forEach(e.left,t),e.value&&t(e.value,e.key),this._forEach(e.mid,t),this._forEach(e.right,t))},e}(),Kn=function(){function e(){this.map=new Map,this.ignoreCase=!1}return e.prototype.set=function(e,t){this.map.set(this.toKey(e),t)},e.prototype.get=function(e){return this.map.get(this.toKey(e))},e.prototype.toKey=function(e){var t=e.toString();return this.ignoreCase&&(t=t.toLowerCase()),t},e}(),Gn=function(e){function t(t,n){void 0===n&&(n=1);var r=e.call(this)||this;return r._limit=t,r._ratio=Math.min(Math.max(0,n),1),r}return Bn(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t,2)},t.prototype.peek=function(t){return e.prototype.get.call(this,t,0)},t.prototype.set=function(t,n){e.prototype.set.call(this,t,n,2),this.checkTrim()},t.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},t}(function(){function e(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return e.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.get=function(e,t){void 0===t&&(t=0);var n=this._map.get(e);if(n)return 0!==t&&this.touch(n,t),n.value},e.prototype.set=function(e,t,n){void 0===n&&(n=0);var r=this._map.get(e);if(r)r.value=t,0!==n&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:default:this.addItemLast(r)}this._map.set(e,r),this._size++}},e.prototype.delete=function(e){return!!this.remove(e)},e.prototype.remove=function(e){var t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value},e.prototype.forEach=function(e,t){for(var n=this._head;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.next},e.prototype.trimOld=function(e){if(!(e>=this.size))if(0!==e){for(var t=this._head,n=this.size;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0)}else this.clear()},e.prototype.addItemFirst=function(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e},e.prototype.addItemLast=function(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e},e.prototype.removeItem=function(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{var t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0},e.prototype.touch=function(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;var n=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(n.previous=r,r.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e}else if(2===t){if(e===this._tail)return;n=e.next,r=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=r,r.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e}},e.prototype.toJSON=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),e},e}()),$n=pt("commandService"),Zn=new(function(){function e(){this._commands=new Map,this._onDidRegisterCommand=new Ht,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return e.prototype.registerCommand=function(e,t){var n=this;if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){for(var r=[],i=0,o=e.description.args;i=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Qn=function(e,t){return function(n,r){t(n,r,e)}};function er(e){return void 0!==e.command}var tr,nr=pt("menuService"),rr=new(function(){function e(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ht,this.onDidChangeMenu=this._onDidChangeMenu.event}return e.prototype.addCommand=function(e){var t=this;return this._commands.set(e.id,e),this._onDidChangeMenu.fire(0),{dispose:function(){t._commands.delete(e.id)&&t._onDidChangeMenu.fire(0)}}},e.prototype.getCommand=function(e){return this._commands.get(e)},e.prototype.getCommands=function(){var e=new Map;return this._commands.forEach((function(t,n){return e.set(n,t)})),e},e.prototype.appendMenuItem=function(e,t){var n=this,r=this._menuItems.get(e);return r?r.push(t):(r=[t],this._menuItems.set(e,r)),this._onDidChangeMenu.fire(e),{dispose:function(){var i=r.indexOf(t);i>=0&&(r.splice(i,1),n._onDidChangeMenu.fire(e))}}},e.prototype.getMenuItems=function(e){var t=(this._menuItems.get(e)||[]).slice(0);return 0===e&&this._appendImplicitItems(t),t},e.prototype._appendImplicitItems=function(e){for(var t=new Set,n=0,r=e.filter((function(e){return er(e)}));n>>0,r=(4294901760&e)>>>16;return new pr(0!==r?[hr(n,t),hr(r,t)]:[hr(n,t)])}function hr(e,t){var n=!!(2048&e),r=!!(256&e);return new fr(2===t?r:n,!!(1024&e),!!(512&e),2===t?n:r,255&e)}!function(){function e(e,t,n,r){void 0===n&&(n=t),void 0===r&&(r=n),ur.define(e,t),cr.define(e,n),lr.define(e,r)}e(0,"unknown"),e(1,"Backspace"),e(2,"Tab"),e(3,"Enter"),e(4,"Shift"),e(5,"Ctrl"),e(6,"Alt"),e(7,"PauseBreak"),e(8,"CapsLock"),e(9,"Escape"),e(10,"Space"),e(11,"PageUp"),e(12,"PageDown"),e(13,"End"),e(14,"Home"),e(15,"LeftArrow","Left"),e(16,"UpArrow","Up"),e(17,"RightArrow","Right"),e(18,"DownArrow","Down"),e(19,"Insert"),e(20,"Delete"),e(21,"0"),e(22,"1"),e(23,"2"),e(24,"3"),e(25,"4"),e(26,"5"),e(27,"6"),e(28,"7"),e(29,"8"),e(30,"9"),e(31,"A"),e(32,"B"),e(33,"C"),e(34,"D"),e(35,"E"),e(36,"F"),e(37,"G"),e(38,"H"),e(39,"I"),e(40,"J"),e(41,"K"),e(42,"L"),e(43,"M"),e(44,"N"),e(45,"O"),e(46,"P"),e(47,"Q"),e(48,"R"),e(49,"S"),e(50,"T"),e(51,"U"),e(52,"V"),e(53,"W"),e(54,"X"),e(55,"Y"),e(56,"Z"),e(57,"Meta"),e(58,"ContextMenu"),e(59,"F1"),e(60,"F2"),e(61,"F3"),e(62,"F4"),e(63,"F5"),e(64,"F6"),e(65,"F7"),e(66,"F8"),e(67,"F9"),e(68,"F10"),e(69,"F11"),e(70,"F12"),e(71,"F13"),e(72,"F14"),e(73,"F15"),e(74,"F16"),e(75,"F17"),e(76,"F18"),e(77,"F19"),e(78,"NumLock"),e(79,"ScrollLock"),e(80,";",";","OEM_1"),e(81,"=","=","OEM_PLUS"),e(82,",",",","OEM_COMMA"),e(83,"-","-","OEM_MINUS"),e(84,".",".","OEM_PERIOD"),e(85,"/","/","OEM_2"),e(86,"`","`","OEM_3"),e(110,"ABNT_C1"),e(111,"ABNT_C2"),e(87,"[","[","OEM_4"),e(88,"\\","\\","OEM_5"),e(89,"]","]","OEM_6"),e(90,"'","'","OEM_7"),e(91,"OEM_8"),e(92,"OEM_102"),e(93,"NumPad0"),e(94,"NumPad1"),e(95,"NumPad2"),e(96,"NumPad3"),e(97,"NumPad4"),e(98,"NumPad5"),e(99,"NumPad6"),e(100,"NumPad7"),e(101,"NumPad8"),e(102,"NumPad9"),e(103,"NumPad_Multiply"),e(104,"NumPad_Add"),e(105,"NumPad_Separator"),e(106,"NumPad_Subtract"),e(107,"NumPad_Decimal"),e(108,"NumPad_Divide")}(),function(e){e.toString=function(e){return ur.keyCodeToStr(e)},e.fromString=function(e){return ur.strToKeyCode(e)},e.toUserSettingsUS=function(e){return cr.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return lr.keyCodeToStr(e)},e.fromUserSettings=function(e){return cr.strToKeyCode(e)||lr.strToKeyCode(e)}}(tr||(tr={}));var fr=function(){function e(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}return e.prototype.equals=function(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode},e.prototype.isModifierKey=function(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode},e.prototype.toChord=function(){return new pr([this])},e.prototype.isDuplicateModifierCase=function(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode},e}(),pr=function(){function e(e){if(0===e.length)throw ze("parts");this.parts=e}return e.prototype.equals=function(e){if(null===e)return!1;if(this.parts.length!==e.parts.length)return!1;for(var t=0;t=21&&e<=30||(e>=31&&e<=56||(80===e||81===e||82===e||83===e||84===e||85===e||86===e||110===e||111===e||87===e||88===e||89===e||90===e||91===e||92===e))},e.prototype._assertNoCtrlAlt=function(t,n){t.ctrlKey&&t.altKey&&!t.metaKey&&e._mightProduceChar(t.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",t," for ",n)},e.prototype._registerDefaultKeybinding=function(e,t,n,r,i,o){1===Ge.a&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e,command:t,commandArgs:n,when:o,weight1:r,weight2:i}),this._cachedMergedKeybindings=null},e.prototype.getDefaultKeybindings=function(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(br)),this._cachedMergedKeybindings.slice(0)},e}());function br(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.commandt.command?1:e.weight2-t.weight2}yr.add("platform.keybindingsRegistry",vr);var wr,Cr=pt("telemetryService"),Sr=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xr=function(){function e(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menubarOpts=e.menubarOpts,this._description=e.description}return e.prototype.register=function(){var e=this;if(this._menubarOpts&&rr.appendMenuItem(this._menubarOpts.menuId,{group:this._menubarOpts.group,command:{id:this.id,title:this._menubarOpts.title},when:this._menubarOpts.when,order:this._menubarOpts.order}),this._kbOpts){var t=this._kbOpts.kbExpr;this.precondition&&(t=t?En.and(t,this.precondition):this.precondition),vr.registerCommandAndKeybindingRule({id:this.id,handler:function(t,n){return e.runCommand(t,n)},weight:this._kbOpts.weight,when:t,primary:this._kbOpts.primary,secondary:this._kbOpts.secondary,win:this._kbOpts.win,linux:this._kbOpts.linux,mac:this._kbOpts.mac,description:this._description})}else Zn.registerCommand({id:this.id,handler:function(t,n){return e.runCommand(t,n)},description:this._description})},e}(),kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Sr(t,e),t.bindToContribution=function(e){return function(t){function n(e){var n=t.call(this,e)||this;return n._callback=e.handler,n}return Sr(n,t),n.prototype.runEditorCommand=function(t,n,r){e(n)&&this._callback(e(n),r)},n}(t)},t.prototype.runCommand=function(e,t){var n=this,r=e.get(mt),i=r.getFocusedCodeEditor()||r.getActiveCodeEditor();if(i)return i.invokeWithinContext((function(e){if(e.get(jn).contextMatchesRules(Re(n.precondition)))return n.runEditorCommand(e,i,t)}))},t}(xr),Lr=function(e){function t(t){var n=e.call(this,t)||this;return n.label=t.label,n.alias=t.alias,n.menuOpts=t.menuOpts,n}return Sr(t,e),t.prototype.register=function(){this.menuOpts&&rr.appendMenuItem(7,{command:{id:this.id,title:this.label},when:En.and(this.precondition,this.menuOpts.when),group:this.menuOpts.group,order:this.menuOpts.order}),e.prototype.register.call(this)},t.prototype.runEditorCommand=function(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})},t.prototype.reportTelemetry=function(e,t){e.get(Cr).publicLog2("editorActionInvoked",{name:this.label,id:this.id})},t}(kr);function Mr(e){return Dr.INSTANCE.registerEditorCommand(e),e}function Er(e){Dr.INSTANCE.registerEditorAction(new e)}!function(e){e.getEditorCommand=function(e){return Dr.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return Dr.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return Dr.INSTANCE.getEditorContributions()}}(wr||(wr={}));var Dr=function(){function e(){this.editorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}return e.prototype.registerEditorContribution=function(e){this.editorContributions.push(e)},e.prototype.registerEditorAction=function(e){e.register(),this.editorActions.push(e)},e.prototype.getEditorContributions=function(){return this.editorContributions.slice(0)},e.prototype.getEditorActions=function(){return this.editorActions.slice(0)},e.prototype.registerEditorCommand=function(e){e.register(),this.editorCommands[e.id]=e},e.prototype.getEditorCommand=function(e){return this.editorCommands[e]||null},e.INSTANCE=new e,e}();yr.add("editor.contributions",Dr.INSTANCE);var Tr=function(){function e(e,t,n,r){e>n||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}return e.prototype.isEmpty=function(){return e.isEmpty(this)},e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.prototype.containsPosition=function(t){return e.containsPosition(this,t)},e.containsPosition=function(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))},e.prototype.containsRange=function(t){return e.containsRange(this,t)},e.containsRange=function(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))},e.prototype.strictContainsRange=function(t){return e.strictContainsRange(this,t)},e.strictContainsRange=function(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))},e.prototype.plusRange=function(t){return e.plusRange(this,t)},e.plusRange=function(t,n){var r,i,o,s;return n.startLineNumbert.endLineNumber?(o=n.endLineNumber,s=n.endColumn):n.endLineNumber===t.endLineNumber?(o=n.endLineNumber,s=Math.max(n.endColumn,t.endColumn)):(o=t.endLineNumber,s=t.endColumn),new e(r,i,o,s)},e.prototype.intersectRanges=function(t){return e.intersectRanges(this,t)},e.intersectRanges=function(t,n){var r=t.startLineNumber,i=t.startColumn,o=t.endLineNumber,s=t.endColumn,a=n.startLineNumber,u=n.startColumn,c=n.endLineNumber,l=n.endColumn;return rc?(o=c,s=l):o===c&&(s=Math.min(s,l)),r>o?null:r===o&&i>s?null:new e(r,i,o,s)},e.prototype.equalsRange=function(t){return e.equalsRange(this,t)},e.equalsRange=function(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.prototype.getEndPosition=function(){return new _t(this.endLineNumber,this.endColumn)},e.prototype.getStartPosition=function(){return new _t(this.startLineNumber,this.startColumn)},e.prototype.toString=function(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"},e.prototype.setEndPosition=function(t,n){return new e(this.startLineNumber,this.startColumn,t,n)},e.prototype.setStartPosition=function(t,n){return new e(t,n,this.endLineNumber,this.endColumn)},e.prototype.collapseToStart=function(){return e.collapseToStart(this)},e.collapseToStart=function(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)},e.fromPositions=function(t,n){return void 0===n&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e.lift=function(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null},e.isIRange=function(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn},e.areIntersectingOrTouching=function(e,t){return!(e.endLineNumbere.startLineNumber},e}(),Nr=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Or=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r,i)||this;return o.selectionStartLineNumber=t,o.selectionStartColumn=n,o.positionLineNumber=r,o.positionColumn=i,o}return Nr(t,e),t.prototype.clone=function(){return new t(this.selectionStartLineNumber,this.selectionStartColumn,this.positionLineNumber,this.positionColumn)},t.prototype.toString=function(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"},t.prototype.equalsSelection=function(e){return t.selectionsEqual(this,e)},t.selectionsEqual=function(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn},t.prototype.getDirection=function(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1},t.prototype.setEndPosition=function(e,n){return 0===this.getDirection()?new t(this.startLineNumber,this.startColumn,e,n):new t(e,n,this.startLineNumber,this.startColumn)},t.prototype.getPosition=function(){return new _t(this.positionLineNumber,this.positionColumn)},t.prototype.setStartPosition=function(e,n){return 0===this.getDirection()?new t(e,n,this.endLineNumber,this.endColumn):new t(this.endLineNumber,this.endColumn,e,n)},t.fromPositions=function(e,n){return void 0===n&&(n=e),new t(e.lineNumber,e.column,n.lineNumber,n.column)},t.liftSelection=function(e){return new t(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)},t.selectionsArrEqual=function(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(var n=0,r=e.length;nr?e[u]=o[a++]:a>i?e[u]=o[s++]:t(o[a],o[s])<0?e[u]=o[a++]:e[u]=o[s++]}(t,n,r,s,i,o)}(e,t,0,e.length-1,[]),e}function Rr(e,t){if(!t)return e.filter((function(t,n){return e.indexOf(t)===n}));var n=Object.create(null);return e.filter((function(e){var r=t(e);return!n[r]&&(n[r]=!0,!0)}))}function Fr(e){var t=new Set;return e.filter((function(e){return!t.has(e)&&(t.add(e),!0)}))}function Yr(e,t){for(var n=0;nt;i--)r.push(i);return r}function Hr(e,t,n){var r=e.slice(0,t),i=e.slice(t);return r.concat(n,i)}function Wr(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;var t=Array.isArray(e)?[]:{};return Object.keys(e).forEach((function(n){e[n]&&"object"==typeof e[n]?t[n]=Wr(e[n]):t[n]=e[n]})),t}var Vr=Object.prototype.hasOwnProperty;function zr(e,t,n){return void 0===n&&(n=!0),xe(e)?(xe(t)&&Object.keys(t).forEach((function(r){r in e?n&&(xe(e[r])&&xe(t[r])?zr(e[r],t[r],n):e[r]=t[r]):e[r]=t[r]})),e):t}function Ur(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n/?";var Gr=function(e){void 0===e&&(e="");for(var t="(-?\\d*\\.\\d\\w*)|([^",n=0,r=Kr;n=0||(t+="\\"+i)}return t+="\\s]+)",new RegExp(t,"g")}();function $r(e){var t=Gr;if(e&&e instanceof RegExp)if(e.global)t=e;else{var 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}function Zr(e,t,n,r){t.lastIndex=0;var i=t.exec(n);if(!i)return null;var o=i[0].indexOf(" ")>=0?function(e,t,n,r){var i,o=e-1-r;for(t.lastIndex=0;i=t.exec(n);){var s=i.index||0;if(s>o)return null;if(t.lastIndex>=o)return{word:i[0],startColumn:r+1+s,endColumn:r+1+t.lastIndex}}return null}(e,t,n,r):function(e,t,n,r){var i,o=e-1-r,s=n.lastIndexOf(" ",o-1)+1;for(t.lastIndex=s;i=t.exec(n);){var a=i.index||0;if(a<=o&&t.lastIndex>=o)return{word:i[0],startColumn:r+1+a,endColumn:r+1+t.lastIndex}}return null}(e,t,n,r);return t.lastIndex=0,o}var Jr,Xr=function(){return(Xr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=2?(S=_?2:4,O=2/v):(S=_?1:3,O=1/v),(k=Math.max(0,Math.floor((N-d-2)*O/(c+O))))/O>y&&(k=Math.floor(y*O)),L=N-k,"left"===m?(x=0,M+=k,E+=k,D+=k,T+=k):x=t-k-d}else x=0,k=0,S=0,L=N;var A=h?f:0;return{width:t,height:n,glyphMarginLeft:M,glyphMarginWidth:C,glyphMarginHeight:n,lineNumbersLeft:E,lineNumbersWidth:b,lineNumbersHeight:n,decorationsLeft:D,decorationsWidth:u,decorationsHeight:n,contentLeft:T,contentWidth:L,contentHeight:n,renderMinimap:S,minimapLeft:x,minimapWidth:k,viewportColumn:Math.max(1,Math.floor((L-d-2)/c)),verticalScrollbarWidth:d,horizontalScrollbarHeight:p,overviewRuler:{top:A,width:d,height:n-2*A,right:0}}},e}(),fi={fontFamily:Ge.d?"Menlo, Monaco, 'Courier New', monospace":Ge.c?"'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:Ge.d?12:14,lineHeight:0,letterSpacing:0},pi={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},gi={inDiffEditor:!1,wordSeparators:Kr,lineNumbersMinChars:5,lineDecorationsWidth:10,readOnly:!1,mouseStyle:"text",disableLayerHinting:!1,automaticLayout:!1,wordWrap:"off",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:1,wordWrapBreakBeforeCharacters:"([{‘“〈《「『【〔([{「£¥$£¥++",wordWrapBreakAfterCharacters:" \t})]?|/&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」",wordWrapBreakObtrusiveCharacters:".",autoClosingBrackets:"languageDefined",autoClosingQuotes:"languageDefined",autoClosingOvertype:"auto",autoSurround:"languageDefined",autoIndent:!0,dragAndDrop:!0,emptySelectionClipboard:!0,copyWithSyntaxHighlighting:!0,useTabStops:!0,multiCursorModifier:"altKey",multiCursorMergeOverlapping:!0,accessibilitySupport:"auto",showUnused:!0,viewInfo:{extraEditorClassName:"",disableMonospaceOptimizations:!1,rulers:[],ariaLabel:we("editorViewAccessibleLabel","Editor content"),renderLineNumbers:1,renderCustomLineNumbers:null,cursorSurroundingLines:0,renderFinalNewline:!0,selectOnLineNumbers:!0,glyphMargin:!0,revealHorizontalRightPadding:30,roundedSelection:!0,overviewRulerLanes:2,overviewRulerBorder:!0,cursorBlinking:1,mouseWheelZoom:!1,cursorSmoothCaretAnimation:!1,cursorStyle:Jr.Line,cursorWidth:0,hideCursorInOverviewRuler:!1,scrollBeyondLastLine:!0,scrollBeyondLastColumn:5,smoothScrolling:!1,stopRenderingLineAfter:1e4,renderWhitespace:"none",renderControlCharacters:!1,fontLigatures:!1,renderIndentGuides:!0,highlightActiveIndentGuide:!0,renderLineHighlight:"line",scrollbar:{vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:10,horizontalSliderSize:10,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,mouseWheelScrollSensitivity:1,fastScrollSensitivity:5},minimap:{enabled:!0,side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120},fixedOverflowWidgets:!1},contribInfo:{selectionClipboard:!0,hover:{enabled:!0,delay:300,sticky:!0},links:!0,contextmenu:!0,quickSuggestions:{other:!0,comments:!1,strings:!1},quickSuggestionsDelay:10,parameterHints:{enabled:!0,cycle:!1},formatOnType:!1,formatOnPaste:!1,suggestOnTriggerCharacters:!0,acceptSuggestionOnEnter:"on",acceptSuggestionOnCommitCharacter:!0,wordBasedSuggestions:!0,suggestSelection:"recentlyUsed",suggestFontSize:0,suggestLineHeight:0,tabCompletion:"off",suggest:{filterGraceful:!0,snippets:"inline",snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,maxVisibleSuggestions:12,filteredTypes:Object.create(null)},gotoLocation:{multiple:"peek"},selectionHighlight:!0,occurrencesHighlight:!0,codeLens:!0,folding:!0,foldingStrategy:"auto",showFoldingControls:"mouseover",matchBrackets:!0,find:{seedSearchStringFromSelection:!0,autoFindInSelection:!1,globalFindClipboard:!1,addExtraSpaceOnTop:!0},colorDecorators:!0,lightbulbEnabled:!0,codeActionsOnSave:{},codeActionsOnSaveTimeout:750}};!function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(ui||(ui={})),function(e){e[e.Inline=1]="Inline"}(ci||(ci={}));var mi=function(){function e(e){this.tabSize=0|e.tabSize,this.indentSize=0|e.tabSize,this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace)}return e.prototype.equals=function(e){return this.tabSize===e.tabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace},e.prototype.createChangeEvent=function(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}},e}(),_i=function(e,t){this.range=e,this.matches=t},yi=function(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n},vi=function(){function e(e,t){this.beforeVersionId=e,this.beforeCursorState=t,this.afterCursorState=null,this.afterVersionId=-1,this.editOperations=[]}return e.prototype.undo=function(e){for(var t=this.editOperations.length-1;t>=0;t--)this.editOperations[t]={operations:e.applyEdits(this.editOperations[t].operations)}},e.prototype.redo=function(e){for(var t=0;t0){var e=this.past.pop();try{e.undo(this.model)}catch(e){return je(e),this.clear(),null}return this.future.push(e),{selections:e.beforeCursorState,recordedVersionId:e.beforeVersionId}}return null},e.prototype.canUndo=function(){return this.past.length>0||null!==this.currentOpenStackElement},e.prototype.redo=function(){if(this.future.length>0){var e=this.future.pop();try{e.redo(this.model)}catch(e){return je(e),this.clear(),null}return this.past.push(e),{selections:e.afterCursorState,recordedVersionId:e.afterVersionId}}return null},e.prototype.canRedo=function(){return this.future.length>0},e}(),Si=function(){this.spacesDiff=0,this.looksLikeAlignment=!1};function xi(e,t,n,r,i){var o;for(i.spacesDiff=0,i.looksLikeAlignment=!1,o=0;o0&&a>0||c>0&&l>0)){var d=Math.abs(a-l),h=Math.abs(s-c);if(0===d)return i.spacesDiff=h,void(h>0&&0<=c-1&&c-10?i++:m>1&&o++,xi(s,a,h,g,c),!c.looksLikeAlignment||n&&t===c.spacesDiff)){var w=c.spacesDiff;w<=8&&u[w]++,s=h,a=g}}var C=n;i!==o&&(C=ix&&(x=t,S=e)})),4===S&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(S=2)}return{insertSpaces:C,tabSize:S}}function Li(e){return(1&e.metadata)>>>0}function Mi(e,t){e.metadata=254&e.metadata|t<<0}function Ei(e){return(2&e.metadata)>>>1==1}function Di(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function Ti(e){return(4&e.metadata)>>>2==1}function Ni(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function Oi(e){return(8&e.metadata)>>>3==1}function Ai(e,t){e.metadata=247&e.metadata|(t?1:0)<<3}function Ii(e,t){e.metadata=207&e.metadata|t<<4}function Pi(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}var Ri=function(){function e(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Mi(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,Ni(this,!1),Ii(this,1),Ai(this,!1),Pi(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Di(this,!1)}return e.prototype.reset=function(e,t,n,r){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=r},e.prototype.setOptions=function(e){this.options=e;var t=this.options.className;Ni(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),Ii(this,this.options.stickiness),Ai(this,!(!this.options.overviewRuler||!this.options.overviewRuler.color)),Pi(this,this.options.collapseOnReplaceEdit)},e.prototype.setCachedOffsets=function(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t},e.prototype.detach=function(){this.parent=null,this.left=null,this.right=null},e}(),Fi=new Ri(null,0,0);Fi.parent=Fi,Fi.left=Fi,Fi.right=Fi,Mi(Fi,0);var Yi=function(){function e(){this.root=Fi,this.requestNormalizeDelta=!1}return e.prototype.intervalSearch=function(e,t,n,r,i){return this.root===Fi?[]:function(e,t,n,r,i,o){var s=e.root,a=0,u=0,c=0,l=[],d=0;for(;s!==Fi;)if(Ei(s))Di(s.left,!1),Di(s.right,!1),s===s.parent.right&&(a-=s.parent.delta),s=s.parent;else{if(!Ei(s.left)){if(a+s.maxEndn)Di(s,!0);else{if((c=a+s.end)>=t){s.setCachedOffsets(u,c,o);var h=!0;r&&s.ownerId&&s.ownerId!==r&&(h=!1),i&&Ti(s)&&(h=!1),h&&(l[d++]=s)}Di(s,!0),s.right===Fi||Ei(s.right)||(a+=s.delta,s=s.right)}}return Di(e.root,!1),l}(this,e,t,n,r,i)},e.prototype.search=function(e,t,n){return this.root===Fi?[]:function(e,t,n,r){var i=e.root,o=0,s=0,a=0,u=[],c=0;for(;i!==Fi;)if(Ei(i))Di(i.left,!1),Di(i.right,!1),i===i.parent.right&&(o-=i.parent.delta),i=i.parent;else if(i.left===Fi||Ei(i.left)){s=o+i.start,a=o+i.end,i.setCachedOffsets(s,a,r);var l=!0;t&&i.ownerId&&i.ownerId!==t&&(l=!1),n&&Ti(i)&&(l=!1),l&&(u[c++]=i),Di(i,!0),i.right===Fi||Ei(i.right)||(o+=i.delta,i=i.right)}else i=i.left;return Di(e.root,!1),u}(this,e,t,n)},e.prototype.collectNodesFromOwner=function(e){return function(e,t){var n=e.root,r=[],i=0;for(;n!==Fi;)Ei(n)?(Di(n.left,!1),Di(n.right,!1),n=n.parent):n.left===Fi||Ei(n.left)?(n.ownerId===t&&(r[i++]=n),Di(n,!0),n.right===Fi||Ei(n.right)||(n=n.right)):n=n.left;return Di(e.root,!1),r}(this,e)},e.prototype.collectNodesPostOrder=function(){return function(e){var t=e.root,n=[],r=0;for(;t!==Fi;)Ei(t)?(Di(t.left,!1),Di(t.right,!1),t=t.parent):t.left===Fi||Ei(t.left)?t.right===Fi||Ei(t.right)?(n[r++]=t,Di(t,!0)):t=t.right:t=t.left;return Di(e.root,!1),n}(this)},e.prototype.insert=function(e){Hi(this,e),this._normalizeDeltaIfNecessary()},e.prototype.delete=function(e){Wi(this,e),this._normalizeDeltaIfNecessary()},e.prototype.resolveNode=function(e,t){for(var n=e,r=0;e!==this.root;)e===e.parent.right&&(r+=e.parent.delta),e=e.parent;var i=n.start+r,o=n.end+r;n.setCachedOffsets(i,o,t)},e.prototype.acceptReplace=function(e,t,n,r){for(var i=function(e,t,n){var r=e.root,i=0,o=0,s=0,a=[],u=0;for(;r!==Fi;)if(Ei(r))Di(r.left,!1),Di(r.right,!1),r===r.parent.right&&(i-=r.parent.delta),r=r.parent;else{if(!Ei(r.left)){if(i+r.maxEndn?Di(r,!0):((s=i+r.end)>=t&&(r.setCachedOffsets(o,s,0),a[u++]=r),Di(r,!0),r.right===Fi||Ei(r.right)||(i+=r.delta,r=r.right))}return Di(e.root,!1),a}(this,e,e+t),o=0,s=i.length;on?(i.start+=s,i.end+=s,i.delta+=s,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),Di(i,!0)):(Di(i,!0),i.right===Fi||Ei(i.right)||(o+=i.delta,i=i.right))}Di(e.root,!1)}(this,e,e+t,n),this._normalizeDeltaIfNecessary();for(o=0,s=i.length;on)&&(1!==r&&(2===r||t))}function Bi(e,t,n,r,i){var o=function(e){return(48&e.metadata)>>>4}(e),s=0===o||2===o,a=1===o||2===o,u=n-t,c=r,l=Math.min(u,c),d=e.start,h=!1,f=e.end,p=!1;t<=d&&f<=n&&function(e){return(64&e.metadata)>>>6==1}(e)&&(e.start=t,h=!0,e.end=t,p=!0);var g=i?1:u>0?2:0;if(!h&&ji(d,s,t,g)&&(h=!0),!p&&ji(f,a,t,g)&&(p=!0),l>0&&!i){g=u>c?2:0;!h&&ji(d,s,t+l,g)&&(h=!0),!p&&ji(f,a,t+l,g)&&(p=!0)}g=i?1:0;!h&&ji(d,s,n,g)&&(e.start=t+c,h=!0),!p&&ji(f,a,n,g)&&(e.end=t+c,p=!0);var m=c-u;h||(e.start=Math.max(0,d+m)),p||(e.end=Math.max(0,f+m)),e.start>e.end&&(e.end=e.start)}function Hi(e,t){if(e.root===Fi)return t.parent=Fi,t.left=Fi,t.right=Fi,Mi(t,0),e.root=t,e.root;!function(e,t){var n=0,r=e.root,i=t.start,o=t.end;for(;;){if($i(i,o,r.start+n,r.end+n)<0){if(r.left===Fi){t.start-=n,t.end-=n,t.maxEnd-=n,r.left=t;break}r=r.left}else{if(r.right===Fi){t.start-=n+r.delta,t.end-=n+r.delta,t.maxEnd-=n+r.delta,r.right=t;break}n+=r.delta,r=r.right}}t.parent=r,t.left=Fi,t.right=Fi,Mi(t,1)}(e,t),Gi(t.parent);for(var n=t;n!==e.root&&1===Li(n.parent);){var r;if(n.parent===n.parent.parent.left)1===Li(r=n.parent.parent.right)?(Mi(n.parent,0),Mi(r,0),Mi(n.parent.parent,1),n=n.parent.parent):(n===n.parent.right&&zi(e,n=n.parent),Mi(n.parent,0),Mi(n.parent.parent,1),Ui(e,n.parent.parent));else 1===Li(r=n.parent.parent.left)?(Mi(n.parent,0),Mi(r,0),Mi(n.parent.parent,1),n=n.parent.parent):(n===n.parent.left&&Ui(e,n=n.parent),Mi(n.parent,0),Mi(n.parent.parent,1),zi(e,n.parent.parent))}return Mi(e.root,0),t}function Wi(e,t){var n,r;if(t.left===Fi?(r=t,(n=t.right).delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta):t.right===Fi?(n=t.left,r=t):((n=(r=function(e){for(;e.left!==Fi;)e=e.left;return e}(t.right)).right).start+=r.delta,n.end+=r.delta,n.delta+=r.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),r.start+=t.delta,r.end+=t.delta,r.delta=t.delta,(r.delta<-1073741824||r.delta>1073741824)&&(e.requestNormalizeDelta=!0)),r===e.root)return e.root=n,Mi(n,0),t.detach(),Vi(),Ki(n),void(e.root.parent=Fi);var i,o=1===Li(r);if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===t?n.parent=r.parent:(r.parent===t?n.parent=r:n.parent=r.parent,r.left=t.left,r.right=t.right,r.parent=t.parent,Mi(r,Li(t)),t===e.root?e.root=r:t===t.parent.left?t.parent.left=r:t.parent.right=r,r.left!==Fi&&(r.left.parent=r),r.right!==Fi&&(r.right.parent=r)),t.detach(),o)return Gi(n.parent),r!==t&&(Gi(r),Gi(r.parent)),void Vi();for(Gi(n),Gi(n.parent),r!==t&&(Gi(r),Gi(r.parent));n!==e.root&&0===Li(n);)n===n.parent.left?(1===Li(i=n.parent.right)&&(Mi(i,0),Mi(n.parent,1),zi(e,n.parent),i=n.parent.right),0===Li(i.left)&&0===Li(i.right)?(Mi(i,1),n=n.parent):(0===Li(i.right)&&(Mi(i.left,0),Mi(i,1),Ui(e,i),i=n.parent.right),Mi(i,Li(n.parent)),Mi(n.parent,0),Mi(i.right,0),zi(e,n.parent),n=e.root)):(1===Li(i=n.parent.left)&&(Mi(i,0),Mi(n.parent,1),Ui(e,n.parent),i=n.parent.left),0===Li(i.left)&&0===Li(i.right)?(Mi(i,1),n=n.parent):(0===Li(i.left)&&(Mi(i.right,0),Mi(i,1),zi(e,i),i=n.parent.left),Mi(i,Li(n.parent)),Mi(n.parent,0),Mi(i.left,0),Ui(e,n.parent),n=e.root));Mi(n,0),Vi()}function Vi(){Fi.parent=Fi,Fi.delta=0,Fi.start=0,Fi.end=0}function zi(e,t){var n=t.right;n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,t.right=n.left,n.left!==Fi&&(n.left.parent=t),n.parent=t.parent,t.parent===Fi?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,Ki(t),Ki(n)}function Ui(e,t){var n=t.left;t.delta-=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=n.delta,t.end-=n.delta,t.left=n.right,n.right!==Fi&&(n.right.parent=t),n.parent=t.parent,t.parent===Fi?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n,Ki(t),Ki(n)}function qi(e){var t=e.end;if(e.left!==Fi){var n=e.left.maxEnd;n>t&&(t=n)}if(e.right!==Fi){var r=e.right.maxEnd+e.delta;r>t&&(t=r)}return t}function Ki(e){e.maxEnd=qi(e)}function Gi(e){for(;e!==Fi;){var t=qi(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function $i(e,t,n,r){return e===n?t-r:e-n}var Zi=function(){function e(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}return e.prototype.next=function(){if(this.right!==Ji)return Xi(this.right);for(var e=this;e.parent!==Ji&&e.parent.left!==e;)e=e.parent;return e.parent===Ji?Ji:e.parent},e.prototype.prev=function(){if(this.left!==Ji)return Qi(this.left);for(var e=this;e.parent!==Ji&&e.parent.right!==e;)e=e.parent;return e.parent===Ji?Ji:e.parent},e.prototype.detach=function(){this.parent=null,this.left=null,this.right=null},e}(),Ji=new Zi(null,0);function Xi(e){for(;e.left!==Ji;)e=e.left;return e}function Qi(e){for(;e.right!==Ji;)e=e.right;return e}function eo(e){return e===Ji?0:e.size_left+e.piece.length+eo(e.right)}function to(e){return e===Ji?0:e.lf_left+e.piece.lineFeedCnt+to(e.right)}function no(){Ji.parent=Ji}function ro(e,t){var n=t.right;n.size_left+=t.size_left+(t.piece?t.piece.length:0),n.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=n.left,n.left!==Ji&&(n.left.parent=t),n.parent=t.parent,t.parent===Ji?e.root=n:t.parent.left===t?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}function io(e,t){var n=t.left;t.left=n.right,n.right!==Ji&&(n.right.parent=t),n.parent=t.parent,t.size_left-=n.size_left+(n.piece?n.piece.length:0),t.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),t.parent===Ji?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}function oo(e,t){var n,r;if(n=t.left===Ji?(r=t).right:t.right===Ji?(r=t).left:(r=Xi(t.right)).right,r===e.root)return e.root=n,n.color=0,t.detach(),no(),void(e.root.parent=Ji);var i=1===r.color;if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===t?(n.parent=r.parent,uo(e,n)):(r.parent===t?n.parent=r:n.parent=r.parent,uo(e,n),r.left=t.left,r.right=t.right,r.parent=t.parent,r.color=t.color,t===e.root?e.root=r:t===t.parent.left?t.parent.left=r:t.parent.right=r,r.left!==Ji&&(r.left.parent=r),r.right!==Ji&&(r.right.parent=r),r.size_left=t.size_left,r.lf_left=t.lf_left,uo(e,r)),t.detach(),n.parent.left===n){var o=eo(n),s=to(n);if(o!==n.parent.size_left||s!==n.parent.lf_left){var a=o-n.parent.size_left,u=s-n.parent.lf_left;n.parent.size_left=o,n.parent.lf_left=s,ao(e,n.parent,a,u)}}if(uo(e,n.parent),i)no();else{for(var c;n!==e.root&&0===n.color;)n===n.parent.left?(1===(c=n.parent.right).color&&(c.color=0,n.parent.color=1,ro(e,n.parent),c=n.parent.right),0===c.left.color&&0===c.right.color?(c.color=1,n=n.parent):(0===c.right.color&&(c.left.color=0,c.color=1,io(e,c),c=n.parent.right),c.color=n.parent.color,n.parent.color=0,c.right.color=0,ro(e,n.parent),n=e.root)):(1===(c=n.parent.left).color&&(c.color=0,n.parent.color=1,io(e,n.parent),c=n.parent.left),0===c.left.color&&0===c.right.color?(c.color=1,n=n.parent):(0===c.left.color&&(c.right.color=0,c.color=1,ro(e,c),c=n.parent.left),c.color=n.parent.color,n.parent.color=0,c.left.color=0,io(e,n.parent),n=e.root));n.color=0,no()}}function so(e,t){for(uo(e,t);t!==e.root&&1===t.parent.color;){var n;if(t.parent===t.parent.parent.left)1===(n=t.parent.parent.right).color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&ro(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,io(e,t.parent.parent));else 1===(n=t.parent.parent.left).color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&io(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,ro(e,t.parent.parent))}e.root.color=0}function ao(e,t,n,r){for(;t!==e.root&&t!==Ji;)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}function uo(e,t){var n=0,r=0;if(t!==e.root){if(0===n){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t===e.root)return;n=eo((t=t.parent).left)-t.size_left,r=to(t.left)-t.lf_left,t.size_left+=n,t.lf_left+=r}for(;t!==e.root&&(0!==n||0!==r);)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}}Ji.parent=Ji,Ji.left=Ji,Ji.right=Ji,Ji.color=0;var co=function(){function e(e,t,n){for(var r=new Uint8Array(e*t),i=0,o=e*t;i255?255:0|e}function ho(e){return e<0?0:e>4294967295?4294967295:0|e}var fo=function(){function e(t){var n=lo(t);this._defaultValue=n,this._asciiMap=e._createAsciiMap(n),this._map=new Map}return e._createAsciiMap=function(e){for(var t=new Uint8Array(256),n=0;n<256;n++)t[n]=e;return t},e.prototype.set=function(e,t){var n=lo(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)},e.prototype.get=function(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue},e}(),po=(function(){function e(){this._actual=new fo(0)}e.prototype.add=function(e){this._actual.set(e,1)},e.prototype.has=function(e){return 1===this._actual.get(e)}}(),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),go=function(e){function t(t){for(var n=e.call(this,0)||this,r=0,i=t.length;r=n)break;var r=e.charCodeAt(t);if(110===r||114===r||87===r)return!0}}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;var t=null;try{t=on(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0})}catch(e){return null}if(!t)return null;var n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new bo(t,this.wordSeparators?yo(this.wordSeparators):null,n?this.searchString:null)},e}();var bo=function(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n};function wo(e,t,n){if(!n)return new _i(e,null);for(var r=[],i=0,o=t.length;i>0);t[i]>=e?r=i-1:t[i+1]>=e?(n=i,r=i):n=i+1}return n+1},e}(),So=function(){function e(){}return e.findMatches=function(e,t,n,r,i){var o=t.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(e,n,new ko(o.wordSeparators,o.regex),r,i):this._doFindMatchesLineByLine(e,n,o,r,i):[]},e._getMultilineMatchRange=function(e,t,n,r,i,o){var s,a,u=0;if(s=r?t+i+(u=r.findLineFeedCountBeforeOffset(i)):t+i,r){var c=r.findLineFeedCountBeforeOffset(i+o.length)-u;a=s+o.length+c}else a=s+o.length;var l=e.getPositionAt(s),d=e.getPositionAt(a);return new Tr(l.lineNumber,l.column,d.lineNumber,d.column)},e._doFindMatchesMultiline=function(e,t,n,r,i){var o,s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),u="\r\n"===e.getEOL()?new Co(a):null,c=[],l=0;for(n.reset(0);o=n.next(a);)if(c[l++]=wo(this._getMultilineMatchRange(e,s,a,u,o.index,o[0]),o,r),l>=i)return c;return c},e._doFindMatchesLineByLine=function(e,t,n,r,i){var o=[],s=0;if(t.startLineNumber===t.endLineNumber){var a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return s=this._findMatchesInLine(n,a,t.startLineNumber,t.startColumn-1,s,o,r,i),o}var u=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);s=this._findMatchesInLine(n,u,t.startLineNumber,t.startColumn-1,s,o,r,i);for(var c=t.startLineNumber+1;c=a))return i;return i}var f,p=new ko(e.wordSeparators,e.regex);p.reset(0);do{if((f=p.next(t))&&(o[i++]=wo(new Tr(n,f.index+1+r,n,f.index+1+f[0].length+r),f,s),i>=a))return i}while(f);return i},e.findNextMatch=function(e,t,n,r){var i=t.parseSearchRequest();if(!i)return null;var o=new ko(i.wordSeparators,i.regex);return i.regex.multiline?this._doFindNextMatchMultiline(e,n,o,r):this._doFindNextMatchLineByLine(e,n,o,r)},e._doFindNextMatchMultiline=function(e,t,n,r){var i=new _t(t.lineNumber,1),o=e.getOffsetAt(i),s=e.getLineCount(),a=e.getValueInRange(new Tr(i.lineNumber,i.column,s,e.getLineMaxColumn(s)),1),u="\r\n"===e.getEOL()?new Co(a):null;n.reset(t.column-1);var c=n.next(a);return c?wo(this._getMultilineMatchRange(e,o,a,u,c.index,c[0]),c,r):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new _t(1,1),n,r):null},e._doFindNextMatchLineByLine=function(e,t,n,r){var i=e.getLineCount(),o=t.lineNumber,s=e.getLineContent(o),a=this._findFirstMatchInLine(n,s,o,t.column,r);if(a)return a;for(var u=1;u<=i;u++){var c=(o+u-1)%i,l=e.getLineContent(c+1),d=this._findFirstMatchInLine(n,l,c+1,1,r);if(d)return d}return null},e._findFirstMatchInLine=function(e,t,n,r,i){e.reset(r-1);var o=e.next(t);return o?wo(new Tr(n,o.index+1,n,o.index+1+o[0].length),o,i):null},e.findPreviousMatch=function(e,t,n,r){var i=t.parseSearchRequest();if(!i)return null;var o=new ko(i.wordSeparators,i.regex);return i.regex.multiline?this._doFindPreviousMatchMultiline(e,n,o,r):this._doFindPreviousMatchLineByLine(e,n,o,r)},e._doFindPreviousMatchMultiline=function(e,t,n,r){var i=this._doFindMatchesMultiline(e,new Tr(1,1,t.lineNumber,t.column),n,r,9990);if(i.length>0)return i[i.length-1];var o=e.getLineCount();return t.lineNumber!==o||t.column!==e.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(e,new _t(o,e.getLineMaxColumn(o)),n,r):null},e._doFindPreviousMatchLineByLine=function(e,t,n,r){var i=e.getLineCount(),o=t.lineNumber,s=e.getLineContent(o).substring(0,t.column-1),a=this._findLastMatchInLine(n,s,o,r);if(a)return a;for(var u=1;u<=i;u++){var c=(i+o-u-1)%i,l=e.getLineContent(c+1),d=this._findLastMatchInLine(n,l,c+1,r);if(d)return d}return null},e._findLastMatchInLine=function(e,t,n,r){var i,o=null;for(e.reset(0);i=e.next(t);)o=wo(new Tr(n,i.index+1,n,i.index+1+i[0].length),i,r);return o},e}();function xo(e,t,n,r,i){return function(e,t,n,r,i){if(0===r)return!0;var o=t.charCodeAt(r-1);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(i>0){var s=t.charCodeAt(r);if(0!==e.get(s))return!0}return!1}(e,t,0,r,i)&&function(e,t,n,r,i){if(r+i===n)return!0;var o=t.charCodeAt(r+i);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(i>0){var s=t.charCodeAt(r+i-1);if(0!==e.get(s))return!0}return!1}(e,t,n,r,i)}var ko=function(){function e(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}return e.prototype.reset=function(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0},e.prototype.next=function(e){var t,n=e.length;do{if(this._prevMatchStartIndex+this._prevMatchLength===n)return null;if(!(t=this._searchRegex.exec(e)))return null;var r=t.index,i=t[0].length;if(r===this._prevMatchStartIndex&&i===this._prevMatchLength){if(0===i){this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=i,!this._wordSeparators||xo(this._wordSeparators,e,n,r,i))return t}while(t);return null},e}();function Lo(e){var t;return(t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length)).set(e,0),t}var Mo=function(e,t,n,r,i){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=i};function Eo(e,t){void 0===t&&(t=!0);for(var n=[0],r=1,i=0,o=e.length;i=0;t--){var n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null},e.prototype.get2=function(e){for(var t=this._cache.length-1;t>=0;t--){var n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null},e.prototype.set=function(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)},e.prototype.valdiate=function(e){for(var t=!1,n=this._cache,r=0;r=e)&&(n[r]=null,t=!0)}if(t){for(var o=[],s=0,a=n;s0){e[i].lineStarts||(e[i].lineStarts=Eo(e[i].buffer));var s=new Do(i+1,{line:0,column:0},{line:e[i].lineStarts.length-1,column:e[i].buffer.length-e[i].lineStarts[e[i].lineStarts.length-1]},e[i].lineStarts.length-1,e[i].buffer.length);this._buffers.push(e[i]),r=this.rbInsertRight(r,s)}this._searchCache=new No(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()},e.prototype.normalizeEOL=function(e){var t=this,n=65535-Math.floor(21845),r=2*n,i="",o=0,s=[];if(this.iterate(this.root,(function(a){var u=t.getNodeContent(a),c=u.length;if(o<=n||o+c0){var a=i.replace(/\r\n|\r|\n/g,e);s.push(new To(a,Eo(a)))}this.create(s,e,!0)},e.prototype.getEOL=function(){return this._EOL},e.prototype.setEOL=function(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)},e.prototype.getOffsetAt=function(e,t){for(var n=0,r=this.root;r!==Ji;)if(r.left!==Ji&&r.lf_left+1>=e)r=r.left;else{if(r.lf_left+r.piece.lineFeedCnt+1>=e)return(n+=r.size_left)+(this.getAccumulatedValue(r,e-r.lf_left-2)+t-1);e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right}return n},e.prototype.getPositionAt=function(e){e=Math.floor(e),e=Math.max(0,e);for(var t=this.root,n=0,r=e;t!==Ji;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){var i=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+i.index,0===i.index){var o=this.getOffsetAt(n+1,1);return new _t(n+1,r-o+1)}return new _t(n+1,i.remainder+1)}if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===Ji){o=this.getOffsetAt(n+1,1);return new _t(n+1,r-e-o+1)}t=t.right}return new _t(1,1)},e.prototype.getValueInRange=function(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";var n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),i=this.getValueInRange2(n,r);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?i:i.replace(/\r\n|\r|\n/g,t):i},e.prototype.getValueInRange2=function(e,t){if(e.node===t.node){var n=e.node,r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r.substring(i+e.remainder,i+t.remainder)}var o=e.node,s=this._buffers[o.piece.bufferIndex].buffer,a=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start),u=s.substring(a+e.remainder,a+o.piece.length);for(o=o.next();o!==Ji;){var c=this._buffers[o.piece.bufferIndex].buffer,l=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start);if(o===t.node){u+=c.substring(l,l+t.remainder);break}u+=c.substr(l,o.piece.length),o=o.next()}return u},e.prototype.getLinesContent=function(){return this.getContentOfSubTree(this.root).split(/\r\n|\r|\n/)},e.prototype.getLength=function(){return this._length},e.prototype.getLineCount=function(){return this._lineCnt},e.prototype.getLineContent=function(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)},e.prototype.getLineCharCode=function(e,t){var n=this.nodeAt2(e,t+1);if(n.remainder===n.node.piece.length){var r=n.node.next();if(!r)return 0;var i=this._buffers[r.piece.bufferIndex],o=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);return i.buffer.charCodeAt(o)}i=this._buffers[n.node.piece.bufferIndex];var s=(o=this.offsetInBuffer(n.node.piece.bufferIndex,n.node.piece.start))+n.remainder;return i.buffer.charCodeAt(s)},e.prototype.getLineLength=function(e){if(e===this.getLineCount()){var t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength},e.prototype.findMatchesInNode=function(e,t,n,r,i,o,s,a,u,c,l){var d,h=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,i),g=this.offsetInBuffer(e.piece.bufferIndex,o);t.reset(p);var m={line:0,column:0};do{if(d=t.next(h.buffer)){if(d.index>=g)return c;this.positionInBuffer(e,d.index-f,m);var _=this.getLineFeedCnt(e.piece.bufferIndex,i,m),y=m.line===i.line?m.column-i.column+r:m.column+1,v=y+d[0].length;if(l[c++]=wo(new Tr(n+_,y,n+_,v),d,a),d.index+d[0].length>=g)return c;if(c>=u)return c}}while(d);return c},e.prototype.findMatchesLineByLine=function(e,t,n,r){var i=[],o=0,s=new ko(t.wordSeparators,t.regex),a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];var u=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===u)return[];var c=this.positionInBuffer(a.node,a.remainder),l=this.positionInBuffer(u.node,u.remainder);if(a.node===u.node)return this.findMatchesInNode(a.node,s,e.startLineNumber,e.startColumn,c,l,t,n,r,o,i),i;for(var d=e.startLineNumber,h=a.node;h!==u.node;){var f=this.getLineFeedCnt(h.piece.bufferIndex,c,h.piece.end);if(f>=1){var p=this._buffers[h.piece.bufferIndex].lineStarts,g=this.offsetInBuffer(h.piece.bufferIndex,h.piece.start),m=p[c.line+f],_=d===e.startLineNumber?e.startColumn:1;if((o=this.findMatchesInNode(h,s,d,_,c,this.positionInBuffer(h,m-g),t,n,r,o,i))>=r)return i;d+=f}var y=d===e.startLineNumber?e.startColumn-1:0;if(d===e.endLineNumber){var v=this.getLineContent(d).substring(y,e.endColumn-1);return o=this._findMatchesInLine(t,s,v,e.endLineNumber,y,o,i,n,r),i}if((o=this._findMatchesInLine(t,s,this.getLineContent(d).substr(y),d,y,o,i,n,r))>=r)return i;d++,h=(a=this.nodeAt2(d,1)).node,c=this.positionInBuffer(a.node,a.remainder)}if(d===e.endLineNumber){var b=d===e.startLineNumber?e.startColumn-1:0;v=this.getLineContent(d).substring(b,e.endColumn-1);return o=this._findMatchesInLine(t,s,v,e.endLineNumber,b,o,i,n,r),i}var w=d===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(u.node,s,d,w,c,l,t,n,r,o,i),i},e.prototype._findMatchesInLine=function(e,t,n,r,i,o,s,a,u){var c,l=e.wordSeparators;if(!a&&e.simpleSearch){for(var d=e.simpleSearch,h=d.length,f=n.length,p=-h;-1!==(p=n.indexOf(d,p+h));)if((!l||xo(l,n,f,p,h))&&(s[o++]=new _i(new Tr(r,p+1+i,r,p+1+h+i),null),o>=u))return o;return o}t.reset(0);do{if((c=t.next(n))&&(s[o++]=wo(new Tr(r,c.index+1+i,r,c.index+1+c[0].length+i),c,a),o>=u))return o}while(c);return o},e.prototype.insert=function(e,t,n){if(void 0===n&&(n=!1),this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ji){var r=this.nodeAt(e),i=r.node,o=r.remainder,s=r.nodeStartOffset,a=i.piece,u=a.bufferIndex,c=this.positionInBuffer(i,o);if(0===i.piece.bufferIndex&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.length<65535)return this.appendToNode(i,t),void this.computeBufferMetadata();if(s===e)this.insertContentToNodeLeft(t,i),this._searchCache.valdiate(e);else if(s+i.piece.length>e){var l=[],d=new Do(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(u,a.end)-this.offsetInBuffer(u,c));if(this.shouldCheckCRLF()&&this.endWithCR(t))if(10===this.nodeCharCodeAt(i,o)){var h={line:d.start.line+1,column:0};d=new Do(d.bufferIndex,h,d.end,this.getLineFeedCnt(d.bufferIndex,h,d.end),d.length-1),t+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(13===this.nodeCharCodeAt(i,o-1)){var f=this.positionInBuffer(i,o-1);this.deleteNodeTail(i,f),t="\r"+t,0===i.piece.length&&l.push(i)}else this.deleteNodeTail(i,c);else this.deleteNodeTail(i,c);var p=this.createNewPieces(t);d.length>0&&this.rbInsertRight(i,d);for(var g=i,m=0;m=0;u--)a=this.rbInsertLeft(a,s[u]);this.validateCRLFWithPrevNode(a),this.deleteNodes(n)},e.prototype.insertContentToNodeRight=function(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");for(var n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]),i=r,o=1;o=l))break;a=c+1}return n?(n.line=c,n.column=s-d,null):{line:c,column:s-d}},e.prototype.getLineFeedCnt=function(e,t,n){if(0===n.column)return n.line-t.line;var r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;var i=r[n.line+1],o=r[n.line]+n.column;if(i>o+1)return n.line-t.line;var s=o-1;return 13===this._buffers[e].buffer.charCodeAt(s)?n.line-t.line+1:n.line-t.line},e.prototype.offsetInBuffer=function(e,t){return this._buffers[e].lineStarts[t.line]+t.column},e.prototype.deleteNodes=function(e){for(var t=0;t65535){for(var t=[];e.length>65535;){var n=e.charCodeAt(65534),r=void 0;13===n||n>=55296&&n<=56319?(r=e.substring(0,65534),e=e.substring(65534)):(r=e.substring(0,65535),e=e.substring(65535));var i=Eo(r);t.push(new Do(this._buffers.length,{line:0,column:0},{line:i.length-1,column:r.length-i[i.length-1]},i.length-1,r.length)),this._buffers.push(new To(r,i))}var o=Eo(e);return t.push(new Do(this._buffers.length,{line:0,column:0},{line:o.length-1,column:e.length-o[o.length-1]},o.length-1,e.length)),this._buffers.push(new To(e,o)),t}var s=this._buffers[0].buffer.length,a=Eo(e,!1),u=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===s&&0!==s&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},u=this._lastChangeBufferPos;for(var c=0;c=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){o=this.getAccumulatedValue(n,e-n.lf_left-2),u=this.getAccumulatedValue(n,e-n.lf_left-1),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return c+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:c,nodeStartLineNumber:l-(e-1-n.lf_left)}),s.substring(a+o,a+u-t)}if(n.lf_left+n.piece.lineFeedCnt===e-1){o=this.getAccumulatedValue(n,e-n.lf_left-2),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=s.substring(a+o,a+n.piece.length);break}e-=n.lf_left+n.piece.lineFeedCnt,c+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==Ji;){s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){u=this.getAccumulatedValue(n,0),a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=s.substring(a,a+u-t)}a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=s.substr(a,n.piece.length),n=n.next()}return r},e.prototype.computeBufferMetadata=function(){for(var e=this.root,t=1,n=0;e!==Ji;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.valdiate(this._length)},e.prototype.getIndexOf=function(e,t){var n=e.piece,r=this.positionInBuffer(e,t),i=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){var o=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(o!==i)return{index:o,remainder:0}}return{index:i,remainder:r.column}},e.prototype.getAccumulatedValue=function(e,t){if(t<0)return 0;var n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,i=n.start.line+t+1;return i>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[i]-r[n.start.line]-n.start.column},e.prototype.deleteNodeTail=function(e,t){var n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.end),o=t,s=this.offsetInBuffer(n.bufferIndex,o),a=this.getLineFeedCnt(n.bufferIndex,n.start,o),u=a-r,c=s-i,l=n.length+c;e.piece=new Do(n.bufferIndex,n.start,o,a,l),ao(this,e,c,u)},e.prototype.deleteNodeHead=function(e,t){var n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.start),o=t,s=this.getLineFeedCnt(n.bufferIndex,o,n.end),a=s-r,u=i-this.offsetInBuffer(n.bufferIndex,o),c=n.length+u;e.piece=new Do(n.bufferIndex,o,n.end,s,c),ao(this,e,u,a)},e.prototype.shrinkNode=function(e,t,n){var r=e.piece,i=r.start,o=r.end,s=r.length,a=r.lineFeedCnt,u=t,c=this.getLineFeedCnt(r.bufferIndex,r.start,u),l=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,i);e.piece=new Do(r.bufferIndex,r.start,u,c,l),ao(this,e,l-s,c-a);var d=new Do(r.bufferIndex,n,o,this.getLineFeedCnt(r.bufferIndex,n,o),this.offsetInBuffer(r.bufferIndex,o)-this.offsetInBuffer(r.bufferIndex,n)),h=this.rbInsertRight(e,d);this.validateCRLFWithPrevNode(h)},e.prototype.appendToNode=function(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");var n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;for(var i=Eo(t,!1),o=0;oe)t=t.left;else{if(t.size_left+t.piece.length>=e){r+=t.size_left;var i={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right}return null},e.prototype.nodeAt2=function(e,t){for(var n=this.root,r=0;n!==Ji;)if(n.left!==Ji&&n.lf_left>=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){var i=this.getAccumulatedValue(n,e-n.lf_left-2),o=this.getAccumulatedValue(n,e-n.lf_left-1);return r+=n.size_left,{node:n,remainder:Math.min(i+t-1,o),nodeStartOffset:r}}if(n.lf_left+n.piece.lineFeedCnt===e-1){if((i=this.getAccumulatedValue(n,e-n.lf_left-2))+t-1<=n.piece.length)return{node:n,remainder:i+t-1,nodeStartOffset:r};t-=n.piece.length-i;break}e-=n.lf_left+n.piece.lineFeedCnt,r+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==Ji;){if(n.piece.lineFeedCnt>0){o=this.getAccumulatedValue(n,0);var s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,o),nodeStartOffset:s}}if(n.piece.length>=t-1)return{node:n,remainder:t-1,nodeStartOffset:this.offsetOfNode(n)};t-=n.piece.length,n=n.next()}return null},e.prototype.nodeCharCodeAt=function(e,t){if(e.piece.lineFeedCnt<1)return-1;var n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(r)},e.prototype.offsetOfNode=function(e){if(!e)return 0;for(var t=e.size_left;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t},e.prototype.shouldCheckCRLF=function(){return!(this._EOLNormalized&&"\n"===this._EOL)},e.prototype.startWithLF=function(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===Ji||0===e.piece.lineFeedCnt)return!1;var t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,i=n[r]+t.start.column;return r!==n.length-1&&(!(n[r+1]>i+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(i))},e.prototype.endWithCR=function(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==Ji&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)},e.prototype.validateCRLFWithPrevNode=function(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){var t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}},e.prototype.validateCRLFWithNextNode=function(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){var t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}},e.prototype.fixCRLF=function(e,t){var n,r=[],i=this._buffers[e.piece.bufferIndex].lineStarts;n=0===e.piece.end.column?{line:e.piece.end.line-1,column:i[e.piece.end.line]-i[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};var o=e.piece.length-1,s=e.piece.lineFeedCnt-1;e.piece=new Do(e.piece.bufferIndex,e.piece.start,n,s,o),ao(this,e,-1,-1),0===e.piece.length&&r.push(e);var a={line:t.piece.start.line+1,column:0},u=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new Do(t.piece.bufferIndex,a,t.piece.end,c,u),ao(this,t,-1,-1),0===t.piece.length&&r.push(t);var l=this.createNewPieces("\r\n");this.rbInsertRight(e,l[0]);for(var d=0;d0){g.sort((function(e,t){return t.lineNumber-e.lineNumber})),w=[];a=0;for(var C=g.length;a0&&g[a-1].lineNumber===_)){var S=g[a].oldContent,x=this.getLineContent(_);0!==x.length&&x!==S&&-1===an(x)&&w.push(_)}}}return new yi(v,b,w)},e.prototype._reduceOperations=function(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]},e.prototype._toSingleEditOperation=function(e){for(var t=!1,n=e[0].range,r=e[e.length-1].range,i=new Tr(n.startLineNumber,n.startColumn,r.endLineNumber,r.endColumn),o=n.startLineNumber,s=n.startColumn,a=[],u=0,c=e.length;u0){var d=a.lines.length,h=a.lines[0],f=a.lines[d-1];l=1===d?new Tr(u,c,u,c+h.length):new Tr(u,c,u+d-1,f.length+1)}else l=new Tr(u,c,u,c);n=l.endLineNumber,r=l.endColumn,t.push(l),i=a}return t},e._sortOpsAscending=function(e,t){var n=Tr.compareRangesUsingEnds(e.range,t.range);return 0===n?e.sortIndex-t.sortIndex:n},e._sortOpsDescending=function(e,t){var n=Tr.compareRangesUsingEnds(e.range,t.range);return 0===n?t.sortIndex-e.sortIndex:-n},e}(),Io=function(){function e(e,t,n,r,i,o,s,a){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=i,this._containsRTL=o,this._isBasicASCII=s,this._normalizeEOL=a}return e.prototype._getEOL=function(e){var t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":n>t/2?"\r\n":"\n"},e.prototype.create=function(e){var t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(var r=0,i=n.length;r=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}},e.prototype._acceptChunk1=function(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))},e.prototype._acceptChunk2=function(e){var t=function(e,t){e.length=0,e[0]=0;for(var n=1,r=0,i=0,o=0,s=!0,a=0,u=t.length;a126)&&(s=!1)}var l=new Mo(Lo(e),r,i,o,s);return e.length=0,l}(this._tmpLineStarts,e);this.chunks.push(new To(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=vn(e))},e.prototype.finish=function(e){return void 0===e&&(e=!0),this._finish(),new Io(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.isBasicASCII,e)},e.prototype._finish=function(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;var e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);var t=Eo(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}},e}(),Ro=function(){this.changeType=1},Fo=function(e,t){this.changeType=2,this.lineNumber=e,this.detail=t},Yo=function(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t},jo=function(e,t,n){this.changeType=4,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n},Bo=function(){this.changeType=5},Ho=function(){function e(e,t,n,r){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=r}return e.prototype.containsEvent=function(e){for(var t=0,n=this.changes.length;t=Uo&&e<=Ko||e>=qo&&e<=Go}function rs(e,t,n,r){for(var i,o="",s=0,a=-1,u=0,c=0;c<=e.length;++c){if(c2){var l=o.lastIndexOf(n);-1===l?(o="",s=0):s=(o=o.slice(0,l)).length-1-o.lastIndexOf(n),a=c,u=0;continue}if(2===o.length||1===o.length){o="",s=0,a=c,u=0;continue}}t&&(o.length>0?o+=n+"..":o="..",s=2)}else o.length>0?o+=n+e.slice(a+1,c):o=e.slice(a+1,c),s=c-a-1;a=c,u=0}else i===$o&&-1!==u?++u:u=-1}return o}function is(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}var os={resolve:function(){for(var e=[],t=0;t=-1;o--){var s=void 0;if(o>=0?s=e[o]:n?void 0!==(s=Vo.b["="+n]||Vo.a())&&s.slice(0,3).toLowerCase()===n.toLowerCase()+"\\"||(s=n+"\\"):s=Vo.a(),Qo(s,"path"),0!==s.length){var a=s.length,u=0,c="",l=!1,d=s.charCodeAt(0);if(a>1)if(es(d))if(l=!0,es(s.charCodeAt(1))){for(var h=2,f=h;h2&&es(s.charCodeAt(2))&&(l=!0,u=3));else es(d)&&(u=1,l=!0);if(!(c.length>0&&n.length>0&&c.toLowerCase()!==n.toLowerCase())&&(0===n.length&&c.length>0&&(n=c),i||(r=s.slice(u)+"\\"+r,i=l),n.length>0&&i))break}}return n+(i?"\\":"")+(r=rs(r,!i,"\\",es))||"."},normalize:function(e){Qo(e,"path");var t=e.length;if(0===t)return".";var n,r,i=0,o=!1,s=e.charCodeAt(0);if(t>1)if(es(s))if(o=!0,es(e.charCodeAt(1))){for(var a=2,u=a;a2&&es(e.charCodeAt(2))&&(o=!0,i=3));else if(es(s))return"\\";return 0!==(r=i0&&es(e.charCodeAt(t-1))&&(r+="\\"),void 0===n?o?r.length>0?"\\"+r:"\\":r.length>0?r:"":o?r.length>0?n+"\\"+r:n+"\\":r.length>0?n+r:n},isAbsolute:function(e){Qo(e,"path");var t=e.length;if(0===t)return!1;var n=e.charCodeAt(0);return!!es(n)||!!(ns(n)&&t>2&&58===e.charCodeAt(1)&&es(e.charCodeAt(2)))},join:function(){for(var e,t,n=[],r=0;r0&&(void 0===e?e=t=o:e+="\\"+o)}if(void 0===e)return".";var s=!0,a=0;if("string"==typeof t&&es(t.charCodeAt(0))){++a;var u=t.length;u>1&&es(t.charCodeAt(1))&&(++a,u>2&&(es(t.charCodeAt(2))?++a:s=!1))}if(s){for(;a=2&&(e="\\"+e.slice(a))}return os.normalize(e)},relative:function(e,t){if(Qo(e,"from"),Qo(t,"to"),e===t)return"";var n=os.resolve(e),r=os.resolve(t);if(n===r)return"";if((e=n.toLowerCase())===(t=r.toLowerCase()))return"";for(var i=0;ii&&e.charCodeAt(o-1)===Jo;--o);for(var s=o-i,a=0;aa&&t.charCodeAt(u-1)===Jo;--u);for(var c=u-a,l=sl){if(t.charCodeAt(a+h)===Jo)return r.slice(a+h+1);if(2===h)return r.slice(a+h)}s>l&&(e.charCodeAt(i+h)===Jo?d=h:2===h&&(d=3));break}var f=e.charCodeAt(i+h);if(f!==t.charCodeAt(a+h))break;f===Jo&&(d=h)}if(h!==l&&-1===d)return r;var p="";for(-1===d&&(d=0),h=i+d+1;h<=o;++h)h!==o&&e.charCodeAt(h)!==Jo||(0===p.length?p+="..":p+="\\..");return p.length>0?p+r.slice(a+d,u):(a+=d,r.charCodeAt(a)===Jo&&++a,r.slice(a,u))},toNamespacedPath:function(e){if("string"!=typeof e)return e;if(0===e.length)return"";var t=os.resolve(e);if(t.length>=3)if(t.charCodeAt(0)===Jo){if(t.charCodeAt(1)===Jo){var n=t.charCodeAt(2);if(63!==n&&n!==$o)return"\\\\?\\UNC\\"+t.slice(2)}}else if(ns(t.charCodeAt(0))&&58===t.charCodeAt(1)&&t.charCodeAt(2)===Jo)return"\\\\?\\"+t;return e},dirname:function(e){Qo(e,"path");var t=e.length;if(0===t)return".";var n=-1,r=-1,i=!0,o=0,s=e.charCodeAt(0);if(t>1)if(es(s)){if(n=o=1,es(e.charCodeAt(1))){for(var a=2,u=a;a2&&es(e.charCodeAt(2))&&(n=o=3));else if(es(s))return e;for(var c=t-1;c>=o;--c)if(es(e.charCodeAt(c))){if(!i){r=c;break}}else i=!1;if(-1===r){if(-1===n)return".";r=n}return e.slice(0,r)},basename:function(e,t){void 0!==t&&Qo(t,"ext"),Qo(e,"path");var n,r=0,i=-1,o=!0;e.length>=2&&(ns(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(r=2));if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,a=-1;for(n=e.length-1;n>=r;--n){var u=e.charCodeAt(n);if(es(u)){if(!o){r=n+1;break}}else-1===a&&(o=!1,a=n+1),s>=0&&(u===t.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=a))}return r===i?i=a:-1===i&&(i=e.length),e.slice(r,i)}for(n=e.length-1;n>=r;--n)if(es(e.charCodeAt(n))){if(!o){r=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":e.slice(r,i)},extname:function(e){Qo(e,"path");var t=0,n=-1,r=0,i=-1,o=!0,s=0;e.length>=2&&58===e.charCodeAt(1)&&ns(e.charCodeAt(0))&&(t=r=2);for(var a=e.length-1;a>=t;--a){var u=e.charCodeAt(a);if(es(u)){if(!o){r=a+1;break}}else-1===i&&(o=!1,i=a+1),u===$o?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1)}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new Xo("pathObject","Object",e);return is("\\",e)},parse:function(e){Qo(e,"path");var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n=e.length,r=0,i=e.charCodeAt(0);if(n>1){if(es(i)){if(r=1,es(e.charCodeAt(1))){for(var o=2,s=o;o2))return t.root=t.dir=e,t;if(es(e.charCodeAt(2))){if(3===n)return t.root=t.dir=e,t;r=3}}}else if(es(i))return t.root=t.dir=e,t;r>0&&(t.root=e.slice(0,r));for(var a=-1,u=r,c=-1,l=!0,d=e.length-1,h=0;d>=r;--d)if(es(i=e.charCodeAt(d))){if(!l){u=d+1;break}}else-1===c&&(l=!1,c=d+1),i===$o?-1===a?a=d:1!==h&&(h=1):-1!==a&&(h=-1);return-1===a||-1===c||0===h||1===h&&a===c-1&&a===u+1?-1!==c&&(t.base=t.name=e.slice(u,c)):(t.name=e.slice(u,a),t.base=e.slice(u,c),t.ext=e.slice(a,c)),t.dir=u>0&&u!==r?e.slice(0,u-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},ss={resolve:function(){for(var e=[],t=0;t=-1&&!r;i--){var o=void 0;Qo(o=i>=0?e[i]:Vo.a(),"path"),0!==o.length&&(n=o+"/"+n,r=o.charCodeAt(0)===Zo)}return n=rs(n,!r,"/",ts),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(Qo(e,"path"),0===e.length)return".";var t=e.charCodeAt(0)===Zo,n=e.charCodeAt(e.length-1)===Zo;return 0!==(e=rs(e,!t,"/",ts)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return Qo(e,"path"),e.length>0&&e.charCodeAt(0)===Zo},join:function(){for(var e,t=[],n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":ss.normalize(e)},relative:function(e,t){if(Qo(e,"from"),Qo(t,"to"),e===t)return"";if((e=ss.resolve(e))===(t=ss.resolve(t)))return"";for(var n=1;na){if(t.charCodeAt(o+c)===Zo)return t.slice(o+c+1);if(0===c)return t.slice(o+c)}else i>a&&(e.charCodeAt(n+c)===Zo?u=c:0===c&&(u=0));break}var l=e.charCodeAt(n+c);if(l!==t.charCodeAt(o+c))break;l===Zo&&(u=c)}var d="";for(c=n+u+1;c<=r;++c)c!==r&&e.charCodeAt(c)!==Zo||(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(o+u):(o+=u,t.charCodeAt(o)===Zo&&++o,t.slice(o))},toNamespacedPath:function(e){return e},dirname:function(e){if(Qo(e,"path"),0===e.length)return".";for(var t=e.charCodeAt(0)===Zo,n=-1,r=!0,i=e.length-1;i>=1;--i)if(e.charCodeAt(i)===Zo){if(!r){n=i;break}}else r=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)},basename:function(e,t){void 0!==t&&Qo(t,"ext"),Qo(e,"path");var n,r=0,i=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(u===Zo){if(!o){r=n+1;break}}else-1===a&&(o=!1,a=n+1),s>=0&&(u===t.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=a))}return r===i?i=a:-1===i&&(i=e.length),e.slice(r,i)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===Zo){if(!o){r=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":e.slice(r,i)},extname:function(e){Qo(e,"path");for(var t=-1,n=0,r=-1,i=!0,o=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(a!==Zo)-1===r&&(i=!1,r=s+1),a===$o?-1===t?t=s:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=s+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)},format:function(e){if(null===e||"object"!=typeof e)throw new Xo("pathObject","Object",e);return is("/",e)},parse:function(e){Qo(e,"path");var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,r=e.charCodeAt(0)===Zo;r?(t.root="/",n=1):n=0;for(var i=-1,o=0,s=-1,a=!0,u=e.length-1,c=0;u>=n;--u){var l=e.charCodeAt(u);if(l!==Zo)-1===s&&(a=!1,s=u+1),l===$o?-1===i?i=u:1!==c&&(c=1):-1!==i&&(c=-1);else if(!a){o=u+1;break}}return-1===i||-1===s||0===c||1===c&&i===s-1&&i===o+1?-1!==s&&(t.base=t.name=0===o&&r?e.slice(1,s):e.slice(o,s)):(0===o&&r?(t.name=e.slice(1,i),t.base=e.slice(1,s)):(t.name=e.slice(o,i),t.base=e.slice(o,s)),t.ext=e.slice(i,s)),o>0?t.dir=e.slice(0,o-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};ss.win32=os.win32=os,ss.posix=os.posix=ss;var as="win32"===Vo.c?os.normalize:ss.normalize,us="win32"===Vo.c?os.join:ss.join,cs="win32"===Vo.c?os.relative:ss.relative,ls="win32"===Vo.c?os.dirname:ss.dirname,ds="win32"===Vo.c?os.basename:ss.basename,hs="win32"===Vo.c?os.extname:ss.extname,fs="win32"===Vo.c?os.sep:ss.sep;var ps,gs,ms=Object.freeze((function(e,t){var n=setTimeout(e.bind(t),0);return{dispose:function(){clearTimeout(n)}}}));(gs=ps||(ps={})).isCancellationToken=function(e){return e===gs.None||e===gs.Cancelled||e instanceof _s||!(!e||"object"!=typeof e)&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},gs.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:It.None}),gs.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ms});var _s=function(){function e(){this._isCancelled=!1,this._emitter=null}return e.prototype.cancel=function(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))},Object.defineProperty(e.prototype,"isCancellationRequested",{get:function(){return this._isCancelled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onCancellationRequested",{get:function(){return this._isCancelled?ms:(this._emitter||(this._emitter=new Ht),this._emitter.event)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._emitter&&(this._emitter.dispose(),this._emitter=null)},e}(),ys=function(){function e(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}return Object.defineProperty(e.prototype,"token",{get:function(){return this._token||(this._token=new _s),this._token},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this._token?this._token instanceof _s&&this._token.cancel():this._token=ps.Cancelled},e.prototype.dispose=function(){this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof _s&&this._token.dispose():this._token=ps.None},e}();function vs(e){var t=new ys,n=e(t.token),r=new Promise((function(e,r){t.token.onCancellationRequested((function(){r(Ve())})),Promise.resolve(n).then((function(n){t.dispose(),e(n)}),(function(e){t.dispose(),r(e)}))}));return new(function(){function e(){}return e.prototype.cancel=function(){t.cancel()},e.prototype.then=function(e,t){return r.then(e,t)},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(e){return r.finally(e)},e}())}var bs=function(){function e(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,this.task=null}return e.prototype.trigger=function(e,t){var n=this;return void 0===t&&(t=this.defaultDelay),this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((function(e,t){n.doResolve=e,n.doReject=t})).then((function(){n.completionPromise=null,n.doResolve=null;var e=n.task;return n.task=null,e()}))),this.timeout=setTimeout((function(){n.timeout=null,n.doResolve(null)}),t),this.completionPromise},e.prototype.isTriggered=function(){return null!==this.timeout},e.prototype.cancel=function(){this.cancelTimeout(),this.completionPromise&&(this.doReject(Ve()),this.completionPromise=null)},e.prototype.cancelTimeout=function(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},e.prototype.dispose=function(){this.cancelTimeout()},e}();function ws(e,t){void 0===t&&(t=0);var n=setTimeout(e,t);return Mt((function(){return clearTimeout(n)}))}var Cs,Ss=function(){function e(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}return e.prototype.dispose=function(){this.cancel()},e.prototype.cancel=function(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)},e.prototype.cancelAndSet=function(e,t){var n=this;this.cancel(),this._token=setTimeout((function(){n._token=-1,e()}),t)},e.prototype.setIfNotSet=function(e,t){var n=this;-1===this._token&&(this._token=setTimeout((function(){n._token=-1,e()}),t))},e}(),xs=function(){function e(){this._token=-1}return e.prototype.dispose=function(){this.cancel()},e.prototype.cancel=function(){-1!==this._token&&(clearInterval(this._token),this._token=-1)},e.prototype.cancelAndSet=function(e,t){this.cancel(),this._token=setInterval((function(){e()}),t)},e}(),ks=function(){function e(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}return e.prototype.dispose=function(){this.cancel(),this.runner=null},e.prototype.cancel=function(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)},e.prototype.schedule=function(e){void 0===e&&(e=this.timeout),this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)},e.prototype.isScheduled=function(){return-1!==this.timeoutToken},e.prototype.onTimeout=function(){this.timeoutToken=-1,this.runner&&this.doRun()},e.prototype.doRun=function(){this.runner&&this.runner()},e}();!function(){if("function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback){var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});Cs=function(t){var n=setTimeout((function(){return t(e)})),r=!1;return{dispose:function(){r||(r=!0,clearTimeout(n))}}}}else Cs=function(e,t){var n=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0),r=!1;return{dispose:function(){r||(r=!0,cancelIdleCallback(n))}}}}();var Ls=function(){function e(e){var t=this;this._didRun=!1,this._executor=function(){try{t._value=e()}catch(e){t._error=e}finally{t._didRun=!0}},this._handle=Cs((function(){return t._executor()}))}return e.prototype.dispose=function(){this._handle.dispose()},e.prototype.getValue=function(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value},e}(),Ms="**",Es="/",Ds="[/\\\\]",Ts="[^/\\\\]",Ns=/\//g;function Os(e){switch(e){case 0:return"";case 1:return Ts+"*?";default:return"(?:"+Ds+"|"+Ts+"+"+Ds+"|"+Ds+Ts+"+)*?"}}function As(e,t){if(!e)return[];for(var n=[],r=!1,i=!1,o="",s=0,a=e;se.length)return!1;if(n){if(!gn(e,t))return!1;if(t.length===e.length)return!0;var i=t.length;return t.charAt(t.length-1)===r&&i--,e.charAt(i)===r}return t.charAt(t.length-1)!==r&&(t+=r),0===e.indexOf(t)}(n,t.base)?e(cs(t.base,n),r):null}}function Us(e,t){return t.trimForExclusions&&rn(e,"/**")?e.substr(0,e.length-2):e}function qs(e,t,n){var r=fs!==ss.sep?e.replace(Ns,fs):e,i=fs+r,o=n?function(e,n){return"string"!=typeof e||e!==r&&!rn(e,i)?null:t}:function(e,n){return"string"==typeof e&&e===r?t:null};return o.allPaths=[(n?"*/":"./")+e],o}function Ks(e,t,n){return!(!e||"string"!=typeof t)&&function(e,t){void 0===t&&(t={});if(!e)return Hs;if("string"==typeof e||(i=e,o=i,o&&"string"==typeof o.base&&"string"==typeof o.pattern)){var n=Vs(e,t);if(n===Ws)return Hs;var r=function(e,t){return!!n(e,t)};return n.allBasenames&&(r.allBasenames=n.allBasenames),n.allPaths&&(r.allPaths=n.allPaths),r}var i,o;return function(e,t){var n=Gs(Object.getOwnPropertyNames(e).map((function(n){return function(e,t,n){if(!1===t)return Ws;var r=Vs(e,n);if(r===Ws)return Ws;if("boolean"==typeof t)return r;if(t){var i=t.when;if("string"==typeof i){var o=function(t,n,o,s){if(!s||!r(t,n))return null;var a,u=s(i.replace("$(basename)",o));return(a=u)&&"function"==typeof a.then?u.then((function(t){return t?e:null})):u?e:null};return o.requiresSiblings=!0,o}}return r}(n,e[n],t)})).filter((function(e){return e!==Ws}))),r=n.length;if(!r)return Ws;if(!n.some((function(e){return!!e.requiresSiblings}))){if(1===r)return n[0];var i=function(e,t){for(var r=0,i=n.length;r0;n--){var o=e.charCodeAt(n-1);if(47===o||92===o)break}t=e.substr(n)}var s=i.indexOf(t);return-1!==s?r[s]:null};a.basenames=i,a.patterns=r,a.allBasenames=i;var u=e.filter((function(e){return!e.basenames}));return u.push(a),u}function $s(e,t,n,r){if(Array.isArray(e)){for(var i=0,o=0,s=e;oi&&(i=a)}return i}if("string"==typeof e)return r?"*"===e?5:e===n?10:0:0;if(e){var u=e.language,c=e.pattern,l=e.scheme,d=e.hasAccessToAllModels;if(!r&&!d)return 0;i=0;if(l)if(l===t.scheme)i=10;else{if("*"!==l)return 0;i=5}if(u)if(u===n)i=10;else{if("*"!==u)return 0;i=Math.max(i,5)}if(c){if(c!==t.fsPath&&!Ks(c,t.fsPath))return 0;i=10}return i}return 0}function Zs(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(Zs):!!e.exclusive)}var Js,Xs,Qs,ea=function(){function e(){this._clock=0,this._entries=[],this._onDidChange=new Ht}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this,r={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(r),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Mt((function(){if(r){var e=n._entries.indexOf(r);e>=0&&(n._entries.splice(e,1),n._lastCandidate=void 0,n._onDidChange.fire(n._entries.length),r=void 0)}}))},e.prototype.has=function(e){return this.all(e).length>0},e.prototype.all=function(e){if(!e)return[];this._updateScores(e);for(var t=[],n=0,r=this._entries;n0&&t.push(i.provider)}return t},e.prototype.ordered=function(e){var t=[];return this._orderedForEach(e,(function(e){return t.push(e.provider)})),t},e.prototype.orderedGroups=function(e){var t,n,r=[];return this._orderedForEach(e,(function(e){t&&n===e._score?t.push(e.provider):(n=e._score,t=[e.provider],r.push(t))})),r},e.prototype._orderedForEach=function(e,t){if(e){this._updateScores(e);for(var n=0,r=this._entries;n0&&t(i)}}},e.prototype._updateScores=function(t){var n={uri:t.uri.toString(),language:t.getLanguageIdentifier().language};if(!this._lastCandidate||this._lastCandidate.language!==n.language||this._lastCandidate.uri!==n.uri){this._lastCandidate=n;for(var r=0,i=this._entries;r0){for(var s=0,a=this._entries;st._score?-1:e._timet._time?-1:0},e}(),ta=function(){function e(){this._map=new Map,this._promises=new Map,this._onDidChange=new Ht,this.onDidChange=this._onDidChange.event,this._colorMap=null}return e.prototype.fire=function(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})},e.prototype.register=function(e,t){var n=this;return this._map.set(e,t),this.fire([e]),Mt((function(){n._map.get(e)===t&&(n._map.delete(e),n.fire([e]))}))},e.prototype.registerPromise=function(e,t){var n=this,r=null,i=!1;return this._promises.set(e,t.then((function(t){n._promises.delete(e),!i&&t&&(r=n.register(e,t))}))),Mt((function(){i=!0,r&&r.dispose()}))},e.prototype.getPromise=function(e){var t=this,n=this.get(e);if(n)return Promise.resolve(n);var r=this._promises.get(e);return r?r.then((function(n){return t.get(e)})):null},e.prototype.get=function(e){return Fe(this._map.get(e))},e.prototype.setColorMap=function(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Wn(this._map),changedColorMap:!0})},e.prototype.getColorMap=function(){return this._colorMap},e.prototype.getDefaultBackground=function(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null},e}(),na=function(e,t){this.language=e,this.id=t},ra=function(){function e(){}return e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(1792&e)>>>8},e.getFontStyle=function(e){return(14336&e)>>>11},e.getForeground=function(e){return(8372224&e)>>>14},e.getBackground=function(e){return(4286578688&e)>>>23},e.getClassNameFromMetadata=function(e){var t="mtk"+this.getForeground(e),n=this.getFontStyle(e);return 1&n&&(t+=" mtki"),2&n&&(t+=" mtkb"),4&n&&(t+=" mtku"),t},e.getInlineStyleFromMetadata=function(e,t){var n=this.getForeground(e),r=this.getFontStyle(e),i="color: "+t[n]+";";return 1&r&&(i+="font-style: italic;"),2&r&&(i+="font-weight: bold;"),4&r&&(i+="text-decoration: underline;"),i},e}();(Js=Object.create(null))[0]="method",Js[1]="function",Js[2]="constructor",Js[3]="field",Js[4]="variable",Js[5]="class",Js[6]="struct",Js[7]="interface",Js[8]="module",Js[9]="property",Js[10]="event",Js[11]="operator",Js[12]="unit",Js[13]="value",Js[14]="constant",Js[15]="enum",Js[16]="enum-member",Js[17]="keyword",Js[25]="snippet",Js[18]="text",Js[19]="color",Js[20]="file",Js[21]="reference",Js[22]="customcolor",Js[23]="folder",Js[24]="type-parameter",function(){var e=Object.create(null);e.method=0,e.function=1,e.constructor=2,e.field=3,e.variable=4,e.class=5,e.struct=6,e.interface=7,e.module=8,e.property=9,e.event=10,e.operator=11,e.unit=12,e.value=13,e.constant=14,e.enum=15,e["enum-member"]=16,e.enumMember=16,e.keyword=17,e.snippet=25,e.text=18,e.color=19,e.file=20,e.reference=21,e.customcolor=22,e.folder=23,e["type-parameter"]=24,e.typeParameter=24}();!function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(Xs||(Xs={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(Qs||(Qs={}));(ia=Object.create(null))[0]="file",ia[1]="module",ia[2]="namespace",ia[3]="package",ia[4]="class",ia[5]="method",ia[6]="property",ia[7]="field",ia[8]="constructor",ia[9]="enum",ia[10]="interface",ia[11]="function",ia[12]="variable",ia[13]="constant",ia[14]="string",ia[15]="number",ia[16]="boolean",ia[17]="array",ia[18]="object",ia[19]="key",ia[20]="null",ia[21]="enum-member",ia[22]="struct",ia[23]="event",ia[24]="operator",ia[25]="type-parameter";var ia,oa=function(){function e(e){this.value=e}return e.Comment=new e("comment"),e.Imports=new e("imports"),e.Region=new e("region"),e}();var sa=new ea,aa=new ea,ua=new ea,ca=new ea,la=new ea,da=new ea,ha=new ea,fa=new ea,pa=new ea,ma=new ea,_a=new ea,ya=new ea,va=new ea,ba=new ea,wa=new ea,Ca=new ea,Sa=new ea,xa=new ea,ka=new ea,La=new ea,Ma=new ta,Ea=function(){function e(e,t){this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t}return e.prototype.equals=function(t){return t instanceof e&&this.slicedEquals(t,0,this._tokensCount)},e.prototype.slicedEquals=function(e,t,n){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;for(var r=t<<1,i=r+(n<<1),o=r;o0?this._tokens[e-1<<1]:0},e.prototype.getLanguageId=function(e){var t=this._tokens[1+(e<<1)];return ra.getLanguageId(t)},e.prototype.getStandardTokenType=function(e){var t=this._tokens[1+(e<<1)];return ra.getTokenType(t)},e.prototype.getForeground=function(e){var t=this._tokens[1+(e<<1)];return ra.getForeground(t)},e.prototype.getClassName=function(e){var t=this._tokens[1+(e<<1)];return ra.getClassNameFromMetadata(t)},e.prototype.getInlineStyle=function(e,t){var n=this._tokens[1+(e<<1)];return ra.getInlineStyleFromMetadata(n,t)},e.prototype.getEndOffset=function(e){return this._tokens[e<<1]},e.prototype.findTokenIndexAtOffset=function(t){return e.findIndexInTokensArray(this._tokens,t)},e.prototype.inflate=function(){return this},e.prototype.sliceAndInflate=function(e,t,n){return new Da(this,e,t,n)},e.convertToEndOffset=function(e,t){for(var n=(e.length>>>1)-1,r=0;r>>1)-1;nt&&(r=i)}return n},e}(),Da=function(){function e(e,t,n,r){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(var i=this._firstTokenIndex,o=e.getCount();i=n)break;this._tokensCount++}}return e.prototype.equals=function(t){return t instanceof e&&(this._startOffset===t._startOffset&&this._endOffset===t._endOffset&&this._deltaOffset===t._deltaOffset&&this._source.slicedEquals(t._source,this._firstTokenIndex,this._tokensCount))},e.prototype.getCount=function(){return this._tokensCount},e.prototype.getForeground=function(e){return this._source.getForeground(this._firstTokenIndex+e)},e.prototype.getEndOffset=function(e){var t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset},e.prototype.getClassName=function(e){return this._source.getClassName(this._firstTokenIndex+e)},e.prototype.getInlineStyle=function(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)},e.prototype.findTokenIndexAtOffset=function(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex},e}(),Ta=function(){function e(e,t,n){this.offset=0|e,this.type=t,this.language=n}return e.prototype.toString=function(){return"("+this.offset+", "+this.type+")"},e}(),Na=function(e,t){this.tokens=e,this.endState=t},Oa=function(e,t){this.tokens=e,this.endState=t},Aa=new(function(){function e(){}return e.prototype.clone=function(){return this},e.prototype.equals=function(e){return this===e},e}()),Ia=new na("vs.editor.nullMode",0);function Pa(e,t,n,r){var i=new Uint32Array(2);return i[0]=r,i[1]=(16384|e<<0|2<<23)>>>0,new Oa(i,null===n?Aa:n)}var Ra=Ge.b.performance&&"function"==typeof Ge.b.performance.now,Fa=function(){function e(e){this._highResolution=Ra&&e,this._startTime=this._now(),this._stopTime=-1}return e.create=function(t){return void 0===t&&(t=!0),new e(t)},e.prototype.stop=function(){this._stopTime=this._now()},e.prototype.elapsed=function(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime},e.prototype._now=function(){return this._highResolution?Ge.b.performance.now():(new Date).getTime()},e}();function Ya(e){for(var t=0,n=0,r=0,i=e.length;r>>0}var Ba=new Uint32Array(0).buffer,Ha=function(){function e(){this.tokens=[]}return e.prototype.add=function(e,t){if(this.tokens.length>0){var n=this.tokens[this.tokens.length-1];if(n.startLineNumber+n.tokens.length-1+1===e)return void n.tokens.push(t)}this.tokens.push(new Wa(e,[t]))},e}(),Wa=function(e,t){this.startLineNumber=e,this.tokens=t};function Va(e){return e instanceof Uint32Array?e:new Uint32Array(e)}var za,Ua=function(){function e(){this._lineTokens=[],this._len=0}return e.prototype.flush=function(){this._lineTokens=[],this._len=0},e.prototype.getTokens=function(e,t,n){var r=null;if(t1&&(i=ra.getLanguageId(r[1])!==e),!i)return Ba}if(!r||0===r.length){var o=new Uint32Array(2);return o[0]=t,o[1]=ja(e),o.buffer}return r[r.length-2]=t,0===r.byteOffset&&r.byteLength===r.buffer.byteLength?r.buffer:r},e.prototype._ensureLine=function(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++},e.prototype._deleteLines=function(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)},e.prototype._insertLines=function(e,t){if(0!==t){for(var n=[],r=0;r=this._len))if(t.startLineNumber!==t.endLineNumber){this._lineTokens[n]=e._deleteEnding(this._lineTokens[n],t.startColumn-1);var r=t.endLineNumber-1,i=null;r=this._len||(0!==n?(this._lineTokens[i]=e._deleteEnding(this._lineTokens[i],t.column-1),this._lineTokens[i]=e._insert(this._lineTokens[i],t.column-1,r),this._insertLines(t.lineNumber,n)):this._lineTokens[i]=e._insert(this._lineTokens[i],t.column-1,r))}},e._deleteBeginning=function(t,n){return null===t||t===Ba?t:e._delete(t,0,n)},e._deleteEnding=function(t,n){if(null===t||t===Ba)return t;var r=Va(t),i=r[r.length-2];return e._delete(t,n,i)},e._delete=function(e,t,n){if(null===e||e===Ba||t===n)return e;var r=Va(e),i=r.length>>>1;if(0===t&&r[r.length-2]===n)return Ba;var o,s,a=Ea.findIndexInTokensArray(r,t),u=a>0?r[a-1<<1]:0;if(ns&&(r[o++]=f,r[o++]=r[1+(h<<1)],s=f)}if(o===r.length)return e;var p=new Uint32Array(o);return p.set(r.subarray(0,o),0),p.buffer},e._append=function(e,t){if(t===Ba)return e;if(e===Ba)return t;if(null===e)return e;if(null===t)return null;var n=Va(e),r=Va(t),i=r.length>>>1,o=new Uint32Array(n.length+r.length);o.set(n,0);for(var s=n.length,a=n[n.length-2],u=0;u>>1,o=Ea.findIndexInTokensArray(r,t);o>0&&(r[o-1<<1]===t&&o--);for(var s=o;s=this._len;)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++},e.prototype._deleteLines=function(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)},e.prototype._insertLines=function(e,t){if(0!==t){for(var n=[],r=[],i=0;i=0;i--)this._invalidateLine(e.startLineNumber+i-1);this._acceptDeleteRange(e),this._acceptInsertText(new _t(e.startLineNumber,e.startColumn),t)},e.prototype._acceptDeleteRange=function(e){e.startLineNumber-1>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)},e.prototype._acceptInsertText=function(e,t){e.lineNumber-1>=this._len||this._insertLines(e.lineNumber,t)},e}(),Ga=function(e){function t(t){var n=e.call(this)||this;return n._textModel=t,n._tokenizationStateStore=new Ka,n._revalidateTokensTimeout=-1,n._tokenizationSupport=null,n._register(Ma.onDidChange((function(e){var t=n._textModel.getLanguageIdentifier();-1!==e.changedLanguages.indexOf(t.language)&&(n._resetTokenizationState(),n._textModel.clearTokens())}))),n._register(n._textModel.onDidChangeRawContentFast((function(e){e.containsEvent(1)&&n._resetTokenizationState()}))),n._register(n._textModel.onDidChangeContentFast((function(e){for(var t=0,r=e.changes.length;t20);){if(this._tokenizeOneInvalidLine(t)>=e)break}this._beginBackgroundTokenization(),this._textModel.setTokens(t.tokens)},t.prototype.tokenizeViewport=function(e,t){var n=new Ha;this._tokenizeViewport(n,e,t),this._textModel.setTokens(n.tokens)},t.prototype.reset=function(){this._resetTokenizationState(),this._textModel.clearTokens()},t.prototype.forceTokenization=function(e){var t=new Ha;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens)},t.prototype.isCheapToTokenize=function(e){if(!this._tokenizationSupport)return!0;var t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e0&&s>=1;s--){var a=this._textModel.getLineFirstNonWhitespaceColumn(s);if(0!==a&&a=0;s--){c=(h=$a(u,this._tokenizationSupport,i[s],c)).endState}for(var l=t;l<=n;l++){var d=this._textModel.getLineContent(l),h=$a(u,this._tokenizationSupport,d,c);e.add(l,h.tokens),this._tokenizationStateStore.setFakeTokens(l-1),c=h.endState}}},t}(Dt);function $a(e,t,n,r){var i=null;if(t)try{i=t.tokenize2(n,r.clone(),0)}catch(e){je(e)}return i||(i=Pa(e.id,0,r,0)),Ea.convertToEndOffset(i.tokens,n.length),i}!function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(za||(za={}));var Za=function(){function e(e){if(this.open=e.open,this.close=e.close,this._standardTokenMask=0,Array.isArray(e.notIn))for(var t=0,n=e.notIn.length;t0&&e.getLanguageId(s-1)===i;)s--;return new Xa(e,i,s,o+1,e.getStartOffset(s),e.getEndOffset(o))}var Xa=function(){function e(e,t,n,r,i,o){this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=r,this.firstCharOffset=i,this._lastCharOffset=o}return e.prototype.getLineContent=function(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)},e.prototype.getTokenCount=function(){return this._lastTokenIndex-this._firstTokenIndex},e.prototype.findTokenIndexAtOffset=function(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex},e.prototype.getStandardTokenType=function(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)},e}();function Qa(e){return 0!=(7&e)}var eu=function(){function e(t){if(t.autoClosingPairs?this._autoClosingPairs=t.autoClosingPairs.map((function(e){return new Za(e)})):t.brackets?this._autoClosingPairs=t.brackets.map((function(e){return new Za({open:e[0],close:e[1]})})):this._autoClosingPairs=[],t.__electricCharacterSupport&&t.__electricCharacterSupport.docComment){var n=t.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Za({open:n.open,close:n.close||""}))}this._autoCloseBefore="string"==typeof t.autoCloseBefore?t.autoCloseBefore:e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=t.surroundingPairs||this._autoClosingPairs}return e.prototype.getAutoClosingPairs=function(){return this._autoClosingPairs},e.prototype.getAutoCloseBeforeSet=function(){return this._autoCloseBefore},e.shouldAutoClosePair=function(e,t,n){if(0===t.getTokenCount())return!0;var r=t.findTokenIndexAtOffset(n-2),i=t.getStandardTokenType(r);return e.isOK(i)},e.prototype.getSurroundingPairs=function(){return this._surroundingPairs},e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t",e}(),tu=function(e,t,n,r,i){this.languageIdentifier=e,this.open=t,this.close=n,this.forwardRegex=r,this.reversedRegex=i},nu=function(e,t){var n=this;this.brackets=t.map((function(t){return new tu(e,t[0],t[1],iu({open:t[0],close:t[1]}),ou({open:t[0],close:t[1]}))})),this.forwardRegex=su(this.brackets),this.reversedRegex=au(this.brackets),this.textIsBracket={},this.textIsOpenBracket={};var r=0;this.brackets.forEach((function(e){n.textIsBracket[e.open.toLowerCase()]=e,n.textIsBracket[e.close.toLowerCase()]=e,n.textIsOpenBracket[e.open.toLowerCase()]=!0,n.textIsOpenBracket[e.close.toLowerCase()]=!1,r=Math.max(r,e.open.length),r=Math.max(r,e.close.length)})),this.maxBracketLength=r};function ru(e,t){var n={};return function(r){var i=e(r);return n.hasOwnProperty(i)||(n[i]=t(r)),n[i]}}var iu=ru((function(e){return e.open+";"+e.close}),(function(e){return cu([e.open,e.close])})),ou=ru((function(e){return e.open+";"+e.close}),(function(e){return cu([hu(e.open),hu(e.close)])})),su=ru((function(e){return e.map((function(e){return e.open+";"+e.close})).join(";")}),(function(e){var t=[];return e.forEach((function(e){t.push(e.open),t.push(e.close)})),cu(t)})),au=ru((function(e){return e.map((function(e){return e.open+";"+e.close})).join(";")}),(function(e){var t=[];return e.forEach((function(e){t.push(hu(e.open)),t.push(hu(e.close))})),cu(t)}));function uu(e){var t=/^[\w]+$/.test(e);return e=en(e),t?"\\b"+e+"\\b":e}function cu(e){return on("("+e.map(uu).join(")|(")+")",!0)}var lu,du,hu=(lu=null,du=null,function(e){return lu!==e&&(du=function(e){for(var t="",n=e.length-1;n>=0;n--)t+=e.charAt(n);return t}(lu=e)),du}),fu=function(){function e(){}return e._findPrevBracketInText=function(e,t,n,r){var i=n.match(e);if(!i)return null;var o=n.length-(i.index||0),s=i[0].length,a=r+o;return new Tr(t,a-s+1,t,a+1)},e.findPrevBracketInToken=function(e,t,n,r,i){var o=hu(n).substring(n.length-i,n.length-r);return this._findPrevBracketInText(e,t,o,r)},e.findNextBracketInText=function(e,t,n,r){var i=n.match(e);if(!i)return null;var o=i.index||0,s=i[0].length;if(0===s)return null;var a=r+o;return new Tr(t,a+1,t,a+1+s)},e.findNextBracketInToken=function(e,t,n,r,i){var o=n.substring(r,i);return this.findNextBracketInText(e,t,o,r)},e}(),pu=function(){function e(e){this._richEditBrackets=e}return e.prototype.getElectricCharacters=function(){var e=[];if(this._richEditBrackets)for(var t=0,n=this._richEditBrackets.brackets.length;t0&&n.length>0)for(r=0,i=this._brackets.length;r0)for(r=0,i=this._brackets.length;r1){var i=void 0,o=-1;for(i=t-1;i>=1;i--){if(e.getLanguageIdAtPosition(i,0)!==r)return o;var s=e.getLineContent(i);if(!n.shouldIgnore(s)&&!/^\s+$/.test(s)&&""!==s)return i;o=i}}return-1},e.prototype.getInheritIndentForLine=function(e,t,n){void 0===n&&(n=!0);var r=this.getIndentRulesSupport(e.getLanguageIdentifier().id);if(!r)return null;if(t<=1)return{indentation:"",action:null};var i=this.getPrecedingValidLine(e,t,r);if(i<0)return null;if(i<1)return{indentation:"",action:null};var o=e.getLineContent(i);if(r.shouldIncrease(o)||r.shouldIndentNextLine(o))return{indentation:un(o),action:za.Indent,line:i};if(r.shouldDecrease(o))return{indentation:un(o),action:null,line:i};if(1===i)return{indentation:un(e.getLineContent(i)),action:null,line:i};var s=i-1,a=r.getIndentMetadata(e.getLineContent(s));if(!(3&a)&&4&a){for(var u=0,c=s-1;c>0;c--)if(!r.shouldIndentNextLine(e.getLineContent(c))){u=c;break}return{indentation:un(e.getLineContent(u+1)),action:null,line:u+1}}if(n)return{indentation:un(e.getLineContent(i)),action:null,line:i};for(c=i;c>0;c--){var l=e.getLineContent(c);if(r.shouldIncrease(l))return{indentation:un(l),action:za.Indent,line:c};if(r.shouldIndentNextLine(l)){u=0;for(var d=c-1;d>0;d--)if(!r.shouldIndentNextLine(e.getLineContent(c))){u=d;break}return{indentation:un(e.getLineContent(u+1)),action:null,line:u+1}}if(r.shouldDecrease(l))return{indentation:un(l),action:null,line:c}}return{indentation:un(e.getLineContent(1)),action:null,line:1}},e.prototype.getGoodIndentForLine=function(e,t,n,r){var i=this.getIndentRulesSupport(t);if(!i)return null;var o=this.getInheritIndentForLine(e,n),s=e.getLineContent(n);if(o){var a=o.line;if(void 0!==a){var u=this._getOnEnterSupport(t),c=null;try{u&&(c=u.onEnter("",e.getLineContent(a),""))}catch(e){je(e)}if(c){var l=un(e.getLineContent(a));return c.removeText&&(l=l.substring(0,l.length-c.removeText)),c.indentAction===za.Indent||c.indentAction===za.IndentOutdent?l=r.shiftIndent(l):c.indentAction===za.Outdent&&(l=r.unshiftIndent(l)),i.shouldDecrease(s)&&(l=r.unshiftIndent(l)),c.appendText&&(l+=c.appendText),un(l)}}return i.shouldDecrease(s)?o.action===za.Indent?o.indentation:r.unshiftIndent(o.indentation):o.action===za.Indent?r.shiftIndent(o.indentation):o.indentation}return null},e.prototype.getIndentForEnter=function(e,t,n,r){e.forceTokenization(t.startLineNumber);var i,o,s=e.getLineTokens(t.startLineNumber),a=Ja(s,t.startColumn-1),u=a.getLineContent(),c=!1;(a.firstCharOffset>0&&s.getLanguageId(0)!==a.languageId?(c=!0,i=u.substr(0,t.startColumn-1-a.firstCharOffset)):i=s.getLineContent().substring(0,t.startColumn-1),t.isEmpty())?o=u.substr(t.startColumn-1-a.firstCharOffset):o=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-a.firstCharOffset);var l=this.getIndentRulesSupport(a.languageId);if(!l)return null;var d=i,h=un(i);if(!r&&!c){var f=this.getInheritIndentForLine(e,t.startLineNumber);l.shouldDecrease(i)&&f&&(h=f.indentation,f.action!==za.Indent&&(h=n.unshiftIndent(h))),d=h+tn(tn(i," "),"\t")}var p={getLineTokens:function(t){return e.getLineTokens(t)},getLanguageIdentifier:function(){return e.getLanguageIdentifier()},getLanguageIdAtPosition:function(t,n){return e.getLanguageIdAtPosition(t,n)},getLineContent:function(n){return n===t.startLineNumber?d:e.getLineContent(n)}},g=un(s.getLineContent()),m=this.getInheritIndentForLine(p,t.startLineNumber+1);if(!m){var _=c?g:h;return{beforeEnter:_,afterEnter:_}}var y=c?g:m.indentation;return m.action===za.Indent&&(y=n.shiftIndent(y)),l.shouldDecrease(o)&&(y=n.unshiftIndent(y)),{beforeEnter:c?g:h,afterEnter:y}},e.prototype.getIndentActionForType=function(e,t,n,r){var i=this.getScopedLineTokens(e,t.startLineNumber,t.startColumn),o=this.getIndentRulesSupport(i.languageId);if(!o)return null;var s,a=i.getLineContent(),u=a.substr(0,t.startColumn-1-i.firstCharOffset);t.isEmpty()?s=a.substr(t.startColumn-1-i.firstCharOffset):s=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-i.firstCharOffset);if(!o.shouldDecrease(u+s)&&o.shouldDecrease(u+n+s)){var c=this.getInheritIndentForLine(e,t.startLineNumber,!1);if(!c)return null;var l=c.indentation;return c.action!==za.Indent&&(l=r.unshiftIndent(l)),l}return null},e.prototype.getIndentMetadata=function(e,t){var n=this.getIndentRulesSupport(e.getLanguageIdentifier().id);return n?t<1||t>e.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null},e.prototype._getOnEnterSupport=function(e){var t=this._getRichEditSupport(e);return t&&t.onEnter||null},e.prototype.getRawEnterActionAtPosition=function(e,t,n){var r=this.getEnterAction(e,new Tr(t,n,t,n));return r?r.enterAction:null},e.prototype.getEnterAction=function(e,t){var n=this.getIndentationAtPosition(e,t.startLineNumber,t.startColumn),r=this.getScopedLineTokens(e,t.startLineNumber,t.startColumn),i=this._getOnEnterSupport(r.languageId);if(!i)return null;var o,s=r.getLineContent(),a=s.substr(0,t.startColumn-1-r.firstCharOffset);t.isEmpty()?o=s.substr(t.startColumn-1-r.firstCharOffset):o=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);var u=t.startLineNumber,c="";if(u>1&&0===r.firstCharOffset){var l=this.getScopedLineTokens(e,u-1);l.languageId===r.languageId&&(c=l.getLineContent())}var d=null;try{d=i.onEnter(c,a,o)}catch(e){je(e)}return d?(d.appendText||(d.indentAction===za.Indent||d.indentAction===za.IndentOutdent?d.appendText="\t":d.appendText=""),d.removeText&&(n=n.substring(0,n.length-d.removeText)),{enterAction:d,indentation:n}):null},e.prototype.getIndentationAtPosition=function(e,t,n){var r=un(e.getLineContent(t));return r.length>n-1&&(r=r.substring(0,n-1)),r},e.prototype.getScopedLineTokens=function(e,t,n){return e.forceTokenization(t),Ja(e.getLineTokens(t),void 0===n?e.getLineMaxColumn(t)-1:n-1)},e.prototype.getBracketsSupport=function(e){var t=this._getRichEditSupport(e);return t&&t.brackets||null},e}());function bu(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}var wu=function(){function e(e,t,n,r){void 0===r&&(r=1),this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,n)),this.a=bu(Math.max(Math.min(1,r),0),3)}return e.equals=function(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a},e}(),Cu=function(){function e(e,t,n,r){this.h=0|Math.max(Math.min(360,e),0),this.s=bu(Math.max(Math.min(1,t),0),3),this.l=bu(Math.max(Math.min(1,n),0),3),this.a=bu(Math.max(Math.min(1,r),0),3)}return e.equals=function(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a},e.fromRGBA=function(t){var n=t.r/255,r=t.g/255,i=t.b/255,o=t.a,s=Math.max(n,r,i),a=Math.min(n,r,i),u=0,c=0,l=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(l<=.5?d/(2*l):d/(2-2*l),1),s){case n:u=(r-i)/d+(r1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},e.toRGBA=function(t){var n,r,i,o=t.h/360,s=t.s,a=t.l,u=t.a;if(0===s)n=r=i=a;else{var c=a<.5?a*(1+s):a+s-a*s,l=2*a-c;n=e._hue2rgb(l,c,o+1/3),r=e._hue2rgb(l,c,o),i=e._hue2rgb(l,c,o-1/3)}return new wu(Math.round(255*n),Math.round(255*r),Math.round(255*i),u)},e}(),Su=function(){function e(e,t,n,r){this.h=0|Math.max(Math.min(360,e),0),this.s=bu(Math.max(Math.min(1,t),0),3),this.v=bu(Math.max(Math.min(1,n),0),3),this.a=bu(Math.max(Math.min(1,r),0),3)}return e.equals=function(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a},e.fromRGBA=function(t){var n,r=t.r/255,i=t.g/255,o=t.b/255,s=Math.max(r,i,o),a=s-Math.min(r,i,o),u=0===s?0:a/s;return n=0===a?0:s===r?((i-o)/a%6+6)%6:s===i?(o-r)/a+2:(r-i)/a+4,new e(Math.round(60*n),u,s,t.a)},e.toRGBA=function(e){var t=e.h,n=e.s,r=e.v,i=e.a,o=r*n,s=o*(1-Math.abs(t/60%2-1)),a=r-o,u=[0,0,0],c=u[0],l=u[1],d=u[2];return t<60?(c=o,l=s):t<120?(c=s,l=o):t<180?(l=o,d=s):t<240?(l=s,d=o):t<300?(c=s,d=o):t<360&&(c=o,d=s),c=Math.round(255*(c+a)),l=Math.round(255*(l+a)),d=Math.round(255*(d+a)),new wu(c,l,d,i)},e}(),xu=function(){function e(e){if(!e)throw new Error("Color needs a value");if(e instanceof wu)this.rgba=e;else if(e instanceof Cu)this._hsla=e,this.rgba=Cu.toRGBA(e);else{if(!(e instanceof Su))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=Su.toRGBA(e)}}return e.fromHex=function(t){return e.Format.CSS.parseHex(t)||e.red},Object.defineProperty(e.prototype,"hsla",{get:function(){return this._hsla?this._hsla:Cu.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hsva",{get:function(){return this._hsva?this._hsva:Su.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){return!!e&&wu.equals(this.rgba,e.rgba)&&Cu.equals(this.hsla,e.hsla)&&Su.equals(this.hsva,e.hsva)},e.prototype.getRelativeLuminance=function(){return bu(.2126*e._relativeLuminanceForComponent(this.rgba.r)+.7152*e._relativeLuminanceForComponent(this.rgba.g)+.0722*e._relativeLuminanceForComponent(this.rgba.b),4)},e._relativeLuminanceForComponent=function(e){var t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},e.prototype.isLighter=function(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128},e.prototype.isLighterThan=function(e){return this.getRelativeLuminance()>e.getRelativeLuminance()},e.prototype.isDarkerThan=function(e){return this.getRelativeLuminance()t.LARGE_FILE_SIZE_THRESHOLD||a>t.LARGE_FILE_LINE_COUNT_THRESHOLD:s._isTooLargeForTokenization=!1,s._isTooLargeForSyncing=u>t.MODEL_SYNC_LIMIT,s._versionId=1,s._alternativeVersionId=1,s._isDisposed=!1,s._isDisposing=!1,s._languageIdentifier=i||Ia,s._languageRegistryListener=vu.onDidChange((function(e){e.languageIdentifier.id===s._languageIdentifier.id&&s._onDidChangeLanguageConfiguration.fire({})})),s._instanceId=Ln(Eu),s._lastDecorationId=0,s._decorations=Object.create(null),s._decorationsTree=new Nu,s._commandManager=new Ci(s),s._isUndoing=!1,s._isRedoing=!1,s._trimAutoWhitespaceLines=null,s._tokens=new Ua,s._tokenization=new Ga(s),s}return ku(t,e),t.createFromString=function(e,n,r,i){return void 0===n&&(n=t.DEFAULT_CREATION_OPTIONS),void 0===r&&(r=null),void 0===i&&(i=null),new t(e,n,r,i)},t.resolveOptions=function(e,t){if(t.detectIndentation){var n=ki(e,t.tabSize,t.insertSpaces);return new mi({tabSize:n.tabSize,indentSize:n.tabSize,insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new mi({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})},t.prototype.onDidChangeRawContentFast=function(e){return this._eventEmitter.fastEvent((function(t){return e(t.rawContentChangedEvent)}))},t.prototype.onDidChangeRawContent=function(e){return this._eventEmitter.slowEvent((function(t){return e(t.rawContentChangedEvent)}))},t.prototype.onDidChangeContentFast=function(e){return this._eventEmitter.fastEvent((function(t){return e(t.contentChangedEvent)}))},t.prototype.onDidChangeContent=function(e){return this._eventEmitter.slowEvent((function(t){return e(t.contentChangedEvent)}))},t.prototype.dispose=function(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,e.prototype.dispose.call(this),this._isDisposing=!1},t.prototype._assertNotDisposed=function(){if(this._isDisposed)throw new Error("Model is disposed!")},t.prototype._emitContentChangedEvent=function(e,t){this._isDisposing||this._eventEmitter.fire(new Wo(e,t))},t.prototype.setValue=function(e){if(this._assertNotDisposed(),null!==e){var t=Mu(e,this._options.defaultEOL);this.setValueFromTextBuffer(t)}},t.prototype._createContentChanged2=function(e,t,n,r,i,o,s){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:r}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:i,isRedoing:o,isFlush:s}},t.prototype.setValueFromTextBuffer=function(e){if(this._assertNotDisposed(),null!==e){var t=this.getFullModelRange(),n=this.getValueLengthInRange(t),r=this.getLineCount(),i=this.getLineMaxColumn(r);this._buffer=e,this._increaseVersionId(),this._tokens.flush(),this._decorations=Object.create(null),this._decorationsTree=new Nu,this._commandManager=new Ci(this),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Ho([new Ro],this._versionId,!1,!1),this._createContentChanged2(new Tr(1,1,r,i),0,n,this.getValue(),!1,!1,!0))}},t.prototype.setEOL=function(e){this._assertNotDisposed();var t=1===e?"\r\n":"\n";if(this._buffer.getEOL()!==t){var n=this.getFullModelRange(),r=this.getValueLengthInRange(n),i=this.getLineCount(),o=this.getLineMaxColumn(i);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Ho([new Bo],this._versionId,!1,!1),this._createContentChanged2(new Tr(1,1,i,o),0,r,this.getValue(),!1,!1,!1))}},t.prototype._onBeforeEOLChange=function(){var e=this.getVersionId(),t=this._decorationsTree.search(0,!1,!1,e);this._ensureNodesHaveRanges(t)},t.prototype._onAfterEOLChange=function(){for(var e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder(),n=0,r=t.length;n0},t.prototype.getAttachedEditorCount=function(){return this._attachedEditorCount},t.prototype.isTooLargeForSyncing=function(){return this._isTooLargeForSyncing},t.prototype.isTooLargeForTokenization=function(){return this._isTooLargeForTokenization},t.prototype.isDisposed=function(){return this._isDisposed},t.prototype.isDominatedByLongLines=function(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;for(var e=0,t=0,n=this._buffer.getLineCount(),r=1;r<=n;r++){var i=this._buffer.getLineLength(r);i>=1e4?t+=i:e+=i}return t>e},Object.defineProperty(t.prototype,"uri",{get:function(){return this._associatedResource},enumerable:!0,configurable:!0}),t.prototype.getOptions=function(){return this._assertNotDisposed(),this._options},t.prototype.getFormattingOptions=function(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}},t.prototype.updateOptions=function(e){this._assertNotDisposed();var t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,n=void 0!==e.indentSize?e.indentSize:this._options.indentSize,r=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,i=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=new mi({tabSize:t,indentSize:n,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:i});if(!this._options.equals(o)){var s=this._options.createChangeEvent(o);this._options=o,this._onDidChangeOptions.fire(s)}},t.prototype.detectIndentation=function(e,t){this._assertNotDisposed();var n=ki(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})},t._normalizeIndentationFromWhitespace=function(e,t,n){for(var r=0,i=0;ithis.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)},t.prototype.getLineLength=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)},t.prototype.getLinesContent=function(){return this._assertNotDisposed(),this._buffer.getLinesContent()},t.prototype.getEOL=function(){return this._assertNotDisposed(),this._buffer.getEOL()},t.prototype.getLineMinColumn=function(e){return this._assertNotDisposed(),1},t.prototype.getLineMaxColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1},t.prototype.getLineFirstNonWhitespaceColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)},t.prototype.getLineLastNonWhitespaceColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)},t.prototype._validateRangeRelaxedNoAllocations=function(e){var t,n,r=this._buffer.getLineCount(),i=e.startLineNumber,o=e.startColumn;if(i<1)t=1,n=1;else if(i>r)t=r,n=this.getLineMaxColumn(t);else{if(t=0|i,o<=1)n=1;else n=o>=(l=this.getLineMaxColumn(t))?l:0|o}var s,a,u=e.endLineNumber,c=e.endColumn;if(u<1)s=1,a=1;else if(u>r)s=r,a=this.getLineMaxColumn(s);else{var l;if(s=0|u,c<=1)a=1;else a=c>=(l=this.getLineMaxColumn(s))?l:0|c}return i===t&&o===n&&u===s&&c===a&&e instanceof Tr&&!(e instanceof Or)?e:new Tr(t,n,s,a)},t.prototype._isValidPosition=function(e,t,n){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(t>this.getLineMaxColumn(e))return!1;if(n&&(t>1&&mn(this._buffer.getLineCharCode(e,t-2))))return!1;return!0},t.prototype._validatePosition=function(e,t,n){var r=Math.floor("number"!=typeof e||isNaN(e)?1:e),i=Math.floor("number"!=typeof t||isNaN(t)?1:t),o=this._buffer.getLineCount();if(r<1)return new _t(1,1);if(r>o)return new _t(o,this.getLineMaxColumn(o));if(i<=1)return new _t(r,1);var s=this.getLineMaxColumn(r);if(i>=s)return new _t(r,s);if(n&&mn(this._buffer.getLineCharCode(r,i-2)))return new _t(r,i-1);return new _t(r,i)},t.prototype.validatePosition=function(e){return this._assertNotDisposed(),e instanceof _t&&this._isValidPosition(e.lineNumber,e.column,!0)?e:this._validatePosition(e.lineNumber,e.column,!0)},t.prototype._isValidRange=function(e,t){var n=e.startLineNumber,r=e.startColumn,i=e.endLineNumber,o=e.endColumn;if(!this._isValidPosition(n,r,!1))return!1;if(!this._isValidPosition(i,o,!1))return!1;if(t){var s=r>1?this._buffer.getLineCharCode(n,r-2):0,a=o>1&&o<=this._buffer.getLineLength(i)?this._buffer.getLineCharCode(i,o-2):0,u=mn(s),c=mn(a);return!u&&!c}return!0},t.prototype.validateRange=function(e){if(this._assertNotDisposed(),e instanceof Tr&&!(e instanceof Or)&&this._isValidRange(e,!0))return e;var t=this._validatePosition(e.startLineNumber,e.startColumn,!1),n=this._validatePosition(e.endLineNumber,e.endColumn,!1),r=t.lineNumber,i=t.column,o=n.lineNumber,s=n.column,a=i>1?this._buffer.getLineCharCode(r,i-2):0,u=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,c=mn(a),l=mn(u);return c||l?r===o&&i===s?new Tr(r,i-1,o,s-1):c&&l?new Tr(r,i-1,o,s+1):c?new Tr(r,i-1,o,s):new Tr(r,i,o,s+1):new Tr(r,i,o,s)},t.prototype.modifyPosition=function(e,t){this._assertNotDisposed();var n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))},t.prototype.getFullModelRange=function(){this._assertNotDisposed();var e=this.getLineCount();return new Tr(1,1,e,this.getLineMaxColumn(e))},t.prototype.findMatchesLineByLine=function(e,t,n,r){return this._buffer.findMatchesLineByLine(e,t,n,r)},t.prototype.findMatches=function(e,t,n,r,i,o,s){var a;if(void 0===s&&(s=999),this._assertNotDisposed(),a=Tr.isIRange(t)?this.validateRange(t):this.getFullModelRange(),!n&&e.indexOf("\n")<0){var u=new vo(e,n,r,i).parseSearchRequest();return u?this.findMatchesLineByLine(a,u,o,s):[]}return So.findMatches(this,new vo(e,n,r,i),a,o,s)},t.prototype.findNextMatch=function(e,t,n,r,i,o){this._assertNotDisposed();var s=this.validatePosition(t);if(!n&&e.indexOf("\n")<0){var a=new vo(e,n,r,i).parseSearchRequest();if(!a)return null;var u=this.getLineCount(),c=new Tr(s.lineNumber,s.column,u,this.getLineMaxColumn(u)),l=this.findMatchesLineByLine(c,a,o,1);return So.findNextMatch(this,new vo(e,n,r,i),s,o),l.length>0?l[0]:(c=new Tr(1,1,s.lineNumber,this.getLineMaxColumn(s.lineNumber)),(l=this.findMatchesLineByLine(c,a,o,1)).length>0?l[0]:null)}return So.findNextMatch(this,new vo(e,n,r,i),s,o)},t.prototype.findPreviousMatch=function(e,t,n,r,i,o){this._assertNotDisposed();var s=this.validatePosition(t);return So.findPreviousMatch(this,new vo(e,n,r,i),s,o)},t.prototype.pushStackElement=function(){this._commandManager.pushStackElement()},t.prototype.pushEOL=function(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype.pushEditOperations=function(e,t,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,t,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype._pushEditOperations=function(e,t,n){var r=this;if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){for(var i=t.map((function(e){return{range:r.validateRange(e.range),text:e.text}})),o=!0,s=0,a=e.length;su.endLineNumber,f=u.startLineNumber>_.endLineNumber;if(!h&&!f){c=!0;break}}if(!c){o=!1;break}}if(o)for(s=0,a=this._trimAutoWhitespaceLines.length;s_.endLineNumber)&&!(p===_.startLineNumber&&_.startColumn===g&&_.isEmpty()&&y&&y.length>0&&"\n"===y.charAt(0)||p===_.startLineNumber&&1===_.startColumn&&_.isEmpty()&&y&&y.length>0&&"\n"===y.charAt(y.length-1))){m=!1;break}}m&&t.push({range:new Tr(p,1,p,g),text:null})}this._trimAutoWhitespaceLines=null}return this._commandManager.pushEditOperation(e,t,n)},t.prototype.applyEdits=function(e){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._applyEdits(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype._applyEdits=function(e){for(var t=0,n=e.length;t=0;v--){var b=f+v,w=o-u-y+b;a.push(new Fo(b,this.getLineContent(w)))}if(_this.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)},t.prototype.getLinesDecorations=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);var i=this.getLineCount(),o=Math.min(i,Math.max(1,e)),s=Math.min(i,Math.max(1,t)),a=this.getLineMaxColumn(s);return this._getDecorationsInRange(new Tr(o,1,s,a),n,r)},t.prototype.getDecorationsInRange=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=!1);var r=this.validateRange(e);return this._getDecorationsInRange(r,t,n)},t.prototype.getOverviewRulerDecorations=function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var n=this.getVersionId(),r=this._decorationsTree.search(e,t,!0,n);return this._ensureNodesHaveRanges(r)},t.prototype.getAllDecorations=function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var n=this.getVersionId(),r=this._decorationsTree.search(e,t,!1,n);return this._ensureNodesHaveRanges(r)},t.prototype._getDecorationsInRange=function(e,t,n){var r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),i=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn),o=this.getVersionId(),s=this._decorationsTree.intervalSearch(r,i,t,n,o);return this._ensureNodesHaveRanges(s)},t.prototype._ensureNodesHaveRanges=function(e){for(var t=0,n=e.length;tthis.getLineCount())throw new Error("Illegal value for lineNumber");this._tokens.setTokens(this._languageIdentifier.id,e-1,this._buffer.getLineLength(e),t)},t.prototype.setTokens=function(e){if(0!==e.length){for(var t=[],n=0,r=e.length;nthis.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)},t.prototype.isCheapToTokenize=function(e){return this._tokenization.isCheapToTokenize(e)},t.prototype.tokenizeIfCheap=function(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)},t.prototype.getLineTokens=function(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)},t.prototype._getLineTokens=function(e){var t=this.getLineContent(e);return this._tokens.getTokens(this._languageIdentifier.id,e-1,t)},t.prototype.getLanguageIdentifier=function(){return this._languageIdentifier},t.prototype.getModeId=function(){return this._languageIdentifier.language},t.prototype.setMode=function(e){if(this._languageIdentifier.id!==e.id){var t={oldLanguage:this._languageIdentifier.language,newLanguage:e.language};this._languageIdentifier=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}},t.prototype.getLanguageIdAtPosition=function(e,t){var n=this.validatePosition(new _t(e,t)),r=this.getLineTokens(n.lineNumber);return r.getLanguageId(r.findTokenIndexAtOffset(n.column-1))},t.prototype.getWordAtPosition=function(e){this._assertNotDisposed();var n=this.validatePosition(e),r=this.getLineContent(n.lineNumber),i=this._getLineTokens(n.lineNumber),o=i.findTokenIndexAtOffset(n.column-1),s=t._findLanguageBoundaries(i,o),a=s[0],u=s[1],c=Zr(n.column,vu.getWordDefinition(i.getLanguageId(o)),r.substring(a,u),a);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(o>0&&a===n.column-1){var l=t._findLanguageBoundaries(i,o-1),d=l[0],h=l[1],f=Zr(n.column,vu.getWordDefinition(i.getLanguageId(o-1)),r.substring(d,h),d);if(f&&f.startColumn<=e.column&&e.column<=f.endColumn)return f}return null},t._findLanguageBoundaries=function(e,t){for(var n=e.getLanguageId(t),r=0,i=t;i>=0&&e.getLanguageId(i)===n;i--)r=e.getStartOffset(i);for(var o=e.getLineContent().length,s=(i=t,e.getCount());i0&&n.getStartOffset(i)===e.column-1){a=n.getStartOffset(i);i--;var c=vu.getBracketsSupport(n.getLanguageId(i));if(c&&!Qa(n.getStandardTokenType(i))){var l,d,h;s=Math.max(n.getStartOffset(i),e.column-1-c.maxBracketLength);if((l=fu.findPrevBracketInToken(c.reversedRegex,t,r,s,a))&&l.startColumn<=e.column&&e.column<=l.endColumn)if(d=(d=r.substring(l.startColumn-1,l.endColumn-1)).toLowerCase(),h=this._matchFoundBracket(l,c.textIsBracket[d],c.textIsOpenBracket[d]))return h}}return null},t.prototype._matchFoundBracket=function(e,t,n){if(!t)return null;var r;if(n){if(r=this._findMatchingBracketDown(t,e.getEndPosition()))return[e,r]}else if(r=this._findMatchingBracketUp(t,e.getStartPosition()))return[e,r];return null},t.prototype._findMatchingBracketUp=function(e,t){for(var n=e.languageIdentifier.id,r=e.reversedRegex,i=-1,o=t.lineNumber;o>=1;o--){var s=this._getLineTokens(o),a=s.getCount(),u=this._buffer.getLineContent(o),c=a-1,l=-1;for(o===t.lineNumber&&(c=s.findTokenIndexAtOffset(t.column-1),l=t.column-1);c>=0;c--){var d=s.getLanguageId(c),h=s.getStandardTokenType(c),f=s.getStartOffset(c),p=s.getEndOffset(c);if(-1===l&&(l=p),d===n&&!Qa(h))for(;;){var g=fu.findPrevBracketInToken(r,o,u,f,l);if(!g)break;var m=u.substring(g.startColumn-1,g.endColumn-1);if((m=m.toLowerCase())===e.open?i++:m===e.close&&i--,0===i)return g;l=g.startColumn-1}l=-1}}return null},t.prototype._findMatchingBracketDown=function(e,t){for(var n=e.languageIdentifier.id,r=e.forwardRegex,i=1,o=t.lineNumber,s=this.getLineCount();o<=s;o++){var a=this._getLineTokens(o),u=a.getCount(),c=this._buffer.getLineContent(o),l=0,d=0;for(o===t.lineNumber&&(l=a.findTokenIndexAtOffset(t.column-1),d=t.column-1);l=1;i--){var o=this._getLineTokens(i),s=o.getCount(),a=this._buffer.getLineContent(i),u=s-1,c=-1;for(i===t.lineNumber&&(u=o.findTokenIndexAtOffset(t.column-1),c=t.column-1);u>=0;u--){var l=o.getLanguageId(u),d=o.getStandardTokenType(u),h=o.getStartOffset(u),f=o.getEndOffset(u);if(-1===c&&(c=f),n!==l&&(n=l,r=vu.getBracketsSupport(n)),r&&!Qa(d)){var p=fu.findPrevBracketInToken(r.reversedRegex,i,a,h,c);if(p)return this._toFoundBracket(r,p)}c=-1}}return null},t.prototype.findNextBracket=function(e){for(var t=this.validatePosition(e),n=-1,r=null,i=t.lineNumber,o=this.getLineCount();i<=o;i++){var s=this._getLineTokens(i),a=s.getCount(),u=this._buffer.getLineContent(i),c=0,l=0;for(i===t.lineNumber&&(c=s.findTokenIndexAtOffset(t.column-1),l=t.column-1);ci)throw new Error("Illegal value for lineNumber");for(var o=vu.getFoldingRules(this._languageIdentifier.id),s=Boolean(o&&o.offSide),a=-2,u=-1,c=-2,l=-1,d=function(e){if(-1!==a&&(-2===a||a>e-1)){a=-1,u=-1;for(var t=e-2;t>=0;t--){var n=r._computeIndentLevel(t);if(n>=0){a=t,u=n;break}}}if(-2===c){c=-1,l=-1;for(t=e;t=0){c=t,l=o;break}}}},h=-2,f=-1,p=-2,g=-1,m=function(e){if(-2===h){h=-1,f=-1;for(var t=e-2;t>=0;t--){var n=r._computeIndentLevel(t);if(n>=0){h=t,f=n;break}}}if(-1!==p&&(-2===p||p=0){p=t,g=o;break}}}},_=0,y=!0,v=0,b=!0,w=0,C=0;y||b;C++){var S=e-C,x=e+C;if(0!==C&&(S<1||Si||x>n)&&(b=!1),C>5e4&&(y=!1,b=!1),y){var k=void 0;if((L=this._computeIndentLevel(S-1))>=0?(c=S-1,l=L,k=Math.ceil(L/this._options.indentSize)):(d(S),k=this._getIndentLevelForWhitespaceLine(s,u,l)),0===C){if(_=S,v=x,0===(w=k))return{startLineNumber:_,endLineNumber:v,indent:w};continue}k>=w?_=S:y=!1}if(b){var L,M=void 0;(L=this._computeIndentLevel(x-1))>=0?(h=x-1,f=L,M=Math.ceil(L/this._options.indentSize)):(m(x),M=this._getIndentLevelForWhitespaceLine(s,f,g)),M>=w?v=x:b=!1}}return{startLineNumber:_,endLineNumber:v,indent:w}},t.prototype.getLinesIndentGuides=function(e,t){this._assertNotDisposed();var n=this.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");for(var r=vu.getFoldingRules(this._languageIdentifier.id),i=Boolean(r&&r.offSide),o=new Array(t-e+1),s=-2,a=-1,u=-2,c=-1,l=e;l<=t;l++){var d=l-e,h=this._computeIndentLevel(l-1);if(h>=0)s=l-1,a=h,o[d]=Math.ceil(h/this._options.indentSize);else{if(-2===s){s=-1,a=-1;for(var f=l-2;f>=0;f--){if((p=this._computeIndentLevel(f))>=0){s=f,a=p;break}}}if(-1!==u&&(-2===u||u=0){u=f,c=p;break}}}o[d]=this._getIndentLevelForWhitespaceLine(i,a,c)}}return o},t.prototype._getIndentLevelForWhitespaceLine=function(e,t,n){return-1===t||-1===n?0:t0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))},t}(Dt),Hu=function(){return!0},Wu=function(){return!1},Vu=function(e){return" "===e||"\t"===e};function zu(e,t,n){e.has(t)?e.get(t).push(n):e.set(t,[n])}var Uu=function(){function e(t,n,r){this._languageIdentifier=t;var i=r.editor;this.readOnly=i.readOnly,this.tabSize=n.tabSize,this.indentSize=n.indentSize,this.insertSpaces=n.insertSpaces,this.pageSize=Math.max(1,Math.floor(i.layoutInfo.height/i.fontInfo.lineHeight)-2),this.lineHeight=i.lineHeight,this.useTabStops=i.useTabStops,this.wordSeparators=i.wordSeparators,this.emptySelectionClipboard=i.emptySelectionClipboard,this.copyWithSyntaxHighlighting=i.copyWithSyntaxHighlighting,this.multiCursorMergeOverlapping=i.multiCursorMergeOverlapping,this.autoClosingBrackets=i.autoClosingBrackets,this.autoClosingQuotes=i.autoClosingQuotes,this.autoClosingOvertype=i.autoClosingOvertype,this.autoSurround=i.autoSurround,this.autoIndent=i.autoIndent,this.autoClosingPairsOpen2=new Map,this.autoClosingPairsClose2=new Map,this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:e._getShouldAutoClose(t,this.autoClosingQuotes),bracket:e._getShouldAutoClose(t,this.autoClosingBrackets)};var o=e._getAutoClosingPairs(t);if(o)for(var s=0,a=o;s=r.length)&&_n(r.charCodeAt(n))},e.isHighSurrogate=function(e,t,n){var r=e.getLineContent(t);return!(n<0||n>=r.length)&&mn(r.charCodeAt(n))},e.isInsideSurrogatePair=function(e,t,n){return this.isHighSurrogate(e,t,n-2)},e.visibleColumnFromColumn=function(e,t,n){var r=e.length;r>t-1&&(r=t-1);for(var i=0,o=0;o=t)return a-ts?s:i},e.nextRenderTabStop=function(e,t){return e+t-e%t},e.nextIndentTabStop=function(e,t){return e+t-e%t},e.prevRenderTabStop=function(e,t){return e-1-(e-1)%t},e.prevIndentTabStop=function(e,t){return e-1-(e-1)%t},e}();function Qu(e){return"'"===e||'"'===e||"`"===e}var ec=function(){function e(){}return e.columnSelect=function(e,t,n,r,i,o){for(var s=Math.abs(i-n)+1,a=n>i,u=r>o,c=ro)continue;if(mr)continue;if(g1&&i--,e.columnSelect(t,n,r.fromViewLineNumber,r.fromViewVisualColumn,r.toViewLineNumber,i)},e.columnSelectRight=function(e,t,n){for(var r=0,i=Math.min(n.fromViewLineNumber,n.toViewLineNumber),o=Math.max(n.fromViewLineNumber,n.toViewLineNumber),s=i;s<=o;s++){var a=t.getLineMaxColumn(s),u=Xu.visibleColumnFromColumn2(e,t,new _t(s,a));r=Math.max(r,u)}var c=n.toViewVisualColumn;return ct.getLineMinColumn(n)?Xu.isLowSurrogate(t,n,r-2)?r-=2:r-=1:n>1&&(n-=1,r=t.getLineMaxColumn(n)),new oc(n,r,0)},e.moveLeft=function(t,n,r,i,o){var s,a;if(r.hasSelection()&&!i)s=r.selection.startLineNumber,a=r.selection.startColumn;else{var u=e.left(t,n,r.position.lineNumber,r.position.column-(o-1));s=u.lineNumber,a=u.column}return r.move(i,s,a,0)},e.right=function(e,t,n,r){return ru?(n=u,s?r=t.getLineMaxColumn(n):(r=Math.min(t.getLineMaxColumn(n),r),Xu.isInsideSurrogatePair(t,n,r)&&(r-=1))):(r=Xu.columnFromVisibleColumn2(e,t,n,a),Xu.isInsideSurrogatePair(t,n,r)&&(r-=1)),i=a-Xu.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize),new oc(n,r,i)},e.moveDown=function(t,n,r,i,o){var s,a;r.hasSelection()&&!i?(s=r.selection.endLineNumber,a=r.selection.endColumn):(s=r.position.lineNumber,a=r.position.column);var u=e.down(t,n,s,a,r.leftoverVisibleColumns,o,!0);return r.move(i,u.lineNumber,u.column,u.leftoverVisibleColumns)},e.translateDown=function(t,n,r){var i=r.selection,o=e.down(t,n,i.selectionStartLineNumber,i.selectionStartColumn,r.selectionStartLeftoverVisibleColumns,1,!1),s=e.down(t,n,i.positionLineNumber,i.positionColumn,r.leftoverVisibleColumns,1,!1);return new qu(new Tr(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new _t(s.lineNumber,s.column),s.leftoverVisibleColumns)},e.up=function(e,t,n,r,i,o,s){var a=Xu.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize)+i;return(n-=o)<1?(n=1,s?r=t.getLineMinColumn(n):(r=Math.min(t.getLineMaxColumn(n),r),Xu.isInsideSurrogatePair(t,n,r)&&(r-=1))):(r=Xu.columnFromVisibleColumn2(e,t,n,a),Xu.isInsideSurrogatePair(t,n,r)&&(r-=1)),i=a-Xu.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize),new oc(n,r,i)},e.moveUp=function(t,n,r,i,o){var s,a;r.hasSelection()&&!i?(s=r.selection.startLineNumber,a=r.selection.startColumn):(s=r.position.lineNumber,a=r.position.column);var u=e.up(t,n,s,a,r.leftoverVisibleColumns,o,!0);return r.move(i,u.lineNumber,u.column,u.leftoverVisibleColumns)},e.translateUp=function(t,n,r){var i=r.selection,o=e.up(t,n,i.selectionStartLineNumber,i.selectionStartColumn,r.selectionStartLeftoverVisibleColumns,1,!1),s=e.up(t,n,i.positionLineNumber,i.positionColumn,r.leftoverVisibleColumns,1,!1);return new qu(new Tr(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new _t(s.lineNumber,s.column),s.leftoverVisibleColumns)},e.moveToBeginningOfLine=function(e,t,n,r){var i,o=n.position.lineNumber,s=t.getLineMinColumn(o),a=t.getLineFirstNonWhitespaceColumn(o)||s;return i=n.position.column===a?s:a,n.move(r,o,i,0)},e.moveToEndOfLine=function(e,t,n,r){var i=n.position.lineNumber,o=t.getLineMaxColumn(i);return n.move(r,i,o,0)},e.moveToBeginningOfBuffer=function(e,t,n,r){return n.move(r,1,1,0)},e.moveToEndOfBuffer=function(e,t,n,r){var i=t.getLineCount(),o=t.getLineMaxColumn(i);return n.move(r,i,o,0)},e}(),ac=function(){function e(){}return e.deleteRight=function(e,t,n,r){for(var i=[],o=3!==e,s=0,a=r.length;s1){var d=n.getLineContent(l.lineNumber),h=an(d),f=-1===h?d.length+1:h+1;if(l.column<=f){var p=Xu.visibleColumnFromColumn2(t,n,l),g=Xu.prevIndentTabStop(p,t.indentSize),m=Xu.columnFromVisibleColumn2(t,n,l.lineNumber,g);c=new Tr(l.lineNumber,m,l.lineNumber,l.column)}else c=new Tr(l.lineNumber,l.column-1,l.lineNumber,l.column)}else{var _=sc.left(t,n,l.lineNumber,l.column);c=new Tr(_.lineNumber,_.column,l.lineNumber,l.column)}}c.isEmpty()?i[s]=null:(c.startLineNumber!==c.endLineNumber&&(o=!0),i[s]=new tc(c,""))}return[o,i]},e.cut=function(e,t,n){for(var r=[],i=0,o=n.length;i1?(u=a.lineNumber-1,c=t.getLineMaxColumn(a.lineNumber-1),l=a.lineNumber,d=t.getLineMaxColumn(a.lineNumber)):(u=a.lineNumber,c=1,l=a.lineNumber,d=t.getLineMaxColumn(a.lineNumber));var h=new Tr(u,c,l,d);h.isEmpty()?r[i]=null:r[i]=new tc(h,"")}else r[i]=null;else r[i]=new tc(s,"")}return new Ju(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})},e}(),uc=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cc=function(){function e(){}return e._createWord=function(e,t,n,r,i){return{start:r,end:i,wordType:t,nextCharClass:n}},e._findPreviousWordOnLine=function(e,t,n){var r=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(r,e,n)},e._doFindPreviousWordOnLine=function(e,t,n){for(var r=0,i=n.column-2;i>=0;i--){var o=e.charCodeAt(i),s=t.get(o);if(0===s){if(2===r)return this._createWord(e,r,s,i+1,this._findEndOfWord(e,t,r,i+1));r=1}else if(2===s){if(1===r)return this._createWord(e,r,s,i+1,this._findEndOfWord(e,t,r,i+1));r=2}else if(1===s&&0!==r)return this._createWord(e,r,s,i+1,this._findEndOfWord(e,t,r,i+1))}return 0!==r?this._createWord(e,r,1,0,this._findEndOfWord(e,t,r,0)):null},e._findEndOfWord=function(e,t,n,r){for(var i=e.length,o=r;o=0;i--){var o=e.charCodeAt(i),s=t.get(o);if(1===s)return i+1;if(1===n&&2===s)return i+1;if(2===n&&0===s)return i+1}return 0},e.moveWordLeft=function(t,n,r,i){var o=r.lineNumber,s=r.column,a=!1;1===s&&o>1&&(a=!0,o-=1,s=n.getLineMaxColumn(o));var u=e._findPreviousWordOnLine(t,n,new _t(o,s));if(0===i){if(u&&!a)if(n.getLineLastNonWhitespaceColumn(o)1?new _t(n-1,e.getLineMaxColumn(n-1)):t;for(var i=e.getLineContent(n),o=t.column-1;o>1;o--){var s=i.charCodeAt(o-2),a=i.charCodeAt(o-1);if(95!==s&&95===a)return new _t(n,o);if(ln(s)&&dn(a))return new _t(n,o);if(dn(s)&&dn(a))if(o+1=u.start+1&&(u=e._findNextWordOnLine(t,n,new _t(o,u.end+1))),s=u?u.start+1:n.getLineMaxColumn(o);return new _t(o,s)},e._moveWordPartRight=function(e,t){var n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===r)return n1?u=1:(a--,u=n.getLineMaxColumn(a)):(l&&u<=l.end+1&&(l=e._findPreviousWordOnLine(t,n,new _t(a,l.start+1))),l?u=l.end+1:u>1?u=1:(a--,u=n.getLineMaxColumn(a))),new Tr(a,u,s.lineNumber,s.column)},e._deleteWordPartLeft=function(t,n){if(!n.isEmpty())return n;var r=n.getPosition(),i=e._moveWordPartLeft(t,r);return new Tr(r.lineNumber,r.column,i.lineNumber,i.column)},e._findFirstNonWhitespaceChar=function(e,t){for(var n=e.length,r=t;r=h.start+1&&(h=e._findNextWordOnLine(t,n,new _t(a,h.end+1))),h?u=h.start+1:ua&&(u=a,c=e.model.getLineMaxColumn(u)),Zu.fromModelState(new qu(new Tr(o.lineNumber,1,u,c),0,new _t(u,c),0))}var l=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumberl){a=e.viewModel.getLineCount();var d=s.lineNumber+1,h=1;return d>a&&(d=a,h=e.viewModel.getLineMaxColumn(d)),Zu.fromViewState(t.viewState.move(t.modelState.hasSelection(),d,h,0))}var f=t.modelState.selectionStart.getEndPosition();return Zu.fromModelState(t.modelState.move(t.modelState.hasSelection(),f.lineNumber,f.column,0))},e.word=function(e,t,n,r){var i=e.model.validatePosition(r);return Zu.fromModelState(cc.word(e.config,e.model,t.modelState,n,i))},e.cancelSelection=function(e,t){if(!t.modelState.hasSelection())return new Zu(t.modelState,t.viewState);var n=t.viewState.position.lineNumber,r=t.viewState.position.column;return Zu.fromViewState(new qu(new Tr(n,r,n,r),0,new _t(n,r),0))},e.moveTo=function(e,t,n,r,i){var o=e.model.validatePosition(r),s=i?e.validateViewPosition(new _t(i.lineNumber,i.column),o):e.convertModelPositionToViewPosition(o);return Zu.fromViewState(t.viewState.move(n,s.lineNumber,s.column,0))},e.move=function(e,t,n){var r=n.select,i=n.value;switch(n.direction){case 0:return 4===n.unit?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,i);case 1:return 4===n.unit?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,i);case 2:return 2===n.unit?this._moveUpByViewLines(e,t,r,i):this._moveUpByModelLines(e,t,r,i);case 3:return 2===n.unit?this._moveDownByViewLines(e,t,r,i):this._moveDownByModelLines(e,t,r,i);case 4:return this._moveToViewMinColumn(e,t,r);case 5:return this._moveToViewFirstNonWhitespaceColumn(e,t,r);case 6:return this._moveToViewCenterColumn(e,t,r);case 7:return this._moveToViewMaxColumn(e,t,r);case 8:return this._moveToViewLastNonWhitespaceColumn(e,t,r);case 9:var o=t[0],s=e.getCompletelyVisibleModelRange(),a=this._firstLineNumberInRange(e.model,s,i),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,o,r,a,u)];case 11:o=t[0],s=e.getCompletelyVisibleModelRange(),a=this._lastLineNumberInRange(e.model,s,i),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,o,r,a,u)];case 10:o=t[0],s=e.getCompletelyVisibleModelRange(),a=Math.round((s.startLineNumber+s.endLineNumber)/2),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,o,r,a,u)];case 12:for(var c=e.getCompletelyVisibleViewRange(),l=[],d=0,h=t.length;dn.endLineNumber-1&&(i=n.endLineNumber-1),i1)if(Xu.visibleColumnFromColumn(v,f+1,s)%a!=0&&t.isCheapToTokenize(h-1)){var p=vu.getRawEnterActionAtPosition(t,h-1,t.getLineMaxColumn(h-1));if(p){if(d=l,p.appendText)for(var g=0,m=p.appendText.length;g1){var a=void 0;for(a=r-1;a>=1;a--){if(cn(n.getLineContent(a))>=0)break}if(a<1)return null;var u=n.getLineMaxColumn(a),c=vu.getEnterAction(n,new Tr(a,u,a,u));c&&(o=c.indentation,(i=c.enterAction)&&(o+=i.appendText))}return i&&(i===za.Indent&&(o=e.shiftIndent(t,o)),i===za.Outdent&&(o=e.unshiftIndent(t,o)),o=t.normalizeIndentation(o)),o||null},e._replaceJumpToNextIndent=function(e,t,n,r){var i="",o=n.getStartPosition();if(e.insertSpaces)for(var s=Xu.visibleColumnFromColumn2(e,t,o),a=e.indentSize,u=a-s%a,c=0;c=0?i.setEndPosition(i.endLineNumber,Math.max(i.endColumn,b+1)):i.setEndPosition(i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),r)return new nc(i,v+t.normalizeIndentation(p.afterEnter),!0);var w=0;return y<=b+1&&(t.insertSpaces||(_=Math.ceil(_/t.indentSize)),w=Math.min(_+1-t.normalizeIndentation(p.afterEnter).length-1,0)),new rc(i,v+t.normalizeIndentation(p.afterEnter),0,w,!0)}return e._typeCommand(i,"\n"+t.normalizeIndentation(m),r)},e._isAutoIndentType=function(e,t,n){if(!e.autoIndent)return!1;for(var r=0,i=n.length;ro.open.length){for(var c=!0,l=0,d=n;lf.column-1){var g=p.charAt(f.column-1);if(!e._isBeforeClosingBrace(t,u,g)&&!c(g))return null}if(!n.isCheapToTokenize(f.lineNumber))return null;if(1===u.open.length&&s&&"always"!==a){var m=yo(t.wordSeparators);if(o&&f.column>1&&0===m.get(p.charCodeAt(f.column-2)))return null;if(!o&&f.column>2&&0===m.get(p.charCodeAt(f.column-3)))return null}n.forceTokenization(f.lineNumber);var _=n.getLineTokens(f.lineNumber),y=!1;try{y=vu.shouldAutoClosePair(u,_,o?f.column:f.column-1)}catch(e){je(e)}if(!y)return null}return u},e._runAutoClosingOpenCharType=function(e,t,n,r,i,o,s){for(var a=[],u=0,c=r.length;u1)for(var o=n.modelState?n.modelState.position:null,s=n.viewState?n.viewState.position:null,a=0,u=i.length;ai&&(r=i);var o=new Tr(r,1,r,e.context.model.getLineMaxColumn(r)),s=0;if(n.at)switch(n.at){case Mc.RawAtArgument.Top:s=3;break;case Mc.RawAtArgument.Center:s=1;break;case Mc.RawAtArgument.Bottom:s=4}var a=e.context.convertModelRangeToViewRange(o);e.revealRange(!1,a,s,0)},t}(Pc))),e.SelectAll=Mr(new(function(e){function t(){return e.call(this,{id:"selectAll",precondition:void 0})||this}return Ac(t,e),t.prototype.runCoreEditorCommand=function(e,t){e.context.model.pushStackElement(),e.setStates(t.source,3,[fc.selectAll(e.context,e.getPrimaryCursor())])},t}(Pc))),e.SetSelection=Mr(new(function(e){function t(){return e.call(this,{id:"setSelection",precondition:void 0})||this}return Ac(t,e),t.prototype.runCoreEditorCommand=function(e,t){e.context.model.pushStackElement(),e.setStates(t.source,3,[Zu.fromModelSelection(t.selection)])},t}(Pc)))}(Dc||(Dc={})),Nc=Tc||(Tc={}),Oc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ac(t,e),t.prototype.runEditorCommand=function(e,t,n){var r=t._getCursors();r&&this.runCoreEditingCommand(t,r,n||{})},t}(kr),Nc.CoreEditingCommand=Oc,Nc.LineBreakInsert=Mr(new(function(e){function t(){return e.call(this,{id:"lineBreakInsert",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:0,mac:{primary:301}}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,vc.lineBreakInsert(t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection}))))},t}(Oc))),Nc.Outdent=Mr(new(function(e){function t(){return e.call(this,{id:"outdent",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:En.and(wc.editorTextFocus,wc.tabDoesNotMoveFocus),primary:1026}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,vc.outdent(t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection})))),e.pushUndoStop()},t}(Oc))),Nc.Tab=Mr(new(function(e){function t(){return e.call(this,{id:"tab",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:En.and(wc.editorTextFocus,wc.tabDoesNotMoveFocus),primary:2}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,vc.tab(t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection})))),e.pushUndoStop()},t}(Oc))),Nc.DeleteLeft=Mr(new(function(e){function t(){return e.call(this,{id:"deleteLeft",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){var r=ac.deleteLeft(t.getPrevEditOperationType(),t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection}))),i=r[0],o=r[1];i&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)},t}(Oc))),Nc.DeleteRight=Mr(new(function(e){function t(){return e.call(this,{id:"deleteRight",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){var r=ac.deleteRight(t.getPrevEditOperationType(),t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection}))),i=r[0],o=r[1];i&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)},t}(Oc)));var Fc=function(e){function t(t){var n=e.call(this,t)||this;return n._editorHandler=t.editorHandler,n._inputHandler=t.inputHandler,n}return Ac(t,e),t.prototype.runCommand=function(e,t){var n=e.get(mt).getFocusedCodeEditor();if(n&&n.hasTextFocus())return this._runEditorHandler(e,n,t);var r=document.activeElement;if(!(r&&["input","textarea"].indexOf(r.tagName.toLowerCase())>=0)){var i=e.get(mt).getActiveCodeEditor();return i?(i.focus(),this._runEditorHandler(e,i,t)):void 0}document.execCommand(this._inputHandler)},t.prototype._runEditorHandler=function(e,t,n){var r=this._editorHandler;"string"==typeof r?t.trigger("keyboard",r,n):((n=n||{}).source="keyboard",r.runEditorCommand(e,t,n))},t}(xr),Yc=function(e){function t(t,n,r){var i=e.call(this,{id:t,precondition:void 0,description:r})||this;return i._handlerId=n,i}return Ac(t,e),t.prototype.runCommand=function(e,t){var n=e.get(mt).getFocusedCodeEditor();n&&n.trigger("keyboard",this._handlerId,t)},t}(xr);function jc(e,t){Rc(new Yc("default:"+e,e)),Rc(new Yc(e,e,t))}Rc(new Fc({editorHandler:Dc.SelectAll,inputHandler:"selectAll",id:"editor.action.selectAll",precondition:wc.textInputFocus,kbOpts:{weight:Ic,kbExpr:null,primary:2079},menubarOpts:{menuId:22,group:"1_basic",title:we({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1}})),Rc(new Fc({editorHandler:xc.Undo,inputHandler:"undo",id:xc.Undo,precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:2104},menubarOpts:{menuId:14,group:"1_do",title:we({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1}})),Rc(new Yc("default:"+xc.Undo,xc.Undo)),Rc(new Fc({editorHandler:xc.Redo,inputHandler:"redo",id:xc.Redo,precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:2103,secondary:[3128],mac:{primary:3128}},menubarOpts:{menuId:14,group:"1_do",title:we({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2}})),Rc(new Yc("default:"+xc.Redo,xc.Redo)),jc(xc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),jc(xc.ReplacePreviousChar),jc(xc.CompositionStart),jc(xc.CompositionEnd),jc(xc.Paste),jc(xc.Cut);var Bc="base.contributions.json";var Hc=new(function(){function e(){this._onDidChangeSchema=new Ht,this.schemasById={}}return e.prototype.registerSchema=function(e,t){var n;this.schemasById[(n=e,n.length>0&&"#"===n.charAt(n.length-1)?n.substring(0,n.length-1):n)]=t,this._onDidChangeSchema.fire(e)},e.prototype.notifySchemaChanged=function(e){this._onDidChangeSchema.fire(e)},e}());yr.add(Bc,Hc);var Wc="base.contributions.colors",Vc=new(function(){function e(){this._onDidChangeSchema=new Ht,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}return e.prototype.registerColor=function(e,t,n,r,i){void 0===r&&(r=!1);var o={id:e,description:n,defaults:t,needsTransparency:r,deprecationMessage:i};this.colorsById[e]=o;var s={type:"string",description:n,format:"color-hex",default:"#ff0000"};return i&&(s.deprecationMessage=i),this.colorSchema.properties[e]=s,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e},e.prototype.resolveDefaultColor=function(e,t){var n=this.colorsById[e];if(n&&n.defaults)return Sd(n.defaults[t.type],t)},e.prototype.getColorSchema=function(){return this.colorSchema},e.prototype.toString=function(){var e=this;return Object.keys(this.colorsById).sort((function(e,t){var n=-1===e.indexOf(".")?0:1,r=-1===t.indexOf(".")?0:1;return n!==r?n-r:e.localeCompare(t)})).map((function(t){return"- `"+t+"`: "+e.colorsById[t].description})).join("\n")},e}());function zc(e,t,n,r,i){return Vc.registerColor(e,t,n,r,i)}yr.add(Wc,Vc);var Uc,qc,Kc=zc("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},we("foreground","Overall foreground color. This color is only used if not overridden by a component.")),Gc=zc("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},we("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),$c=zc("focusBorder",{dark:xu.fromHex("#0E639C").transparent(.8),light:xu.fromHex("#007ACC").transparent(.4),hc:"#F38518"},we("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Zc=zc("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},we("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Jc=zc("contrastActiveBorder",{light:null,dark:null,hc:$c},we("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),Xc=(zc("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},we("textLinkForeground","Foreground color for links in text.")),zc("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:xu.black},we("textCodeBlockBackground","Background color for code blocks in text.")),zc("widget.shadow",{dark:"#000000",light:"#A8A8A8",hc:null},we("widgetShadow","Shadow color of widgets such as find/replace inside the editor."))),Qc=zc("input.background",{dark:"#3C3C3C",light:xu.white,hc:xu.black},we("inputBoxBackground","Input box background.")),el=zc("input.foreground",{dark:Kc,light:Kc,hc:Kc},we("inputBoxForeground","Input box foreground.")),tl=zc("input.border",{dark:null,light:null,hc:Zc},we("inputBoxBorder","Input box border.")),nl=zc("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:Zc},we("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),rl=zc("inputOption.activeBackground",{dark:wd($c,.5),light:wd($c,.3),hc:null},we("inputOption.activeBackground","Background color of activated options in input fields.")),il=zc("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:xu.black},we("inputValidationInfoBackground","Input validation background color for information severity.")),ol=zc("inputValidation.infoForeground",{dark:null,light:null,hc:null},we("inputValidationInfoForeground","Input validation foreground color for information severity.")),sl=zc("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:Zc},we("inputValidationInfoBorder","Input validation border color for information severity.")),al=zc("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:xu.black},we("inputValidationWarningBackground","Input validation background color for warning severity.")),ul=zc("inputValidation.warningForeground",{dark:null,light:null,hc:null},we("inputValidationWarningForeground","Input validation foreground color for warning severity.")),cl=zc("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:Zc},we("inputValidationWarningBorder","Input validation border color for warning severity.")),ll=zc("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:xu.black},we("inputValidationErrorBackground","Input validation background color for error severity.")),dl=zc("inputValidation.errorForeground",{dark:null,light:null,hc:null},we("inputValidationErrorForeground","Input validation foreground color for error severity.")),hl=zc("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:Zc},we("inputValidationErrorBorder","Input validation border color for error severity.")),fl=zc("dropdown.background",{dark:"#3C3C3C",light:xu.white,hc:xu.black},we("dropdownBackground","Dropdown background.")),pl=zc("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:xu.white},we("dropdownForeground","Dropdown foreground.")),gl=zc("list.focusBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},we("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),ml=zc("list.focusForeground",{dark:null,light:null,hc:null},we("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_l=zc("list.activeSelectionBackground",{dark:"#094771",light:"#0074E8",hc:null},we("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),yl=zc("list.activeSelectionForeground",{dark:xu.white,light:xu.white,hc:null},we("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),vl=zc("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},we("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),bl=zc("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},we("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),wl=zc("list.inactiveFocusBackground",{dark:null,light:null,hc:null},we("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Cl=zc("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},we("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Sl=zc("list.hoverForeground",{dark:null,light:null,hc:null},we("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),xl=zc("list.dropBackground",{dark:gl,light:gl,hc:null},we("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),kl=(zc("list.highlightForeground",{dark:"#0097fb",light:"#0066BF",hc:$c},we("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),zc("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:xu.black},we("listFilterWidgetBackground","Background color of the type filter widget in lists and trees."))),Ll=zc("listFilterWidget.outline",{dark:xu.transparent,light:xu.transparent,hc:"#f38518"},we("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Ml=zc("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:Zc},we("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),El=zc("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},we("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Dl=(zc("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:xu.white},we("pickerGroupForeground","Quick picker color for grouping labels.")),zc("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:xu.white},we("pickerGroupBorder","Quick picker color for grouping borders.")),zc("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:xu.black},we("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),zc("badge.foreground",{dark:xu.white,light:"#333",hc:xu.white},we("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),zc("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},we("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled."))),Tl=zc("scrollbarSlider.background",{dark:xu.fromHex("#797979").transparent(.4),light:xu.fromHex("#646464").transparent(.4),hc:wd(Zc,.6)},we("scrollbarSliderBackground","Scrollbar slider background color.")),Nl=zc("scrollbarSlider.hoverBackground",{dark:xu.fromHex("#646464").transparent(.7),light:xu.fromHex("#646464").transparent(.7),hc:wd(Zc,.8)},we("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),Ol=zc("scrollbarSlider.activeBackground",{dark:xu.fromHex("#BFBFBF").transparent(.4),light:xu.fromHex("#000000").transparent(.6),hc:Zc},we("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),Al=(zc("progressBar.background",{dark:xu.fromHex("#0E70C0"),light:xu.fromHex("#0E70C0"),hc:Zc},we("progressBarBackground","Background color of the progress bar that can show for long running operations.")),zc("menu.border",{dark:null,light:null,hc:Zc},we("menuBorder","Border color of menus."))),Il=zc("menu.foreground",{dark:pl,light:Kc,hc:pl},we("menuForeground","Foreground color of menu items.")),Pl=zc("menu.background",{dark:fl,light:fl,hc:fl},we("menuBackground","Background color of menu items.")),Rl=zc("menu.selectionForeground",{dark:yl,light:yl,hc:yl},we("menuSelectionForeground","Foreground color of the selected menu item in menus.")),Fl=zc("menu.selectionBackground",{dark:_l,light:_l,hc:_l},we("menuSelectionBackground","Background color of the selected menu item in menus.")),Yl=zc("menu.selectionBorder",{dark:null,light:null,hc:Jc},we("menuSelectionBorder","Border color of the selected menu item in menus.")),jl=zc("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:Zc},we("menuSeparatorBackground","Color of a separator menu item in menus.")),Bl=zc("editorError.foreground",{dark:"#F48771",light:"#E51400",hc:null},we("editorError.foreground","Foreground color of error squigglies in the editor.")),Hl=zc("editorError.border",{dark:null,light:null,hc:xu.fromHex("#E47777").transparent(.8)},we("errorBorder","Border color of error boxes in the editor.")),Wl=zc("editorWarning.foreground",{dark:"#CCA700",light:"#E9A700",hc:null},we("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Vl=zc("editorWarning.border",{dark:null,light:null,hc:xu.fromHex("#FFCC00").transparent(.8)},we("warningBorder","Border color of warning boxes in the editor.")),zl=zc("editorInfo.foreground",{dark:"#75BEFF",light:"#75BEFF",hc:null},we("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Ul=zc("editorInfo.border",{dark:null,light:null,hc:xu.fromHex("#75BEFF").transparent(.8)},we("infoBorder","Border color of info boxes in the editor.")),ql=zc("editorHint.foreground",{dark:xu.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},we("editorHint.foreground","Foreground color of hint squigglies in the editor.")),Kl=zc("editorHint.border",{dark:null,light:null,hc:xu.fromHex("#eeeeee").transparent(.8)},we("hintBorder","Border color of hint boxes in the editor.")),Gl=zc("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:xu.black},we("editorBackground","Editor background color.")),$l=zc("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:xu.white},we("editorForeground","Editor default foreground color.")),Zl=zc("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},we("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Jl=zc("editorWidget.foreground",{dark:Kc,light:Kc,hc:Kc},we("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Xl=zc("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:Zc},we("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),Ql=zc("editorWidget.resizeBorder",{light:null,dark:null,hc:null},we("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),ed=zc("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},we("editorSelectionBackground","Color of the editor selection.")),td=zc("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},we("editorSelectionForeground","Color of the selected text for high contrast.")),nd=zc("editor.inactiveSelectionBackground",{light:wd(ed,.5),dark:wd(ed,.5),hc:wd(ed,.5)},we("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),rd=zc("editor.selectionHighlightBackground",{light:Cd(ed,Gl,.3,.6),dark:Cd(ed,Gl,.3,.6),hc:null},we("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),id=(zc("editor.selectionHighlightBorder",{light:null,dark:null,hc:Jc},we("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),zc("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},we("editorFindMatch","Color of the current search match."))),od=zc("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},we("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),sd=zc("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},we("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),ad=zc("editor.findMatchBorder",{light:null,dark:null,hc:Jc},we("editorFindMatchBorder","Border color of the current search match.")),ud=zc("editor.findMatchHighlightBorder",{light:null,dark:null,hc:Jc},we("findMatchHighlightBorder","Border color of the other search matches.")),cd=zc("editor.findRangeHighlightBorder",{dark:null,light:null,hc:wd(Jc,.4)},we("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),ld=(zc("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},we("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),zc("editorHoverWidget.background",{light:Zl,dark:Zl,hc:Zl},we("hoverBackground","Background color of the editor hover."))),dd=(zc("editorHoverWidget.border",{light:Xl,dark:Xl,hc:Xl},we("hoverBorder","Border color of the editor hover.")),zc("editorHoverWidget.statusBarBackground",{dark:(Uc=ld,qc=.2,function(e){var t=Sd(Uc,e);if(t)return t.lighten(qc)}),light:bd(ld,.05),hc:Zl},we("statusBarBackground","Background color of the editor hover status bar.")),zc("editorLink.activeForeground",{dark:"#4E94CE",light:xu.blue,hc:xu.cyan},we("activeLinkForeground","Color of active links.")),new xu(new wu(155,185,85,.2))),hd=new xu(new wu(255,0,0,.2)),fd=zc("diffEditor.insertedTextBackground",{dark:dd,light:dd,hc:null},we("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),pd=zc("diffEditor.removedTextBackground",{dark:hd,light:hd,hc:null},we("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),gd=zc("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},we("diffEditorInsertedOutline","Outline color for the text that got inserted.")),md=zc("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},we("diffEditorRemovedOutline","Outline color for text that got removed.")),_d=zc("diffEditor.border",{dark:null,light:null,hc:Zc},we("diffEditorBorder","Border color between the two text editors.")),yd=(zc("editor.snippetTabstopHighlightBackground",{dark:new xu(new wu(124,124,124,.3)),light:new xu(new wu(10,50,100,.2)),hc:new xu(new wu(124,124,124,.3))},we("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),zc("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},we("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),zc("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},we("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),zc("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new xu(new wu(10,50,100,.5)),hc:"#525252"},we("snippetFinalTabstopHighlightBorder","Highlight border color of the final stabstop of a snippet.")),zc("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},we("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0)),vd=(zc("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},we("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),zc("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},we("minimapFindMatchHighlight","Minimap marker color for find matches."),!0));function bd(e,t){return function(n){var r=Sd(e,n);if(r)return r.darken(t)}}function wd(e,t){return function(n){var r=Sd(e,n);if(r)return r.transparent(t)}}function Cd(e,t,n,r){return function(i){var o=Sd(e,i);if(o){var s=Sd(t,i);return s?o.isDarkerThan(s)?xu.getLighterColor(o,s,n).transparent(r):xu.getDarkerColor(o,s,n).transparent(r):o.transparent(n*r)}}}function Sd(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?xu.fromHex(e):t.getColor(e):e instanceof xu?e:"function"==typeof e?e(t):void 0}var xd=yr.as(Bc);xd.registerSchema("vscode://schemas/workbench-colors",Vc.getColorSchema());var kd=new ks((function(){return xd.notifySchemaChanged("vscode://schemas/workbench-colors")}),200);Vc.onDidChangeSchema((function(){kd.isScheduled()||kd.schedule()}));var Ld=pt("themeService");function Md(e){return{id:e}}var Ed="dark",Dd="hc";function Td(e){switch(e){case Ed:return"vs-dark";case Dd:return"hc-black";default:return"vs"}}var Nd="base.contributions.theming",Od=new(function(){function e(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Ht}return e.prototype.onThemeChange=function(e){var t=this;return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Mt((function(){var n=t.themingParticipants.indexOf(e);t.themingParticipants.splice(n,1)}))},e.prototype.getThemingParticipants=function(){return this.themingParticipants},e}());function Ad(e){return Od.onThemeChange(e)}yr.add(Nd,Od);var Id=function(){function e(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationId=null,this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}return e.prototype.dispose=function(){this._editor.deltaDecorations(this._allDecorations(),[]),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationId=null,this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null},e.prototype.reset=function(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationId=null,this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null},e.prototype.getCount=function(){return this._decorations.length},e.prototype.getFindScope=function(){return this._findScopeDecorationId?this._editor.getModel().getDecorationRange(this._findScopeDecorationId):null},e.prototype.getStartPosition=function(){return this._startPosition},e.prototype.setStartPosition=function(e){this._startPosition=e,this.setCurrentFindMatch(null)},e.prototype._getDecorationIndex=function(e){var t=this._decorations.indexOf(e);return t>=0?t+1:1},e.prototype.getCurrentMatchesPosition=function(t){for(var n=0,r=this._editor.getModel().getDecorationsInRange(t);n1e3){o=e._FIND_MATCH_NO_OVERVIEW_DECORATION;for(var a=r._editor.getModel().getLineCount(),u=r._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/u)),l=t[0].range.startLineNumber,d=t[0].range.endLineNumber,h=1,f=t.length;h=p.startLineNumber?p.endLineNumber>d&&(d=p.endLineNumber):(s.push({range:new Tr(l,1,d,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),l=p.startLineNumber,d=p.endLineNumber)}s.push({range:new Tr(l,1,d,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}var g=new Array(t.length);for(h=0,f=t.length;h=0;t--){var n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(r&&!(r.endLineNumber>e.lineNumber)){if(r.endLineNumbere.column))return r}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])},e.prototype.matchAfterPosition=function(e){if(0===this._decorations.length)return null;for(var t=0,n=this._decorations.length;te.lineNumber)return i;if(!(i.startColumn0){for(var n=[],r=0;r0;){if(e0},e.prototype._cannotFind=function(){if(!this._hasMatches()){var e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1},e.prototype._setCurrentFindMatch=function(e){var t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)},e.prototype._prevSearchPosition=function(e){var t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),n=e.lineNumber,r=e.column,i=this._editor.getModel();return t||1===r?(1===n?n=i.getLineCount():n--,r=i.getLineMaxColumn(n)):r--,new _t(n,r)},e.prototype._moveToPrevMatch=function(t,n){if(void 0===n&&(n=!1),this._decorations.getCount()<19999){var r=this._decorations.matchBeforePosition(t);return r&&r.isEmpty()&&r.getStartPosition().equals(t)&&(t=this._prevSearchPosition(t),r=this._decorations.matchBeforePosition(t)),void(r&&this._setCurrentFindMatch(r))}if(!this._cannotFind()){var i=this._decorations.getFindScope(),o=e._getSearchRange(this._editor.getModel(),i);o.getEndPosition().isBefore(t)&&(t=o.getEndPosition()),t.isBefore(o.getStartPosition())&&(t=o.getEndPosition());var s=t.lineNumber,a=t.column,u=this._editor.getModel(),c=new _t(s,a),l=u.findPreviousMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1);if(l&&l.range.isEmpty()&&l.range.getStartPosition().equals(c)&&(c=this._prevSearchPosition(c),l=u.findPreviousMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1)),l)return n||o.containsRange(l.range)?void this._setCurrentFindMatch(l.range):this._moveToPrevMatch(l.range.getStartPosition(),!0)}},e.prototype.moveToPrevMatch=function(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())},e.prototype._nextSearchPosition=function(e){var t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),n=e.lineNumber,r=e.column,i=this._editor.getModel();return t||r===i.getLineMaxColumn(n)?(n===i.getLineCount()?n=1:n++,r=1):r++,new _t(n,r)},e.prototype._moveToNextMatch=function(e){if(this._decorations.getCount()<19999){var t=this._decorations.matchAfterPosition(e);return t&&t.isEmpty()&&t.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),t=this._decorations.matchAfterPosition(e)),void(t&&this._setCurrentFindMatch(t))}var n=this._getNextMatch(e,!1,!0);n&&this._setCurrentFindMatch(n.range)},e.prototype._getNextMatch=function(t,n,r,i){if(void 0===i&&(i=!1),this._cannotFind())return null;var o=this._decorations.getFindScope(),s=e._getSearchRange(this._editor.getModel(),o);s.getEndPosition().isBefore(t)&&(t=s.getStartPosition()),t.isBefore(s.getStartPosition())&&(t=s.getStartPosition());var a=t.lineNumber,u=t.column,c=this._editor.getModel(),l=new _t(a,u),d=c.findNextMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,n);return r&&d&&d.range.isEmpty()&&d.range.getStartPosition().equals(l)&&(l=this._nextSearchPosition(l),d=c.findNextMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,n)),d?i||s.containsRange(d.range)?d:this._getNextMatch(d.range.getEndPosition(),n,r,!0):null},e.prototype.moveToNextMatch=function(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())},e.prototype._getReplacePattern=function(){return this._state.isRegex?function(e){if(!e||0===e.length)return new jd(null);for(var t=new Hd(e),n=0,r=e.length;n=r)break;if(36===(a=e.charCodeAt(n))){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(48===a||38===a){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1);continue}if(49<=a&&a<=57){var o=a-48;if(n+1=r)break;var a;switch(a=e.charCodeAt(n)){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic("\n",n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic("\t",n+1)}}}return t.finalize()}(this._state.replaceString):jd.fromStaticValue(this._state.replaceString)},e.prototype.replace=function(){if(this._hasMatches()){var e=this._getReplacePattern(),t=this._editor.getSelection(),n=this._getNextMatch(t.getStartPosition(),!0,!1);if(n)if(t.equalsRange(n.range)){var r=e.buildReplaceString(n.matches,this._state.preserveCase),i=new tc(t,r);this._executeEditorCommand("replace",i),this._decorations.setStartPosition(new _t(t.startLineNumber,t.startColumn+r.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(n.range)}},e.prototype._findMatches=function(t,n,r){var i=e._getSearchRange(this._editor.getModel(),t);return this._editor.getModel().findMatches(this._state.searchString,i,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,n,r)},e.prototype.replaceAll=function(){if(this._hasMatches()){var e=this._decorations.getFindScope();null===e&&this._state.matchesCount>=19999?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}},e.prototype._largeReplaceAll=function(){var e=new vo(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null).parseSearchRequest();if(e){var t=e.regex;if(!t.multiline){var n="m";t.ignoreCase&&(n+="i"),t.global&&(n+="g"),t=new RegExp(t.source,n)}var r,i=this._editor.getModel(),o=i.getValue(1),s=i.getFullModelRange(),a=this._getReplacePattern(),u=this._state.preserveCase;r=a.hasReplacementPatterns||u?o.replace(t,(function(){return a.buildReplaceString(arguments,u)})):o.replace(t,a.buildReplaceString(null,u));var c=new ic(s,r,this._editor.getSelection());this._executeEditorCommand("replaceAll",c)}},e.prototype._regularReplaceAll=function(e){for(var t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),r=[],i=0,o=n.length;i=0,th=Qd.indexOf("Edge/")>=0,nh=eh||th,rh=Qd.indexOf("Firefox")>=0,ih=Qd.indexOf("AppleWebKit")>=0,oh=Qd.indexOf("Chrome")>=0,sh=!oh&&Qd.indexOf("Safari")>=0,ah=!oh&&!sh&&ih,uh=Qd.indexOf("iPad")>=0,ch=th&&Qd.indexOf("WebView/")>=0;var lh=function(e,t,n){var r=function(e){return i.fire(e)},i=new Ht({onFirstListenerAdd:function(){e.addEventListener(t,r,n)},onLastListenerRemove:function(){e.removeEventListener(t,r,n)}});return i.event};var dh=new Array(230),hh=new Array(112);!function(){for(var e=0;e0;)Kh.sort(Jh.sort),Kh.shift().execute();$h=!1},zh=function(e,t){void 0===t&&(t=0);var n,r=new Jh(e,t);return qh.push(r),Gh||(Gh=!0,n=Zh,Uh||(Uh=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||function(e){return setTimeout((function(){return e((new Date).getTime())}),0)}),Uh.call(self,n)),r},Vh=function(e,t){if($h){var n=new Jh(e,t);return Kh.push(n),n}return zh(e,t)};var Xh=16,Qh=function(e,t){return t},ef=function(e){function t(t,n,r,i,o){void 0===i&&(i=Qh),void 0===o&&(o=Xh);var s=e.call(this)||this,a=null,u=0,c=s._register(new Ss),l=function(){u=(new Date).getTime(),r(a),a=null};return s._register(Bh(t,n,(function(e){a=i(a,e);var t=(new Date).getTime()-u;t>=o?(c.cancel(),l()):c.setIfNotSet(l,o-t)}))),s}return Lh(t,e),t}(Dt);function tf(e,t,n,r,i){return new ef(e,t,n,r,i)}function nf(e){return document.defaultView.getComputedStyle(e,null)}var rf=function(){function e(){}return e.convertToPixels=function(e,t){return parseFloat(t)||0},e.getDimension=function(t,n,r){var i=nf(t),o="0";return i&&(o=i.getPropertyValue?i.getPropertyValue(n):i.getAttribute(r)),e.convertToPixels(t,o)},e.getBorderLeftWidth=function(t){return e.getDimension(t,"border-left-width","borderLeftWidth")},e.getBorderRightWidth=function(t){return e.getDimension(t,"border-right-width","borderRightWidth")},e.getBorderTopWidth=function(t){return e.getDimension(t,"border-top-width","borderTopWidth")},e.getBorderBottomWidth=function(t){return e.getDimension(t,"border-bottom-width","borderBottomWidth")},e.getPaddingLeft=function(t){return e.getDimension(t,"padding-left","paddingLeft")},e.getPaddingRight=function(t){return e.getDimension(t,"padding-right","paddingRight")},e.getPaddingTop=function(t){return e.getDimension(t,"padding-top","paddingTop")},e.getPaddingBottom=function(t){return e.getDimension(t,"padding-bottom","paddingBottom")},e.getMarginLeft=function(t){return e.getDimension(t,"margin-left","marginLeft")},e.getMarginTop=function(t){return e.getDimension(t,"margin-top","marginTop")},e.getMarginRight=function(t){return e.getDimension(t,"margin-right","marginRight")},e.getMarginBottom=function(t){return e.getDimension(t,"margin-bottom","marginBottom")},e}();function of(e){for(var t=e.offsetParent,n=e.offsetTop,r=e.offsetLeft;null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement;){n-=e.scrollTop;var i=nf(e);i&&(r-="rtl"!==i.direction?e.scrollLeft:-e.scrollLeft),e===t&&(r+=rf.getBorderLeftWidth(e),n+=rf.getBorderTopWidth(e),n+=e.offsetTop,r+=e.offsetLeft,t=e.offsetParent)}return{left:r,top:n}}function sf(e){var t=e.getBoundingClientRect();return{left:t.left+af.scrollX,top:t.top+af.scrollY,width:t.width,height:t.height}}var af=new(function(){function e(){}return Object.defineProperty(e.prototype,"scrollX",{get:function(){return"number"==typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollY",{get:function(){return"number"==typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop},enumerable:!0,configurable:!0}),e}());function uf(e){var t=rf.getMarginLeft(e)+rf.getMarginRight(e);return e.offsetWidth+t}function cf(e){var t=rf.getBorderLeftWidth(e)+rf.getBorderRightWidth(e),n=rf.getPaddingLeft(e)+rf.getPaddingRight(e);return e.offsetWidth-t-n}function lf(e){var t=rf.getMarginTop(e)+rf.getMarginBottom(e);return e.offsetHeight+t}function df(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function hf(e){void 0===e&&(e=document.getElementsByTagName("head")[0]);var t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}var ff=null;function pf(){return ff||(ff=hf()),ff}var gf={CLICK:"click",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:ih?"webkitAnimationStart":"animationstart",ANIMATION_END:ih?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:ih?"webkitAnimationIteration":"animationiteration"},mf={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}};var _f=function(e){function t(t){var n=e.call(this)||this;n._onDidFocus=n._register(new Ht),n.onDidFocus=n._onDidFocus.event,n._onDidBlur=n._register(new Ht),n.onDidBlur=n._onDidBlur.event;var r=df(document.activeElement,t),i=!1;return n._register(lh(t,gf.FOCUS,!0)((function(){i=!1,r||(r=!0,n._onDidFocus.fire())}))),n._register(lh(t,gf.BLUR,!0)((function(){r&&(i=!0,window.setTimeout((function(){i&&(i=!1,r=!1,n._onDidBlur.fire())}),0))}))),n}return Lh(t,e),t}(Dt);function yf(e){return new _f(e)}function vf(e){for(var t=[],n=1;nt&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,r.matchesPosition=!0,i=!0),this._matchesCount!==t&&(this._matchesCount=t,r.matchesCount=!0,i=!0),void 0!==n&&(Tr.equalsRange(this._currentMatch,n)||(this._currentMatch=n,r.currentMatch=!0,i=!0)),i&&this._onFindReplaceStateChange.fire(r)},e.prototype.change=function(e,t,n){void 0===n&&(n=!0);var r={moveCursor:t,updateHistory:n,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1},i=!1,o=this.isRegex,s=this.wholeWord,a=this.matchCase,u=this.preserveCase;void 0!==e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,r.searchString=!0,i=!0),void 0!==e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,r.replaceString=!0,i=!0),void 0!==e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,r.isRevealed=!0,i=!0),void 0!==e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,r.isReplaceRevealed=!0,i=!0),void 0!==e.isRegex&&(this._isRegex=e.isRegex),void 0!==e.wholeWord&&(this._wholeWord=e.wholeWord),void 0!==e.matchCase&&(this._matchCase=e.matchCase),void 0!==e.preserveCase&&(this._preserveCase=e.preserveCase),void 0!==e.searchScope&&(Tr.equalsRange(this._searchScope,e.searchScope)||(this._searchScope=e.searchScope,r.searchScope=!0,i=!0)),this._isRegexOverride=void 0!==e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride=void 0!==e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride=void 0!==e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride=void 0!==e.preserveCaseOverride?e.preserveCaseOverride:0,o!==this.isRegex&&(i=!0,r.isRegex=!0),s!==this.wholeWord&&(i=!0,r.wholeWord=!0),a!==this.matchCase&&(i=!0,r.matchCase=!0),u!==this.preserveCase&&(i=!0,r.preserveCase=!0),i&&this._onFindReplaceStateChange.fire(r)},e}();n(380),n(381);function $f(e,t){Qf(qf,e,t)}function Zf(e,t){Ge.d?$f(e,t):Qf(Kf,e,t)}var Jf=0,Xf=void 0;function Qf(e,t,n){if(Uf){if(!n)switch(Xf===t?Jf++:(Xf=t,Jf=0),Jf){case 0:break;case 1:t=we("repeated","{0} (occurred again)",t);break;default:t=we("repeatedNtimes","{0} (occurred {1} times)",t,Jf)}Eh(e),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}}n(382);function ep(e,t,n){var r=null,i=null;if("function"==typeof n.value?(r="value",0!==(i=n.value).length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof n.get&&(r="get",i=n.get),!i)throw new Error("not supported");var o="$memoize$"+t;n[r]=function(){for(var e=[],t=0;t=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};!function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}(tp||(tp={}));var ip=function(e){function t(){var t=e.call(this)||this;return t.dispatched=!1,t.activeTouches={},t.handle=null,t.targets=[],t._register(Bh(document,"touchstart",(function(e){return t.onTouchStart(e)}))),t._register(Bh(document,"touchend",(function(e){return t.onTouchEnd(e)}))),t._register(Bh(document,"touchmove",(function(e){return t.onTouchMove(e)}))),t}return np(t,e),t.addTarget=function(e){t.isTouchDevice()&&(t.INSTANCE||(t.INSTANCE=new t),t.INSTANCE.targets.push(e))},t.isTouchDevice=function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0},t.prototype.dispose=function(){this.handle&&(this.handle.dispose(),this.handle=null),e.prototype.dispose.call(this)},t.prototype.onTouchStart=function(e){var t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(var n=0,r=e.targetTouches.length;n=t.HOLD_DELAY&&Math.abs(u.initialPageX-Ar(u.rollingPageX))<30&&Math.abs(u.initialPageY-Ar(u.rollingPageY))<30){var l;(l=o.newGestureEvent(tp.Contextmenu,u.initialTarget)).pageX=Ar(u.rollingPageX),l.pageY=Ar(u.rollingPageY),o.dispatchEvent(l)}else if(1===r){var d=Ar(u.rollingPageX),h=Ar(u.rollingPageY),f=Ar(u.rollingTimestamps)-u.rollingTimestamps[0],p=d-u.rollingPageX[0],g=h-u.rollingPageY[0],m=o.targets.filter((function(e){return u.initialTarget instanceof Node&&e.contains(u.initialTarget)}));o.inertia(m,n,Math.abs(p)/f,p>0?1:-1,d,Math.abs(g)/f,g>0?1:-1,h)}o.dispatchEvent(o.newGestureEvent(tp.End,u.initialTarget)),delete o.activeTouches[a.identifier]},o=this,s=0,a=e.changedTouches.length;s0&&(p=!1,h=i*r*d),s>0&&(p=!1,f=a*s*d);var g=c.newGestureEvent(tp.Change);g.translationX=h,g.translationY=f,e.forEach((function(e){return e.dispatchEvent(g)})),p||c.inertia(e,l,r,i,o+h,s,a,u+f)}))},t.prototype.onTouchMove=function(e){for(var t=Date.now(),n=0,r=e.changedTouches.length;n3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(i.pageX),o.rollingPageY.push(i.pageY),o.rollingTimestamps.push(t)}else console.warn("end of an UNKNOWN touch",i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)},t.SCROLL_FRICTION=-.005,t.HOLD_DELAY=700,rp([ep],t,"isTouchDevice",null),t}(Dt),op=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sp=!1,ap=function(e){function t(t,n,r){void 0===r&&(r={});var i=e.call(this)||this;return i._state=3,i._onDidEnablementChange=i._register(new Ht),i.onDidEnablementChange=i._onDidEnablementChange.event,i._onDidStart=i._register(new Ht),i.onDidStart=i._onDidStart.event,i._onDidChange=i._register(new Ht),i.onDidChange=i._onDidChange.event,i._onDidReset=i._register(new Ht),i.onDidReset=i._onDidReset.event,i._onDidEnd=i._register(new Ht),i.onDidEnd=i._onDidEnd.event,i.linkedSash=void 0,i.orthogonalStartSashDisposables=i._register(new Et),i.orthogonalEndSashDisposables=i._register(new Et),i.el=vf(t,Sf(".monaco-sash")),Ge.d&&Ih(i.el,"mac"),i._register(lh(i.el,"mousedown")(i.onMouseDown,i)),i._register(lh(i.el,"dblclick")(i.onMouseDoubleClick,i)),ip.addTarget(i.el),i._register(lh(i.el,tp.Start)(i.onTouchStart,i)),uh&&Ih(i.el,"touch"),i.setOrientation(r.orientation||0),i.hidden=!1,i.layoutProvider=n,i.orthogonalStartSash=r.orthogonalStartSash,i.orthogonalEndSash=r.orthogonalEndSash,Yh(i.el,"debug",sp),i}return op(t,e),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){this._state!==e&&(Yh(this.el,"disabled",0===e),Yh(this.el,"minimum",1===e),Yh(this.el,"maximum",2===e),this._state=e,this._onDidEnablementChange.fire(e))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"orthogonalStartSash",{get:function(){return this._orthogonalStartSash},set:function(e){this.orthogonalStartSashDisposables.clear(),e?(this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange,this)),this.onOrthogonalStartSashEnablementChange(e.state)):this.onOrthogonalStartSashEnablementChange(0),this._orthogonalStartSash=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"orthogonalEndSash",{get:function(){return this._orthogonalEndSash},set:function(e){this.orthogonalEndSashDisposables.clear(),e?(this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange,this)),this.onOrthogonalEndSashEnablementChange(e.state)):this.onOrthogonalEndSashEnablementChange(0),this._orthogonalEndSash=e},enumerable:!0,configurable:!0}),t.prototype.setOrientation=function(e){this.orientation=e,1===this.orientation?(Ih(this.el,"horizontal"),Rh(this.el,"vertical")):(Rh(this.el,"horizontal"),Ih(this.el,"vertical")),this.layoutProvider&&this.layout()},t.prototype.onMouseDown=function(e){var t=this;mf.stop(e,!1);var n=!1;if(!e.__orthogonalSashEvent){var r=this.getOrthogonalSash(e);r&&(n=!0,e.__orthogonalSashEvent=!0,r.onMouseDown(e))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onMouseDown(e)),this.state){for(var i=Lf("iframe").concat(Lf("webview")),o=0,s=i;o=this.el.clientHeight-4)return this.orthogonalEndSash}else{if(e.offsetX<=4)return this.orthogonalStartSash;if(e.offsetX>=this.el.clientWidth-4)return this.orthogonalEndSash}},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.el&&this.el.parentElement&&this.el.parentElement.removeChild(this.el),this.el=null},t}(Dt);n(131),n(383);function up(e,t){void 0===t&&(t={});var n=cp(t);return function e(t,n,r){var i;if(2===n.type)i=document.createTextNode(n.content||"");else if(3===n.type)i=document.createElement("b");else if(4===n.type)i=document.createElement("i");else if(5===n.type&&r){var o=document.createElement("a");o.href="#",r.disposeables.add(Hh(o,"click",(function(e){r.callback(String(n.index),e)}))),i=o}else 7===n.type?i=document.createElement("br"):1===n.type&&(i=t);i&&t!==i&&t.appendChild(i);i&&Array.isArray(n.children)&&n.children.forEach((function(t){e(i,t,r)}))}(n,function(e){var t={type:1,children:[]},n=0,r=t,i=[],o=new lp(e);for(;!o.eos();){var s=o.next(),a="\\"===s&&0!==dp(o.peek());if(a&&(s=o.next()),a||0===dp(s)||s!==o.peek())if("\n"===s)2===r.type&&(r=i.pop()),r.children.push({type:7});else if(2!==r.type){var u={type:2,content:s};r.children.push(u),i.push(r),r=u}else r.content+=s;else{o.advance(),2===r.type&&(r=i.pop());var c=dp(s);if(r.type===c||5===r.type&&6===c)r=i.pop();else{var l={type:c,children:[]};5===c&&(l.index=n,n++),r.children.push(l),i.push(r),r=l}}}2===r.type&&(r=i.pop());i.length;return t}(e),t.actionHandler),n}function cp(e){var t=e.inline?"span":"div",n=document.createElement(t);return e.className&&(n.className=e.className),n}var lp=function(){function e(e){this.source=e,this.index=0}return e.prototype.eos=function(){return this.index>=this.source.length},e.prototype.next=function(){var e=this.peek();return this.advance(),e},e.prototype.peek=function(){return this.source[this.index]},e.prototype.advance=function(){this.index++},e}();function dp(e){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;default:return 0}}n(384);var hp=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fp=function(e){function t(t,n,r){var i=e.call(this)||this;return i.options=r,i._context=t||i,i._action=n,n instanceof Gt&&i._register(n.onDidChange((function(e){i.element&&i.handleActionChangeEvent(e)}))),i}return hp(t,e),t.prototype.handleActionChangeEvent=function(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()},Object.defineProperty(t.prototype,"actionRunner",{get:function(){return this._actionRunner},set:function(e){this._actionRunner=e},enumerable:!0,configurable:!0}),t.prototype.getAction=function(){return this._action},t.prototype.isEnabled=function(){return this._action.enabled},t.prototype.setActionContext=function(e){this._context=e},t.prototype.render=function(e){var t=this;this.element=e,ip.addTarget(e);var n=this.options&&this.options.draggable;n&&(e.draggable=!0),this._register(Bh(this.element,tp.Tap,(function(e){return t.onClick(e)}))),this._register(Bh(this.element,gf.MOUSE_DOWN,(function(e){n||mf.stop(e,!0),t._action.enabled&&0===e.button&&t.element&&Ih(t.element,"active")}))),this._register(Bh(this.element,gf.CLICK,(function(e){mf.stop(e,!0),t.options&&t.options.isMenu?t.onClick(e):Ge.h((function(){return t.onClick(e)}))}))),this._register(Bh(this.element,gf.DBLCLICK,(function(e){mf.stop(e,!0)}))),[gf.MOUSE_UP,gf.MOUSE_OUT].forEach((function(e){t._register(Bh(t.element,e,(function(e){mf.stop(e),Rh(t.element,"active")})))}))},t.prototype.onClick=function(e){var t;mf.stop(e,!0),Ee(this._context)?t=e:xe(t=this._context)&&(t.event=e),this._actionRunner.run(this._action,t)},t.prototype.focus=function(){this.element&&(this.element.focus(),Ih(this.element,"focused"))},t.prototype.blur=function(){this.element&&(this.element.blur(),Rh(this.element,"focused"))},t.prototype.updateEnabled=function(){},t.prototype.updateLabel=function(){},t.prototype.updateTooltip=function(){},t.prototype.updateClass=function(){},t.prototype.updateChecked=function(){},t.prototype.dispose=function(){this.element&&(Dh(this.element),this.element=void 0),e.prototype.dispose.call(this)},t}(Dt),pp=function(e){function t(n){var r=e.call(this,t.ID,n,n?"separator text":"separator")||this;return r.checked=!1,r.radio=!1,r.enabled=!1,r}return hp(t,e),t.ID="vs.actions.separator",t}(Gt),gp=function(e){function t(t,n,r){void 0===r&&(r={});var i=e.call(this,t,n,r)||this;return i.options=r,i.options.icon=void 0!==r.icon&&r.icon,i.options.label=void 0===r.label||r.label,i.cssClass="",i}return hp(t,e),t.prototype.render=function(t){e.prototype.render.call(this,t),this.element&&(this.label=vf(this.element,Sf("a.action-label"))),this._action.id===pp.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button"),this.options.label&&this.options.keybinding&&this.element&&(vf(this.element,Sf("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()},t.prototype.focus=function(){e.prototype.focus.call(this),this.label.focus()},t.prototype.updateLabel=function(){this.options.label&&(this.label.textContent=this.getAction().label)},t.prototype.updateTooltip=function(){var e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=we({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&(this.label.title=e)},t.prototype.updateClass=function(){this.cssClass&&Fh(this.label,this.cssClass),this.options.icon?(this.cssClass=this.getAction().class,Ih(this.label,"icon"),this.cssClass&&Ph(this.label,this.cssClass),this.updateEnabled()):Rh(this.label,"icon")},t.prototype.updateEnabled=function(){this.getAction().enabled?(this.label.removeAttribute("aria-disabled"),this.element&&Rh(this.element,"disabled"),Rh(this.label,"disabled"),this.label.tabIndex=0):(this.label.setAttribute("aria-disabled","true"),this.element&&Ih(this.element,"disabled"),Ih(this.label,"disabled"),kf(this.label))},t.prototype.updateChecked=function(){this.getAction().checked?Ih(this.label,"checked"):Rh(this.label,"checked")},t}(fp),mp={orientation:0,context:null,triggerKeys:{keys:[3,10],keyDown:!1}},_p=function(e){function t(t,n){void 0===n&&(n=mp);var r,i,o=e.call(this)||this;switch(o._onDidBlur=o._register(new Ht),o.onDidBlur=o._onDidBlur.event,o._onDidCancel=o._register(new Ht),o.onDidCancel=o._onDidCancel.event,o._onDidRun=o._register(new Ht),o.onDidRun=o._onDidRun.event,o._onDidBeforeRun=o._register(new Ht),o.onDidBeforeRun=o._onDidBeforeRun.event,o.options=n,o._context=n.context,o.options.triggerKeys||(o.options.triggerKeys=mp.triggerKeys),o.options.actionRunner?o._actionRunner=o.options.actionRunner:(o._actionRunner=new $t,o._register(o._actionRunner)),o._register(o._actionRunner.onDidRun((function(e){return o._onDidRun.fire(e)}))),o._register(o._actionRunner.onDidBeforeRun((function(e){return o._onDidBeforeRun.fire(e)}))),o.viewItems=[],o.focusedItem=void 0,o.domNode=document.createElement("div"),o.domNode.className="monaco-action-bar",!1!==n.animated&&Ih(o.domNode,"animated"),o.options.orientation){case 0:r=15,i=17;break;case 1:r=17,i=15,o.domNode.className+=" reverse";break;case 2:r=16,i=18,o.domNode.className+=" vertical";break;case 3:r=18,i=16,o.domNode.className+=" vertical reverse"}return o._register(Bh(o.domNode,gf.KEY_DOWN,(function(e){var t=new gh(e),n=!0;t.equals(r)?o.focusPrevious():t.equals(i)?o.focusNext():t.equals(9)?o.cancel():o.isTriggerKeyEvent(t)?o.options.triggerKeys&&o.options.triggerKeys.keyDown&&o.doTrigger(t):n=!1,n&&(t.preventDefault(),t.stopPropagation())}))),o._register(Bh(o.domNode,gf.KEY_UP,(function(e){var t=new gh(e);o.isTriggerKeyEvent(t)?(o.options.triggerKeys&&!o.options.triggerKeys.keyDown&&o.doTrigger(t),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&o.updateFocusedItem()}))),o.focusTracker=o._register(yf(o.domNode)),o._register(o.focusTracker.onDidBlur((function(){document.activeElement!==o.domNode&&df(document.activeElement,o.domNode)||(o._onDidBlur.fire(),o.focusedItem=void 0)}))),o._register(o.focusTracker.onDidFocus((function(){return o.updateFocusedItem()}))),o.actionsList=document.createElement("ul"),o.actionsList.className="actions-container",o.actionsList.setAttribute("role","toolbar"),o.options.ariaLabel&&o.actionsList.setAttribute("aria-label",o.options.ariaLabel),o.domNode.appendChild(o.actionsList),t.appendChild(o.domNode),o}return hp(t,e),t.prototype.isTriggerKeyEvent=function(e){var t=!1;return this.options.triggerKeys&&this.options.triggerKeys.keys.forEach((function(n){t=t||e.equals(n)})),t},t.prototype.updateFocusedItem=function(){for(var e=0;e=n.actionsList.children.length?(n.actionsList.appendChild(o),n.viewItems.push(r)):(n.actionsList.insertBefore(o,n.actionsList.children[i]),n.viewItems.splice(i,0,r),i++)}))},t.prototype.clear=function(){this.viewItems=kt(this.viewItems),Eh(this.actionsList)},t.prototype.isEmpty=function(){return 0===this.viewItems.length},t.prototype.focus=function(e){var t=!1,n=void 0;void 0===e?t=!0:"number"==typeof e?n=e:"boolean"==typeof e&&(t=e),t&&void 0===this.focusedItem?(this.focusedItem=this.viewItems.length-1,this.focusNext()):(void 0!==n&&(this.focusedItem=n),this.updateFocus())},t.prototype.focusNext=function(){void 0===this.focusedItem&&(this.focusedItem=this.viewItems.length-1);var e,t=this.focusedItem;do{this.focusedItem=(this.focusedItem+1)%this.viewItems.length,e=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&!e.isEnabled());this.focusedItem!==t||e.isEnabled()||(this.focusedItem=void 0),this.updateFocus()},t.prototype.focusPrevious=function(){void 0===this.focusedItem&&(this.focusedItem=0);var e,t=this.focusedItem;do{this.focusedItem=this.focusedItem-1,this.focusedItem<0&&(this.focusedItem=this.viewItems.length-1),e=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&!e.isEnabled());this.focusedItem!==t||e.isEnabled()||(this.focusedItem=void 0),this.updateFocus(!0)},t.prototype.updateFocus=function(e){void 0===this.focusedItem&&this.actionsList.focus();for(var t=0;tthis._limit&&this._initialize(e.slice(e.length-this._limit))},e.prototype._initialize=function(e){this._history=new Set;for(var t=0,n=e;t140)n._setDesiredScrollPositionNow(o.getScrollPosition());else{var a=n._sliderMousePosition(e)-r;n._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(a))}}),(function(){n.slider.toggleClassName("active",!1),n._host.onDragEnd(),t()})),this._host.onDragStart()},t.prototype._setDesiredScrollPositionNow=function(e){var t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)},t}(Nf),Tp=function(){function e(e,t,n){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=0,this._scrollSize=0,this._scrollPosition=0,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}return e.prototype.clone=function(){var t=new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize);return t.setVisibleSize(this._visibleSize),t.setScrollSize(this._scrollSize),t.setScrollPosition(this._scrollPosition),t},e.prototype.setVisibleSize=function(e){var t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)},e.prototype.setScrollSize=function(e){var t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)},e.prototype.setScrollPosition=function(e){var t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)},e._computeValues=function(e,t,n,r,i){var o=Math.max(0,n-e),s=Math.max(0,o-2*t),a=r>0&&r>n;if(!a)return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(s),computedSliderRatio:0,computedSliderPosition:0};var u=Math.round(Math.max(20,Math.floor(n*s/r))),c=(s-u)/(r-n),l=i*c;return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(u),computedSliderRatio:c,computedSliderPosition:Math.round(l)}},e.prototype._refreshComputedValues=function(){var t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition},e.prototype.getArrowSize=function(){return this._arrowSize},e.prototype.getScrollPosition=function(){return this._scrollPosition},e.prototype.getRectangleLargeSize=function(){return this._computedAvailableSize},e.prototype.getRectangleSmallSize=function(){return this._scrollbarSize},e.prototype.isNeeded=function(){return this._computedIsNeeded},e.prototype.getSliderSize=function(){return this._computedSliderSize},e.prototype.getSliderPosition=function(){return this._computedSliderPosition},e.prototype.getDesiredScrollPositionFromOffset=function(e){if(!this._computedIsNeeded)return 0;var t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)},e.prototype.getDesiredScrollPositionFromDelta=function(e){if(!this._computedIsNeeded)return 0;var t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)},e}(),Np=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Op=function(e){function t(t,n,r){var i=e.call(this,{lazyRender:n.lazyRender,host:r,scrollbarState:new Tp(n.horizontalHasArrows?n.arrowSize:0,2===n.horizontal?0:n.horizontalScrollbarSize,2===n.vertical?0:n.verticalScrollbarSize),visibility:n.horizontal,extraScrollbarClassName:"horizontal",scrollable:t})||this;if(n.horizontalHasArrows){var o=(n.arrowSize-xp)/2,s=(n.horizontalScrollbarSize-xp)/2;i._createArrow({className:"left-arrow",top:s,left:o,bottom:void 0,right:void 0,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return i._host.onMouseWheel(new xh(null,1,0))}}),i._createArrow({className:"right-arrow",top:s,left:void 0,bottom:void 0,right:o,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return i._host.onMouseWheel(new xh(null,-1,0))}})}return i._createSlider(Math.floor((n.horizontalScrollbarSize-n.horizontalSliderSize)/2),0,void 0,n.horizontalSliderSize),i}return Np(t,e),t.prototype._updateSlider=function(e,t){this.slider.setWidth(e),this.slider.setLeft(t)},t.prototype._renderDomNode=function(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)},t.prototype.onDidScroll=function(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender},t.prototype._mouseDownRelativePosition=function(e,t){return e},t.prototype._sliderMousePosition=function(e){return e.posx},t.prototype._sliderOrthogonalMousePosition=function(e){return e.posy},t.prototype.writeScrollPosition=function(e,t){e.scrollLeft=t},t}(Dp),Ap=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ip=function(e){function t(t,n,r){var i=e.call(this,{lazyRender:n.lazyRender,host:r,scrollbarState:new Tp(n.verticalHasArrows?n.arrowSize:0,2===n.vertical?0:n.verticalScrollbarSize,0),visibility:n.vertical,extraScrollbarClassName:"vertical",scrollable:t})||this;if(n.verticalHasArrows){var o=(n.arrowSize-xp)/2,s=(n.verticalScrollbarSize-xp)/2;i._createArrow({className:"up-arrow",top:o,left:s,bottom:void 0,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return i._host.onMouseWheel(new xh(null,0,1))}}),i._createArrow({className:"down-arrow",top:void 0,left:s,bottom:o,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return i._host.onMouseWheel(new xh(null,0,-1))}})}return i._createSlider(0,Math.floor((n.verticalScrollbarSize-n.verticalSliderSize)/2),n.verticalSliderSize,void 0),i}return Ap(t,e),t.prototype._updateSlider=function(e,t){this.slider.setHeight(e),this.slider.setTop(t)},t.prototype._renderDomNode=function(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)},t.prototype.onDidScroll=function(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender},t.prototype._mouseDownRelativePosition=function(e,t){return t},t.prototype._sliderMousePosition=function(e){return e.posy},t.prototype._sliderOrthogonalMousePosition=function(e){return e.posx},t.prototype.writeScrollPosition=function(e,t){e.scrollTop=t},t}(Dp),Pp=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rp=function(){function e(e,t,n,r,i,o){(e|=0)<0&&(e=0),(n|=0)+e>(t|=0)&&(n=t-e),n<0&&(n=0),(r|=0)<0&&(r=0),(o|=0)+r>(i|=0)&&(o=i-r),o<0&&(o=0),this.width=e,this.scrollWidth=t,this.scrollLeft=n,this.height=r,this.scrollHeight=i,this.scrollTop=o}return e.prototype.equals=function(e){return this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop},e.prototype.withScrollDimensions=function(t){return new e(void 0!==t.width?t.width:this.width,void 0!==t.scrollWidth?t.scrollWidth:this.scrollWidth,this.scrollLeft,void 0!==t.height?t.height:this.height,void 0!==t.scrollHeight?t.scrollHeight:this.scrollHeight,this.scrollTop)},e.prototype.withScrollPosition=function(t){return new e(this.width,this.scrollWidth,void 0!==t.scrollLeft?t.scrollLeft:this.scrollLeft,this.height,this.scrollHeight,void 0!==t.scrollTop?t.scrollTop:this.scrollTop)},e.prototype.createScrollEvent=function(e){var t=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,i=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:t,scrollWidthChanged:n,scrollLeftChanged:r,heightChanged:i,scrollHeightChanged:o,scrollTopChanged:s}},e}(),Fp=function(e){function t(t,n){var r=e.call(this)||this;return r._onScroll=r._register(new Ht),r.onScroll=r._onScroll.event,r._smoothScrollDuration=t,r._scheduleAtNextAnimationFrame=n,r._state=new Rp(0,0,0,0,0,0),r._smoothScrolling=null,r}return Pp(t,e),t.prototype.dispose=function(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),e.prototype.dispose.call(this)},t.prototype.setSmoothScrollDuration=function(e){this._smoothScrollDuration=e},t.prototype.validateScrollPosition=function(e){return this._state.withScrollPosition(e)},t.prototype.getScrollDimensions=function(){return this._state},t.prototype.setScrollDimensions=function(e){var t=this._state.withScrollDimensions(e);this._setState(t),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)},t.prototype.getFutureScrollPosition=function(){return this._smoothScrolling?this._smoothScrolling.to:this._state},t.prototype.getCurrentScrollPosition=function(){return this._state},t.prototype.setScrollPositionNow=function(e){var t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t)},t.prototype.setScrollPositionSmooth=function(e){var t=this;if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};var n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;var r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration);this._smoothScrolling.dispose(),this._smoothScrolling=r}else{n=this._state.withScrollPosition(e);this._smoothScrolling=Bp.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((function(){t._smoothScrolling&&(t._smoothScrolling.animationFrameDisposable=null,t._performSmoothScrolling())}))},t.prototype._performSmoothScrolling=function(){var e=this;if(this._smoothScrolling){var t=this._smoothScrolling.tick(),n=this._state.withScrollPosition(t);if(this._setState(n),t.isDone)return this._smoothScrolling.dispose(),void(this._smoothScrolling=null);this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((function(){e._smoothScrolling&&(e._smoothScrolling.animationFrameDisposable=null,e._performSmoothScrolling())}))}},t.prototype._setState=function(e){var t=this._state;t.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(t)))},t}(Dt),Yp=function(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n};function jp(e,t){var n=t-e;return function(t){return e+n*(1-function(e){return Math.pow(e,3)}(1-t))}}var Bp=function(){function e(e,t,n,r){this.from=e,this.to=t,this.duration=r,this._startTime=n,this.animationFrameDisposable=null,this._initAnimations()}return e.prototype._initAnimations=function(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)},e.prototype._initAnimation=function(e,t,n){var r,i,o;if(Math.abs(e-t)>2.5*n){var s=void 0,a=void 0;return e0&&Math.abs(e.deltaY)>0)return 1;var t=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return(Math.abs(e.deltaX-Math.round(e.deltaX))>0||Math.abs(e.deltaY-Math.round(e.deltaY))>0)&&(t+=.25),Math.min(Math.max(t,0),1)},e.INSTANCE=new e,e}(),zp=function(e){function t(t,n,r){var i=e.call(this)||this;i._onScroll=i._register(new Ht),i.onScroll=i._onScroll.event,t.style.overflow="hidden",i._options=Gp(n),i._scrollable=r,i._register(i._scrollable.onScroll((function(e){i._onDidScroll(e),i._onScroll.fire(e)})));var o={onMouseWheel:function(e){return i._onMouseWheel(e)},onDragStart:function(){return i._onDragStart()},onDragEnd:function(){return i._onDragEnd()}};return i._verticalScrollbar=i._register(new Ip(i._scrollable,i._options,o)),i._horizontalScrollbar=i._register(new Op(i._scrollable,i._options,o)),i._domNode=document.createElement("div"),i._domNode.className="monaco-scrollable-element "+i._options.className,i._domNode.setAttribute("role","presentation"),i._domNode.style.position="relative",i._domNode.style.overflow="hidden",i._domNode.appendChild(t),i._domNode.appendChild(i._horizontalScrollbar.domNode.domNode),i._domNode.appendChild(i._verticalScrollbar.domNode.domNode),i._options.useShadows?(i._leftShadowDomNode=bp(document.createElement("div")),i._leftShadowDomNode.setClassName("shadow"),i._domNode.appendChild(i._leftShadowDomNode.domNode),i._topShadowDomNode=bp(document.createElement("div")),i._topShadowDomNode.setClassName("shadow"),i._domNode.appendChild(i._topShadowDomNode.domNode),i._topLeftShadowDomNode=bp(document.createElement("div")),i._topLeftShadowDomNode.setClassName("shadow top-left-corner"),i._domNode.appendChild(i._topLeftShadowDomNode.domNode)):(i._leftShadowDomNode=null,i._topShadowDomNode=null,i._topLeftShadowDomNode=null),i._listenOnDomNode=i._options.listenOnDomNode||i._domNode,i._mouseWheelToDispose=[],i._setListeningToMouseWheel(i._options.handleMouseWheel),i.onmouseover(i._listenOnDomNode,(function(e){return i._onMouseOver(e)})),i.onnonbubblingmouseout(i._listenOnDomNode,(function(e){return i._onMouseOut(e)})),i._hideTimeout=i._register(new Ss),i._isDragging=!1,i._mouseIsOver=!1,i._shouldRender=!0,i._revealOnScroll=!0,i}return Hp(t,e),t.prototype.dispose=function(){this._mouseWheelToDispose=kt(this._mouseWheelToDispose),e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this._domNode},t.prototype.getOverviewRulerLayoutInfo=function(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this._verticalScrollbar.delegateMouseDown(e)},t.prototype.getScrollDimensions=function(){return this._scrollable.getScrollDimensions()},t.prototype.setScrollDimensions=function(e){this._scrollable.setScrollDimensions(e)},t.prototype.updateClassName=function(e){this._options.className=e,Ge.d&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className},t.prototype.updateOptions=function(e){var t=Gp(e);this._options.handleMouseWheel=t.handleMouseWheel,this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity,this._options.fastScrollSensitivity=t.fastScrollSensitivity,this._setListeningToMouseWheel(this._options.handleMouseWheel),this._options.lazyRender||this._render()},t.prototype._setListeningToMouseWheel=function(e){var t=this;if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=kt(this._mouseWheelToDispose),e)){this._mouseWheelToDispose.push(Bh(this._listenOnDomNode,nh?"mousewheel":"wheel",(function(e){t._onMouseWheel(new xh(e))})))}},t.prototype._onMouseWheel=function(e){var t,n=Vp.INSTANCE;if(n.accept(Date.now(),e.deltaX,e.deltaY),e.deltaY||e.deltaX){var r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.flipAxes&&(r=(t=[i,r])[0],i=t[1]);var o=!Ge.d&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!o||i||(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);var s=this._scrollable.getFutureScrollPosition(),a={};if(r){var u=s.scrollTop-50*r;this._verticalScrollbar.writeScrollPosition(a,u)}if(i){var c=s.scrollLeft-50*i;this._horizontalScrollbar.writeScrollPosition(a,c)}if(a=this._scrollable.validateScrollPosition(a),s.scrollLeft!==a.scrollLeft||s.scrollTop!==a.scrollTop)this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),this._shouldRender=!0}(this._options.alwaysConsumeMouseWheel||this._shouldRender)&&(e.preventDefault(),e.stopPropagation())},t.prototype._onDidScroll=function(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()},t.prototype.renderNow=function(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()},t.prototype._render=function(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){var e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0;this._leftShadowDomNode.setClassName("shadow"+(n?" left":"")),this._topShadowDomNode.setClassName("shadow"+(t?" top":"")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"+(t?" top":"")+(n?" left":""))}},t.prototype._onDragStart=function(){this._isDragging=!0,this._reveal()},t.prototype._onDragEnd=function(){this._isDragging=!1,this._hide()},t.prototype._onMouseOut=function(e){this._mouseIsOver=!1,this._hide()},t.prototype._onMouseOver=function(e){this._mouseIsOver=!0,this._reveal()},t.prototype._reveal=function(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()},t.prototype._hide=function(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())},t.prototype._scheduleHide=function(){var e=this;this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((function(){return e._hide()}),500)},t}(Nf),Up=function(e){function t(t,n){var r=this;(n=n||{}).mouseWheelSmoothScroll=!1;var i=new Fp(0,(function(e){return zh(e)}));return(r=e.call(this,t,n,i)||this)._register(i),r}return Hp(t,e),t.prototype.setScrollPosition=function(e){this._scrollable.setScrollPositionNow(e)},t.prototype.getScrollPosition=function(){return this._scrollable.getCurrentScrollPosition()},t}(zp),qp=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return Hp(t,e),t}(zp),Kp=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._element=t,r.onScroll((function(e){e.scrollTopChanged&&(r._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(r._element.scrollLeft=e.scrollLeft)})),r.scanDomNode(),r}return Hp(t,e),t.prototype.scanDomNode=function(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})},t}(Up);function Gp(e){var t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,Ge.d&&(t.className+=" mac"),t}var $p=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zp=Sf,Jp={inputBackground:xu.fromHex("#3C3C3C"),inputForeground:xu.fromHex("#CCCCCC"),inputValidationInfoBorder:xu.fromHex("#55AAFF"),inputValidationInfoBackground:xu.fromHex("#063B49"),inputValidationWarningBorder:xu.fromHex("#B89500"),inputValidationWarningBackground:xu.fromHex("#352A05"),inputValidationErrorBorder:xu.fromHex("#BE1100"),inputValidationErrorBackground:xu.fromHex("#5A1D1D")},Xp=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.history=new yp(r.history,100),i}return $p(t,e),t.prototype.addToHistory=function(){this.value&&this.value!==this.getCurrentValue()&&this.history.add(this.value)},t.prototype.showNextValue=function(){this.history.has(this.value)||this.addToHistory();var e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,Zf(this.value))},t.prototype.showPreviousValue=function(){this.history.has(this.value)||this.addToHistory();var e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Zf(this.value))},t.prototype.getCurrentValue=function(){var e=this.history.current();return e||(e=this.history.last(),this.history.next()),e},t.prototype.getPreviousValue=function(){return this.history.previous()||this.history.first()},t.prototype.getNextValue=function(){return this.history.next()||this.history.last()},t}(function(e){function t(t,n,r){var i=e.call(this)||this;i.state="idle",i.maxHeight=Number.POSITIVE_INFINITY,i._onDidChange=i._register(new Ht),i.onDidChange=i._onDidChange.event,i._onDidHeightChange=i._register(new Ht),i.onDidHeightChange=i._onDidHeightChange.event,i.contextViewProvider=n,i.options=r||Object.create(null),zr(i.options,Jp,!1),i.message=null,i.placeholder=i.options.placeholder||"",i.ariaLabel=i.options.ariaLabel||"",i.inputBackground=i.options.inputBackground,i.inputForeground=i.options.inputForeground,i.inputBorder=i.options.inputBorder,i.inputValidationInfoBorder=i.options.inputValidationInfoBorder,i.inputValidationInfoBackground=i.options.inputValidationInfoBackground,i.inputValidationInfoForeground=i.options.inputValidationInfoForeground,i.inputValidationWarningBorder=i.options.inputValidationWarningBorder,i.inputValidationWarningBackground=i.options.inputValidationWarningBackground,i.inputValidationWarningForeground=i.options.inputValidationWarningForeground,i.inputValidationErrorBorder=i.options.inputValidationErrorBorder,i.inputValidationErrorBackground=i.options.inputValidationErrorBackground,i.inputValidationErrorForeground=i.options.inputValidationErrorForeground,i.options.validationOptions&&(i.validation=i.options.validationOptions.validation),i.element=vf(t,Zp(".monaco-inputbox.idle"));var o=i.options.flexibleHeight?"textarea":"input",s=vf(i.element,Zp(".wrapper"));if(i.input=vf(s,Zp(o+".input")),i.input.setAttribute("autocorrect","off"),i.input.setAttribute("autocapitalize","off"),i.input.setAttribute("spellcheck","false"),i.onfocus(i.input,(function(){return Ih(i.element,"synthetic-focus")})),i.onblur(i.input,(function(){return Rh(i.element,"synthetic-focus")})),i.options.flexibleHeight){i.maxHeight="number"==typeof i.options.flexibleMaxHeight?i.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,i.mirror=vf(s,Zp("div.mirror")),i.mirror.innerHTML=" ",i.scrollableElement=new Up(i.element,{vertical:1}),i.options.flexibleWidth&&(i.input.setAttribute("wrap","off"),i.mirror.style.whiteSpace="pre",i.mirror.style.wordWrap="initial"),vf(t,i.scrollableElement.getDomNode()),i._register(i.scrollableElement),i._register(i.scrollableElement.onScroll((function(e){return i.input.scrollTop=e.scrollTop})));var a=It.filter(lh(document,"selectionchange"),(function(){var e=document.getSelection();return!!e&&e.anchorNode===s}));i._register(a(i.updateScrollDimensions,i)),i._register(i.onDidHeightChange(i.updateScrollDimensions,i))}else i.input.type=i.options.type||"text",i.input.setAttribute("wrap","off");return i.ariaLabel&&i.input.setAttribute("aria-label",i.ariaLabel),i.placeholder&&i.setPlaceHolder(i.placeholder),i.oninput(i.input,(function(){return i.onValueChange()})),i.onblur(i.input,(function(){return i.onBlur()})),i.onfocus(i.input,(function(){return i.onFocus()})),i.placeholder&&eh&&i.onclick(i.input,(function(e){mf.stop(e,!0),i.input.focus()})),setTimeout((function(){i.input&&i.updateMirror()}),0),i.options.actions&&(i.actionbar=i._register(new _p(i.element)),i.actionbar.push(i.options.actions,{icon:!0,label:!1})),i.applyStyles(),i}return $p(t,e),t.prototype.onBlur=function(){this._hideMessage()},t.prototype.onFocus=function(){this._showMessage()},t.prototype.setPlaceHolder=function(e){this.input&&(this.input.setAttribute("placeholder",e),this.input.title=e)},t.prototype.setAriaLabel=function(e){this.ariaLabel=e,this.input&&(e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label"))},Object.defineProperty(t.prototype,"inputElement",{get:function(){return this.input},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.input.value},set:function(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return"number"==typeof this.cachedHeight?this.cachedHeight:lf(this.element)},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this.input.focus()},t.prototype.blur=function(){this.input.blur()},t.prototype.hasFocus=function(){return document.activeElement===this.input},t.prototype.select=function(e){void 0===e&&(e=null),this.input.select(),e&&this.input.setSelectionRange(e.start,e.end)},t.prototype.enable=function(){this.input.removeAttribute("disabled")},t.prototype.disable=function(){this.input.disabled=!0,this._hideMessage()},Object.defineProperty(t.prototype,"width",{get:function(){return uf(this.input)},set:function(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){var t=0;if(this.mirror)t=(parseFloat(this.mirror.style.paddingLeft||"")||0)+(parseFloat(this.mirror.style.paddingRight||"")||0);this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paddingRight",{set:function(e){this.options.flexibleHeight&&this.options.flexibleWidth?this.input.style.width="calc(100% - "+e+"px)":this.input.style.paddingRight=e+"px",this.mirror&&(this.mirror.style.paddingRight=e+"px")},enumerable:!0,configurable:!0}),t.prototype.updateScrollDimensions=function(){if("number"==typeof this.cachedContentHeight&&"number"==typeof this.cachedHeight){var e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}},t.prototype.showMessage=function(e,t){this.message=e,Rh(this.element,"idle"),Rh(this.element,"info"),Rh(this.element,"warning"),Rh(this.element,"error"),Ih(this.element,this.classForType(e.type));var n=this.stylesForType(this.message.type);this.element.style.border=n.border?"1px solid "+n.border:null,$f(3===e.type?we("alertErrorMessage","Error: {0}",e.content):2===e.type?we("alertWarningMessage","Warning: {0}",e.content):we("alertInfoMessage","Info: {0}",e.content)),(this.hasFocus()||t)&&this._showMessage()},t.prototype.hideMessage=function(){this.message=null,Rh(this.element,"info"),Rh(this.element,"warning"),Rh(this.element,"error"),Ih(this.element,"idle"),this._hideMessage(),this.applyStyles()},t.prototype.validate=function(){var e=null;return this.validation&&((e=this.validation(this.value))?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),!e},t.prototype.stylesForType=function(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.inputValidationErrorForeground}}},t.prototype.classForType=function(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}},t.prototype._showMessage=function(){var e=this;if(this.contextViewProvider&&this.message){var t,n=function(){return t.style.width=uf(e.element)+"px"};this.contextViewProvider.showContextView({getAnchor:function(){return e.element},anchorAlignment:1,render:function(r){if(!e.message)return null;t=vf(r,Zp(".monaco-inputbox-container")),n();var i={inline:!0,className:"monaco-inputbox-message"},o=e.message.formatContent?up(e.message.content,i):function(e,t){void 0===t&&(t={});var n=cp(t);return n.textContent=e,n}(e.message.content,i);Ih(o,e.classForType(e.message.type));var s=e.stylesForType(e.message.type);return o.style.backgroundColor=s.background?s.background.toString():null,o.style.color=s.foreground?s.foreground.toString():null,o.style.border=s.border?"1px solid "+s.border:null,vf(t,o),null},onHide:function(){e.state="closed"},layout:n}),this.state="open"}},t.prototype._hideMessage=function(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")},t.prototype.onValueChange=function(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()},t.prototype.updateMirror=function(){if(this.mirror){var e=this.value||this.placeholder,t=10===e.charCodeAt(e.length-1)?" ":"";e+t?this.mirror.textContent=e+t:this.mirror.innerHTML=" ",this.layout()}},t.prototype.style=function(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.element){var e=this.inputBackground?this.inputBackground.toString():null,t=this.inputForeground?this.inputForeground.toString():null,n=this.inputBorder?this.inputBorder.toString():null;this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor=e,this.input.style.color=t,this.element.style.borderWidth=n?"1px":null,this.element.style.borderStyle=n?"solid":null,this.element.style.borderColor=n}},t.prototype.layout=function(){if(this.mirror){var e=this.cachedContentHeight;this.cachedContentHeight=lf(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}},t.prototype.dispose=function(){this._hideMessage(),this.element=null,this.input=null,this.contextViewProvider=void 0,this.message=null,this.validation=void 0,this.state=null,this.actionbar=void 0,e.prototype.dispose.call(this)},t}(Nf)),Qp=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),eg=we("defaultLabel","input"),tg=function(e){function t(t,n,r,i){var o=e.call(this)||this;o._showOptionButtons=r,o.fixFocusOnOptionClickEnabled=!0,o._onDidOptionChange=o._register(new Ht),o.onDidOptionChange=o._onDidOptionChange.event,o._onKeyDown=o._register(new Ht),o.onKeyDown=o._onKeyDown.event,o._onMouseDown=o._register(new Ht),o.onMouseDown=o._onMouseDown.event,o._onInput=o._register(new Ht),o._onKeyUp=o._register(new Ht),o._onCaseSensitiveKeyDown=o._register(new Ht),o.onCaseSensitiveKeyDown=o._onCaseSensitiveKeyDown.event,o._onRegexKeyDown=o._register(new Ht),o.onRegexKeyDown=o._onRegexKeyDown.event,o._lastHighlightFindOptions=0,o.contextViewProvider=n,o.placeholder=i.placeholder||"",o.validation=i.validation,o.label=i.label||eg,o.inputActiveOptionBorder=i.inputActiveOptionBorder,o.inputActiveOptionBackground=i.inputActiveOptionBackground,o.inputBackground=i.inputBackground,o.inputForeground=i.inputForeground,o.inputBorder=i.inputBorder,o.inputValidationInfoBorder=i.inputValidationInfoBorder,o.inputValidationInfoBackground=i.inputValidationInfoBackground,o.inputValidationInfoForeground=i.inputValidationInfoForeground,o.inputValidationWarningBorder=i.inputValidationWarningBorder,o.inputValidationWarningBackground=i.inputValidationWarningBackground,o.inputValidationWarningForeground=i.inputValidationWarningForeground,o.inputValidationErrorBorder=i.inputValidationErrorBorder,o.inputValidationErrorBackground=i.inputValidationErrorBackground,o.inputValidationErrorForeground=i.inputValidationErrorForeground;var s=i.appendCaseSensitiveLabel||"",a=i.appendWholeWordsLabel||"",u=i.appendRegexLabel||"",c=i.history||[],l=!!i.flexibleHeight,d=!!i.flexibleWidth,h=i.flexibleMaxHeight;o.domNode=document.createElement("div"),Ih(o.domNode,"monaco-findInput"),o.inputBox=o._register(new Xp(o.domNode,o.contextViewProvider,{placeholder:o.placeholder||"",ariaLabel:o.label||"",validationOptions:{validation:o.validation},inputBackground:o.inputBackground,inputForeground:o.inputForeground,inputBorder:o.inputBorder,inputValidationInfoBackground:o.inputValidationInfoBackground,inputValidationInfoForeground:o.inputValidationInfoForeground,inputValidationInfoBorder:o.inputValidationInfoBorder,inputValidationWarningBackground:o.inputValidationWarningBackground,inputValidationWarningForeground:o.inputValidationWarningForeground,inputValidationWarningBorder:o.inputValidationWarningBorder,inputValidationErrorBackground:o.inputValidationErrorBackground,inputValidationErrorForeground:o.inputValidationErrorForeground,inputValidationErrorBorder:o.inputValidationErrorBorder,history:c,flexibleHeight:l,flexibleWidth:d,flexibleMaxHeight:h})),o.regex=o._register(new Hf({appendTitle:u,isChecked:!1,inputActiveOptionBorder:o.inputActiveOptionBorder,inputActiveOptionBackground:o.inputActiveOptionBackground})),o._register(o.regex.onChange((function(e){o._onDidOptionChange.fire(e),!e&&o.fixFocusOnOptionClickEnabled&&o.inputBox.focus(),o.validate()}))),o._register(o.regex.onKeyDown((function(e){o._onRegexKeyDown.fire(e)}))),o.wholeWords=o._register(new Bf({appendTitle:a,isChecked:!1,inputActiveOptionBorder:o.inputActiveOptionBorder,inputActiveOptionBackground:o.inputActiveOptionBackground})),o._register(o.wholeWords.onChange((function(e){o._onDidOptionChange.fire(e),!e&&o.fixFocusOnOptionClickEnabled&&o.inputBox.focus(),o.validate()}))),o.caseSensitive=o._register(new jf({appendTitle:s,isChecked:!1,inputActiveOptionBorder:o.inputActiveOptionBorder,inputActiveOptionBackground:o.inputActiveOptionBackground})),o._register(o.caseSensitive.onChange((function(e){o._onDidOptionChange.fire(e),!e&&o.fixFocusOnOptionClickEnabled&&o.inputBox.focus(),o.validate()}))),o._register(o.caseSensitive.onKeyDown((function(e){o._onCaseSensitiveKeyDown.fire(e)}))),o._showOptionButtons&&(o.inputBox.paddingRight=o.caseSensitive.width()+o.wholeWords.width()+o.regex.width());var f=[o.caseSensitive.domNode,o.wholeWords.domNode,o.regex.domNode];o.onkeydown(o.domNode,(function(e){if(e.equals(15)||e.equals(17)||e.equals(9)){var t=f.indexOf(document.activeElement);if(t>=0){var n=-1;e.equals(17)?n=(t+1)%f.length:e.equals(15)&&(n=0===t?f.length-1:t-1),e.equals(9)?f[t].blur():n>=0&&f[n].focus(),mf.stop(e,!0)}}}));var p=document.createElement("div");return p.className="controls",p.style.display=o._showOptionButtons?"block":"none",p.appendChild(o.caseSensitive.domNode),p.appendChild(o.wholeWords.domNode),p.appendChild(o.regex.domNode),o.domNode.appendChild(p),t&&t.appendChild(o.domNode),o.onkeydown(o.inputBox.inputElement,(function(e){return o._onKeyDown.fire(e)})),o.onkeyup(o.inputBox.inputElement,(function(e){return o._onKeyUp.fire(e)})),o.oninput(o.inputBox.inputElement,(function(e){return o._onInput.fire()})),o.onmousedown(o.inputBox.inputElement,(function(e){return o._onMouseDown.fire(e)})),o}return Qp(t,e),t.prototype.enable=function(){Rh(this.domNode,"disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()},t.prototype.disable=function(){Ih(this.domNode,"disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()},t.prototype.setFocusInputOnOptionClick=function(e){this.fixFocusOnOptionClickEnabled=e},t.prototype.setEnabled=function(e){e?this.enable():this.disable()},t.prototype.getValue=function(){return this.inputBox.value},t.prototype.setValue=function(e){this.inputBox.value!==e&&(this.inputBox.value=e)},t.prototype.style=function(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.domNode){var e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);var t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}},t.prototype.select=function(){this.inputBox.select()},t.prototype.focus=function(){this.inputBox.focus()},t.prototype.getCaseSensitive=function(){return this.caseSensitive.checked},t.prototype.setCaseSensitive=function(e){this.caseSensitive.checked=e},t.prototype.getWholeWords=function(){return this.wholeWords.checked},t.prototype.setWholeWords=function(e){this.wholeWords.checked=e},t.prototype.getRegex=function(){return this.regex.checked},t.prototype.setRegex=function(e){this.regex.checked=e,this.validate()},t.prototype.focusOnCaseSensitive=function(){this.caseSensitive.focus()},t.prototype.highlightFindOptions=function(){Rh(this.domNode,"highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,Ih(this.domNode,"highlight-"+this._lastHighlightFindOptions)},t.prototype.validate=function(){this.inputBox&&this.inputBox.validate()},t.prototype.clearMessage=function(){this.inputBox&&this.inputBox.hideMessage()},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t}(Nf),ng=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rg=we("defaultLabel","input"),ig=we("label.preserveCaseCheckbox","Preserve Case"),og=function(e){function t(t){return e.call(this,{actionClassName:"monaco-case-sensitive",title:ig+t.appendTitle,isChecked:t.isChecked,inputActiveOptionBorder:t.inputActiveOptionBorder})||this}return ng(t,e),t}(If),sg=function(e){function t(t,n,r,i){var o=e.call(this)||this;o._showOptionButtons=r,o.fixFocusOnOptionClickEnabled=!0,o.cachedOptionsWidth=0,o._onDidOptionChange=o._register(new Ht),o.onDidOptionChange=o._onDidOptionChange.event,o._onKeyDown=o._register(new Ht),o.onKeyDown=o._onKeyDown.event,o._onMouseDown=o._register(new Ht),o._onInput=o._register(new Ht),o._onKeyUp=o._register(new Ht),o._onPreserveCaseKeyDown=o._register(new Ht),o.onPreserveCaseKeyDown=o._onPreserveCaseKeyDown.event,o.contextViewProvider=n,o.placeholder=i.placeholder||"",o.validation=i.validation,o.label=i.label||rg,o.inputActiveOptionBorder=i.inputActiveOptionBorder,o.inputBackground=i.inputBackground,o.inputForeground=i.inputForeground,o.inputBorder=i.inputBorder,o.inputValidationInfoBorder=i.inputValidationInfoBorder,o.inputValidationInfoBackground=i.inputValidationInfoBackground,o.inputValidationInfoForeground=i.inputValidationInfoForeground,o.inputValidationWarningBorder=i.inputValidationWarningBorder,o.inputValidationWarningBackground=i.inputValidationWarningBackground,o.inputValidationWarningForeground=i.inputValidationWarningForeground,o.inputValidationErrorBorder=i.inputValidationErrorBorder,o.inputValidationErrorBackground=i.inputValidationErrorBackground,o.inputValidationErrorForeground=i.inputValidationErrorForeground;var s=!!i.flexibleHeight,a=!!i.flexibleWidth,u=i.flexibleMaxHeight;return o.buildDomNode(i.history||[],s,a,u),t&&t.appendChild(o.domNode),o.onkeydown(o.inputBox.inputElement,(function(e){return o._onKeyDown.fire(e)})),o.onkeyup(o.inputBox.inputElement,(function(e){return o._onKeyUp.fire(e)})),o.oninput(o.inputBox.inputElement,(function(e){return o._onInput.fire()})),o.onmousedown(o.inputBox.inputElement,(function(e){return o._onMouseDown.fire(e)})),o}return ng(t,e),t.prototype.enable=function(){Rh(this.domNode,"disabled"),this.inputBox.enable(),this.preserveCase.enable()},t.prototype.disable=function(){Ih(this.domNode,"disabled"),this.inputBox.disable(),this.preserveCase.disable()},t.prototype.setEnabled=function(e){e?this.enable():this.disable()},t.prototype.style=function(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.domNode){var e={inputActiveOptionBorder:this.inputActiveOptionBorder};this.preserveCase.style(e);var t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}},t.prototype.select=function(){this.inputBox.select()},t.prototype.focus=function(){this.inputBox.focus()},t.prototype.getPreserveCase=function(){return this.preserveCase.checked},t.prototype.setPreserveCase=function(e){this.preserveCase.checked=e},t.prototype.focusOnPreserve=function(){this.preserveCase.focus()},t.prototype.buildDomNode=function(e,t,n,r){var i=this;this.domNode=document.createElement("div"),Ih(this.domNode,"monaco-findInput"),this.inputBox=this._register(new Xp(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:e,flexibleHeight:t,flexibleWidth:n,flexibleMaxHeight:r})),this.preserveCase=this._register(new og({appendTitle:"",isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder})),this._register(this.preserveCase.onChange((function(e){i._onDidOptionChange.fire(e),!e&&i.fixFocusOnOptionClickEnabled&&i.inputBox.focus(),i.validate()}))),this._register(this.preserveCase.onKeyDown((function(e){i._onPreserveCaseKeyDown.fire(e)}))),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;var o=[this.preserveCase.domNode];this.onkeydown(this.domNode,(function(e){if(e.equals(15)||e.equals(17)||e.equals(9)){var t=o.indexOf(document.activeElement);if(t>=0){var n=-1;e.equals(17)?n=(t+1)%o.length:e.equals(15)&&(n=0===t?o.length-1:t-1),e.equals(9)?o[t].blur():n>=0&&o[n].focus(),mf.stop(e,!0)}}}));var s=document.createElement("div");s.className="controls",s.style.display=this._showOptionButtons?"block":"none",s.appendChild(this.preserveCase.domNode),this.domNode.appendChild(s)},t.prototype.validate=function(){this.inputBox&&this.inputBox.validate()},Object.defineProperty(t.prototype,"width",{set:function(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t}(Nf),ag=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ug=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},cg=function(e,t){return function(n,r){t(n,r,e)}},lg="historyNavigationWidget",dg="historyNavigationEnabled";function hg(e,t){return e.getContext(document.activeElement).getValue(t)}function fg(e,t){var n=function(e,t){return e.createScoped(t.target)}(e,t);return function(e,t,n){new Yn(n,t).bindTo(e)}(n,t,lg),{scopedContextKeyService:n,historyNavigationEnablement:new Yn(dg,!0).bindTo(n)}}var pg=function(e){function t(t,n,r,i,o){void 0===o&&(o=!1);var s=e.call(this,t,n,o,r)||this;return s._register(fg(i,{target:s.inputBox.element,historyNavigator:s.inputBox}).scopedContextKeyService),s}return ag(t,e),t=ug([cg(3,jn)],t)}(tg),gg=function(e){function t(t,n,r,i,o){void 0===o&&(o=!1);var s=e.call(this,t,n,o,r)||this;return s._register(fg(i,{target:s.inputBox.element,historyNavigator:s.inputBox}).scopedContextKeyService),s}return ag(t,e),t=ug([cg(3,jn)],t)}(sg);vr.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:En.and(En.has(lg),En.equals(dg,!0)),primary:16,secondary:[528],handler:function(e,t){var n=hg(e.get(jn),lg);n&&n.historyNavigator.showPreviousValue()}}),vr.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:En.and(En.has(lg),En.equals(dg,!0)),primary:18,secondary:[530],handler:function(e,t){var n=hg(e.get(jn),lg);n&&n.historyNavigator.showNextValue()}});var mg=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_g=we("label.find","Find"),yg=we("placeholder.find","Find"),vg=we("label.previousMatchButton","Previous match"),bg=we("label.nextMatchButton","Next match"),wg=we("label.toggleSelectionFind","Find in selection"),Cg=we("label.closeButton","Close"),Sg=we("label.replace","Replace"),xg=we("placeholder.replace","Replace"),kg=we("label.replaceButton","Replace"),Lg=we("label.replaceAllButton","Replace All"),Mg=we("label.toggleReplaceButton","Toggle Replace mode"),Eg=we("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",19999),Dg=we("label.matchesLocation","{0} of {1}"),Tg=we("label.noResults","No Results"),Ng=69,Og=17+(Ng+3+1)+92+2,Ag=33,Ig="ctrlEnterReplaceAll.windows.donotask",Pg=Ge.d?256:2048,Rg=function(e){this.afterLineNumber=e,this.heightInPx=Ag,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"};function Fg(e,t,n){var r=!!t.match(/\n/);n&&r&&n.selectionStart>0&&e.stopPropagation()}function Yg(e,t,n){var r=!!t.match(/\n/);n&&r&&n.selectionEnd=0?Ih(this._domNode,"multipleline"):Rh(this._domNode,"multipleline");try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?this._codeEditor.getConfiguration().readOnly||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=uf(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){var t=this._state.searchString.length>0&&0===this._state.matchesCount;Yh(this._domNode,"no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory()},t.prototype._delayedUpdateHistory=function(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this))},t.prototype._updateHistory=function(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()},t.prototype._updateMatchesCount=function(){var e;if(this._matchesCount.style.minWidth=Ng+"px",this._state.matchesCount>=19999?this._matchesCount.title=Eg:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild),this._state.matchesCount>0){var t=String(this._state.matchesCount);this._state.matchesCount>=19999&&(t+="+");var n=String(this._state.matchesPosition);"0"===n&&(n="?"),e=Xt(Dg,n,t)}else e=Tg;this._matchesCount.appendChild(document.createTextNode(e)),$f(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString),!0),Ng=Math.max(Ng,this._matchesCount.clientWidth)},t.prototype._getAriaLabel=function(e,t,n){return e===Tg?""===n?we("ariaSearchNoResultEmpty","{0} found",e):we("ariaSearchNoResult","{0} found for {1}",e,n):t?we("ariaSearchNoResultWithLineNum","{0} found for {1} at {2}",e,n,t.startLineNumber+":"+t.startColumn):we("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for {1}",e,n)},t.prototype._updateToggleSelectionFindButton=function(){var e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),n=this._toggleSelectionFind.checked;this._toggleSelectionFind.setEnabled(this._isVisible&&(n||t))},t.prototype._updateButtons=function(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);var e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t),this._nextBtn.setEnabled(this._isVisible&&e&&t),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),Yh(this._domNode,"replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("collapse",!this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("expand",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);var n=!this._codeEditor.getConfiguration().readOnly;this._toggleReplaceBtn.setEnabled(this._isVisible&&n)},t.prototype._reveal=function(){var e=this;if(!this._isVisible){this._isVisible=!0;var t=this._codeEditor.getSelection();!!t&&(t.startLineNumber!==t.endLineNumber||t.startColumn!==t.endColumn)&&this._codeEditor.getConfiguration().contribInfo.find.autoFindInSelection?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._tryUpdateWidgetWidth(),this._updateButtons(),setTimeout((function(){Ih(e._domNode,"visible"),e._domNode.setAttribute("aria-hidden","false")}),0),setTimeout((function(){e._findInput.validate()}),200),this._codeEditor.layoutOverlayWidget(this);var n=!0;if(this._codeEditor.getConfiguration().contribInfo.find.seedSearchStringFromSelection&&t){var r=this._codeEditor.getDomNode();if(r){var i=sf(r),o=this._codeEditor.getScrolledVisiblePosition(t.getStartPosition()),s=i.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&at.startLineNumber&&(n=!1);var u=of(this._domNode).left;s>u&&(n=!1);var c=this._codeEditor.getScrolledVisiblePosition(t.getEndPosition());i.left+(c?c.left:0)>u&&(n=!1)}}}this._showViewZone(n)}},t.prototype._hide=function(e){this._isVisible&&(this._isVisible=!1,this._updateButtons(),Rh(this._domNode,"visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())},t.prototype._layoutViewZone=function(){var e=this;if(this._codeEditor.getConfiguration().contribInfo.find.addExtraSpaceOnTop){if(this._isVisible){var t=this._viewZone;void 0===this._viewZoneId&&t&&this._codeEditor.changeViewZones((function(n){t.heightInPx=e._getHeight(),e._viewZoneId=n.addZone(t),e._codeEditor.setScrollTop(e._codeEditor.getScrollTop()+t.heightInPx)}))}}else this._removeViewZone()},t.prototype._showViewZone=function(e){var t=this;if((void 0===e&&(e=!0),this._isVisible)&&this._codeEditor.getConfiguration().contribInfo.find.addExtraSpaceOnTop){void 0===this._viewZone&&(this._viewZone=new Rg(0));var n=this._viewZone;this._codeEditor.changeViewZones((function(r){if(void 0!==t._viewZoneId){var i=t._getHeight();if(i===n.heightInPx)return;var o=i-n.heightInPx;return n.heightInPx=i,r.layoutZone(t._viewZoneId),void(e&&t._codeEditor.setScrollTop(t._codeEditor.getScrollTop()+o))}o=t._getHeight();n.heightInPx=o,t._viewZoneId=r.addZone(n),e&&t._codeEditor.setScrollTop(t._codeEditor.getScrollTop()+o)}))}},t.prototype._removeViewZone=function(){var e=this;this._codeEditor.changeViewZones((function(t){void 0!==e._viewZoneId&&(t.removeZone(e._viewZoneId),e._viewZoneId=void 0,e._viewZone&&(e._codeEditor.setScrollTop(e._codeEditor.getScrollTop()-e._viewZone.heightInPx),e._viewZone=void 0))}))},t.prototype._applyTheme=function(e){var t={inputActiveOptionBorder:e.getColor(nl),inputActiveOptionBackground:e.getColor(rl),inputBackground:e.getColor(Qc),inputForeground:e.getColor(el),inputBorder:e.getColor(tl),inputValidationInfoBackground:e.getColor(il),inputValidationInfoForeground:e.getColor(ol),inputValidationInfoBorder:e.getColor(sl),inputValidationWarningBackground:e.getColor(al),inputValidationWarningForeground:e.getColor(ul),inputValidationWarningBorder:e.getColor(cl),inputValidationErrorBackground:e.getColor(ll),inputValidationErrorForeground:e.getColor(dl),inputValidationErrorBorder:e.getColor(hl)};this._findInput.style(t),this._replaceInput.style(t)},t.prototype._tryUpdateWidgetWidth=function(){if(this._isVisible)if(this._codeEditor.getConfiguration().layoutInfo.contentWidth<=0)Ih(this._domNode,"hiddenEditor");else{Ah(this._domNode,"hiddenEditor")&&Rh(this._domNode,"hiddenEditor");var e=this._codeEditor.getConfiguration().layoutInfo.width,t=this._codeEditor.getConfiguration().layoutInfo.minimapWidth,n=!1,r=!1,i=!1;if(this._resized)if(uf(this._domNode)>419)return this._domNode.style.maxWidth=e-28-t-15+"px",void(this._replaceInput.width=uf(this._findInput.domNode));if(447+t>=e&&(r=!0),447+t-Ng>=e&&(i=!0),447+t-Ng>=e+50&&(n=!0),Yh(this._domNode,"collapsed-find-widget",n),Yh(this._domNode,"narrow-find-widget",i),Yh(this._domNode,"reduced-find-widget",r),i||n||(this._domNode.style.maxWidth=e-28-t-15+"px"),this._resized){this._findInput.inputBox.layout();var o=this._findInput.inputBox.width;o>0&&(this._replaceInput.width=o)}}},t.prototype._getHeight=function(){var e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4},t.prototype._tryUpdateHeight=function(){var e=this._getHeight();return(null===this._cachedHeight||this._cachedHeight!==e)&&(this._cachedHeight=e,this._domNode.style.height=e+"px",!0)},t.prototype.focusFindInput=function(){this._findInput.select(),this._findInput.focus()},t.prototype.focusReplaceInput=function(){this._replaceInput.select(),this._replaceInput.focus()},t.prototype.highlightFindOptions=function(){this._findInput.highlightFindOptions()},t.prototype._updateSearchScope=function(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){var e=this._codeEditor.getSelection();1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));var t=this._state.currentMatch;e.startLineNumber!==e.endLineNumber&&(Tr.equalsRange(e,t)||this._state.change({searchScope:e},!0))}},t.prototype._onFindInputMouseDown=function(e){e.middleButton&&e.stopPropagation()},t.prototype._onFindInputKeyDown=function(e){if(e.equals(3|Pg)){var t=this._findInput.inputBox.inputElement,n=t.selectionStart,r=t.selectionEnd,i=t.value;if(null!==n&&null!==r){var o=i.substr(0,n)+"\n"+i.substr(r);return this._findInput.inputBox.value=o,t.setSelectionRange(n+1,n+1),this._findInput.inputBox.layout(),void e.preventDefault()}}return e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?Fg(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?Yg(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0},t.prototype._onReplaceInputKeyDown=function(e){if(e.equals(3|Pg)){Ge.g&&Ge.e&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(we("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(Ig,!0,0));var t=this._replaceInput.inputBox.inputElement,n=t.selectionStart,r=t.selectionEnd,i=t.value;if(null!==n&&null!==r){var o=i.substr(0,n)+"\n"+i.substr(r);return this._replaceInput.inputBox.value=o,t.setSelectionRange(n+1,n+1),this._replaceInput.inputBox.layout(),void e.preventDefault()}}return e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?Fg(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?Yg(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0},t.prototype.getHorizontalSashTop=function(e){return 0},t.prototype.getHorizontalSashLeft=function(e){return 0},t.prototype.getHorizontalSashWidth=function(e){return 500},t.prototype._keybindingLabelFor=function(e){var t=this._keybindingService.lookupKeybinding(e);return t?" ("+t.getLabel()+")":""},t.prototype._buildDomNode=function(){var e=this;this._findInput=this._register(new pg(null,this._contextViewProvider,{width:221,label:_g,placeholder:yg,appendCaseSensitiveLabel:this._keybindingLabelFor($d.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor($d.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor($d.ToggleRegexCommand),validation:function(t){if(0===t.length||!e._findInput.getRegex())return null;try{return new RegExp(t),null}catch(e){return{content:e.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118},this._contextKeyService,!0)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown((function(t){return e._onFindInputKeyDown(t)}))),this._register(this._findInput.inputBox.onDidChange((function(){e._ignoreChangeEvent||e._state.change({searchString:e._findInput.getValue()},!0)}))),this._register(this._findInput.onDidOptionChange((function(){e._state.change({isRegex:e._findInput.getRegex(),wholeWord:e._findInput.getWholeWords(),matchCase:e._findInput.getCaseSensitive()},!0)}))),this._register(this._findInput.onCaseSensitiveKeyDown((function(t){t.equals(1026)&&e._isReplaceVisible&&(e._replaceInput.focus(),t.preventDefault())}))),this._register(this._findInput.onRegexKeyDown((function(t){t.equals(2)&&e._isReplaceVisible&&(e._replaceInput.focusOnPreserve(),t.preventDefault())}))),this._register(this._findInput.inputBox.onDidHeightChange((function(t){e._tryUpdateHeight()&&e._showViewZone()}))),Ge.c&&this._register(this._findInput.onMouseDown((function(t){return e._onFindInputMouseDown(t)}))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new Hg({label:vg+this._keybindingLabelFor($d.PreviousMatchFindAction),className:"previous",onTrigger:function(){e._codeEditor.getAction($d.PreviousMatchFindAction).run().then(void 0,je)}})),this._nextBtn=this._register(new Hg({label:bg+this._keybindingLabelFor($d.NextMatchFindAction),className:"next",onTrigger:function(){e._codeEditor.getAction($d.NextMatchFindAction).run().then(void 0,je)}}));var t=document.createElement("div");t.className="find-part",t.appendChild(this._findInput.domNode);var n=document.createElement("div");n.className="find-actions",t.appendChild(n),n.appendChild(this._matchesCount),n.appendChild(this._prevBtn.domNode),n.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Bg({parent:n,title:wg+this._keybindingLabelFor($d.ToggleSearchScopeCommand),onChange:function(){if(e._toggleSelectionFind.checked){if(e._codeEditor.hasModel()){var t=e._codeEditor.getSelection();1===t.endColumn&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,e._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()||e._state.change({searchScope:t},!0)}}else e._state.change({searchScope:null},!0)}})),this._closeBtn=this._register(new Hg({label:Cg+this._keybindingLabelFor($d.CloseFindWidgetCommand),className:"close-fw",onTrigger:function(){e._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:function(t){t.equals(2)&&e._isReplaceVisible&&(e._replaceBtn.isEnabled()?e._replaceBtn.focus():e._codeEditor.focus(),t.preventDefault())}})),n.appendChild(this._closeBtn.domNode),this._replaceInput=this._register(new gg(null,void 0,{label:Sg,placeholder:xg,history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown((function(t){return e._onReplaceInputKeyDown(t)}))),this._register(this._replaceInput.inputBox.onDidChange((function(){e._state.change({replaceString:e._replaceInput.inputBox.value},!1)}))),this._register(this._replaceInput.inputBox.onDidHeightChange((function(t){e._isReplaceVisible&&e._tryUpdateHeight()&&e._showViewZone()}))),this._register(this._replaceInput.onDidOptionChange((function(){e._state.change({preserveCase:e._replaceInput.getPreserveCase()},!0)}))),this._register(this._replaceInput.onPreserveCaseKeyDown((function(t){t.equals(2)&&(e._prevBtn.isEnabled()?e._prevBtn.focus():e._nextBtn.isEnabled()?e._nextBtn.focus():e._toggleSelectionFind.isEnabled()?e._toggleSelectionFind.focus():e._closeBtn.isEnabled()&&e._closeBtn.focus(),t.preventDefault())}))),this._replaceBtn=this._register(new Hg({label:kg+this._keybindingLabelFor($d.ReplaceOneAction),className:"replace",onTrigger:function(){e._controller.replace()},onKeyDown:function(t){t.equals(1026)&&(e._closeBtn.focus(),t.preventDefault())}})),this._replaceAllBtn=this._register(new Hg({label:Lg+this._keybindingLabelFor($d.ReplaceAllAction),className:"replace-all",onTrigger:function(){e._controller.replaceAll()}}));var r=document.createElement("div");r.className="replace-part",r.appendChild(this._replaceInput.domNode);var i=document.createElement("div");i.className="replace-actions",r.appendChild(i),i.appendChild(this._replaceBtn.domNode),i.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new Hg({label:Mg,className:"toggle left",onTrigger:function(){e._state.change({isReplaceRevealed:!e._isReplaceVisible},!1),e._isReplaceVisible&&(e._replaceInput.width=uf(e._findInput.domNode),e._replaceInput.inputBox.layout()),e._showViewZone()}})),this._toggleReplaceBtn.toggleClass("expand",this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("collapse",!this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.style.width="419px",this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(t),this._domNode.appendChild(r),this._resizeSash=new ap(this._domNode,this,{orientation:0}),this._resized=!1;var o=419;this._register(this._resizeSash.onDidStart((function(){o=uf(e._domNode)}))),this._register(this._resizeSash.onDidChange((function(t){e._resized=!0;var n=o+t.startX-t.currentX;if(!(n<419)){var r=n-Og;n>(parseFloat(nf(e._domNode).maxWidth)||0)||(e._domNode.style.width=n+"px",e._findInput.inputBox.width=r,e._isReplaceVisible&&(e._replaceInput.width=uf(e._findInput.domNode)),e._findInput.inputBox.layout(),e._tryUpdateHeight())}}))),this._register(this._resizeSash.onDidReset((function(){var t=uf(e._domNode);if(!(t<419)){var n=419;e._resized&&419!==t||(n=e._codeEditor.getConfiguration().layoutInfo.width-28-e._codeEditor.getConfiguration().layoutInfo.minimapWidth-15,e._resized=!0);var r=n-Og;e._domNode.style.width=n+"px",e._findInput.inputBox.width=r,e._isReplaceVisible&&(e._replaceInput.width=uf(e._findInput.domNode)),e._findInput.inputBox.layout()}})))},t.prototype.updateAccessibilitySupport=function(){var e=this._codeEditor.getConfiguration().accessibilitySupport;this._findInput.setFocusInputOnOptionClick(2!==e)},t.ID="editor.contrib.findWidget",t}(Nf),Bg=function(e){function t(n){var r=e.call(this)||this;return r._opts=n,r._domNode=document.createElement("div"),r._domNode.className="monaco-checkbox",r._domNode.title=r._opts.title,r._domNode.tabIndex=0,r._checkbox=document.createElement("input"),r._checkbox.type="checkbox",r._checkbox.className="checkbox",r._checkbox.id="checkbox-"+t._COUNTER++,r._checkbox.tabIndex=-1,r._label=document.createElement("label"),r._label.className="label",r._label.htmlFor=r._checkbox.id,r._label.tabIndex=-1,r._domNode.appendChild(r._checkbox),r._domNode.appendChild(r._label),r._opts.parent.appendChild(r._domNode),r.onchange(r._checkbox,(function(){r._opts.onChange()})),r}return mg(t,e),Object.defineProperty(t.prototype,"domNode",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),t.prototype.isEnabled=function(){return this._domNode.tabIndex>=0},Object.defineProperty(t.prototype,"checked",{get:function(){return this._checkbox.checked},set:function(e){this._checkbox.checked=e},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this._domNode.focus()},t.prototype.enable=function(){this._checkbox.removeAttribute("disabled")},t.prototype.disable=function(){this._checkbox.disabled=!0},t.prototype.setEnabled=function(e){e?(this.enable(),this.domNode.tabIndex=0):(this.disable(),this.domNode.tabIndex=-1)},t._COUNTER=0,t}(Nf),Hg=function(e){function t(t){var n=e.call(this)||this;return n._opts=t,n._domNode=document.createElement("div"),n._domNode.title=n._opts.label,n._domNode.tabIndex=0,n._domNode.className="button "+n._opts.className,n._domNode.setAttribute("role","button"),n._domNode.setAttribute("aria-label",n._opts.label),n.onclick(n._domNode,(function(e){n._opts.onTrigger(),e.preventDefault()})),n.onkeydown(n._domNode,(function(e){if(e.equals(10)||e.equals(3))return n._opts.onTrigger(),void e.preventDefault();n._opts.onKeyDown&&n._opts.onKeyDown(e)})),n}return mg(t,e),Object.defineProperty(t.prototype,"domNode",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),t.prototype.isEnabled=function(){return this._domNode.tabIndex>=0},t.prototype.focus=function(){this._domNode.focus()},t.prototype.setEnabled=function(e){Yh(this._domNode,"disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1},t.prototype.setExpanded=function(e){this._domNode.setAttribute("aria-expanded",String(!!e))},t.prototype.toggleClass=function(e,t){Yh(this._domNode,e,t)},t}(Nf);Ad((function(e,t){var n=function(e,n){n&&t.addRule(".monaco-editor "+e+" { background-color: "+n+"; }")};n(".findMatch",e.getColor(od)),n(".currentFindMatch",e.getColor(id)),n(".findScope",e.getColor(sd)),n(".find-widget",e.getColor(Zl));var r=e.getColor(Xc);r&&t.addRule(".monaco-editor .find-widget { box-shadow: 0 2px 8px "+r+"; }");var i=e.getColor(ud);i&&t.addRule(".monaco-editor .findMatch { border: 1px "+("hc"===e.type?"dotted":"solid")+" "+i+"; box-sizing: border-box; }");var o=e.getColor(ad);o&&t.addRule(".monaco-editor .currentFindMatch { border: 2px solid "+o+"; padding: 1px; box-sizing: border-box; }");var s=e.getColor(cd);s&&t.addRule(".monaco-editor .findScope { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+s+"; }");var a=e.getColor(Zc);a&&t.addRule(".monaco-editor .find-widget { border: 2px solid "+a+"; }");var u=e.getColor(Jl);u&&t.addRule(".monaco-editor .find-widget { color: "+u+"; }");var c=e.getColor(Gc);c&&t.addRule(".monaco-editor .find-widget.no-results .matchesCount { color: "+c+"; }");var l=e.getColor(Ql);if(l)t.addRule(".monaco-editor .find-widget .monaco-sash { background-color: "+l+"; width: 3px !important; margin-left: -4px;}");else{var d=e.getColor(Xl);d&&t.addRule(".monaco-editor .find-widget .monaco-sash { background-color: "+d+"; width: 3px !important; margin-left: -4px;}")}var h=e.getColor(nl);h&&t.addRule(".monaco-editor .find-widget .monaco-checkbox .checkbox:checked + .label { border: 1px solid "+h.toString()+"; }");var f=e.getColor(rl);f&&t.addRule(".monaco-editor .find-widget .monaco-checkbox .checkbox:checked + .label { background-color: "+f.toString()+"; }");var p=e.getColor($c);p&&t.addRule(".monaco-workbench .monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: "+p+"; }")}));var Wg,Vg=pt("clipboardService"),zg=pt("contextViewService"),Ug=pt("contextMenuService"),qg=pt("keybindingService"),Kg=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gg=pt("storageService");!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(Wg||(Wg={}));var $g,Zg,Jg=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._serviceBrand=null,t._onDidChangeStorage=t._register(new Ht),t.onDidChangeStorage=t._onDidChangeStorage.event,t.onWillSaveState=It.None,t.globalCache=new Map,t.workspaceCache=new Map,t}return Kg(t,e),t.prototype.getCache=function(e){return 0===e?this.globalCache:this.workspaceCache},t.prototype.get=function(e,t,n){var r=this.getCache(t).get(e);return Ee(r)?n:r},t.prototype.getBoolean=function(e,t,n){var r=this.getCache(t).get(e);return Ee(r)?n:"true"===r},t.prototype.store=function(e,t,n){if(Ee(t))return this.remove(e,n);var r=String(t);return this.getCache(n).get(e)===r?Promise.resolve():(this.getCache(n).set(e,r),this._onDidChangeStorage.fire({scope:n,key:e}),Promise.resolve())},t.prototype.remove=function(e,t){return this.getCache(t).delete(e)?(this._onDidChangeStorage.fire({scope:t,key:e}),Promise.resolve()):Promise.resolve()},t}(Dt);(Zg=$g||($g={}))[Zg.Ignore=0]="Ignore",Zg[Zg.Info=1]="Info",Zg[Zg.Warning=2]="Warning",Zg[Zg.Error=3]="Error",function(e){var t="error",n="warning",r="warn",i="info",o=Object.create(null);o[e.Error]=we("sev.error","Error"),o[e.Warning]=we("sev.warning","Warning"),o[e.Info]=we("sev.info","Info"),e.fromValue=function(o){return o?fn(t,o)?e.Error:fn(n,o)||fn(r,o)?e.Warning:fn(i,o)?e.Info:e.Ignore:e.Ignore}}($g||($g={}));var Xg=$g,Qg=pt("notificationService"),em=function(){},tm=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nm=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},rm=function(e,t){return function(n,r){t(n,r,e)}},im=524288;function om(e){if(!e.hasModel())return null;var t=e.getSelection();if(t.startLineNumber===t.endLineNumber)if(t.isEmpty()){var n=e.getModel().getWordAtPosition(t.getStartPosition());if(n)return n.word}else if(e.getModel().getValueLengthInRange(t)e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()||this._state.change({searchScope:e},!0)}},t.prototype.setSearchString=function(e){this._state.isRegex&&(e=en(e)),this._state.change({searchString:e},!1)},t.prototype.highlightFindOptions=function(){},t.prototype._start=function(e){if(this.disposeModel(),this._editor.hasModel()){var t,n={isRevealed:!0};if(e.seedSearchStringFromSelection)(t=om(this._editor))&&(this._state.isRegex?n.searchString=en(t):n.searchString=t);if(!n.searchString&&e.seedSearchStringFromGlobalClipboard)(t=this.getGlobalBufferTerm())&&(n.searchString=t);if(e.forceRevealReplace?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){var r=this._editor.getSelection();r.isEmpty()||(n.searchScope=r)}this._state.change(n,!1),this._model||(this._model=new Zd(this._editor,this._state))}},t.prototype.start=function(e){this._start(e)},t.prototype.moveToNextMatch=function(){return!!this._model&&(this._model.moveToNextMatch(),!0)},t.prototype.moveToPrevMatch=function(){return!!this._model&&(this._model.moveToPrevMatch(),!0)},t.prototype.replace=function(){return!!this._model&&(this._model.replace(),!0)},t.prototype.replaceAll=function(){return!!this._model&&(this._model.replaceAll(),!0)},t.prototype.selectAllMatches=function(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)},t.prototype.getGlobalBufferTerm=function(){return this._editor.getConfiguration().contribInfo.find.globalFindClipboard&&this._clipboardService&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""},t.prototype.setGlobalBufferTerm=function(e){this._editor.getConfiguration().contribInfo.find.globalFindClipboard&&this._clipboardService&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)},t.ID="editor.contrib.findController",t=nm([rm(1,jn),rm(2,Gg),rm(3,Vg)],t)}(Dt),um=function(e){function t(t,n,r,i,o,s,a,u){var c=e.call(this,t,r,a,u)||this;return c._contextViewService=n,c._keybindingService=i,c._themeService=o,c._notificationService=s,c._widget=null,c._findOptionsWidget=null,c}return tm(t,e),t.prototype._start=function(t){this._widget||this._createFindWidget(),!this._widget.getPosition()&&this._editor.getConfiguration().contribInfo.find.autoFindInSelection&&(t.updateSearchScope=!0),e.prototype._start.call(this,t),2===t.shouldFocus?this._widget.focusReplaceInput():1===t.shouldFocus&&this._widget.focusFindInput()},t.prototype.highlightFindOptions=function(){this._widget||this._createFindWidget(),this._state.isRevealed?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()},t.prototype._createFindWidget=function(){this._widget=this._register(new jg(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new Vf(this._editor,this._state,this._keybindingService,this._themeService))},t=nm([rm(1,zg),rm(2,jn),rm(3,qg),rm(4,Ld),rm(5,Qg),rm(6,Gg),rm(7,gt(Vg))],t)}(am),cm=function(e){function t(){return e.call(this,{id:$d.StartFindAction,label:we("startFindAction","Find"),alias:"Find",precondition:void 0,kbOpts:{kbExpr:null,primary:2084,weight:100},menubarOpts:{menuId:14,group:"3_find",title:we({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}})||this}return tm(t,e),t.prototype.run=function(e,t){var n=am.get(t);n&&n.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getConfiguration().contribInfo.find.globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1})},t}(Lr),lm=function(e){function t(){return e.call(this,{id:$d.StartFindWithSelection,label:we("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})||this}return tm(t,e),t.prototype.run=function(e,t){var n=am.get(t);n&&(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:!0,seedSearchStringFromGlobalClipboard:!1,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1}),n.setGlobalBufferTerm(n.getState().searchString))},t}(Lr),dm=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tm(t,e),t.prototype.run=function(e,t){var n=am.get(t);n&&!this._run(n)&&(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===n.getState().searchString.length&&t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1}),this._run(n))},t}(Lr),hm=function(e){function t(){return e.call(this,{id:$d.NextMatchFindAction,label:we("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:{kbExpr:wc.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(dm),fm=function(e){function t(){return e.call(this,{id:$d.NextMatchFindAction,label:we("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:{kbExpr:En.and(wc.focus,Vd),primary:3,weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(dm),pm=function(e){function t(){return e.call(this,{id:$d.PreviousMatchFindAction,label:we("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:{kbExpr:wc.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(dm),gm=function(e){function t(){return e.call(this,{id:$d.PreviousMatchFindAction,label:we("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:{kbExpr:En.and(wc.focus,Vd),primary:1027,weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(dm),mm=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tm(t,e),t.prototype.run=function(e,t){var n=am.get(t);if(n){var r=om(t);r&&n.setSearchString(r),this._run(n)||(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1}),this._run(n))}},t}(Lr),_m=function(e){function t(){return e.call(this,{id:$d.NextSelectionMatchFindAction,label:we("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:wc.focus,primary:2109,weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(mm),ym=function(e){function t(){return e.call(this,{id:$d.PreviousSelectionMatchFindAction,label:we("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:wc.focus,primary:3133,weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(mm),vm=function(e){function t(){return e.call(this,{id:$d.StartFindReplaceAction,label:we("startReplace","Replace"),alias:"Replace",precondition:void 0,kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menubarOpts:{menuId:14,group:"3_find",title:we({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}})||this}return tm(t,e),t.prototype.run=function(e,t){if(t.hasModel()&&!t.getConfiguration().readOnly){var n=am.get(t),r=t.getSelection(),i=n.isFindInputFocused(),o=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&t.getConfiguration().contribInfo.find.seedSearchStringFromSelection&&!i,s=i||o?2:1;n&&n.start({forceRevealReplace:!0,seedSearchStringFromSelection:o,seedSearchStringFromGlobalClipboard:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,shouldFocus:s,shouldAnimate:!0,updateSearchScope:!1})}},t}(Lr);sm=um,Dr.INSTANCE.registerEditorContribution(sm),Er(cm),Er(lm),Er(hm),Er(fm),Er(pm),Er(gm),Er(_m),Er(ym),Er(vm);var bm=kr.bindToContribution(am.get);Mr(new bm({id:$d.CloseFindWidgetCommand,precondition:Wd,handler:function(e){return e.closeFindWidget()},kbOpts:{weight:105,kbExpr:wc.focus,primary:9,secondary:[1033]}})),Mr(new bm({id:$d.ToggleCaseSensitiveCommand,precondition:void 0,handler:function(e){return e.toggleCaseSensitive()},kbOpts:{weight:105,kbExpr:wc.focus,primary:Ud.primary,mac:Ud.mac,win:Ud.win,linux:Ud.linux}})),Mr(new bm({id:$d.ToggleWholeWordCommand,precondition:void 0,handler:function(e){return e.toggleWholeWords()},kbOpts:{weight:105,kbExpr:wc.focus,primary:qd.primary,mac:qd.mac,win:qd.win,linux:qd.linux}})),Mr(new bm({id:$d.ToggleRegexCommand,precondition:void 0,handler:function(e){return e.toggleRegex()},kbOpts:{weight:105,kbExpr:wc.focus,primary:Kd.primary,mac:Kd.mac,win:Kd.win,linux:Kd.linux}})),Mr(new bm({id:$d.ToggleSearchScopeCommand,precondition:void 0,handler:function(e){return e.toggleSearchScope()},kbOpts:{weight:105,kbExpr:wc.focus,primary:Gd.primary,mac:Gd.mac,win:Gd.win,linux:Gd.linux}})),Mr(new bm({id:$d.ReplaceOneAction,precondition:Wd,handler:function(e){return e.replace()},kbOpts:{weight:105,kbExpr:wc.focus,primary:3094}})),Mr(new bm({id:$d.ReplaceOneAction,precondition:Wd,handler:function(e){return e.replace()},kbOpts:{weight:105,kbExpr:En.and(wc.focus,zd),primary:3}})),Mr(new bm({id:$d.ReplaceAllAction,precondition:Wd,handler:function(e){return e.replaceAll()},kbOpts:{weight:105,kbExpr:wc.focus,primary:2563}})),Mr(new bm({id:$d.ReplaceAllAction,precondition:Wd,handler:function(e){return e.replaceAll()},kbOpts:{weight:105,kbExpr:En.and(wc.focus,zd),primary:void 0,mac:{primary:2051}}})),Mr(new bm({id:$d.SelectAllMatchesAction,precondition:Wd,handler:function(e){return e.selectAllMatches()},kbOpts:{weight:105,kbExpr:wc.focus,primary:515}}));var wm,Cm,Sm,xm,km,Lm,Mm,Em,Dm,Tm,Nm,Om,Am,Im,Pm,Rm,Fm,Ym,jm,Bm,Hm,Wm,Vm,zm,Um,qm,Km,Gm,$m,Zm,Jm;n(386);!function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(wm||(wm={})),(Sm=Cm||(Cm={}))[Sm.Hint=1]="Hint",Sm[Sm.Info=2]="Info",Sm[Sm.Warning=4]="Warning",Sm[Sm.Error=8]="Error",function(e){e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.KEY_0=21]="KEY_0",e[e.KEY_1=22]="KEY_1",e[e.KEY_2=23]="KEY_2",e[e.KEY_3=24]="KEY_3",e[e.KEY_4=25]="KEY_4",e[e.KEY_5=26]="KEY_5",e[e.KEY_6=27]="KEY_6",e[e.KEY_7=28]="KEY_7",e[e.KEY_8=29]="KEY_8",e[e.KEY_9=30]="KEY_9",e[e.KEY_A=31]="KEY_A",e[e.KEY_B=32]="KEY_B",e[e.KEY_C=33]="KEY_C",e[e.KEY_D=34]="KEY_D",e[e.KEY_E=35]="KEY_E",e[e.KEY_F=36]="KEY_F",e[e.KEY_G=37]="KEY_G",e[e.KEY_H=38]="KEY_H",e[e.KEY_I=39]="KEY_I",e[e.KEY_J=40]="KEY_J",e[e.KEY_K=41]="KEY_K",e[e.KEY_L=42]="KEY_L",e[e.KEY_M=43]="KEY_M",e[e.KEY_N=44]="KEY_N",e[e.KEY_O=45]="KEY_O",e[e.KEY_P=46]="KEY_P",e[e.KEY_Q=47]="KEY_Q",e[e.KEY_R=48]="KEY_R",e[e.KEY_S=49]="KEY_S",e[e.KEY_T=50]="KEY_T",e[e.KEY_U=51]="KEY_U",e[e.KEY_V=52]="KEY_V",e[e.KEY_W=53]="KEY_W",e[e.KEY_X=54]="KEY_X",e[e.KEY_Y=55]="KEY_Y",e[e.KEY_Z=56]="KEY_Z",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.NumLock=78]="NumLock",e[e.ScrollLock=79]="ScrollLock",e[e.US_SEMICOLON=80]="US_SEMICOLON",e[e.US_EQUAL=81]="US_EQUAL",e[e.US_COMMA=82]="US_COMMA",e[e.US_MINUS=83]="US_MINUS",e[e.US_DOT=84]="US_DOT",e[e.US_SLASH=85]="US_SLASH",e[e.US_BACKTICK=86]="US_BACKTICK",e[e.US_OPEN_SQUARE_BRACKET=87]="US_OPEN_SQUARE_BRACKET",e[e.US_BACKSLASH=88]="US_BACKSLASH",e[e.US_CLOSE_SQUARE_BRACKET=89]="US_CLOSE_SQUARE_BRACKET",e[e.US_QUOTE=90]="US_QUOTE",e[e.OEM_8=91]="OEM_8",e[e.OEM_102=92]="OEM_102",e[e.NUMPAD_0=93]="NUMPAD_0",e[e.NUMPAD_1=94]="NUMPAD_1",e[e.NUMPAD_2=95]="NUMPAD_2",e[e.NUMPAD_3=96]="NUMPAD_3",e[e.NUMPAD_4=97]="NUMPAD_4",e[e.NUMPAD_5=98]="NUMPAD_5",e[e.NUMPAD_6=99]="NUMPAD_6",e[e.NUMPAD_7=100]="NUMPAD_7",e[e.NUMPAD_8=101]="NUMPAD_8",e[e.NUMPAD_9=102]="NUMPAD_9",e[e.NUMPAD_MULTIPLY=103]="NUMPAD_MULTIPLY",e[e.NUMPAD_ADD=104]="NUMPAD_ADD",e[e.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",e[e.NUMPAD_SUBTRACT=106]="NUMPAD_SUBTRACT",e[e.NUMPAD_DECIMAL=107]="NUMPAD_DECIMAL",e[e.NUMPAD_DIVIDE=108]="NUMPAD_DIVIDE",e[e.KEY_IN_COMPOSITION=109]="KEY_IN_COMPOSITION",e[e.ABNT_C1=110]="ABNT_C1",e[e.ABNT_C2=111]="ABNT_C2",e[e.MAX_VALUE=112]="MAX_VALUE"}(xm||(xm={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(km||(km={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(Lm||(Lm={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(Mm||(Mm={})),function(e){e[e.Inline=1]="Inline"}(Em||(Em={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Dm||(Dm={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Tm||(Tm={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(Nm||(Nm={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(Om||(Om={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(Am||(Am={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(Im||(Im={})),function(e){e[e.None=0]="None",e[e.Small=1]="Small",e[e.Large=2]="Large",e[e.SmallBlocks=3]="SmallBlocks",e[e.LargeBlocks=4]="LargeBlocks"}(Pm||(Pm={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(Rm||(Rm={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(Fm||(Fm={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(Ym||(Ym={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(jm||(jm={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(Bm||(Bm={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(Hm||(Hm={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}(Wm||(Wm={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(Vm||(Vm={})),function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.Snippet=25]="Snippet"}(zm||(zm={})),function(e){e[e.Deprecated=1]="Deprecated"}(Um||(Um={})),function(e){e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(qm||(qm={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(Km||(Km={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(Gm||(Gm={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}($m||($m={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(Zm||(Zm={})),function(e){e[e.Deprecated=1]="Deprecated"}(Jm||(Jm={}));var Xm=function(){function e(){}return e.chord=function(e,t){return function(e,t){return(e|(65535&t)<<16>>>0)>>>0}(e,t)},e.CtrlCmd=2048,e.Shift=1024,e.Alt=512,e.WinCtrl=256,e}();function Qm(){return{editor:void 0,languages:void 0,CancellationTokenSource:ys,Emitter:Ht,KeyCode:xm,KeyMod:Xm,Position:_t,Range:Tr,Selection:Or,SelectionDirection:km,MarkerSeverity:Cm,MarkerTag:wm,Uri:it,Token:Ta}}var e_;n(388);function t_(e){var t=JSON.parse(e);return t=function e(t,n){if(!t||n>200)return t;if("object"==typeof t){switch(t.$mid){case 1:return it.revive(t);case 2:return new RegExp(t.source,t.flags)}for(var r in t)Object.hasOwnProperty.call(t,r)&&(t[r]=e(t[r],n+1))}return t}(t,0)}function n_(e){var t,n,r=e.path;return t=e.authority&&r.length>1&&e.scheme===bh.file?"//"+e.authority+r:Ge.g&&47===r.charCodeAt(0)&&((n=r.charCodeAt(1))>=65&&n<=90||n>=97&&n<=122)&&58===r.charCodeAt(2)?r.substr(1):r,Ge.g&&(t=t.replace(/\//g,"\\")),t}!function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){var n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach((function(e){var t=e.split(":"),r=t[0],i=t[1];r&&i&&n.set(r,i)}));var r=t.path.substring(0,t.path.indexOf(";"));return r&&n.set(e.META_DATA_MIME,r),n}}(e_||(e_={}));var r_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i_=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o_=function(e,t){return function(n,r){t(n,r,e)}},s_=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(s,a)}u((r=r.apply(e,t||[])).next())}))},a_=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));var n=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{var r=n.range.getStartPosition();this._editor.setPosition(r),this._editor.revealPositionInCenter(r,t)}finally{this.ignoreSelectionChange=!1}}},t.prototype.canNavigate=function(){return this.ranges&&this.ranges.length>0},t.prototype.next=function(e){void 0===e&&(e=0),this._move(!0,e)},t.prototype.previous=function(e){void 0===e&&(e=0),this._move(!1,e)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.ranges=[],this.disposed=!0},t}(Dt),h_=new(function(){function e(){this._zoomLevel=0,this._onDidChangeZoomLevel=new Ht,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}return e.prototype.getZoomLevel=function(){return this._zoomLevel},e.prototype.setZoomLevel=function(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))},e}()),f_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),p_=Ge.d?1.5:1.35;function g_(e,t){if("number"==typeof e)return e;if(void 0===e)return t;var n=parseFloat(e);return isNaN(n)?t:n}function m_(e,t,n){return en?n:e}function __(e,t){return"string"!=typeof e?t:e}var y_=function(){function e(e){this.zoomLevel=e.zoomLevel,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}return e.createFromRawSettings=function(t,n,r){void 0===r&&(r=!1);var i=__(t.fontFamily,fi.fontFamily),o=__(t.fontWeight,fi.fontWeight),s=g_(t.fontSize,fi.fontSize);0===(s=m_(s,0,100))?s=fi.fontSize:s<8&&(s=8);var a=function(e,t){if("number"==typeof e)return Math.round(e);if(void 0===e)return t;var n=parseInt(e);return isNaN(n)?t:n}(t.lineHeight,0);0===(a=m_(a,0,150))?a=Math.round(p_*s):a<8&&(a=8);var u=g_(t.letterSpacing,0);u=m_(u,-5,20);var c=1+(r?0:.1*h_.getZoomLevel());return new e({zoomLevel:n,fontFamily:i,fontWeight:o,fontSize:s*=c,lineHeight:a*=c,letterSpacing:u})},e.prototype.getId=function(){return this.zoomLevel+"-"+this.fontFamily+"-"+this.fontWeight+"-"+this.fontSize+"-"+this.lineHeight+"-"+this.letterSpacing},e.prototype.getMassagedFontFamily=function(){return/[,"']/.test(this.fontFamily)?this.fontFamily:/[+ ]/.test(this.fontFamily)?'"'+this.fontFamily+'"':this.fontFamily},e}(),v_=function(e){function t(t,n){var r=e.call(this,t)||this;return r.isTrusted=n,r.isMonospace=t.isMonospace,r.typicalHalfwidthCharacterWidth=t.typicalHalfwidthCharacterWidth,r.typicalFullwidthCharacterWidth=t.typicalFullwidthCharacterWidth,r.canUseHalfwidthRightwardsArrow=t.canUseHalfwidthRightwardsArrow,r.spaceWidth=t.spaceWidth,r.maxDigitWidth=t.maxDigitWidth,r}return f_(t,e),t.prototype.equals=function(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.maxDigitWidth===e.maxDigitWidth},t}(y_),b_=pt("editorWorkerService"),w_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C_="$initialize",S_=!1;function x_(e){Ge.f&&(S_||(S_=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq")),console.warn(e.message))}var k_=function(){function e(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}return e.prototype.setWorkerId=function(e){this._workerId=e},e.prototype.sendMessage=function(e,t){var n=this,r=String(++this._lastSentReq);return new Promise((function(i,o){n._pendingReplies[r]={resolve:i,reject:o},n._send({vsWorker:n._workerId,req:r,method:e,args:t})}))},e.prototype.handleMessage=function(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))},e.prototype._handleMessage=function(e){var t=this;if(e.seq){var n=e;if(!this._pendingReplies[n.seq])return void console.warn("Got reply to unknown seq");var r=this._pendingReplies[n.seq];if(delete this._pendingReplies[n.seq],n.err){var i=n.err;return n.err.$isError&&((i=new Error).name=n.err.name,i.message=n.err.message,i.stack=n.err.stack),void r.reject(i)}r.resolve(n.res)}else{var o=e,s=o.req;this._handler.handleMessage(o.method,o.args).then((function(e){t._send({vsWorker:t._workerId,seq:s,res:e,err:void 0})}),(function(e){e.detail instanceof Error&&(e.detail=Be(e.detail)),t._send({vsWorker:t._workerId,seq:s,res:void 0,err:Be(e)})}))}},e.prototype._send=function(e){var t=[];if(e.req)for(var n=e,r=0;r0||this.m_modifiedCount>0)&&this.m_changes.push(new D_(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Number.MAX_VALUE,this.m_modifiedStart=Number.MAX_VALUE},e.prototype.AddOriginalElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++},e.prototype.AddModifiedElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++},e.prototype.getChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes},e.prototype.getReverseChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes},e}(),P_=function(){function e(e,t,n){void 0===n&&(n=null),this.OriginalSequence=e,this.ModifiedSequence=t,this.ContinueProcessingPredicate=n,this.m_forwardHistory=[],this.m_reverseHistory=[]}return e.prototype.ElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.OriginalElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.OriginalSequence.getElementAtIndex(t)},e.prototype.ModifiedElementsAreEqual=function(e,t){return this.ModifiedSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.ComputeDiff=function(e){return this._ComputeDiff(0,this.OriginalSequence.getLength()-1,0,this.ModifiedSequence.getLength()-1,e)},e.prototype._ComputeDiff=function(e,t,n,r,i){var o=this.ComputeDiffRecursive(e,t,n,r,[!1]);return i?this.PrettifyChanges(o):o},e.prototype.ComputeDiffRecursive=function(e,t,n,r,i){for(i[0]=!1;e<=t&&n<=r&&this.ElementsAreEqual(e,n);)e++,n++;for(;t>=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){var o=void 0;return n<=r?(O_.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new D_(e,0,n,r-n+1)]):e<=t?(O_.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[new D_(e,t-e+1,n,0)]):(O_.Assert(e===t+1,"originalStart should only be one more than originalEnd"),O_.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}var s=[0],a=[0],u=this.ComputeRecursionPoint(e,t,n,r,s,a,i),c=s[0],l=a[0];if(null!==u)return u;if(!i[0]){var d=this.ComputeDiffRecursive(e,c,n,l,i),h=[];return h=i[0]?[new D_(c+1,t-(c+1)+1,l+1,r-(l+1)+1)]:this.ComputeDiffRecursive(c+1,t,l+1,r,i),this.ConcatenateChanges(d,h)}return[new D_(e,t-e+1,n,r-n+1)]},e.prototype.WALKTRACE=function(e,t,n,r,i,o,s,a,u,c,l,d,h,f,p,g,m,_){var y,v,b=null,w=new I_,C=t,S=n,x=h[0]-g[0]-r,k=Number.MIN_VALUE,L=this.m_forwardHistory.length-1;do{(v=x+e)===C||v=0&&(e=(u=this.m_forwardHistory[L])[0],C=1,S=u.length-1)}while(--L>=-1);if(y=w.getReverseChanges(),_[0]){var M=h[0]+1,E=g[0]+1;if(null!==y&&y.length>0){var D=y[y.length-1];M=Math.max(M,D.getOriginalEnd()),E=Math.max(E,D.getModifiedEnd())}b=[new D_(M,d-M+1,E,p-E+1)]}else{w=new I_,C=o,S=s,x=h[0]-g[0]-a,k=Number.MAX_VALUE,L=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{(v=x+i)===C||v=c[v+1]?(f=(l=c[v+1]-1)-x-a,l>k&&w.MarkNextChange(),k=l+1,w.AddOriginalElement(l+1,f+1),x=v+1-i):(f=(l=c[v-1])-x-a,l>k&&w.MarkNextChange(),k=l,w.AddModifiedElement(l+1,f+1),x=v-1-i),L>=0&&(i=(c=this.m_reverseHistory[L])[0],C=1,S=c.length-1)}while(--L>=-1);b=w.getChanges()}return this.ConcatenateChanges(y,b)},e.prototype.ComputeRecursionPoint=function(e,t,n,r,i,o,s){var a,u=0,c=0,l=0,d=0,h=0,f=0;e--,n--,i[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];var p,g,m=t-e+(r-n),_=m+1,y=new Array(_),v=new Array(_),b=r-n,w=t-e,C=e-n,S=t-r,x=(w-b)%2==0;for(y[b]=e,v[w]=t,s[0]=!1,a=1;a<=m/2+1;a++){var k=0,L=0;for(l=this.ClipDiagonalBound(b-a,a,b,_),d=this.ClipDiagonalBound(b+a,a,b,_),p=l;p<=d;p+=2){for(c=(u=p===l||pk+L&&(k=u,L=c),!x&&Math.abs(p-w)<=a-1&&u>=v[p])return i[0]=u,o[0]=c,g<=v[p]&&a<=1448?this.WALKTRACE(b,l,d,C,w,h,f,S,y,v,u,t,i,c,r,o,x,s):null}var M=(k-e+(L-n)-a)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(k,this.OriginalSequence,M))return s[0]=!0,i[0]=k,o[0]=L,M>0&&a<=1448?this.WALKTRACE(b,l,d,C,w,h,f,S,y,v,u,t,i,c,r,o,x,s):(e++,n++,[new D_(e,t-e+1,n,r-n+1)]);for(h=this.ClipDiagonalBound(w-a,a,w,_),f=this.ClipDiagonalBound(w+a,a,w,_),p=h;p<=f;p+=2){for(c=(u=p===h||p=v[p+1]?v[p+1]-1:v[p-1])-(p-w)-S,g=u;u>e&&c>n&&this.ElementsAreEqual(u,c);)u--,c--;if(v[p]=u,x&&Math.abs(p-b)<=a&&u<=y[p])return i[0]=u,o[0]=c,g>=y[p]&&a<=1448?this.WALKTRACE(b,l,d,C,w,h,f,S,y,v,u,t,i,c,r,o,x,s):null}if(a<=1447){var E=new Array(d-l+2);E[0]=b-l+1,A_.Copy(y,l,E,1,d-l+1),this.m_forwardHistory.push(E),(E=new Array(f-h+2))[0]=w-h+1,A_.Copy(v,h,E,1,f-h+1),this.m_reverseHistory.push(E)}}return this.WALKTRACE(b,l,d,C,w,h,f,S,y,v,u,t,i,c,r,o,x,s)},e.prototype.PrettifyChanges=function(e){for(var t=0;t0,s=n.modifiedLength>0;n.originalStart+n.originalLength=0;t--){n=e[t],r=0,i=0;if(t>0){var u=e[t-1];u.originalLength>0&&(r=u.originalStart+u.originalLength),u.modifiedLength>0&&(i=u.modifiedStart+u.modifiedLength)}o=n.originalLength>0,s=n.modifiedLength>0;for(var c=0,l=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength),d=1;;d++){var h=n.originalStart-d,f=n.modifiedStart-d;if(hl&&(l=p,c=d)}n.originalStart-=c,n.modifiedStart-=c}return e},e.prototype._OriginalIsBoundary=function(e){if(e<=0||e>=this.OriginalSequence.getLength()-1)return!0;var t=this.OriginalSequence.getElementAtIndex(e);return"string"==typeof t&&/^\s*$/.test(t)},e.prototype._OriginalRegionIsBoundary=function(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1},e.prototype._ModifiedIsBoundary=function(e){if(e<=0||e>=this.ModifiedSequence.getLength()-1)return!0;var t=this.ModifiedSequence.getElementAtIndex(e);return"string"==typeof t&&/^\s*$/.test(t)},e.prototype._ModifiedRegionIsBoundary=function(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1},e.prototype._boundaryScore=function(e,t,n,r){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(n,r)?1:0)},e.prototype.ConcatenateChanges=function(e,t){var n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){var r=new Array(e.length+t.length-1);return A_.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],A_.Copy(t,1,r,e.length,t.length-1),r}r=new Array(e.length+t.length);return A_.Copy(e,0,r,0,e.length),A_.Copy(t,0,r,e.length,t.length),r},e.prototype.ChangesOverlap=function(e,t,n){if(O_.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),O_.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){var r=e.originalStart,i=e.originalLength,o=e.modifiedStart,s=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(i=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(s=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new D_(r,i,o,s),!0}return n[0]=null,!1},e.prototype.ClipDiagonalBound=function(e,t,n,r){if(e>=0&&e1&&p>1;){if(d.charCodeAt(f-2)!==h.charCodeAt(p-2))break;f--,p--}(f>1||p>1)&&this._pushTrimWhitespaceCharChange(i,o+1,1,f,s+1,1,p);for(var g=j_._getLastNonBlankColumn(d,1),m=j_._getLastNonBlankColumn(h,1),_=d.length+1,y=h.length+1;g<_&&m=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.changeValue=function(e,t){return e=ho(e),t=ho(t),this.values[e]!==t&&(this.values[e]=t,e-1=n.length)return!1;var i=n.length-e;return t>=i&&(t=i),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.getTotalValue=function(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)},e.prototype.getAccumulatedValue=function(e){return e<0?0:(e=ho(e),this._getAccumulatedValue(e))},e.prototype._getAccumulatedValue=function(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];var t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(var n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]},e.prototype.getIndexOf=function(e){e=Math.floor(e),this.getTotalValue();for(var t=0,n=this.values.length-1,r=0,i=0,o=0;t<=n;)if(r=t+(n-t)/2|0,e<(o=(i=this.prefixSum[r])-this.values[r]))n=r-1;else{if(!(e>=i))break;t=r+1}return new z_(r,e-o)},e}(),q_=function(){function e(e){this._cacheAccumulatedValueStart=0,this._cache=null,this._actual=new U_(e),this._bustCache()}return e.prototype._bustCache=function(){this._cacheAccumulatedValueStart=0,this._cache=null},e.prototype.insertValues=function(e,t){this._actual.insertValues(e,t)&&this._bustCache()},e.prototype.changeValue=function(e,t){this._actual.changeValue(e,t)&&this._bustCache()},e.prototype.removeValues=function(e,t){this._actual.removeValues(e,t)&&this._bustCache()},e.prototype.getTotalValue=function(){return this._actual.getTotalValue()},e.prototype.getAccumulatedValue=function(e){return this._actual.getAccumulatedValue(e)},e.prototype.getIndexOf=function(e){if(e=Math.floor(e),null!==this._cache){var t=e-this._cacheAccumulatedValueStart;if(t>=0&&tt&&(t=c),s>n&&(n=s),(l=o[2])>n&&(n=l)}t++,n++;var a=new co(n,t,0);for(r=0,i=e.length;r=this._maxCharCode?0:this._states.get(e,t)},e}(),$_=null;var Z_=null;var J_=function(){function e(){}return e._createLink=function(e,t,n,r,i){var o=i-1;do{var s=t.charCodeAt(o);if(2!==e.get(s))break;o--}while(o>r);if(r>0){var a=t.charCodeAt(r-1),u=t.charCodeAt(o);(40===a&&41===u||91===a&&93===u||123===a&&125===u)&&o--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:o+2},url:t.substring(r,o+1)}},e.computeLinks=function(t,n){void 0===n&&(null===$_&&($_=new G_([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),n=$_);for(var r=function(){if(null===Z_){Z_=new fo(0);for(var e=0;e<" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…".length;e++)Z_.set(" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…".charCodeAt(e),1);for(e=0;e<".,;".length;e++)Z_.set(".,;".charCodeAt(e),2)}return Z_}(),i=[],o=1,s=t.getLineCount();o<=s;o++){for(var a=t.getLineContent(o),u=a.length,c=0,l=0,d=0,h=1,f=!1,p=!1,g=!1;c=0?((r+=n?1:-1)<0?r=e.length-1:r%=e.length,e[r]):null},e.INSTANCE=new e,e}(),Q_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ey=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Q_(t,e),Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._versionId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eol",{get:function(){return this._eol},enumerable:!0,configurable:!0}),t.prototype.getValue=function(){return this.getText()},t.prototype.getLinesContent=function(){return this._lines.slice(0)},t.prototype.getLineCount=function(){return this._lines.length},t.prototype.getLineContent=function(e){return this._lines[e-1]},t.prototype.getWordAtPosition=function(e,t){var n=Zr(e.column,$r(t),this._lines[e.lineNumber-1],0);return n?new Tr(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn):null},t.prototype.getWordUntilPosition=function(e,t){var n=this.getWordAtPosition(e,t);return n?{word:this._lines[e.lineNumber-1].substring(n.startColumn-1,e.column-1),startColumn:n.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}},t.prototype.createWordIterator=function(e){var t,n,r=this,i=0,o=0,s=[],a=function(){if(o=r._lines.length?At:(n=r._lines[i],s=r._wordenize(n,e),o=0,i+=1,a())};return{next:a}},t.prototype.getLineWords=function(e,t){for(var n=this._lines[e-1],r=[],i=0,o=this._wordenize(n,t);ithis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{var i=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>i&&(n=i,r=!0)}return r?{lineNumber:t,column:n}:e},t}(K_),ty=function(){function e(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}return e.prototype.dispose=function(){this._models=Object.create(null)},e.prototype._getModel=function(e){return this._models[e]},e.prototype._getModels=function(){var e=this,t=[];return Object.keys(this._models).forEach((function(n){return t.push(e._models[n])})),t},e.prototype.acceptNewModel=function(e){this._models[e.url]=new ey(it.parse(e.url),e.lines,e.EOL,e.versionId)},e.prototype.acceptModelChanged=function(e,t){this._models[e]&&this._models[e].onEvents(t)},e.prototype.acceptRemovedModel=function(e){this._models[e]&&delete this._models[e]},e.prototype.computeDiff=function(e,t,n){var r=this._getModel(e),i=this._getModel(t);if(!r||!i)return Promise.resolve(null);var o=r.getLinesContent(),s=i.getLinesContent(),a=new V_(o,s,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0}).computeDiff(),u=!(a.length>0)&&this._modelsAreIdentical(r,i);return Promise.resolve({identical:u,changes:a})},e.prototype._modelsAreIdentical=function(e,t){var n=e.getLineCount();if(n!==t.getLineCount())return!1;for(var r=1;r<=n;r++){if(e.getLineContent(r)!==t.getLineContent(r))return!1}return!0},e.prototype.computeMoreMinimalEdits=function(t,n){var r=this._getModel(t);if(!r)return Promise.resolve(n);for(var i=[],o=void 0,s=0,a=n=Pr(n,(function(e,t){return e.range&&t.range?Tr.compareRangesUsingStarts(e.range,t.range):(e.range?0:1)-(t.range?0:1)}));se._diffLimit)i.push({range:c,text:l});else for(var f=N_(h,l,!1),p=r.offsetAt(Tr.lift(c).getStartPosition()),g=0,m=f;g=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},uy=function(e,t){return function(n,r){t(n,r,e)}},cy=6e4,ly=3e5;function dy(e,t){var n=e.getModel(t);return!!n&&!n.isTooLargeForSyncing()}var hy=function(e){function t(t,n,r){var i=e.call(this)||this;return i._modelService=t,i._workerManager=i._register(new py(i._modelService)),i._logService=r,i._register(Sa.register("*",{provideLinks:function(e,t){return dy(i._modelService,e.uri)?i._workerManager.withWorker().then((function(t){return t.computeLinks(e.uri)})).then((function(e){return e&&{links:e}})):Promise.resolve({links:[]})}})),i._register(ua.register("*",new fy(i._workerManager,n,i._modelService))),i}return sy(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.canComputeDiff=function(e,t){return dy(this._modelService,e)&&dy(this._modelService,t)},t.prototype.computeDiff=function(e,t,n){return this._workerManager.withWorker().then((function(r){return r.computeDiff(e,t,n)}))},t.prototype.computeMoreMinimalEdits=function(e,t){var n,r=this;if(n=t,Array.isArray(n)&&n.length>0){if(!dy(this._modelService,e))return Promise.resolve(t);var i=Fa.create(!0),o=this._workerManager.withWorker().then((function(n){return n.computeMoreMinimalEdits(e,t)}));return o.finally((function(){return r._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed())})),o}return Promise.resolve(void 0)},t.prototype.canNavigateValueSet=function(e){return dy(this._modelService,e)},t.prototype.navigateValueSet=function(e,t,n){return this._workerManager.withWorker().then((function(r){return r.navigateValueSet(e,t,n)}))},t.prototype.canComputeWordRanges=function(e){return dy(this._modelService,e)},t.prototype.computeWordRanges=function(e,t){return this._workerManager.withWorker().then((function(n){return n.computeWordRanges(e,t)}))},t=ay([uy(0,yt),uy(1,ny),uy(2,iy)],t)}(Dt),fy=function(){function e(e,t,n){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}return e.prototype.provideCompletionItems=function(e,t){if(this._configurationService.getValue(e.uri,t,"editor").wordBasedSuggestions&&dy(this._modelService,e.uri))return this._workerManager.withWorker().then((function(n){return n.textualSuggest(e.uri,t)}))},e}(),py=function(e){function t(t){var n=e.call(this)||this;return n._modelService=t,n._editorWorkerClient=null,n._lastWorkerUsedTime=(new Date).getTime(),n._register(new xs).cancelAndSet((function(){return n._checkStopIdleWorker()}),Math.round(ly/2)),n._register(n._modelService.onModelRemoved((function(e){return n._checkStopEmptyWorker()}))),n}return sy(t,e),t.prototype.dispose=function(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),e.prototype.dispose.call(this)},t.prototype._checkStopEmptyWorker=function(){this._editorWorkerClient&&(0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null))},t.prototype._checkStopIdleWorker=function(){this._editorWorkerClient&&((new Date).getTime()-this._lastWorkerUsedTime>ly&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null))},t.prototype.withWorker=function(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new yy(this._modelService,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)},t}(Dt),gy=function(e){function t(t,n,r){var i=e.call(this)||this;if(i._syncedModels=Object.create(null),i._syncedModelsLastUsedTime=Object.create(null),i._proxy=t,i._modelService=n,!r){var o=new xs;o.cancelAndSet((function(){return i._checkStopModelSync()}),Math.round(cy/2)),i._register(o)}return i}return sy(t,e),t.prototype.dispose=function(){for(var t in this._syncedModels)kt(this._syncedModels[t]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),e.prototype.dispose.call(this)},t.prototype.ensureSyncedResources=function(e){for(var t=0,n=e;tcy&&t.push(n)}for(var r=0,i=t;r=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(var n=0;nn)&&(!l.isEmpty()||0!==c.type&&3!==c.type)){var d=l.startLineNumber===n?l.startColumn:r,h=l.endLineNumber===n?l.endColumn:i;o[s++]=new e(d,h,c.inlineClassName,c.type)}}return o},e.compare=function(e,t){return e.startColumn===t.startColumn?e.endColumn===t.endColumn?e.classNamet.className?1:0:e.endColumn-t.endColumn:e.startColumn-t.startColumn},e}(),ky=function(e,t,n){this.startOffset=e,this.endOffset=t,this.className=n},Ly=function(){function e(){this.stopOffsets=[],this.classNames=[],this.count=0}return e.prototype.consumeLowerThan=function(e,t,n){for(;this.count>0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t);break}this.count++},e}(),My=function(){function e(){}return e.normalize=function(e,t){if(0===t.length)return[];for(var n=[],r=new Ly,i=0,o=0,s=t.length;o1)mn(e.charCodeAt(u-2))&&u--;if(c>1)mn(e.charCodeAt(c-2))&&c--;var d=u-1,h=c-2;i=r.consumeLowerThan(d,i,n),0===r.count&&(i=d),r.insert(h,l)}return r.consumeLowerThan(1073741824,i,n),n},e}(),Ey=function(e,t){this.endIndex=e,this.type=t},Dy=function(){function e(e,t){this.startOffset=e,this.endOffset=t}return e.prototype.equals=function(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset},e}(),Ty=function(){function e(e,t,n,r,i,o,s,a,u,c,l,d,h,f,p,g){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=r,this.isBasicASCII=i,this.containsRTL=o,this.fauxIndentLength=s,this.lineTokens=a,this.lineDecorations=u,this.tabSize=c,this.spaceWidth=l,this.stopRenderingLineAfter=d,this.renderWhitespace="all"===h?3:"boundary"===h?1:"selection"===h?2:0,this.renderControlCharacters=f,this.fontLigatures=p,this.selectionsOnLine=g&&g.sort((function(e,t){return e.startOffset>>16},e.getCharIndex=function(e){return(65535&e)>>>0},e.prototype.setPartData=function(e,t,n,r){var i=(t<<16|n<<0)>>>0;this._data[e]=i,this._absoluteOffsets[e]=r+n},e.prototype.getAbsoluteOffsets=function(){return this._absoluteOffsets},e.prototype.charOffsetToPartData=function(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]},e.prototype.partDataToCharOffset=function(t,n,r){if(0===this.length)return 0;for(var i=(t<<16|r<<0)>>>0,o=0,s=this.length-1;o+1>>1,u=this._data[a];if(u===i)return a;u>i?s=a:o=a}if(o===s)return o;var c=this._data[o],l=this._data[s];if(c===i)return o;if(l===i)return s;var d=e.getPartIndex(c);return r-e.getCharIndex(c)<=(d!==e.getPartIndex(l)?n:e.getCharIndex(l))-r?o:s},e}(),Oy=function(e,t,n){this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n};function Ay(e,t){if(0===e.lineContent.length){var n=0,r=" ";if(e.lineDecorations.length>0){for(var i=[],o=0,s=e.lineDecorations.length;o')}return t.appendASCIIString(r),new Oy(new Ny(0,0),!1,n)}return function(e,t){var n=e.fontIsMonospace,r=e.canUseHalfwidthRightwardsArrow,i=e.containsForeignElements,o=e.lineContent,s=e.len,a=e.isOverflowing,u=e.parts,c=e.tabSize,l=e.containsRTL,d=e.spaceWidth,h=e.renderWhitespace,f=e.renderControlCharacters,p=new Ny(s+1,u.length),g=0,m=0,_=0,y=0,v=0;t.appendASCIIString("");for(var b=0,w=u.length;b=0;if(_=0,t.appendASCIIString('0&&(!r||T>1?t.write1(8594):t.write1(65515),T--);T>0;)t.write1(160),T--;else t.write1(183);_++}y=L}else{L=0;for(l&&t.appendASCIIString(' dir="ltr"'),t.appendASCII(62);g0;)t.write1(160),L++,T--;break;case 32:t.write1(160),L++;break;case 60:t.appendASCIIString("<"),L++;break;case 62:t.appendASCIIString(">"),L++;break;case 38:t.appendASCIIString("&"),L++;break;case 0:t.appendASCIIString("�"),L++;break;case 65279:case 8232:t.write1(65533),L++;break;default:Sn(D)&&m++,f&&D<32?(t.write1(9216+D),L++):(t.write1(D),L++)}_++}y=L}t.appendASCIIString("")}p.setPartData(s,u.length-1,_,v),a&&t.appendASCIIString("");return t.appendASCIIString(""),new Oy(p,l,i)}(function(e){var t,n,r=e.useMonospaceOptimizations,i=e.lineContent;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0&&(r[i++]=new Ey(t,""));for(var o=0,s=e.getCount();o=n){r[i++]=new Ey(n,u);break}r[i++]=new Ey(a,u)}}return r}(e.lineTokens,e.fauxIndentLength,n);(3===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine)&&(o=function(e,t,n,r,i,o,s,a,u){var c,l=[],d=0,h=0,f=r[h].type,p=r[h].endIndex,g=r.length,m=an(e);-1===m?(m=t,c=t):c=cn(e);for(var _=0,y=0;y=w.endOffset&&(b++,w=a&&a[b]);var S=void 0;if(yc)S=!0;else if(9===C)S=!0;else if(32===C)if(u)if(v)S=!0;else{var x=y+1y),v?(!S||!s&&_>=o)&&(l[d++]=new Ey(y,"vs-whitespace"),_%=o):(y===p||S&&y>i)&&(l[d++]=new Ey(y,f),_%=o),9===C?_=o:Sn(C)?_+=2:_++,v=S,y===p&&++h0?e.charCodeAt(t-1):0,M=t>1?e.charCodeAt(t-2):0;32===L&&32!==M&&9!==M||(k=!0)}else k=!0;return l[d++]=new Ey(t,k?"vs-whitespace":f),l}(i,n,e.continuesWithWrappedLine,o,e.fauxIndentLength,e.tabSize,r,e.selectionsOnLine,1===e.renderWhitespace));var s=0;if(e.lineDecorations.length>0){for(var a=0,u=e.lineDecorations.length;ac&&(c=g.startOffset,a[u++]=new Ey(c,p)),!(g.endOffset+1<=f)){c=f,a[u++]=new Ey(c,p+" "+g.className);break}c=g.endOffset+1,a[u++]=new Ey(c,p+" "+g.className),s++}f>c&&(c=f,a[u++]=new Ey(c,p))}var m=n[n.length-1].endIndex;if(s=50&&(i[o++]=new Ey(l+1,c),d=l+1,l=-1);d!==u&&(i[o++]=new Ey(u,c))}else i[o++]=f;r=u}else for(s=0,a=t.length;s50){c=f.type;var g=Math.ceil(p/50);for(h=1;h'"_]/g,"-")}function $y(e,t){return new Error(e.languageId+": "+t)}function Zy(e,t,n,r,i){var o=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,s,a,u,c,l,d,h,f){return qy(a)?qy(u)?!qy(c)&&c0;){var r=e.tokenizer[n];if(r)return r;var i=n.lastIndexOf(".");n=i<0?null:n.substr(0,i)}return null}var Xy=function(){function e(e){this._maxCacheDepth=e,this._entries=Object.create(null)}return e.create=function(e,t){return this._INSTANCE.create(e,t)},e.prototype.create=function(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new Qy(e,t);var n=Qy.getStackElementId(e);n.length>0&&(n+="|"),n+=t;var r=this._entries[n];return r||(r=new Qy(e,t),this._entries[n]=r,r)},e._INSTANCE=new e(5),e}(),Qy=function(){function e(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}return e.getStackElementId=function(e){for(var t="";null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t},e._equals=function(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t},e.prototype.equals=function(t){return e._equals(this,t)},e.prototype.push=function(e){return Xy.create(this,e)},e.prototype.pop=function(){return this.parent},e.prototype.popall=function(){for(var e=this;e.parent;)e=e.parent;return e},e.prototype.switchTo=function(e){return Xy.create(this.parent,e)},e}(),ev=function(){function e(e,t){this.modeId=e,this.state=t}return e.prototype.equals=function(e){return this.modeId===e.modeId&&this.state.equals(e.state)},e.prototype.clone=function(){return this.state.clone()===this.state?this:new e(this.modeId,this.state)},e}(),tv=function(){function e(e){this._maxCacheDepth=e,this._entries=Object.create(null)}return e.create=function(e,t){return this._INSTANCE.create(e,t)},e.prototype.create=function(e,t){if(null!==t)return new nv(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new nv(e,t);var n=Qy.getStackElementId(e),r=this._entries[n];return r||(r=new nv(e,null),this._entries[n]=r,r)},e._INSTANCE=new e(5),e}(),nv=function(){function e(e,t){this.stack=e,this.embeddedModeData=t}return e.prototype.clone=function(){return(this.embeddedModeData?this.embeddedModeData.clone():null)===this.embeddedModeData?this:tv.create(this.stack,this.embeddedModeData)},e.prototype.equals=function(t){return t instanceof e&&(!!this.stack.equals(t.stack)&&(null===this.embeddedModeData&&null===t.embeddedModeData||null!==this.embeddedModeData&&null!==t.embeddedModeData&&this.embeddedModeData.equals(t.embeddedModeData)))},e}(),rv=function(){function e(){this._tokens=[],this._language=null,this._lastTokenType=null,this._lastTokenLanguage=null}return e.prototype.enterMode=function(e,t){this._language=t},e.prototype.emit=function(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._language||(this._lastTokenType=t,this._lastTokenLanguage=this._language,this._tokens.push(new Ta(e,t,this._language)))},e.prototype.nestedModeTokenize=function(e,t,n){var r=t.modeId,i=t.state,o=Ma.get(r);if(!o)return this.enterMode(n,r),this.emit(n,""),i;var s=o.tokenize(e,i,n);return this._tokens=this._tokens.concat(s.tokens),this._lastTokenType=null,this._lastTokenLanguage=null,this._language=null,s.endState},e.prototype.finalize=function(e){return new Na(this._tokens,e)},e}(),iv=function(){function e(e,t){this._modeService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}return e.prototype.enterMode=function(e,t){this._currentLanguageId=this._modeService.getLanguageIdentifier(t).id},e.prototype.emit=function(e,t){var n=this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))},e._merge=function(e,t,n){var r=null!==e?e.length:0,i=t.length,o=null!==n?n.length:0;if(0===r&&0===i&&0===o)return new Uint32Array(0);if(0===r&&0===i)return n;if(0===i&&0===o)return e;var s=new Uint32Array(r+i+o);null!==e&&s.set(e);for(var a=0;a0&&r.nestedModeTokenize(s,t.embeddedModeData,n);var a=e.substring(i);return this._myTokenize(a,t,n+i,r)},e.prototype._safeRuleName=function(e){return e?e.name:"(unknown)"},e.prototype._myTokenize=function(e,t,n,r){r.enterMode(n,this._modeId);for(var i,o,s=e.length,a=t.embeddedModeData,u=t.stack,c=0,l=null,d=!0;d||c=s)break;d=!1;var C=this._lexer.tokenizer[g];if(!C&&!(C=Jy(this._lexer,g)))throw $y(this._lexer,"tokenizer state is not defined: "+g);for(var S=e.substr(c),x=0,k=C;x=this._lexer.maxStack)throw $y(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(g)}else if("@pop"===y.next){if(u.depth<=1)throw $y(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(v));u=u.pop()}else if("@popall"===y.next)u=u.popall();else{var E;if("@"===(E=Zy(this._lexer,y.next,_,m,g))[0]&&(E=E.substr(1)),!Jy(this._lexer,E))throw $y(this._lexer,"trying to set a next state '"+E+"' that is undefined in rule: "+this._safeRuleName(v));u=u.push(E)}}y.log&&"string"==typeof y.log&&(i=this._lexer,o=this._lexer.languageId+": "+Zy(this._lexer,y.log,_,m,g),console.log(i.languageId+": "+o))}if(null===M)throw $y(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(v));if(Array.isArray(M)){if(l&&l.groups.length>0)throw $y(this._lexer,"groups cannot be nested: "+this._safeRuleName(v));if(m.length!==M.length+1)throw $y(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(v));for(var D=0,T=1;T=0&&a()}))})},e.colorizeLine=function(e,t,n,r,i){void 0===i&&(i=4);var o=By.isBasicASCII(e,t),s=By.containsRTL(e,o,n);return Py(new Ty(!1,!0,e,!1,o,s,0,r,[],i,0,-1,"none",!1,!1,null)).html},e.colorizeModelLine=function(e,t,n){void 0===n&&(n=4);var r=e.getLineContent(t);e.forceTokenization(t);var i=e.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),i,n)},e}();function uv(e,t,n){return new Promise((function(r,i){var o=function(){var s=function(e,t,n){for(var r=[],i=n.getInitialState(),o=0,s=e.length;o"),i=u.endState}return r.join("")}(e,t,n);if(n instanceof ov){var a=n.getLoadStatus();if(!1===a.loaded)return void a.promise.then(o,i)}r(s)};o()}))}function cv(e,t){var n=[],r=new Uint32Array(2);r[0]=0,r[1]=16793600;for(var i=0,o=e.length;i")}return n.join("")}var lv={Configuration:"base.contributions.configuration"},dv={properties:{},patternProperties:{}},hv={properties:{},patternProperties:{}},fv={properties:{},patternProperties:{}},pv={properties:{},patternProperties:{}},gv={properties:{},patternProperties:{}},mv={properties:{},patternProperties:{}},_v="vscode://schemas/settings/editor",yv=yr.as(Bc),vv=function(){function e(){this.overrideIdentifiers=[],this._onDidSchemaChange=new Ht,this._onDidUpdateConfiguration=new Ht,this.defaultOverridesConfigurationNode={id:"defaultOverrides",title:we("defaultConfigurations.title","Default Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultOverridesConfigurationNode],this.editorConfigurationSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowsTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},this.computeOverridePropertyPattern(),yv.registerSchema(_v,this.editorConfigurationSchema)}return e.prototype.registerConfiguration=function(e,t){void 0===t&&(t=!0),this.registerConfigurations([e],t)},e.prototype.registerConfigurations=function(e,t){var n=this;void 0===t&&(t=!0);var r=[];e.forEach((function(e){r.push.apply(r,n.validateAndRegisterProperties(e,t)),n.configurationContributors.push(e),n.registerJSONConfiguration(e),n.updateSchemaForOverrideSettingsConfiguration(e)})),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(r)},e.prototype.registerOverrideIdentifiers=function(e){var t;(t=this.overrideIdentifiers).push.apply(t,e),this.updateOverridePropertyPatternKey()},e.prototype.validateAndRegisterProperties=function(e,t,n,r){void 0===t&&(t=!0),void 0===n&&(n=3),void 0===r&&(r=!1),n=Ee(e.scope)?n:e.scope,r=e.overridable||r;var i=[],o=e.properties;if(o)for(var s in o){var a=void 0;if(t&&(a=Lv(s)))console.warn(a),delete o[s];else{var u=o[s];Me(u.default)&&(u.default=xv(u.type)),r&&(u.overridable=!0),Sv.test(s)?u.scope=void 0:u.scope=Ee(u.scope)?n:u.scope,!o[s].hasOwnProperty("included")||o[s].included?(this.configurationProperties[s]=o[s],i.push(s)):(this.excludedConfigurationProperties[s]=o[s],delete o[s])}}var c=e.allOf;if(c)for(var l=0,d=c;l console.log` because `log` has been completed recently."),we("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],default:"recentlyUsed",description:we("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")},"editor.suggestFontSize":{type:"integer",default:0,minimum:0,markdownDescription:we("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")},"editor.suggestLineHeight":{type:"integer",default:0,minimum:0,markdownDescription:we("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.")},"editor.tabCompletion":{type:"string",default:"off",enum:["on","off","onlySnippets"],enumDescriptions:[we("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),we("tabCompletion.off","Disable tab completions."),we("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:we("tabCompletion","Enables tab completions.")},"editor.suggest.filterGraceful":{type:"boolean",default:!0,description:we("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:!1,description:we("suggest.localityBonus","Controls whether sorting favours words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:!1,markdownDescription:we("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:!0,description:we("suggest.snippetsPreventQuickSuggestions","Control whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:Ev.contribInfo.suggest.showIcons,description:we("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.maxVisibleSuggestions":{type:"number",default:Ev.contribInfo.suggest.maxVisibleSuggestions,minimum:1,maximum:15,description:we("suggest.maxVisibleSuggestions","Controls how many suggestions IntelliSense will show before showing a scrollbar (maximum 15).")},"editor.suggest.filteredTypes":{type:"object",default:{keyword:!0,snippet:!0},markdownDescription:we("suggest.filtered","Controls whether some suggestion types should be filtered from IntelliSense. A list of suggestion types can be found here: https://code.visualstudio.com/docs/editor/intellisense#_types-of-completions."),properties:{method:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.method","When set to `false` IntelliSense never shows `method` suggestions.")},function:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.function","When set to `false` IntelliSense never shows `function` suggestions.")},constructor:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.constructor","When set to `false` IntelliSense never shows `constructor` suggestions.")},field:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.field","When set to `false` IntelliSense never shows `field` suggestions.")},variable:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.variable","When set to `false` IntelliSense never shows `variable` suggestions.")},class:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.class","When set to `false` IntelliSense never shows `class` suggestions.")},struct:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.struct","When set to `false` IntelliSense never shows `struct` suggestions.")},interface:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.interface","When set to `false` IntelliSense never shows `interface` suggestions.")},module:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.module","When set to `false` IntelliSense never shows `module` suggestions.")},property:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.property","When set to `false` IntelliSense never shows `property` suggestions.")},event:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.event","When set to `false` IntelliSense never shows `event` suggestions.")},operator:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.operator","When set to `false` IntelliSense never shows `operator` suggestions.")},unit:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.unit","When set to `false` IntelliSense never shows `unit` suggestions.")},value:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.value","When set to `false` IntelliSense never shows `value` suggestions.")},constant:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.constant","When set to `false` IntelliSense never shows `constant` suggestions.")},enum:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.enum","When set to `false` IntelliSense never shows `enum` suggestions.")},enumMember:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.enumMember","When set to `false` IntelliSense never shows `enumMember` suggestions.")},keyword:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.keyword","When set to `false` IntelliSense never shows `keyword` suggestions.")},text:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.text","When set to `false` IntelliSense never shows `text` suggestions.")},color:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.color","When set to `false` IntelliSense never shows `color` suggestions.")},file:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.file","When set to `false` IntelliSense never shows `file` suggestions.")},reference:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.reference","When set to `false` IntelliSense never shows `reference` suggestions.")},customcolor:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.customcolor","When set to `false` IntelliSense never shows `customcolor` suggestions.")},folder:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.folder","When set to `false` IntelliSense never shows `folder` suggestions.")},typeParameter:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.typeParameter","When set to `false` IntelliSense never shows `typeParameter` suggestions.")},snippet:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.snippet","When set to `false` IntelliSense never shows `snippet` suggestions.")}}},"editor.gotoLocation.multiple":{description:we("editor.gotoLocation.multiple","Controls the behavior of 'Go To' commands, like Go To Definition, when multiple target locations exist."),type:"string",enum:["peek","gotoAndPeek","goto"],default:Ev.contribInfo.gotoLocation.multiple,enumDescriptions:[we("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),we("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),we("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},"editor.selectionHighlight":{type:"boolean",default:Ev.contribInfo.selectionHighlight,description:we("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")},"editor.occurrencesHighlight":{type:"boolean",default:Ev.contribInfo.occurrencesHighlight,description:we("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")},"editor.overviewRulerLanes":{type:"integer",default:3,description:we("overviewRulerLanes","Controls the number of decorations that can show up at the same position in the overview ruler.")},"editor.overviewRulerBorder":{type:"boolean",default:Ev.viewInfo.overviewRulerBorder,description:we("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")},"editor.cursorBlinking":{type:"string",enum:["blink","smooth","phase","expand","solid"],default:function(e){if(1===e)return"blink";if(4===e)return"expand";if(3===e)return"phase";if(2===e)return"smooth";if(5===e)return"solid";throw new Error("blinkingStyleToString: Unknown blinkingStyle")}(Ev.viewInfo.cursorBlinking),description:we("cursorBlinking","Control the cursor animation style.")},"editor.mouseWheelZoom":{type:"boolean",default:Ev.viewInfo.mouseWheelZoom,markdownDescription:we("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")},"editor.cursorSmoothCaretAnimation":{type:"boolean",default:Ev.viewInfo.cursorSmoothCaretAnimation,description:we("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")},"editor.cursorStyle":{type:"string",enum:["block","block-outline","line","line-thin","underline","underline-thin"],default:function(e){if(e===Jr.Line)return"line";if(e===Jr.Block)return"block";if(e===Jr.Underline)return"underline";if(e===Jr.LineThin)return"line-thin";if(e===Jr.BlockOutline)return"block-outline";if(e===Jr.UnderlineThin)return"underline-thin";throw new Error("cursorStyleToString: Unknown cursorStyle")}(Ev.viewInfo.cursorStyle),description:we("cursorStyle","Controls the cursor style.")},"editor.cursorWidth":{type:"integer",default:Ev.viewInfo.cursorWidth,markdownDescription:we("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")},"editor.fontLigatures":{type:"boolean",default:Ev.viewInfo.fontLigatures,description:we("fontLigatures","Enables/Disables font ligatures.")},"editor.hideCursorInOverviewRuler":{type:"boolean",default:Ev.viewInfo.hideCursorInOverviewRuler,description:we("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")},"editor.renderWhitespace":{type:"string",enum:["none","boundary","selection","all"],enumDescriptions:["",we("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),we("renderWhitespace.selection","Render whitespace characters only on selected text."),""],default:Ev.viewInfo.renderWhitespace,description:we("renderWhitespace","Controls how the editor should render whitespace characters.")},"editor.renderControlCharacters":{type:"boolean",default:Ev.viewInfo.renderControlCharacters,description:we("renderControlCharacters","Controls whether the editor should render control characters.")},"editor.renderIndentGuides":{type:"boolean",default:Ev.viewInfo.renderIndentGuides,description:we("renderIndentGuides","Controls whether the editor should render indent guides.")},"editor.highlightActiveIndentGuide":{type:"boolean",default:Ev.viewInfo.highlightActiveIndentGuide,description:we("highlightActiveIndentGuide","Controls whether the editor should highlight the active indent guide.")},"editor.renderLineHighlight":{type:"string",enum:["none","gutter","line","all"],enumDescriptions:["","","",we("renderLineHighlight.all","Highlights both the gutter and the current line.")],default:Ev.viewInfo.renderLineHighlight,description:we("renderLineHighlight","Controls how the editor should render the current line highlight.")},"editor.codeLens":{type:"boolean",default:Ev.contribInfo.codeLens,description:we("codeLens","Controls whether the editor shows CodeLens.")},"editor.folding":{type:"boolean",default:Ev.contribInfo.folding,description:we("folding","Controls whether the editor has code folding enabled.")},"editor.foldingStrategy":{type:"string",enum:["auto","indentation"],default:Ev.contribInfo.foldingStrategy,markdownDescription:we("foldingStrategy","Controls the strategy for computing folding ranges. `auto` uses a language specific folding strategy, if available. `indentation` uses the indentation based folding strategy.")},"editor.showFoldingControls":{type:"string",enum:["always","mouseover"],default:Ev.contribInfo.showFoldingControls,description:we("showFoldingControls","Controls whether the fold controls on the gutter are automatically hidden.")},"editor.matchBrackets":{type:"boolean",default:Ev.contribInfo.matchBrackets,description:we("matchBrackets","Highlight matching brackets when one of them is selected.")},"editor.glyphMargin":{type:"boolean",default:Ev.viewInfo.glyphMargin,description:we("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")},"editor.useTabStops":{type:"boolean",default:Ev.useTabStops,description:we("useTabStops","Inserting and deleting whitespace follows tab stops.")},"editor.trimAutoWhitespace":{type:"boolean",default:Tv.trimAutoWhitespace,description:we("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:we("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.dragAndDrop":{type:"boolean",default:Ev.dragAndDrop,description:we("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")},"editor.accessibilitySupport":{type:"string",enum:["auto","on","off"],enumDescriptions:[we("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),we("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader."),we("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:Ev.accessibilitySupport,description:we("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers.")},"editor.showUnused":{type:"boolean",default:Ev.showUnused,description:we("showUnused","Controls fading out of unused code.")},"editor.links":{type:"boolean",default:Ev.contribInfo.links,description:we("links","Controls whether the editor should detect links and make them clickable.")},"editor.colorDecorators":{type:"boolean",default:Ev.contribInfo.colorDecorators,description:we("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")},"editor.lightbulb.enabled":{type:"boolean",default:Ev.contribInfo.lightbulbEnabled,description:we("codeActions","Enables the code action lightbulb in the editor.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:we("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.codeActionsOnSave":{type:"object",properties:{"source.organizeImports":{type:"boolean",description:we("codeActionsOnSave.organizeImports","Controls whether organize imports action should be run on file save.")},"source.fixAll":{type:"boolean",description:we("codeActionsOnSave.fixAll","Controls whether auto fix action should be run on file save.")}},additionalProperties:{type:"boolean"},default:Ev.contribInfo.codeActionsOnSave,description:we("codeActionsOnSave","Code action kinds to be run on save.")},"editor.codeActionsOnSaveTimeout":{type:"number",default:Ev.contribInfo.codeActionsOnSaveTimeout,description:we("codeActionsOnSaveTimeout","Timeout in milliseconds after which the code actions that are run on save are cancelled.")},"editor.selectionClipboard":{type:"boolean",default:Ev.contribInfo.selectionClipboard,description:we("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Ge.c},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:we("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:we("ignoreTrimWhitespace","Controls whether the diff editor shows changes in leading or trailing whitespace as diffs.")},"editor.largeFileOptimizations":{type:"boolean",default:Tv.largeFileOptimizations,description:we("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:we("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")}}},Rv=null;function Fv(){return null===Rv&&(Rv=Object.create(null),Object.keys(Pv.properties).forEach((function(e){Rv[e]=!0}))),Rv}Iv.registerConfiguration(Pv);var Yv=function(){function e(){}return e.insert=function(e,t){return{range:new Tr(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}},e.delete=function(e){return{range:e,text:null}},e.replace=function(e,t){return{range:e,text:t}},e.replaceMove=function(e,t){return{range:e,text:t,forceMoveMarkers:!0}},e}(),jv=pt("configurationService");function Bv(e,t){var n=Object.create(null);for(var r in e)Hv(n,r,e[r],t);return n}function Hv(e,t,n,r){for(var i=t.split("."),o=i.pop(),s=e,a=0;a0;){var n=t.shift();for(var r in Object.freeze(n),n)if(Vr.call(n,r)){var i=n[r];"object"!=typeof i||Object.isFrozen(i)||t.push(i)}}return e}(e):e},e.prototype.getContentsForOverrideIdentifer=function(e){for(var t=0,n=this.overrides;t5e3&&n._leaveChordMode():n._leaveChordMode()}),500)},t.prototype._leaveChordMode=function(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null},t.prototype._dispatch=function(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t)},t.prototype._doDispatch=function(e,t){var n=this,r=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;var i=e.getDispatchParts()[0];if(null===i)return r;var o=this._contextKeyService.getContext(t),s=this._currentChord?this._currentChord.keypress:null,a=e.getLabel(),u=this._getResolver().resolve(o,s,i);return u&&u.enterChord?(r=!0,this._enterChordMode(i,a),r):(this._currentChord&&(u&&u.commandId||(this._notificationService.status(we("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),r=!0)),this._leaveChordMode(),u&&u.commandId&&(u.bubble||(r=!0),void 0===u.commandArgs?this._commandService.executeCommand(u.commandId).then(void 0,(function(e){return n._notificationService.warn(e)})):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,(function(e){return n._notificationService.warn(e)})),this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding"})),r)},t.prototype.mightProducePrintableCharacter=function(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)},t}(Dt),Zv=function(){function e(t,n){this._defaultKeybindings=t,this._defaultBoundCommands=new Map;for(var r=0,i=t.length;r=0;l--)this._isTargetedForRemoval(e[l],a,u,s,c)&&e.splice(l,1);else n.push(o)}return e.concat(n)},e.prototype._addKeyPress=function(t,n){var r=this._map.get(t);if(void 0===r)return this._map.set(t,[n]),void this._addToLookupMap(n);for(var i=r.length-1;i>=0;i--){var o=r[i];if(o.command!==n.command){var s=o.keypressParts.length>1,a=n.keypressParts.length>1;s&&a&&o.keypressParts[1]!==n.keypressParts[1]||e.whenIsEntirelyIncluded(o.when,n.when)&&this._removeFromLookupMap(o)}}r.push(n),this._addToLookupMap(n)},e.prototype._addToLookupMap=function(e){if(e.command){var t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}},e.prototype._removeFromLookupMap=function(e){if(e.command){var t=this._lookupMap.get(e.command);if(void 0!==t)for(var n=0,r=t.length;n1&&null!==u.keypressParts[1]?{enterChord:!0,commandId:null,commandArgs:null,bubble:!1}:{enterChord:!1,commandId:u.command,commandArgs:u.commandArgs,bubble:u.bubble}:null},e.prototype._findCommand=function(t,n){for(var r=n.length-1;r>=0;r--){var i=n[r];if(e.contextMatchesRules(t,i.when))return i}return null},e.contextMatchesRules=function(e,t){return!t||t.evaluate(e)},e}(),Jv=function(e,t,n,r,i){this.resolvedKeybinding=e,this.keypressParts=e?function(e){for(var t=[],n=0,r=e.length;n1},t.prototype.getParts=function(){var e=this;return this._parts.map((function(t){return e._getPart(t)}))},t.prototype._getPart=function(e){return new gr(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))},t.prototype.getDispatchParts=function(){var e=this;return this._parts.map((function(t){return e._getDispatchPart(t)}))},t}(mr),sb=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ab=function(e){function t(t,n){return e.call(this,n,t.parts)||this}return sb(t,e),t.prototype._keyCodeToUILabel=function(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return tr.toString(e)},t.prototype._getLabel=function(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)},t.prototype._getAriaLabel=function(e){return e.isDuplicateModifierCase()?"":tr.toString(e.keyCode)},t.prototype._getDispatchPart=function(e){return t.getDispatchStr(e)},t.getDispatchStr=function(e){if(e.isModifierKey())return null;var t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=tr.toString(e.keyCode)},t}(ob),ub=pt("contextService");!function(e){e.isIWorkspace=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&Array.isArray(e.folders)}}(nb||(nb={})),(rb||(rb={})).isIWorkspaceFolder=function(e){return e&&"object"==typeof e&&it.isUri(e.uri)&&"string"==typeof e.name&&"function"==typeof e.toResource};!function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=null),this._id=e,this._configuration=n,this._foldersMap=qn.forPaths(),this.folders=t}Object.defineProperty(e.prototype,"folders",{get:function(){return this._folders},set:function(e){this._folders=e,this.updateFoldersMap()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._configuration},set:function(e){this._configuration=e},enumerable:!0,configurable:!0}),e.prototype.getFolder=function(e){return e&&this._foldersMap.findSubstr(e.with({scheme:e.scheme,authority:e.authority,path:e.path}).toString())||null},e.prototype.updateFoldersMap=function(){this._foldersMap=qn.forPaths();for(var e=0,t=this.folders;e=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},kb=function(e,t){return function(n,r){t(n,r,e)}},Lb=function(){function e(e){this.model=e,this._onDispose=new Ht}return Object.defineProperty(e.prototype,"textEditorModel",{get:function(){return this.model},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._onDispose.fire()},e}();function Mb(e,t,n){return(r=e)&&"function"==typeof r.getEditorType&&r.getEditorType()===Sc.ICodeEditor?t(e):n(e);var r}var Eb=function(){function e(){}return e.prototype.setEditor=function(e){this.editor=e},e.prototype.createModelReference=function(e){var t=this,n=null;return this.editor&&(n=Mb(this.editor,(function(n){return t.findModel(n,e)}),(function(n){return t.findModel(n.getOriginalEditor(),e)||t.findModel(n.getModifiedEditor(),e)}))),n?Promise.resolve(new Tt(new Lb(n))):Promise.reject(new Error("Model not found"))},e.prototype.findModel=function(e,t){var n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n},e}(),Db=function(){function e(){}return e.prototype.showWhile=function(e,t){return Promise.resolve(void 0)},e}(),Tb=function(){},Nb=function(){function e(){}return e.prototype.info=function(e){return this.notify({severity:Xg.Info,message:e})},e.prototype.warn=function(e){return this.notify({severity:Xg.Warning,message:e})},e.prototype.error=function(e){return this.notify({severity:Xg.Error,message:e})},e.prototype.notify=function(t){switch(t.severity){case Xg.Error:console.error(t.message);break;case Xg.Warning:console.warn(t.message);break;default:console.log(t.message)}return e.NO_OP},e.prototype.status=function(e,t){return Dt.None},e.NO_OP=new em,e}(),Ob=function(){function e(e){this._onWillExecuteCommand=new Ht,this._onDidExecuteCommand=new Ht,this._instantiationService=e,this._dynamicCommands=Object.create(null)}return e.prototype.addCommand=function(e){var t=this,n=e.id;return this._dynamicCommands[n]=e,Mt((function(){delete t._dynamicCommands[n]}))},e.prototype.executeCommand=function(e){for(var t=[],n=1;n.001){v=!1;break}}var x=!0;v&&_.width!==b&&(x=!1),_.width>m.width&&(x=!1);var k=Jd.INSTANCE.getTimeSinceLastZoomLevelChanged()>2e3;return new v_({zoomLevel:Xd(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:v,typicalHalfwidthCharacterWidth:r.width,typicalFullwidthCharacterWidth:i.width,canUseHalfwidthRightwardsArrow:x,spaceWidth:o.width,maxDigitWidth:y},k)},t.INSTANCE=new t,t}(Dt),Jb=function(e){function t(t,n,r,i){void 0===r&&(r=null);var o,s=e.call(this,t,n)||this;return s.accessibilityService=i,s._elementSizeObserver=s._register(new Kb(r,(function(){return s._onReferenceDomElementSizeChanged()}))),s._register(Zb.INSTANCE.onDidChange((function(){return s._onCSSBasedConfigurationChanged()}))),s._validatedOptions.automaticLayout&&s._elementSizeObserver.startObserving(),s._register((o=function(e){return s._recomputeOptions()},Jd.INSTANCE.onDidChangeZoomLevel(o))),s._register(s.accessibilityService.onDidChangeAccessibilitySupport((function(){return s._recomputeOptions()}))),s._recomputeOptions(),s}return Gb(t,e),t.applyFontInfoSlow=function(e,t){e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"},t.applyFontInfo=function(e,t){e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)},t.prototype._onReferenceDomElementSizeChanged=function(){this._recomputeOptions()},t.prototype._onCSSBasedConfigurationChanged=function(){this._recomputeOptions()},t.prototype.observeReferenceElement=function(e){this._elementSizeObserver.observe(e)},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._getExtraEditorClassName=function(){var e="";return sh||ah||(e+="no-user-select "),Ge.d&&(e+="mac "),e},t.prototype._getEnvConfiguration=function(){return{extraEditorClassName:this._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:ih||rh,pixelRatio:Jd.INSTANCE.getPixelRatio(),zoomLevel:Xd(),accessibilitySupport:this.accessibilityService.getAccessibilitySupport()}},t.prototype.readConfiguration=function(e){return Zb.INSTANCE.readConfiguration(e)},t}(Av),Xb=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qb=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.toClientCoordinates=function(){return new ew(this.x-af.scrollX,this.y-af.scrollY)},e}(),ew=function(){function e(e,t){this.clientX=e,this.clientY=t}return e.prototype.toPageCoordinates=function(){return new Qb(this.clientX+af.scrollX,this.clientY+af.scrollY)},e}(),tw=function(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r};function nw(e){var t=sf(e);return new tw(t.left,t.top,t.width,t.height)}var rw=function(e){function t(t,n){var r=e.call(this,t)||this;return r.pos=new Qb(r.posx,r.posy),r.editorPos=nw(n),r}return Xb(t,e),t}(Sh),iw=function(){function e(e){this._editorViewDomNode=e}return e.prototype._create=function(e){return new rw(e,this._editorViewDomNode)},e.prototype.onContextMenu=function(e,t){var n=this;return Bh(e,"contextmenu",(function(e){t(n._create(e))}))},e.prototype.onMouseUp=function(e,t){var n=this;return Bh(e,"mouseup",(function(e){t(n._create(e))}))},e.prototype.onMouseDown=function(e,t){var n=this;return Bh(e,"mousedown",(function(e){t(n._create(e))}))},e.prototype.onMouseLeave=function(e,t){var n=this;return Wh(e,(function(e){t(n._create(e))}))},e.prototype.onMouseMoveThrottled=function(e,t,n,r){var i=this;return tf(e,"mousemove",t,(function(e,t){return n(e,i._create(t))}),r)},e}(),ow=function(e){function t(t){var n=e.call(this)||this;return n._editorViewDomNode=t,n._globalMouseMoveMonitor=n._register(new Cp),n._keydownListener=null,n}return Xb(t,e),t.prototype.startMonitoring=function(e,t,n){var r=this;this._keydownListener=Hh(document,"keydown",(function(e){e.toKeybinding().isModifierKey()||r._globalMouseMoveMonitor.stopMonitoring(!0)}),!0);this._globalMouseMoveMonitor.startMonitoring((function(t,n){return e(t,new rw(n,r._editorViewDomNode))}),t,(function(){r._keydownListener.dispose(),n()}))},t}(Dt),sw=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),aw=function(e){function t(){var t=e.call(this)||this;return t._shouldRender=!0,t}return sw(t,e),t.prototype.shouldRender=function(){return this._shouldRender},t.prototype.forceShouldRender=function(){this._shouldRender=!0},t.prototype.setShouldRender=function(){this._shouldRender=!0},t.prototype.onDidRender=function(){this._shouldRender=!1},t.prototype.onConfigurationChanged=function(e){return!1},t.prototype.onCursorStateChanged=function(e){return!1},t.prototype.onDecorationsChanged=function(e){return!1},t.prototype.onFlushed=function(e){return!1},t.prototype.onFocusChanged=function(e){return!1},t.prototype.onLanguageConfigurationChanged=function(e){return!1},t.prototype.onLineMappingChanged=function(e){return!1},t.prototype.onLinesChanged=function(e){return!1},t.prototype.onLinesDeleted=function(e){return!1},t.prototype.onLinesInserted=function(e){return!1},t.prototype.onRevealRangeRequest=function(e){return!1},t.prototype.onScrollChanged=function(e){return!1},t.prototype.onTokensChanged=function(e){return!1},t.prototype.onTokensColorsChanged=function(e){return!1},t.prototype.onZonesChanged=function(e){return!1},t.prototype.onThemeChanged=function(e){return!1},t.prototype.handleEvents=function(e){for(var t=!1,n=0,r=e.length;n=u?i=Math.max(i,u+c-r):(t[n++]=new pw(r,i),r=u,i=c)}return t[n++]=new pw(r,i),t},e._createHorizontalRangesFromClientRects=function(e,t){if(!e||0===e.length)return null;for(var n=[],r=0,i=e.length;ra)return null;(t=Math.min(a,Math.max(0,t)))!==(r=Math.min(a,Math.max(0,r)))&&r>0&&0===i&&(r--,i=1073741824);var u=e.children[t].firstChild,c=e.children[r].firstChild;if(u&&c||(!u&&0===n&&t>0&&(u=e.children[t-1].firstChild,n=1073741824),!c&&0===i&&r>0&&(c=e.children[r-1].firstChild,i=1073741824)),!u||!c)return null;n=Math.min(u.textContent.length,Math.max(0,n)),i=Math.min(c.textContent.length,Math.max(0,i));var l=this._readClientRects(u,n,c,i,s);return this._createHorizontalRangesFromClientRects(l,o)},e}(),_w=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yw=!!Ge.e||!(Ge.c||rh||sh),vw=nh,bw=function(){function e(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}return Object.defineProperty(e.prototype,"clientRectDeltaLeft",{get:function(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft},enumerable:!0,configurable:!0}),e}(),ww=function(){function e(e,t){this.themeType=t,this.renderWhitespace=e.editor.viewInfo.renderWhitespace,this.renderControlCharacters=e.editor.viewInfo.renderControlCharacters,this.spaceWidth=e.editor.fontInfo.spaceWidth,this.useMonospaceOptimizations=e.editor.fontInfo.isMonospace&&!e.editor.viewInfo.disableMonospaceOptimizations,this.canUseHalfwidthRightwardsArrow=e.editor.fontInfo.canUseHalfwidthRightwardsArrow,this.lineHeight=e.editor.lineHeight,this.stopRenderingLineAfter=e.editor.viewInfo.stopRenderingLineAfter,this.fontLigatures=e.editor.viewInfo.fontLigatures}return e.prototype.equals=function(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures},e}(),Cw=function(){function e(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}return e.prototype.getDomNode=function(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null},e.prototype.setDomNode=function(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=bp(e)},e.prototype.onContentChanged=function(){this._isMaybeInvalid=!0},e.prototype.onTokensChanged=function(){this._isMaybeInvalid=!0},e.prototype.onDecorationsChanged=function(){this._isMaybeInvalid=!0},e.prototype.onOptionsChanged=function(e){this._isMaybeInvalid=!0,this._options=e},e.prototype.onSelectionChanged=function(){return!(!vw&&this._options.themeType!==Dd&&"selection"!==this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)},e.prototype.renderLine=function(t,n,r,i){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;var o=r.getViewLineRenderingData(t),s=this._options,a=xy.filter(o.inlineDecorations,t,o.minColumn,o.maxColumn),u=null;if(vw||s.themeType===Dd||"selection"===this._options.renderWhitespace)for(var c=0,l=r.selections;ct)){var h=d.startLineNumber===t?d.startColumn:o.minColumn,f=d.endLineNumber===t?d.endColumn:o.maxColumn;h');var g=Ay(p,i);i.appendASCIIString("");var m=null;return yw&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===g.containsForeignElements&&o.content.length<300&&p.lineTokens.getCount()<100&&(m=new Sw(this._renderedViewLine?this._renderedViewLine.domNode:null,p,g.characterMapping)),m||(m=Lw(this._renderedViewLine?this._renderedViewLine.domNode:null,p,g.characterMapping,g.containsRTL,g.containsForeignElements)),this._renderedViewLine=m,!0},e.prototype.layoutLine=function(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))},e.prototype.getWidth=function(){return this._renderedViewLine?this._renderedViewLine.getWidth():0},e.prototype.getWidthIsFast=function(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()},e.prototype.getVisibleRangesForRange=function(e,t,n){if(!this._renderedViewLine)return null;e|=0,t|=0,e=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,e)),t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t));var r=0|this._renderedViewLine.input.stopRenderingLineAfter;return-1!==r&&e>r&&t>r?null:(-1!==r&&e>r&&(e=r),-1!==r&&t>r&&(t=r),this._renderedViewLine.getVisibleRangesForRange(e,t,n))},e.prototype.getColumnOfNodeOffset=function(e,t,n){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,n):1},e.CLASS_NAME="view-line",e}(),Sw=function(){function e(e,t,n){this.domNode=e,this.input=t,this._characterMapping=n,this._charWidth=t.spaceWidth}return e.prototype.getWidth=function(){return this._getCharPosition(this._characterMapping.length)},e.prototype.getWidthIsFast=function(){return!0},e.prototype.getVisibleRangesForRange=function(e,t,n){var r=this._getCharPosition(e),i=this._getCharPosition(t);return[new pw(r,i-r)]},e.prototype._getCharPosition=function(e){var t=this._characterMapping.getAbsoluteOffsets();return 0===t.length?0:Math.round(this._charWidth*t[e-1])},e.prototype.getColumnOfNodeOffset=function(e,t,n){for(var r=t.textContent.length,i=-1;t;)t=t.previousSibling,i++;return this._characterMapping.partDataToCharOffset(i,r,n)+1},e}(),xw=function(){function e(e,t,n,r,i){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=i,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||0===this._characterMapping.length){this._pixelOffsetCache=new Int32Array(Math.max(2,this._characterMapping.length+1));for(var o=0,s=this._characterMapping.length;o<=s;o++)this._pixelOffsetCache[o]=-1}}return e.prototype._getReadingTarget=function(){return this.domNode.domNode.firstChild},e.prototype.getWidth=function(){return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget().offsetWidth),this._cachedWidth},e.prototype.getWidthIsFast=function(){return-1!==this._cachedWidth},e.prototype.getVisibleRangesForRange=function(e,t,n){if(null!==this._pixelOffsetCache){var r=this._readPixelOffset(e,n);if(-1===r)return null;var i=this._readPixelOffset(t,n);return-1===i?null:[new pw(r,i-r)]}return this._readVisibleRangesForRange(e,t,n)},e.prototype._readVisibleRangesForRange=function(e,t,n){if(e===t){var r=this._readPixelOffset(e,n);return-1===r?null:[new pw(r,0)]}return this._readRawVisibleRangesForRange(e,t,n)},e.prototype._readPixelOffset=function(e,t){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth()}if(null!==this._pixelOffsetCache){var n=this._pixelOffsetCache[e];if(-1!==n)return n;var r=this._actualReadPixelOffset(e,t);return this._pixelOffsetCache[e]=r,r}return this._actualReadPixelOffset(e,t)},e.prototype._actualReadPixelOffset=function(e,t){if(0===this._characterMapping.length){var n=mw.readHorizontalRanges(this._getReadingTarget(),0,0,0,0,t.clientRectDeltaLeft,t.endNode);return n&&0!==n.length?n[0].left:-1}if(e===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();var r=this._characterMapping.charOffsetToPartData(e-1),i=Ny.getPartIndex(r),o=Ny.getCharIndex(r),s=mw.readHorizontalRanges(this._getReadingTarget(),i,o,i,o,t.clientRectDeltaLeft,t.endNode);return s&&0!==s.length?s[0].left:-1},e.prototype._readRawVisibleRangesForRange=function(e,t,n){if(1===e&&t===this._characterMapping.length)return[new pw(0,this.getWidth())];var r=this._characterMapping.charOffsetToPartData(e-1),i=Ny.getPartIndex(r),o=Ny.getCharIndex(r),s=this._characterMapping.charOffsetToPartData(t-1),a=Ny.getPartIndex(s),u=Ny.getCharIndex(s);return mw.readHorizontalRanges(this._getReadingTarget(),i,o,a,u,n.clientRectDeltaLeft,n.endNode)},e.prototype.getColumnOfNodeOffset=function(e,t,n){for(var r=t.textContent.length,i=-1;t;)t=t.previousSibling,i++;return this._characterMapping.partDataToCharOffset(i,r,n)+1},e}(),kw=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _w(t,e),t.prototype._readVisibleRangesForRange=function(t,n,r){var i=e.prototype._readVisibleRangesForRange.call(this,t,n,r);if(!i||0===i.length||t===n||1===t&&n===this._characterMapping.length)return i;if(!this.input.containsRTL){var o=this._readPixelOffset(n,r);if(-1!==o){var s=i[i.length-1];s.left=4&&3===e[0]&&7===e[3]},e.isStrictChildOfViewLines=function(e){return e.length>4&&3===e[0]&&7===e[3]},e.isChildOfScrollableElement=function(e){return e.length>=2&&3===e[0]&&5===e[1]},e.isChildOfMinimap=function(e){return e.length>=2&&3===e[0]&&8===e[1]},e.isChildOfContentWidgets=function(e){return e.length>=4&&3===e[0]&&1===e[3]},e.isChildOfOverflowingContentWidgets=function(e){return e.length>=1&&2===e[0]},e.isChildOfOverlayWidgets=function(e){return e.length>=2&&3===e[0]&&4===e[1]},e}(),Ow=function(){function e(e,t,n){this.model=e.model,this.layoutInfo=e.configuration.editor.layoutInfo,this.viewDomNode=t.viewDomNode,this.lineHeight=e.configuration.editor.lineHeight,this.typicalHalfwidthCharacterWidth=e.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,this.lastViewCursorsRenderData=n,this._context=e,this._viewHelper=t}return e.prototype.getZoneAtCoord=function(t){return e.getZoneAtCoord(this._context,t)},e.getZoneAtCoord=function(e,t){var n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){var r=n.verticalOffset+n.height/2,i=e.model.getLineCount(),o=null,s=void 0,a=null;return n.afterLineNumber!==i&&(a=new _t(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(o=new _t(n.afterLineNumber,e.model.getLineMaxColumn(n.afterLineNumber))),s=null===a?o:null===o?a:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Rw._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))})),Iw={isAfterLines:!0};function Pw(e){return{isAfterLines:!1,horizontalDistanceToText:e}}var Rw=function(){function e(e,t){this._context=e,this._viewHelper=t}return e.prototype.mouseTargetIsWidget=function(e){var t=e.target,n=lw.collect(t,this._viewHelper.viewDomNode);return!(!Nw.isChildOfContentWidgets(n)&&!Nw.isChildOfOverflowingContentWidgets(n))||!!Nw.isChildOfOverlayWidgets(n)},e.prototype.createMouseTarget=function(t,n,r,i){var o=new Ow(this._context,this._viewHelper,t),s=new Aw(o,n,r,i);try{return e._createMouseTarget(o,s,!1)}catch(e){return s.fulfill(0)}},e._createMouseTarget=function(t,n,r){if(null===n.target){if(r)return n.fulfill(0);var i=e._doHitTest(t,n);return i.position?e.createMouseTargetFromHitTestPosition(t,n,i.position.lineNumber,i.position.column):this._createMouseTarget(t,n.withTarget(i.hitTarget),!0)}var o=n,s=null;return(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=s||e._hitTestContentWidget(t,o))||e._hitTestOverlayWidget(t,o))||e._hitTestMinimap(t,o))||e._hitTestScrollbarSlider(t,o))||e._hitTestViewZone(t,o))||e._hitTestMargin(t,o))||e._hitTestViewCursor(t,o))||e._hitTestTextArea(t,o))||e._hitTestViewLines(t,o,r))||e._hitTestScrollbar(t,o))||n.fulfill(0)},e._hitTestContentWidget=function(e,t){if(Nw.isChildOfContentWidgets(t.targetPath)||Nw.isChildOfOverflowingContentWidgets(t.targetPath)){var n=e.findAttribute(t.target,"widgetId");return n?t.fulfill(9,null,null,n):t.fulfill(0)}return null},e._hitTestOverlayWidget=function(e,t){if(Nw.isChildOfOverlayWidgets(t.targetPath)){var n=e.findAttribute(t.target,"widgetId");return n?t.fulfill(12,null,null,n):t.fulfill(0)}return null},e._hitTestViewCursor=function(e,t){if(t.target)for(var n=0,r=o=e.lastViewCursorsRenderData;ni.contentLeft+i.width)){var l=e.getVerticalOffsetForLineNumber(i.position.lineNumber);if(l<=a&&a<=l+i.height)return t.fulfill(6,i.position)}}return null},e._hitTestViewZone=function(e,t){var n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){var r=t.isInContentArea?8:5;return t.fulfill(r,n.position,null,n)}return null},e._hitTestTextArea=function(e,t){return Nw.isTextArea(t.targetPath)?t.fulfill(1):null},e._hitTestMargin=function(e,t){if(t.isInMarginArea){var n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=n.range.getStartPosition(),i=Math.abs(t.pos.x-t.editorPos.x),o={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:i};return(i-=e.layoutInfo.glyphMarginLeft)<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,r,n.range,o):(i-=e.layoutInfo.glyphMarginWidth)<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,r,n.range,o):(i-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,r,n.range,o))}return null},e._hitTestViewLines=function(t,n,r){if(!Nw.isChildOfViewLines(n.targetPath))return null;if(t.isAfterLines(n.mouseVerticalOffset)){var i=t.model.getLineCount(),o=t.model.getLineMaxColumn(i);return n.fulfill(7,new _t(i,o),void 0,Iw)}if(r){if(Nw.isStrictChildOfViewLines(n.targetPath)){var s=t.getLineNumberAtVerticalOffset(n.mouseVerticalOffset);if(0===t.model.getLineLength(s)){var a=t.getLineWidth(s),u=Pw(n.mouseContentHorizontalOffset-a);return n.fulfill(7,new _t(s,1),void 0,u)}}return n.fulfill(0)}var c=e._doHitTest(t,n);return c.position?e.createMouseTargetFromHitTestPosition(t,n,c.position.lineNumber,c.position.column):this._createMouseTarget(t,n.withTarget(c.hitTarget),!0)},e._hitTestMinimap=function(e,t){if(Nw.isChildOfMinimap(t.targetPath)){var n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.model.getLineMaxColumn(n);return t.fulfill(11,new _t(n,r))}return null},e._hitTestScrollbarSlider=function(e,t){if(Nw.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){var n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){var r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.model.getLineMaxColumn(r);return t.fulfill(11,new _t(r,i))}}return null},e._hitTestScrollbar=function(e,t){if(Nw.isChildOfScrollableElement(t.targetPath)){var n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.model.getLineMaxColumn(n);return t.fulfill(11,new _t(n,r))}return null},e.prototype.getMouseColumn=function(t,n){var r=this._context.configuration.editor.layoutInfo,i=this._context.viewLayout.getCurrentScrollLeft()+n.x-t.x-r.contentLeft;return e._getMouseColumn(i,this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth)},e._getMouseColumn=function(e,t){return e<0?1:Math.round(e/t)+1},e.createMouseTargetFromHitTestPosition=function(e,t,n,r){var i=new _t(n,r),o=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>o){if(th&&1===i.column){var s=Pw(t.mouseContentHorizontalOffset-o);return t.fulfill(7,new _t(n,e.model.getLineMaxColumn(n)),void 0,s)}var a=Pw(t.mouseContentHorizontalOffset-o);return t.fulfill(7,i,void 0,a)}var u=e.visibleRangeForPosition2(n,r);if(!u)return t.fulfill(0,i);var c=u.left;if(t.mouseContentHorizontalOffset===c)return t.fulfill(6,i);var l=[];if(l.push({offset:u.left,column:r}),r>1){var d=e.visibleRangeForPosition2(n,r-1);d&&l.push({offset:d.left,column:r-1})}if(r=t.editorPos.y+e.layoutInfo.height&&(i=t.editorPos.y+e.layoutInfo.height-1);var o=new Qb(t.pos.x,i),s=this._actualDoHitTestWithCaretRangeFromPoint(e,o.toClientCoordinates());return s.position?s:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())},e._actualDoHitTestWithCaretRangeFromPoint=function(e,t){var n=document.caretRangeFromPoint(t.clientX,t.clientY);if(!n||!n.startContainer)return{position:null,hitTarget:null};var r=n.startContainer,i=null;if(r.nodeType===r.TEXT_NODE){var o=(a=(s=r.parentNode)?s.parentNode:null)?a.parentNode:null;if((o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===Cw.CLASS_NAME)return{position:e.getPositionFromDOMInfo(s,n.startOffset),hitTarget:null};i=r.parentNode}else if(r.nodeType===r.ELEMENT_NODE){var s,a;if(((a=(s=r.parentNode)?s.parentNode:null)&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Cw.CLASS_NAME)return{position:e.getPositionFromDOMInfo(r,r.textContent.length),hitTarget:null};i=r}return{position:null,hitTarget:i}},e._doHitTestWithCaretPositionFromPoint=function(e,t){var n=document.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){var r=n.offsetNode.parentNode,i=r?r.parentNode:null,o=i?i.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===Cw.CLASS_NAME?{position:e.getPositionFromDOMInfo(n.offsetNode.parentNode,n.offset),hitTarget:null}:{position:null,hitTarget:n.offsetNode.parentNode}}return{position:null,hitTarget:n.offsetNode}},e._doHitTestWithMoveToPoint=function(e,t){var n=null,r=null,i=document.body.createTextRange();try{i.moveToPoint(t.clientX,t.clientY)}catch(e){return{position:null,hitTarget:null}}i.collapse(!0);var o=i?i.parentElement():null,s=o?o.parentNode:null,a=s?s.parentNode:null;if((a&&a.nodeType===a.ELEMENT_NODE?a.className:"")===Cw.CLASS_NAME){var u=i.duplicate();u.moveToElementText(o),u.setEndPoint("EndToStart",i),n=e.getPositionFromDOMInfo(o,u.text.length),u.moveToElementText(e.viewDomNode)}else r=o;return i.moveToElementText(e.viewDomNode),{position:n,hitTarget:r}},e._doHitTest=function(e,t){return document.caretRangeFromPoint?this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint?this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates()):document.body.createTextRange?this._doHitTestWithMoveToPoint(e,t.pos.toClientCoordinates()):{position:null,hitTarget:null}},e}(),Fw=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Yw(e){return function(t,n){var r=!1;return e&&(r=e.mouseTargetIsWidget(n)),r||n.preventDefault(),n}}var jw=function(e){function t(n,r,i){var o=e.call(this)||this;o._isFocused=!1,o._context=n,o.viewController=r,o.viewHelper=i,o.mouseTargetFactory=new Rw(o._context,i),o._mouseDownOperation=o._register(new Bw(o._context,o.viewController,o.viewHelper,(function(e,t){return o._createMouseTarget(e,t)}),(function(e){return o._getMouseColumn(e)}))),o._asyncFocus=o._register(new ks((function(){return o.viewHelper.focusTextArea()}),0)),o.lastMouseLeaveTime=-1;var s=new iw(o.viewHelper.viewDomNode);o._register(s.onContextMenu(o.viewHelper.viewDomNode,(function(e){return o._onContextMenu(e,!0)}))),o._register(s.onMouseMoveThrottled(o.viewHelper.viewDomNode,(function(e){return o._onMouseMove(e)}),Yw(o.mouseTargetFactory),t.MOUSE_MOVE_MINIMUM_TIME)),o._register(s.onMouseUp(o.viewHelper.viewDomNode,(function(e){return o._onMouseUp(e)}))),o._register(s.onMouseLeave(o.viewHelper.viewDomNode,(function(e){return o._onMouseLeave(e)}))),o._register(s.onMouseDown(o.viewHelper.viewDomNode,(function(e){return o._onMouseDown(e)})));return o._register(Bh(o.viewHelper.viewDomNode,nh?"mousewheel":"wheel",(function(e){if(o.viewController.emitMouseWheel(e),o._context.configuration.editor.viewInfo.mouseWheelZoom){var t=new xh(e);if(t.browserEvent.ctrlKey||t.browserEvent.metaKey){var n=h_.getZoomLevel(),r=t.deltaY>0?1:-1;h_.setZoomLevel(n+r),t.preventDefault(),t.stopPropagation()}}}),!0)),o._context.addEventHandler(o),o}return Fw(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onCursorStateChanged=function(e){return this._mouseDownOperation.onCursorStateChanged(e),!1},t.prototype.onFocusChanged=function(e){return this._isFocused=e.isFocused,!1},t.prototype.onScrollChanged=function(e){return this._mouseDownOperation.onScrollChanged(),!1},t.prototype.getTargetAtClientPoint=function(e,t){var n=new ew(e,t).toPageCoordinates(),r=nw(this.viewHelper.viewDomNode);if(n.yr.y+r.height||n.xr.x+r.width)return null;var i=this.viewHelper.getLastViewCursorsRenderData();return this.mouseTargetFactory.createMouseTarget(i,r,n,null)},t.prototype._createMouseTarget=function(e,t){var n=this.viewHelper.getLastViewCursorsRenderData();return this.mouseTargetFactory.createMouseTarget(n,e.editorPos,e.pos,t?e.target:null)},t.prototype._getMouseColumn=function(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)},t.prototype._onContextMenu=function(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})},t.prototype._onMouseMove=function(e){this._mouseDownOperation.isActive()||(e.timestampt.y+t.height){var a,u;o=r.getCurrentScrollTop()+(e.posy-t.y);if(a=Ow.getZoneAtCoord(this._context,o))if(u=this._helpPositionJumpOverViewZone(a))return new Tw(null,13,i,u);var c=r.getLineNumberAtVerticalOffset(o);return new Tw(null,13,i,new _t(c,n.getLineMaxColumn(c)))}var l=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+(e.posy-t.y));return e.posxt.x+t.width?new Tw(null,13,i,new _t(l,n.getLineMaxColumn(l))):null},t.prototype._findMousePosition=function(e,t){var n=this._getPositionOutsideEditor(e);if(n)return n;var r=this._createMouseTarget(e,t);if(!r.position)return null;if(8===r.type||5===r.type){var i=this._helpPositionJumpOverViewZone(r.detail);if(i)return new Tw(r.element,r.type,r.mouseColumn,i,null,r.detail)}return r},t.prototype._helpPositionJumpOverViewZone=function(e){var t=new _t(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,r=e.positionAfter;return n&&r?n.isBefore(t)?n:r:null},t.prototype._dispatchMouse=function(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton})},t}(Dt),Hw=function(){function e(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}return Object.defineProperty(e.prototype,"altKey",{get:function(){return this._altKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ctrlKey",{get:function(){return this._ctrlKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metaKey",{get:function(){return this._metaKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shiftKey",{get:function(){return this._shiftKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftButton",{get:function(){return this._leftButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"middleButton",{get:function(){return this._middleButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startedOnLineNumbers",{get:function(){return this._startedOnLineNumbers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._lastMouseDownCount},enumerable:!0,configurable:!0}),e.prototype.setModifiers=function(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey},e.prototype.setStartButtons=function(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton},e.prototype.setStartedOnLineNumbers=function(e){this._startedOnLineNumbers=e},e.prototype.trySetCount=function(t,n){var r=(new Date).getTime();r-this._lastSetMouseDownCountTime>e.CLEAR_MOUSE_DOWN_COUNT_TIME&&(t=1),this._lastSetMouseDownCountTime=r,t>this._lastMouseDownCount+1&&(t=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(n)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=n,this._lastMouseDownCount=Math.min(t,this._lastMouseDownPositionEqualCount)},e.CLEAR_MOUSE_DOWN_COUNT_TIME=400,e}(),Ww=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Vw(e,t){var n={translationY:t.translationY,translationX:t.translationX};return e&&(n.translationY+=e.translationY,n.translationX+=e.translationX),n}var zw=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.viewHelper.linesContentDomNode.style.msTouchAction="none",i.viewHelper.linesContentDomNode.style.msContentZooming="none",i._installGestureHandlerTimeout=window.setTimeout((function(){if(i._installGestureHandlerTimeout=-1,window.MSGesture){var e=new MSGesture,t=new MSGesture;e.target=i.viewHelper.linesContentDomNode,t.target=i.viewHelper.linesContentDomNode,i.viewHelper.linesContentDomNode.addEventListener("MSPointerDown",(function(n){var r=n.pointerType;r!==(n.MSPOINTER_TYPE_MOUSE||"mouse")?r===(n.MSPOINTER_TYPE_TOUCH||"touch")?(i._lastPointerType="touch",e.addPointer(n.pointerId)):(i._lastPointerType="pen",t.addPointer(n.pointerId)):i._lastPointerType="mouse"})),i._register(tf(i.viewHelper.linesContentDomNode,"MSGestureChange",(function(e){return i._onGestureChange(e)}),Vw)),i._register(Bh(i.viewHelper.linesContentDomNode,"MSGestureTap",(function(e){return i._onCaptureGestureTap(e)}),!0))}}),100),i._lastPointerType="mouse",i}return Ww(t,e),t.prototype._onMouseDown=function(t){"mouse"===this._lastPointerType&&e.prototype._onMouseDown.call(this,t)},t.prototype._onCaptureGestureTap=function(e){var t=this,n=new rw(e,this.viewHelper.viewDomNode),r=this._createMouseTarget(n,!1);r.position&&this.viewController.moveTo(r.position),n.browserEvent.fromElement?(n.preventDefault(),this.viewHelper.focusTextArea()):setTimeout((function(){t.viewHelper.focusTextArea()}))},t.prototype._onGestureChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t.prototype.dispose=function(){window.clearTimeout(this._installGestureHandlerTimeout),e.prototype.dispose.call(this)},t}(jw),Uw=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.viewHelper.linesContentDomNode.style.touchAction="none",i._installGestureHandlerTimeout=window.setTimeout((function(){if(i._installGestureHandlerTimeout=-1,window.MSGesture){var e=new MSGesture,t=new MSGesture;e.target=i.viewHelper.linesContentDomNode,t.target=i.viewHelper.linesContentDomNode,i.viewHelper.linesContentDomNode.addEventListener("pointerdown",(function(n){var r=n.pointerType;"mouse"!==r?"touch"===r?(i._lastPointerType="touch",e.addPointer(n.pointerId)):(i._lastPointerType="pen",t.addPointer(n.pointerId)):i._lastPointerType="mouse"})),i._register(tf(i.viewHelper.linesContentDomNode,"MSGestureChange",(function(e){return i._onGestureChange(e)}),Vw)),i._register(Bh(i.viewHelper.linesContentDomNode,"MSGestureTap",(function(e){return i._onCaptureGestureTap(e)}),!0))}}),100),i._lastPointerType="mouse",i}return Ww(t,e),t.prototype._onMouseDown=function(t){"mouse"===this._lastPointerType&&e.prototype._onMouseDown.call(this,t)},t.prototype._onCaptureGestureTap=function(e){var t=this,n=new rw(e,this.viewHelper.viewDomNode),r=this._createMouseTarget(n,!1);r.position&&this.viewController.moveTo(r.position),n.browserEvent.fromElement?(n.preventDefault(),this.viewHelper.focusTextArea()):setTimeout((function(){t.viewHelper.focusTextArea()}))},t.prototype._onGestureChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t.prototype.dispose=function(){window.clearTimeout(this._installGestureHandlerTimeout),e.prototype.dispose.call(this)},t}(jw),qw=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return ip.addTarget(i.viewHelper.linesContentDomNode),i._register(Bh(i.viewHelper.linesContentDomNode,tp.Tap,(function(e){return i.onTap(e)}))),i._register(Bh(i.viewHelper.linesContentDomNode,tp.Change,(function(e){return i.onChange(e)}))),i._register(Bh(i.viewHelper.linesContentDomNode,tp.Contextmenu,(function(e){return i._onContextMenu(new rw(e,i.viewHelper.viewDomNode),!1)}))),i}return Ww(t,e),t.prototype.onTap=function(e){e.preventDefault(),this.viewHelper.focusTextArea();var t=this._createMouseTarget(new rw(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.moveTo(t.position)},t.prototype.onChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t}(jw),Kw=function(e){function t(t,n,r){var i=e.call(this)||this;return window.navigator.msPointerEnabled?i.handler=i._register(new zw(t,n,r)):window.TouchEvent?i.handler=i._register(new qw(t,n,r)):window.navigator.pointerEnabled||window.PointerEvent?i.handler=i._register(new Uw(t,n,r)):i.handler=i._register(new jw(t,n,r)),i}return Ww(t,e),t.prototype.getTargetAtClientPoint=function(e,t){return this.handler.getTargetAtClientPoint(e,t)},t}(Dt),Gw=(n(391),function(){function e(e,t,n,r,i){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selectionStartPosition=r,this.selectionEndPosition=i}return e.prototype.toString=function(){return"[ <"+this.value+">, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"},e.readFromTextArea=function(t){return new e(t.getValue(),t.getSelectionStart(),t.getSelectionEnd(),null,null)},e.prototype.collapseSelection=function(){return new e(this.value,this.value.length,this.value.length,null,null)},e.prototype.writeToTextArea=function(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)},e.prototype.deduceEditorPosition=function(e){if(e<=this.selectionStart){var t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}var n=this.value.substring(this.selectionStart,e);if(-1===n.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,n,1);var r=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,r,-1)},e.prototype._finishDeduceEditorPosition=function(e,t,n){for(var r=0,i=-1;-1!==(i=t.indexOf("\n",i+1));)r++;return[e,n*t.length,r]},e.selectedText=function(t){return new e(t,0,t.length,null,null)},e.deduceInput=function(e,t,n,r){if(!e)return{text:"",replaceCharCnt:0};var i=e.value,o=e.selectionStart,s=e.selectionEnd,a=t.value,u=t.selectionStart,c=t.selectionEnd;r&&i.length>0&&o===s&&u===c&&!nn(a,i)&&rn(a,i)&&(o=0,s=0);var l=function(e,t){var n,r=Math.min(e.length,t.length),i=e.length-1,o=t.length-1;for(n=0;n0){var p=null;if(u===a.length?nn(a,i)&&(p=a.substring(i.length)):rn(a,i)&&(p=a.substring(0,a.length-i.length)),null!==p&&p.length>0&&(/\uFE0F/.test(p)||(d=p,bn.test(d))))return{text:p,replaceCharCnt:0}}return u===c?i===a&&0===o&&s===i.length&&u===a.length&&-1===a.indexOf("\n")&&function(e){for(var t=0,n=e.length;t500&&(d=d.substring(d.length-500,d.length)),g.length>500&&(g=g.substring(0,500)),o.length>1e3&&(o=o.substring(0,500)+String.fromCharCode(8230)+o.substring(o.length-500,o.length))}return new Gw(d+o+g,d.length,d.length+o.length,new _t(r.startLineNumber,r.startColumn),new _t(r.endLineNumber,r.endColumn))},e._LINES_PER_PAGE=10,e}(),Zw=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jw={forceCopyWithSyntaxHighlighting:!1},Xw=function(e){function t(t,n){var r=e.call(this)||this;r._onFocus=r._register(new Ht),r.onFocus=r._onFocus.event,r._onBlur=r._register(new Ht),r.onBlur=r._onBlur.event,r._onKeyDown=r._register(new Ht),r.onKeyDown=r._onKeyDown.event,r._onKeyUp=r._register(new Ht),r.onKeyUp=r._onKeyUp.event,r._onCut=r._register(new Ht),r.onCut=r._onCut.event,r._onPaste=r._register(new Ht),r.onPaste=r._onPaste.event,r._onType=r._register(new Ht),r.onType=r._onType.event,r._onCompositionStart=r._register(new Ht),r.onCompositionStart=r._onCompositionStart.event,r._onCompositionUpdate=r._register(new Ht),r.onCompositionUpdate=r._onCompositionUpdate.event,r._onCompositionEnd=r._register(new Ht),r.onCompositionEnd=r._onCompositionEnd.event,r._onSelectionChangeRequest=r._register(new Ht),r.onSelectionChangeRequest=r._onSelectionChangeRequest.event,r._host=t,r._textArea=r._register(new eC(n)),r._lastTextAreaEvent=0,r._asyncTriggerCut=r._register(new ks((function(){return r._onCut.fire()}),0)),r._textAreaState=Gw.EMPTY,r._selectionChangeListener=null,r.writeScreenReaderContent("ctor"),r._hasFocus=!1,r._isDoingComposition=!1,r._nextCommand=0,r._register(Hh(n.domNode,"keydown",(function(e){!r._isDoingComposition||109!==e.keyCode&&1!==e.keyCode||e.stopPropagation(),e.equals(9)&&e.preventDefault(),r._onKeyDown.fire(e)}))),r._register(Hh(n.domNode,"keyup",(function(e){r._onKeyUp.fire(e)}))),r._register(Bh(n.domNode,"compositionstart",(function(e){r._lastTextAreaEvent=1,r._isDoingComposition||(r._isDoingComposition=!0,nh||r._setAndWriteTextAreaState("compositionstart",Gw.EMPTY),r._onCompositionStart.fire())})));var i=function(e,t){var n=r._textAreaState,i=Gw.readFromTextArea(r._textArea);return[i,Gw.deduceInput(n,i,e,t)]},o=function(e){var t=r._textAreaState,n=Gw.selectedText(e);return[n,{text:n.value,replaceCharCnt:t.selectionEnd-t.selectionStart}]},s=function(e){return!(!nh||"ja"!==e)||!(!eh||0!==e.indexOf("zh-Han"))};return r._register(Bh(n.domNode,"compositionupdate",(function(e){if(r._lastTextAreaEvent=2,s(e.locale)){var t=i(!1,!1),n=t[0],a=t[1];return r._textAreaState=n,r._onType.fire(a),void r._onCompositionUpdate.fire(e)}var u=o(e.data),c=u[0],l=u[1];r._textAreaState=c,r._onType.fire(l),r._onCompositionUpdate.fire(e)}))),r._register(Bh(n.domNode,"compositionend",(function(e){if(r._lastTextAreaEvent=3,s(e.locale)){var t=i(!1,!1),n=t[0],a=t[1];r._textAreaState=n,r._onType.fire(a)}else{var u=o(e.data);n=u[0],a=u[1];r._textAreaState=n,r._onType.fire(a)}(nh||oh)&&(r._textAreaState=Gw.readFromTextArea(r._textArea)),r._isDoingComposition&&(r._isDoingComposition=!1,r._onCompositionEnd.fire())}))),r._register(Bh(n.domNode,"input",(function(){var e=8===r._lastTextAreaEvent;if(r._lastTextAreaEvent=4,r._textArea.setIgnoreSelectionChangeTime("received input event"),!r._isDoingComposition){var t=i(Ge.d,e&&Ge.d),n=t[0],o=t[1];0===o.replaceCharCnt&&1===o.text.length&&mn(o.text.charCodeAt(0))||(r._textAreaState=n,0===r._nextCommand?""!==o.text&&r._onType.fire(o):(""!==o.text&&r._onPaste.fire({text:o.text}),r._nextCommand=0))}}))),r._register(Bh(n.domNode,"cut",(function(e){r._lastTextAreaEvent=5,r._textArea.setIgnoreSelectionChangeTime("received cut event"),r._ensureClipboardGetsEditorSelection(e),r._asyncTriggerCut.schedule()}))),r._register(Bh(n.domNode,"copy",(function(e){r._lastTextAreaEvent=6,r._ensureClipboardGetsEditorSelection(e)}))),r._register(Bh(n.domNode,"paste",(function(e){if(r._lastTextAreaEvent=7,r._textArea.setIgnoreSelectionChangeTime("received paste event"),Qw.canUseTextData(e)){var t=Qw.getTextData(e);""!==t&&r._onPaste.fire({text:t})}else r._textArea.getSelectionStart()!==r._textArea.getSelectionEnd()&&r._setAndWriteTextAreaState("paste",Gw.EMPTY),r._nextCommand=1}))),r._register(Bh(n.domNode,"focus",(function(){r._lastTextAreaEvent=8,r._setHasFocus(!0)}))),r._register(Bh(n.domNode,"blur",(function(){r._lastTextAreaEvent=9,r._setHasFocus(!1)}))),r}return Zw(t,e),t.prototype._installSelectionChangeListener=function(){var e=this,t=0;return Bh(document,"selectionchange",(function(n){if(e._hasFocus&&!e._isDoingComposition&&oh&&Ge.g){var r=Date.now(),i=r-t;if(t=r,!(i<5)){var o=r-e._textArea.getIgnoreSelectionChangeTime();if(e._textArea.resetSelectionChangeTime(),!(o<100)&&e._textAreaState.selectionStartPosition&&e._textAreaState.selectionEndPosition){var s=e._textArea.getValue();if(e._textAreaState.value===s){var a=e._textArea.getSelectionStart(),u=e._textArea.getSelectionEnd();if(e._textAreaState.selectionStart!==a||e._textAreaState.selectionEnd!==u){var c=e._textAreaState.deduceEditorPosition(a),l=e._host.deduceModelPosition(c[0],c[1],c[2]),d=e._textAreaState.deduceEditorPosition(u),h=e._host.deduceModelPosition(d[0],d[1],d[2]),f=new Or(l.lineNumber,l.column,h.lineNumber,h.column);e._onSelectionChangeRequest.fire(f)}}}}}}))},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)},t.prototype.focusTextArea=function(){this._setHasFocus(!0)},t.prototype.isFocused=function(){return this._hasFocus},t.prototype._setHasFocus=function(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&(th?this._setAndWriteTextAreaState("focusgain",Gw.EMPTY):this.writeScreenReaderContent("focusgain")),this._hasFocus?this._onFocus.fire():this._onBlur.fire())},t.prototype._setAndWriteTextAreaState=function(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t},t.prototype.writeScreenReaderContent=function(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))},t.prototype._ensureClipboardGetsEditorSelection=function(e){var t=this._host.getPlainTextToCopy();if(Qw.canUseTextData(e)){var n=null;(function(){if(eh)return!1;if(th){var e=Qd.indexOf("Edge/"),t=parseInt(Qd.substring(e+5,Qd.indexOf(".",e)),10);if(!t||t>=12&&t<=16)return!1}return!0})()&&(t.length<65536||Jw.forceCopyWithSyntaxHighlighting)&&(n=this._host.getHTMLToCopy()),Qw.setTextData(e,t,n)}else this._setAndWriteTextAreaState("copy or cut",Gw.selectedText(t))},t}(Dt),Qw=function(){function e(){}return e.canUseTextData=function(e){return!!e.clipboardData||!!window.clipboardData},e.getTextData=function(e){if(e.clipboardData)return e.preventDefault(),e.clipboardData.getData("text/plain");if(window.clipboardData)return e.preventDefault(),window.clipboardData.getData("Text");throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")},e.setTextData=function(e,t,n){if(e.clipboardData)return e.clipboardData.setData("text/plain",t),null!==n&&e.clipboardData.setData("text/html",n),void e.preventDefault();if(window.clipboardData)return window.clipboardData.setData("Text",t),void e.preventDefault();throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")},e}(),eC=function(e){function t(t){var n=e.call(this)||this;return n._actual=t,n._ignoreSelectionChangeTime=0,n}return Zw(t,e),t.prototype.setIgnoreSelectionChangeTime=function(e){this._ignoreSelectionChangeTime=Date.now()},t.prototype.getIgnoreSelectionChangeTime=function(){return this._ignoreSelectionChangeTime},t.prototype.resetSelectionChangeTime=function(){this._ignoreSelectionChangeTime=0},t.prototype.getValue=function(){return this._actual.domNode.value},t.prototype.setValue=function(e,t){var n=this._actual.domNode;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.value=t)},t.prototype.getSelectionStart=function(){return this._actual.domNode.selectionStart},t.prototype.getSelectionEnd=function(){return this._actual.domNode.selectionEnd},t.prototype.setSelectionRange=function(e,t,n){var r=this._actual.domNode,i=document.activeElement===r,o=r.selectionStart,s=r.selectionEnd;if(i&&o===t&&s===n)rh&&window.parent!==window&&r.focus();else{if(i)return this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,n),void(rh&&window.parent!==window&&r.focus());try{var a=function(e){for(var t=[],n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)t[n]=e.scrollTop,e=e.parentNode;return t}(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,n),function(e,t){for(var n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)e.scrollTop!==t[n]&&(e.scrollTop=t[n]),e=e.parentNode}(r,a)}catch(e){}}},t}(Dt),tC=(n(392),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),nC=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tC(t,e),t}(aw),rC=zc("editor.lineHighlightBackground",{dark:null,light:null,hc:null},we("lineHighlight","Background color for the highlight of line at the cursor position.")),iC=zc("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},we("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),oC=zc("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},we("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),sC=zc("editor.rangeHighlightBorder",{dark:null,light:null,hc:Jc},we("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),aC=zc("editorCursor.foreground",{dark:"#AEAFAD",light:xu.black,hc:xu.white},we("caret","Color of the editor cursor.")),uC=zc("editorCursor.background",null,we("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),cC=zc("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},we("editorWhitespaces","Color of whitespace characters in the editor.")),lC=zc("editorIndentGuide.background",{dark:cC,light:cC,hc:cC},we("editorIndentGuides","Color of the editor indentation guides.")),dC=zc("editorIndentGuide.activeBackground",{dark:cC,light:cC,hc:cC},we("editorActiveIndentGuide","Color of the active editor indentation guides.")),hC=zc("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:xu.white},we("editorLineNumbers","Color of editor line numbers.")),fC=zc("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:Jc},we("editorActiveLineNumber","Color of editor active line number"),!1,we("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),pC=zc("editorLineNumber.activeForeground",{dark:fC,light:fC,hc:fC},we("editorActiveLineNumber","Color of editor active line number")),gC=zc("editorRuler.foreground",{dark:"#5A5A5A",light:xu.lightgrey,hc:xu.white},we("editorRuler","Color of the editor rulers.")),mC=(zc("editorCodeLens.foreground",{dark:"#999999",light:"#999999",hc:"#999999"},we("editorCodeLensForeground","Foreground color of editor code lenses")),zc("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},we("editorBracketMatchBackground","Background color behind matching brackets")),zc("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:Zc},we("editorBracketMatchBorder","Color for matching brackets boxes")),zc("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},we("editorOverviewRulerBorder","Color of the overview ruler border."))),_C=zc("editorGutter.background",{dark:Gl,light:Gl,hc:Gl},we("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),yC=zc("editorUnnecessaryCode.border",{dark:null,light:null,hc:xu.fromHex("#fff").transparent(.8)},we("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),vC=zc("editorUnnecessaryCode.opacity",{dark:xu.fromHex("#000a"),light:xu.fromHex("#0007"),hc:null},we("unnecessaryCodeOpacity","Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.")),bC=zc("editorOverviewRuler.errorForeground",{dark:new xu(new wu(255,18,18,.7)),light:new xu(new wu(255,18,18,.7)),hc:new xu(new wu(255,50,50,1))},we("overviewRuleError","Overview ruler marker color for errors.")),wC=zc("editorOverviewRuler.warningForeground",{dark:Wl,light:Wl,hc:Vl},we("overviewRuleWarning","Overview ruler marker color for warnings.")),CC=zc("editorOverviewRuler.infoForeground",{dark:zl,light:zl,hc:Ul},we("overviewRuleInfo","Overview ruler marker color for infos."));Ad((function(e,t){var n=e.getColor(Gl);n&&t.addRule(".monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: "+n+"; }");var r=e.getColor($l);r&&t.addRule(".monaco-editor, .monaco-editor .inputarea.ime-input { color: "+r+"; }");var i=e.getColor(_C);i&&t.addRule(".monaco-editor .margin { background-color: "+i+"; }");var o=e.getColor(oC);o&&t.addRule(".monaco-editor .rangeHighlight { background-color: "+o+"; }");var s=e.getColor(sC);s&&t.addRule(".monaco-editor .rangeHighlight { border: 1px "+("hc"===e.type?"dotted":"solid")+" "+s+"; }");var a=e.getColor(cC);a&&t.addRule(".vs-whitespace { color: "+a+" !important; }")}));var SC=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xC=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._readConfig(),n._lastCursorModelPosition=new _t(1,1),n._renderResult=null,n._context.addEventHandler(n),n}return SC(t,e),t.prototype._readConfig=function(){var e=this._context.configuration.editor;this._lineHeight=e.lineHeight,this._renderLineNumbers=e.viewInfo.renderLineNumbers,this._renderCustomLineNumbers=e.viewInfo.renderCustomLineNumbers,this._renderFinalNewline=e.viewInfo.renderFinalNewline,this._lineNumbersLeft=e.layoutInfo.lineNumbersLeft,this._lineNumbersWidth=e.layoutInfo.lineNumbersWidth},t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return this._readConfig(),!0},t.prototype.onCursorStateChanged=function(e){var t=e.selections[0].getPosition();return this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t),2===this._renderLineNumbers||3===this._renderLineNumbers},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._getLineRenderLineNumber=function(e){var t=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new _t(e,1));if(1!==t.column)return"";var n=t.lineNumber;if(!this._renderFinalNewline){var r=this._context.model.getLineCount(),i=this._context.model.getLineContent(n);if(n===r&&""===i)return""}if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(2===this._renderLineNumbers){var o=Math.abs(this._lastCursorModelPosition.lineNumber-n);return 0===o?''+n+"":String(o)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===n?String(n):n%10==0?String(n):"":String(n)},t.prototype.prepareRender=function(e){if(0!==this._renderLineNumbers){for(var n=Ge.c?this._lineHeight%2==0?" lh-even":" lh-odd":"",r=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,o='
',s=[],a=r;a<=i;a++){var u=a-r,c=this._getLineRenderLineNumber(a);s[u]=c?o+c+"
":""}this._renderResult=s}else this._renderResult=null},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t.CLASS_NAME="line-numbers",t}(nC);Ad((function(e,t){var n=e.getColor(hC);n&&t.addRule(".monaco-editor .line-numbers { color: "+n+"; }");var r=e.getColor(pC);r&&t.addRule(".monaco-editor .current-line ~ .line-numbers { color: "+r+"; }")}));var kC=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),LC=function(e){function t(n){var r=e.call(this,n)||this;return r._canUseLayerHinting=r._context.configuration.editor.canUseLayerHinting,r._contentLeft=r._context.configuration.editor.layoutInfo.contentLeft,r._glyphMarginLeft=r._context.configuration.editor.layoutInfo.glyphMarginLeft,r._glyphMarginWidth=r._context.configuration.editor.layoutInfo.glyphMarginWidth,r._domNode=bp(document.createElement("div")),r._domNode.setClassName(t.OUTER_CLASS_NAME),r._domNode.setPosition("absolute"),r._domNode.setAttribute("role","presentation"),r._domNode.setAttribute("aria-hidden","true"),r._glyphMarginBackgroundDomNode=bp(document.createElement("div")),r._glyphMarginBackgroundDomNode.setClassName(t.CLASS_NAME),r._domNode.appendChild(r._glyphMarginBackgroundDomNode),r}return kC(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){return e.canUseLayerHinting&&(this._canUseLayerHinting=this._context.configuration.editor.canUseLayerHinting),e.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft,this._glyphMarginLeft=this._context.configuration.editor.layoutInfo.glyphMarginLeft,this._glyphMarginWidth=this._context.configuration.editor.layoutInfo.glyphMarginWidth),!0},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollTopChanged},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setLayerHinting(this._canUseLayerHinting);var t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);var n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)},t.CLASS_NAME="glyph-margin",t.OUTER_CLASS_NAME="margin",t}(cw),MC=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),EC=function(e){this.type=1,this.canUseLayerHinting=e.canUseLayerHinting,this.pixelRatio=e.pixelRatio,this.editorClassName=e.editorClassName,this.lineHeight=e.lineHeight,this.readOnly=e.readOnly,this.accessibilitySupport=e.accessibilitySupport,this.emptySelectionClipboard=e.emptySelectionClipboard,this.copyWithSyntaxHighlighting=e.copyWithSyntaxHighlighting,this.layoutInfo=e.layoutInfo,this.fontInfo=e.fontInfo,this.viewInfo=e.viewInfo,this.wrappingInfo=e.wrappingInfo},DC=function(e){this.type=2,this.selections=e},TC=function(){this.type=3},NC=function(){this.type=4},OC=function(e){this.type=5,this.isFocused=e},AC=function(){this.type=6},IC=function(e,t){this.type=7,this.fromLineNumber=e,this.toLineNumber=t},PC=function(e,t){this.type=8,this.fromLineNumber=e,this.toLineNumber=t},RC=function(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t},FC=function(e,t,n,r){this.type=10,this.range=e,this.verticalType=t,this.revealHorizontal=n,this.scrollType=r},YC=function(e){this.type=11,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged},jC=function(e){this.type=12,this.ranges=e},BC=function(){this.type=15},HC=function(){this.type=13},WC=function(){this.type=14},VC=function(){this.type=16},zC=function(e){function t(){var t=e.call(this)||this;return t._listeners=[],t._collector=null,t._collectorCnt=0,t}return MC(t,e),t.prototype.dispose=function(){this._listeners=[],e.prototype.dispose.call(this)},t.prototype._beginEmit=function(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new UC),this._collector},t.prototype._endEmit=function(){if(this._collectorCnt--,0===this._collectorCnt){var e=this._collector.finalize();this._collector=null,e.length>0&&this._emit(e)}},t.prototype._emit=function(e){for(var t=this._listeners.slice(0),n=0,r=t.length;n0)return new Gw(r,r.length,r.length,n,n)}}return Gw.EMPTY}return $w.fromEditorSelection(e,s,i._selections[0],0===i._accessibilitySupport)},deduceModelPosition:function(e,t,n){return i._context.model.deduceModelPositionRelativeToViewPosition(e,t,n)}};return i._textAreaInput=i._register(new Xw(a,i.textArea)),i._register(i._textAreaInput.onKeyDown((function(e){i._viewController.emitKeyDown(e)}))),i._register(i._textAreaInput.onKeyUp((function(e){i._viewController.emitKeyUp(e)}))),i._register(i._textAreaInput.onPaste((function(e){var t=ZC.INSTANCE.get(e.text),n=!1,r=null;t&&(n=i._emptySelectionClipboard&&t.isFromEmptySelection,r=t.multicursorText),i._viewController.paste("keyboard",e.text,n,r)}))),i._register(i._textAreaInput.onCut((function(){i._viewController.cut("keyboard")}))),i._register(i._textAreaInput.onType((function(e){e.replaceCharCnt?i._viewController.replacePreviousChar("keyboard",e.text,e.replaceCharCnt):i._viewController.type("keyboard",e.text)}))),i._register(i._textAreaInput.onSelectionChangeRequest((function(e){i._viewController.setSelection("keyboard",e)}))),i._register(i._textAreaInput.onCompositionStart((function(){var e=i._selections[0].startLineNumber,t=i._selections[0].startColumn;i._context.privateViewEventBus.emit(new FC(new Tr(e,t,e,t),0,!0,1));var n=i._viewHelper.visibleRangeForPositionRelativeToEditor(e,t);n&&(i._visibleTextArea=new GC(i._context.viewLayout.getVerticalOffsetForLineNumber(e),n.left,$C?0:1),i._render()),i.textArea.setClassName("inputarea ime-input"),i._viewController.compositionStart("keyboard")}))),i._register(i._textAreaInput.onCompositionUpdate((function(e){i._visibleTextArea=nh?i._visibleTextArea.setWidth(0):i._visibleTextArea.setWidth(function(e,t){var n=document.createElement("canvas").getContext("2d");n.font=(r=t,i="normal",o=r.fontWeight,s=r.fontSize,a=r.lineHeight,u=r.fontFamily,i+" normal "+o+" "+s+"px / "+a+"px "+u);var r,i,o,s,a,u;var c=n.measureText(e);return rh?c.width+2:c.width}(e.data,i._fontInfo)),i._render()}))),i._register(i._textAreaInput.onCompositionEnd((function(){i._visibleTextArea=null,i._render(),i.textArea.setClassName("inputarea"),i._viewController.compositionEnd("keyboard")}))),i._register(i._textAreaInput.onFocus((function(){i._context.privateViewEventBus.emit(new OC(!0))}))),i._register(i._textAreaInput.onBlur((function(){i._context.privateViewEventBus.emit(new OC(!1))}))),i}return KC(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._getWordBeforePosition=function(e){for(var t=this._context.model.getLineContent(e.lineNumber),n=yo(this._context.configuration.editor.wordSeparators),r=e.column,i=0;r>1;){var o=t.charCodeAt(r-2);if(0!==n.get(o)||i>50)return t.substring(r-1,e.column-1);i++,r--}return t.substring(0,e.column-1)},t.prototype._getCharacterBeforePosition=function(e){if(e.column>1){var t=this._context.model.getLineContent(e.lineNumber).charAt(e.column-2);if(!mn(t.charCodeAt(0)))return t}return""},t.prototype.onConfigurationChanged=function(e){var t=this._context.configuration.editor;return e.fontInfo&&(this._fontInfo=t.fontInfo),e.viewInfo&&this.textArea.setAttribute("aria-label",t.viewInfo.ariaLabel),e.layoutInfo&&(this._contentLeft=t.layoutInfo.contentLeft,this._contentWidth=t.layoutInfo.contentWidth,this._contentHeight=t.layoutInfo.contentHeight),e.lineHeight&&(this._lineHeight=t.lineHeight),e.accessibilitySupport&&(this._accessibilitySupport=t.accessibilitySupport,this._textAreaInput.writeScreenReaderContent("strategy changed")),e.emptySelectionClipboard&&(this._emptySelectionClipboard=t.emptySelectionClipboard),e.copyWithSyntaxHighlighting&&(this._copyWithSyntaxHighlighting=t.copyWithSyntaxHighlighting),!0},t.prototype.onCursorStateChanged=function(e){return this._selections=e.selections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0},t.prototype.onZonesChanged=function(e){return!0},t.prototype.isFocused=function(){return this._textAreaInput.isFocused()},t.prototype.focusTextArea=function(){this._textAreaInput.focusTextArea()},t.prototype.prepareRender=function(e){var t=new _t(this._selections[0].positionLineNumber,this._selections[0].positionColumn);this._primaryCursorVisibleRange=e.visibleRangeForPosition(t)},t.prototype.render=function(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()},t.prototype._render=function(){if(this._visibleTextArea)this._renderInsideEditor(this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight,!0);else if(this._primaryCursorVisibleRange){var e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth)this._renderAtTopLeft();else{var t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;t<0||t>this._contentHeight?this._renderAtTopLeft():this._renderInsideEditor(t,e,$C?0:1,$C?0:1,!1)}}else this._renderAtTopLeft()},t.prototype._renderInsideEditor=function(e,t,n,r,i){var o=this.textArea,s=this.textAreaCover;i?Jb.applyFontInfo(o,this._fontInfo):(o.setFontSize(1),o.setLineHeight(this._fontInfo.lineHeight)),o.setTop(e),o.setLeft(t),o.setWidth(n),o.setHeight(r),s.setTop(0),s.setLeft(0),s.setWidth(0),s.setHeight(0)},t.prototype._renderAtTopLeft=function(){var e=this.textArea,t=this.textAreaCover;if(Jb.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),$C)return e.setWidth(0),e.setHeight(0),t.setWidth(0),void t.setHeight(0);e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1),this._context.configuration.editor.viewInfo.glyphMargin?t.setClassName("monaco-editor-background textAreaCover "+LC.OUTER_CLASS_NAME):0!==this._context.configuration.editor.viewInfo.renderLineNumbers?t.setClassName("monaco-editor-background textAreaCover "+xC.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")},t}(cw);var XC=function(){function e(e,t,n,r){this.configuration=e,this.viewModel=t,this.outgoingEvents=n,this.commandDelegate=r}return e.prototype._execMouseCommand=function(e,t){t.source="mouse",this.commandDelegate.executeEditorCommand(e,t)},e.prototype.paste=function(e,t,n,r){this.commandDelegate.paste(e,t,n,r)},e.prototype.type=function(e,t){this.commandDelegate.type(e,t)},e.prototype.replacePreviousChar=function(e,t,n){this.commandDelegate.replacePreviousChar(e,t,n)},e.prototype.compositionStart=function(e){this.commandDelegate.compositionStart(e)},e.prototype.compositionEnd=function(e){this.commandDelegate.compositionEnd(e)},e.prototype.cut=function(e){this.commandDelegate.cut(e)},e.prototype.setSelection=function(e,t){this.commandDelegate.executeEditorCommand(Dc.SetSelection,{source:e,selection:t})},e.prototype._validateViewColumn=function(e){var t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):2===e.mouseDownCount?this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!1):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)},e.prototype._usualArgs=function(e){return e=this._validateViewColumn(e),{position:this._convertViewToModelPosition(e),viewPosition:e}},e.prototype.moveTo=function(e){this._execMouseCommand(Dc.MoveTo,this._usualArgs(e))},e.prototype._moveToSelect=function(e){this._execMouseCommand(Dc.MoveToSelect,this._usualArgs(e))},e.prototype._columnSelect=function(e,t,n){e=this._validateViewColumn(e),this._execMouseCommand(Dc.ColumnSelect,{position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,setAnchorIfNotSet:n})},e.prototype._createCursor=function(e,t){e=this._validateViewColumn(e),this._execMouseCommand(Dc.CreateCursor,{position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})},e.prototype._lastCursorMoveToSelect=function(e){this._execMouseCommand(Dc.LastCursorMoveToSelect,this._usualArgs(e))},e.prototype._wordSelect=function(e){this._execMouseCommand(Dc.WordSelect,this._usualArgs(e))},e.prototype._wordSelectDrag=function(e){this._execMouseCommand(Dc.WordSelectDrag,this._usualArgs(e))},e.prototype._lastCursorWordSelect=function(e){this._execMouseCommand(Dc.LastCursorWordSelect,this._usualArgs(e))},e.prototype._lineSelect=function(e){this._execMouseCommand(Dc.LineSelect,this._usualArgs(e))},e.prototype._lineSelectDrag=function(e){this._execMouseCommand(Dc.LineSelectDrag,this._usualArgs(e))},e.prototype._lastCursorLineSelect=function(e){this._execMouseCommand(Dc.LastCursorLineSelect,this._usualArgs(e))},e.prototype._lastCursorLineSelectDrag=function(e){this._execMouseCommand(Dc.LastCursorLineSelectDrag,this._usualArgs(e))},e.prototype._selectAll=function(){this._execMouseCommand(Dc.SelectAll,{})},e.prototype._convertViewToModelPosition=function(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)},e.prototype.emitKeyDown=function(e){this.outgoingEvents.emitKeyDown(e)},e.prototype.emitKeyUp=function(e){this.outgoingEvents.emitKeyUp(e)},e.prototype.emitContextMenu=function(e){this.outgoingEvents.emitContextMenu(e)},e.prototype.emitMouseMove=function(e){this.outgoingEvents.emitMouseMove(e)},e.prototype.emitMouseLeave=function(e){this.outgoingEvents.emitMouseLeave(e)},e.prototype.emitMouseUp=function(e){this.outgoingEvents.emitMouseUp(e)},e.prototype.emitMouseDown=function(e){this.outgoingEvents.emitMouseDown(e)},e.prototype.emitMouseDrag=function(e){this.outgoingEvents.emitMouseDrag(e)},e.prototype.emitMouseDrop=function(e){this.outgoingEvents.emitMouseDrop(e)},e.prototype.emitMouseWheel=function(e){this.outgoingEvents.emitMouseWheel(e)},e}(),QC=function(){function e(e){this._createLine=e,this._set(1,[])}return e.prototype.flush=function(){this._set(1,[])},e.prototype._set=function(e,t){this._lines=t,this._rendLineNumberStart=e},e.prototype._get=function(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}},e.prototype.getStartLineNumber=function(){return this._rendLineNumberStart},e.prototype.getEndLineNumber=function(){return this._rendLineNumberStart+this._lines.length-1},e.prototype.getCount=function(){return this._lines.length},e.prototype.getLine=function(e){var t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]},e.prototype.onLinesDeleted=function(e,t){if(0===this.getCount())return null;var n=this.getStartLineNumber(),r=this.getEndLineNumber();if(tr)return null;for(var o=0,s=0,a=n;a<=r;a++){var u=a-this._rendLineNumberStart;e<=a&&a<=t&&(0===s?(o=u,s=1):s++)}if(e=n&&o<=r&&(this._lines[o-this._rendLineNumberStart].onContentChanged(),i=!0);return i},e.prototype.onLinesInserted=function(e,t){if(0===this.getCount())return null;var n=t-e+1,r=this.getStartLineNumber(),i=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=n,null;if(e>i)return null;if(n+e>i)return this._lines.splice(e-this._rendLineNumberStart,i-e+1);for(var o=[],s=0;sn))for(var a=Math.max(t,s.fromLineNumber),u=Math.min(n,s.toLineNumber),c=a;c<=u;c++){var l=c-this._rendLineNumberStart;this._lines[l].onTokensChanged(),r=!0}}return r},e}(),eS=function(){function e(e){var t=this;this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new QC((function(){return t._host.createVisibleLine()}))}return e.prototype._createDomNode=function(){var e=bp(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e},e.prototype.onConfigurationChanged=function(e){return e.layoutInfo},e.prototype.onFlushed=function(e){return this._linesCollection.flush(),!0},e.prototype.onLinesChanged=function(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)},e.prototype.onLinesDeleted=function(e){var t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(var n=0,r=t.length;nt)(u=t)<=(s=Math.min(n,i.rendLineNumberStart-1))&&(this._insertLinesBefore(i,u,s,r,t),i.linesLength+=s-u+1);else if(i.rendLineNumberStart0&&(this._removeLinesBefore(i,a),i.linesLength-=a)}if(i.rendLineNumberStart=t,i.rendLineNumberStart+i.linesLength-1n){var s,a,u=Math.max(0,n-i.rendLineNumberStart+1);(a=(s=i.linesLength-1)-u+1)>0&&(this._removeLinesAfter(i,a),i.linesLength-=a)}return this._finishRendering(i,!1,r),i},e.prototype._renderUntouchedLines=function(e,t,n,r,i){for(var o=e.rendLineNumberStart,s=e.lines,a=t;a<=n;a++){var u=o+a;s[a].layoutLine(u,r[u-i])}},e.prototype._insertLinesBefore=function(e,t,n,r,i){for(var o=[],s=0,a=t;a<=n;a++)o[s++]=this.host.createVisibleLine();e.lines=o.concat(e.lines)},e.prototype._removeLinesBefore=function(e,t){for(var n=0;n=0;s--){var a=e.lines[s];r[s]&&(a.setDomNode(o),o=o.previousSibling)}},e.prototype._finishRenderingInvalidLines=function(e,t,n){var r=document.createElement("div");r.innerHTML=t;for(var i=0;i'),r.appendASCIIString(i),r.appendASCIIString(""),!0)},e.prototype.layoutLine=function(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))},e}(),oS=function(e){function t(t){var n=e.call(this,t)||this;return n._contentWidth=n._context.configuration.editor.layoutInfo.contentWidth,n.domNode.setHeight(0),n}return nS(t,e),t.prototype.onConfigurationChanged=function(t){return t.layoutInfo&&(this._contentWidth=this._context.configuration.editor.layoutInfo.contentWidth),e.prototype.onConfigurationChanged.call(this,t)},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollWidthChanged},t.prototype._viewOverlaysRender=function(t){e.prototype._viewOverlaysRender.call(this,t),this.domNode.setWidth(Math.max(t.scrollWidth,this._contentWidth))},t}(rS),sS=function(e){function t(t){var n=e.call(this,t)||this;return n._contentLeft=n._context.configuration.editor.layoutInfo.contentLeft,n.domNode.setClassName("margin-view-overlays"),n.domNode.setWidth(1),Jb.applyFontInfo(n.domNode,n._context.configuration.editor.fontInfo),n}return nS(t,e),t.prototype.onConfigurationChanged=function(t){var n=!1;return t.fontInfo&&(Jb.applyFontInfo(this.domNode,this._context.configuration.editor.fontInfo),n=!0),t.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft,n=!0),e.prototype.onConfigurationChanged.call(this,t)||n},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollHeightChanged},t.prototype._viewOverlaysRender=function(t){e.prototype._viewOverlaysRender.call(this,t);var n=Math.min(t.scrollHeight,1e6);this.domNode.setHeight(n),this.domNode.setWidth(this._contentLeft)},t}(rS),aS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uS=function(e,t){this.top=e,this.left=t},cS=function(e){function t(t,n){var r=e.call(this,t)||this;return r._viewDomNode=n,r._widgets={},r.domNode=bp(document.createElement("div")),lw.write(r.domNode,1),r.domNode.setClassName("contentWidgets"),r.domNode.setPosition("absolute"),r.domNode.setTop(0),r.overflowingContentWidgetsDomNode=bp(document.createElement("div")),lw.write(r.overflowingContentWidgetsDomNode,2),r.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets"),r}return aS(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._widgets={}},t.prototype.onConfigurationChanged=function(e){for(var t=0,n=Object.keys(this._widgets);t=r,l=a,d=i.viewportHeight-a>=r,h=e.left,f=t.left;return h+n>i.scrollLeft+i.viewportWidth&&(h=i.scrollLeft+i.viewportWidth-n),f+n>i.scrollLeft+i.viewportWidth&&(f=i.scrollLeft+i.viewportWidth-n),h=22,v=p+r<=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-22;g+n+20>_&&(g-=o=g-(_-n-20),l-=o);m+n+20>_&&(m-=o=m-(_-n-20),d-=o);g<0&&(g-=o=g,l-=o);m<0&&(m-=o=m,d-=o);return this._fixedOverflowWidgets&&(u=f,c=p,l=g,d=m),{fitsAbove:y,aboveTop:u,aboveLeft:l,fitsBelow:v,belowTop:c,belowLeft:d}},e.prototype._prepareRenderWidgetAtExactPositionOverflowing=function(e){return new uS(e.top,e.left+this._contentLeft)},e.prototype._getTopAndBottomLeft=function(e){if(!this._viewPosition)return[null,null];var t=e.visibleRangeForPosition(this._viewPosition);if(!t)return[null,null];var n=e.getVerticalOffsetForLineNumber(this._viewPosition.lineNumber)-e.scrollTop,r=new uS(n,t.left),i=this._viewPosition.lineNumber,o=t.left;if(this._viewRange){var s=e.linesVisibleRangesForRange(this._viewRange,!1);if(s&&s.length>0)for(var a=s.length-1;a>=0;a--){var u=s[a];if(u.lineNumber>=i){u.lineNumber>i&&(i=u.lineNumber,o=1073741824);for(var c=0,l=u.ranges.length;ce.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))},e.prototype.prepareRender=function(e){this._renderData=this._prepareRenderWidget(e)},e.prototype.render=function(e){this._renderData?(this.allowEditorOverflow?(this.domNode.setTop(this._renderData.top),this.domNode.setLeft(this._renderData.left)):(this.domNode.setTop(this._renderData.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0)):this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden"))},e}(),dS=(n(393),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),hS=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._renderLineHighlight=n._context.configuration.editor.viewInfo.renderLineHighlight,n._selectionIsEmpty=!0,n._primaryCursorLineNumber=1,n._scrollWidth=0,n._contentWidth=n._context.configuration.editor.layoutInfo.contentWidth,n._context.addEventHandler(n),n}return dS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._renderLineHighlight=this._context.configuration.editor.viewInfo.renderLineHighlight),e.layoutInfo&&(this._contentWidth=this._context.configuration.editor.layoutInfo.contentWidth),!0},t.prototype.onCursorStateChanged=function(e){var t=!1,n=e.selections[0].positionLineNumber;this._primaryCursorLineNumber!==n&&(this._primaryCursorLineNumber=n,t=!0);var r=e.selections[0].isEmpty();return this._selectionIsEmpty!==r?(this._selectionIsEmpty=r,!0):t},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollWidthChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){this._scrollWidth=e.scrollWidth},t.prototype.render=function(e,t){return t===this._primaryCursorLineNumber&&this._shouldShowCurrentLine()?'
':""},t.prototype._shouldShowCurrentLine=function(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty},t.prototype._willRenderMarginCurrentLine=function(){return"gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight},t}(nC);Ad((function(e,t){var n=e.getColor(rC);if(n&&t.addRule(".monaco-editor .view-overlays .current-line { background-color: "+n+"; }"),!n||n.isTransparent()||e.defines(iC)){var r=e.getColor(iC);r&&(t.addRule(".monaco-editor .view-overlays .current-line { border: 2px solid "+r+"; }"),"hc"===e.type&&t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"))}}));n(394);var fS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pS=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._renderLineHighlight=n._context.configuration.editor.viewInfo.renderLineHighlight,n._selectionIsEmpty=!0,n._primaryCursorLineNumber=1,n._contentLeft=n._context.configuration.editor.layoutInfo.contentLeft,n._context.addEventHandler(n),n}return fS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._renderLineHighlight=this._context.configuration.editor.viewInfo.renderLineHighlight),e.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft),!0},t.prototype.onCursorStateChanged=function(e){var t=!1,n=e.selections[0].positionLineNumber;this._primaryCursorLineNumber!==n&&(this._primaryCursorLineNumber=n,t=!0);var r=e.selections[0].isEmpty();return this._selectionIsEmpty!==r?(this._selectionIsEmpty=r,!0):t},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){},t.prototype.render=function(e,t){if(t===this._primaryCursorLineNumber){var n="current-line";if(this._shouldShowCurrentLine())n="current-line current-line-margin"+(this._willRenderContentCurrentLine()?" current-line-margin-both":"");return'
'}return""},t.prototype._shouldShowCurrentLine=function(){return"gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight},t.prototype._willRenderContentCurrentLine=function(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty},t}(nC);Ad((function(e,t){var n=e.getColor(rC);if(n)t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { background-color: "+n+"; border: none; }");else{var r=e.getColor(iC);r&&t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid "+r+"; }"),"hc"===e.type&&t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")}}));n(395);var gS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mS=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._renderResult=null,n._context.addEventHandler(n),n}return gS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged||e.scrollWidthChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){for(var t=e.getDecorationsInViewport(),n=[],r=0,i=0,o=t.length;it.options.zIndex)return 1;var n=e.options.className,r=t.options.className;return nr?1:Tr.compareRangesUsingStarts(e.range,t.range)}));for(var a=e.visibleRange.startLineNumber,u=e.visibleRange.endLineNumber,c=[],l=a;l<=u;l++){c[l-a]=""}this._renderWholeLineDecorations(e,n,c),this._renderNormalDecorations(e,n,c),this._renderResult=c},t.prototype._renderWholeLineDecorations=function(e,t,n){for(var r=String(this._lineHeight),i=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,s=0,a=t.length;s',l=Math.max(u.range.startLineNumber,i),d=Math.min(u.range.endLineNumber,o),h=l;h<=d;h++){n[h-i]+=c}}},t.prototype._renderNormalDecorations=function(e,t,n){for(var r=String(this._lineHeight),i=e.visibleRange.startLineNumber,o=null,s=!1,a=null,u=0,c=t.length;u';s[d]+=m}}},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t}(nC),_S=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yS=function(e){function t(t,n,r,i){var o=e.call(this,t)||this,s=o._context.configuration.editor.viewInfo.scrollbar,a={listenOnDomNode:r.domNode,className:"editor-scrollable "+Td(t.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity};o.scrollbar=o._register(new qp(n.domNode,a,o._context.viewLayout.scrollable)),lw.write(o.scrollbar.getDomNode(),5),o.scrollbarDomNode=bp(o.scrollbar.getDomNode()),o.scrollbarDomNode.setPosition("absolute"),o._setLayout();var u=function(e,t,n){var r={};if(t){var i=e.scrollTop;i&&(r.scrollTop=o._context.viewLayout.getCurrentScrollTop()+i,e.scrollTop=0)}if(n){var s=e.scrollLeft;s&&(r.scrollLeft=o._context.viewLayout.getCurrentScrollLeft()+s,e.scrollLeft=0)}o._context.viewLayout.setScrollPositionNow(r)};return o._register(Bh(r.domNode,"scroll",(function(e){return u(r.domNode,!0,!0)}))),o._register(Bh(n.domNode,"scroll",(function(e){return u(n.domNode,!0,!1)}))),o._register(Bh(i.domNode,"scroll",(function(e){return u(i.domNode,!0,!1)}))),o._register(Bh(o.scrollbarDomNode.domNode,"scroll",(function(e){return u(o.scrollbarDomNode.domNode,!0,!1)}))),o}return _S(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._setLayout=function(){var e=this._context.configuration.editor.layoutInfo;this.scrollbarDomNode.setLeft(e.contentLeft),"right"===this._context.configuration.editor.viewInfo.minimap.side?this.scrollbarDomNode.setWidth(e.contentWidth+e.minimapWidth):this.scrollbarDomNode.setWidth(e.contentWidth),this.scrollbarDomNode.setHeight(e.contentHeight)},t.prototype.getOverviewRulerLayoutInfo=function(){return this.scrollbar.getOverviewRulerLayoutInfo()},t.prototype.getDomNode=function(){return this.scrollbarDomNode},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)},t.prototype.onConfigurationChanged=function(e){if(e.viewInfo){var t=this._context.configuration.editor,n={handleMouseWheel:t.viewInfo.scrollbar.handleMouseWheel,mouseWheelScrollSensitivity:t.viewInfo.scrollbar.mouseWheelScrollSensitivity,fastScrollSensitivity:t.viewInfo.scrollbar.fastScrollSensitivity};this.scrollbar.updateOptions(n)}return e.layoutInfo&&this._setLayout(),!0},t.prototype.onScrollChanged=function(e){return!0},t.prototype.onThemeChanged=function(e){return this.scrollbar.updateClassName("editor-scrollable "+Td(this._context.theme.type)),!0},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this.scrollbar.renderNow()},t}(cw),vS=(n(396),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),bS=function(e,t,n){this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(n)},wS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vS(t,e),t.prototype._render=function(e,t,n){for(var r=[],i=e;i<=t;i++){r[i-e]=[]}if(0===n.length)return r;n.sort((function(e,t){return e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className',s=[],a=t;a<=n;a++){var u=a-t,c=r[u];0===c.length?s[u]="":s[u]='
=this._renderResult.length?"":this._renderResult[n]},t}(wS),SS=(n(397),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),xS=function(e){function t(t){var n=e.call(this)||this;n._context=t,n._primaryLineNumber=0,n._lineHeight=n._context.configuration.editor.lineHeight,n._spaceWidth=n._context.configuration.editor.fontInfo.spaceWidth,n._enabled=n._context.configuration.editor.viewInfo.renderIndentGuides,n._activeIndentEnabled=n._context.configuration.editor.viewInfo.highlightActiveIndentGuide;var r=n._context.configuration.editor.wrappingInfo.wrappingColumn;return n._maxIndentLeft=-1===r?-1:r*n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._renderResult=null,n._context.addEventHandler(n),n}return SS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){if(e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(this._spaceWidth=this._context.configuration.editor.fontInfo.spaceWidth),e.viewInfo&&(this._enabled=this._context.configuration.editor.viewInfo.renderIndentGuides,this._activeIndentEnabled=this._context.configuration.editor.viewInfo.highlightActiveIndentGuide),e.wrappingInfo||e.fontInfo){var t=this._context.configuration.editor.wrappingInfo.wrappingColumn;this._maxIndentLeft=-1===t?-1:t*this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth}return!0},t.prototype.onCursorStateChanged=function(e){var t=e.selections[0],n=t.isEmpty()?t.positionLineNumber:0;return this._primaryLineNumber!==n&&(this._primaryLineNumber=n,!0)},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.onLanguageConfigurationChanged=function(e){return!0},t.prototype.prepareRender=function(e){if(this._enabled){var t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._context.model.getOptions().indentSize*this._spaceWidth,i=e.scrollWidth,o=this._lineHeight,s=this._context.model.getLinesIndentGuides(t,n),a=0,u=0,c=0;if(this._activeIndentEnabled&&this._primaryLineNumber){var l=this._context.model.getActiveIndentGuide(this._primaryLineNumber,t,n);a=l.startLineNumber,u=l.endLineNumber,c=l.indent}for(var d=[],h=t;h<=n;h++){for(var f=a<=h&&h<=u,p=h-t,g=s[p],m="",_=e.visibleRangeForPosition(new _t(h,1)),y=_?_.left:0,v=1;v<=g;v++){if(m+='
',(y+=r)>i||this._maxIndentLeft>0&&y>this._maxIndentLeft)break}d[p]=m}this._renderResult=d}else this._renderResult=null},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t}(nC);Ad((function(e,t){var n=e.getColor(lC);n&&t.addRule(".monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 "+n+" inset; }");var r=e.getColor(dC)||n;r&&t.addRule(".monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 "+r+" inset; }")}));n(398);var kS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),LS=function(){function e(){this._currentVisibleRange=new Tr(1,1,1,1)}return e.prototype.getCurrentVisibleRange=function(){return this._currentVisibleRange},e.prototype.setCurrentVisibleRange=function(e){this._currentVisibleRange=e},e}(),MS=function(e,t,n,r,i,o){this.lineNumber=e,this.startColumn=t,this.endColumn=n,this.startScrollTop=r,this.stopScrollTop=i,this.scrollType=o},ES=function(e){function t(t,n){var r=e.call(this,t)||this;r._linesContent=n,r._textRangeRestingSpot=document.createElement("div"),r._visibleLines=new eS(r),r.domNode=r._visibleLines.domNode;var i=r._context.configuration;return r._lineHeight=i.editor.lineHeight,r._typicalHalfwidthCharacterWidth=i.editor.fontInfo.typicalHalfwidthCharacterWidth,r._isViewportWrapping=i.editor.wrappingInfo.isViewportWrapping,r._revealHorizontalRightPadding=i.editor.viewInfo.revealHorizontalRightPadding,r._scrollOff=i.editor.viewInfo.cursorSurroundingLines,r._canUseLayerHinting=i.editor.canUseLayerHinting,r._viewLineOptions=new ww(i,r._context.theme.type),lw.write(r.domNode,7),r.domNode.setClassName("view-lines"),Jb.applyFontInfo(r.domNode,i.editor.fontInfo),r._maxLineWidth=0,r._asyncUpdateLineWidths=new ks((function(){r._updateLineWidthsSlow()}),200),r._lastRenderedData=new LS,r._horizontalRevealRequest=null,r}return kS(t,e),t.prototype.dispose=function(){this._asyncUpdateLineWidths.dispose(),e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this.domNode},t.prototype.createVisibleLine=function(){return new Cw(this._viewLineOptions)},t.prototype.onConfigurationChanged=function(e){this._visibleLines.onConfigurationChanged(e),e.wrappingInfo&&(this._maxLineWidth=0);var t=this._context.configuration;return e.lineHeight&&(this._lineHeight=t.editor.lineHeight),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=t.editor.fontInfo.typicalHalfwidthCharacterWidth),e.wrappingInfo&&(this._isViewportWrapping=t.editor.wrappingInfo.isViewportWrapping),e.viewInfo&&(this._revealHorizontalRightPadding=t.editor.viewInfo.revealHorizontalRightPadding,this._scrollOff=t.editor.viewInfo.cursorSurroundingLines),e.canUseLayerHinting&&(this._canUseLayerHinting=t.editor.canUseLayerHinting),e.fontInfo&&Jb.applyFontInfo(this.domNode,t.editor.fontInfo),this._onOptionsMaybeChanged(),e.layoutInfo&&(this._maxLineWidth=0),!0},t.prototype._onOptionsMaybeChanged=function(){var e=this._context.configuration,t=new ww(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;for(var n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber(),i=n;i<=r;i++){this._visibleLines.getVisibleLine(i).onOptionsChanged(this._viewLineOptions)}return!0}return!1},t.prototype.onCursorStateChanged=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=!1,i=t;i<=n;i++)r=this._visibleLines.getVisibleLine(i).onSelectionChanged()||r;return r},t.prototype.onDecorationsChanged=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=t;r<=n;r++)this._visibleLines.getVisibleLine(r).onDecorationsChanged();return!0},t.prototype.onFlushed=function(e){var t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t},t.prototype.onLinesChanged=function(e){return this._visibleLines.onLinesChanged(e)},t.prototype.onLinesDeleted=function(e){return this._visibleLines.onLinesDeleted(e)},t.prototype.onLinesInserted=function(e){return this._visibleLines.onLinesInserted(e)},t.prototype.onRevealRangeRequest=function(e){var t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.range,e.verticalType),n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:this._horizontalRevealRequest=new MS(e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):this._horizontalRevealRequest=null;var r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop);return 0===e.scrollType&&r>this._lineHeight?this._context.viewLayout.setScrollPositionSmooth(n):this._context.viewLayout.setScrollPositionNow(n),!0},t.prototype.onScrollChanged=function(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){var t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0},t.prototype.onTokensChanged=function(e){return this._visibleLines.onTokensChanged(e)},t.prototype.onZonesChanged=function(e){return this._context.viewLayout.onMaxLineWidthChanged(this._maxLineWidth),this._visibleLines.onZonesChanged(e)},t.prototype.onThemeChanged=function(e){return this._onOptionsMaybeChanged()},t.prototype.getPositionFromDOMInfo=function(e,t){var n=this._getViewLineDomNode(e);if(null===n)return null;var r=this._getLineNumberFor(n);if(-1===r)return null;if(r<1||r>this._context.model.getLineCount())return null;if(1===this._context.model.getLineMaxColumn(r))return new _t(r,1);var i=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(ro)return null;var s=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(r,e,t),a=this._context.model.getLineMinColumn(r);return sn?-1:this._visibleLines.getVisibleLine(e).getWidth()},t.prototype.linesVisibleRangesForRange=function(e,t){if(this.shouldRender())return null;var n=e.endLineNumber,r=Tr.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;var i=[],o=0,s=new bw(this.domNode.domNode,this._textRangeRestingSpot),a=0;t&&(a=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new _t(r.startLineNumber,1)).lineNumber);for(var u=this._visibleLines.getStartLineNumber(),c=this._visibleLines.getEndLineNumber(),l=r.startLineNumber;l<=r.endLineNumber;l++)if(!(lc)){var d=l===r.startLineNumber?r.startColumn:1,h=l===r.endLineNumber?r.endColumn:this._context.model.getLineMaxColumn(l),f=this._visibleLines.getVisibleLine(l).getVisibleRangesForRange(d,h,s);if(f&&0!==f.length){if(t&&lo)){var a=s===t.startLineNumber?t.startColumn:1,u=s===t.endLineNumber?t.endColumn:this._context.model.getLineMaxColumn(s),c=this._visibleLines.getVisibleLine(s).getVisibleRangesForRange(a,u,r);c&&0!==c.length&&(n=n.concat(c))}return 0===n.length?null:n},t.prototype.visibleRangeForPosition=function(e){var t=this.visibleRangesForRange2(new Tr(e.lineNumber,e.column,e.lineNumber,e.column));return t?t[0]:null},t.prototype.updateLineWidths=function(){this._updateLineWidths(!1)},t.prototype._updateLineWidthsFast=function(){return this._updateLineWidths(!0)},t.prototype._updateLineWidthsSlow=function(){this._updateLineWidths(!1)},t.prototype._updateLineWidths=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=1,i=!0,o=t;o<=n;o++){var s=this._visibleLines.getVisibleLine(o);!e||s.getWidthIsFast()?r=Math.max(r,s.getWidth()):i=!1}return i&&1===t&&n===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),i},t.prototype.prepareRender=function(){throw new Error("Not supported")},t.prototype.render=function(){throw new Error("Not supported")},t.prototype.renderText=function(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){var t=this._horizontalRevealRequest.lineNumber,n=this._horizontalRevealRequest.startColumn,r=this._horizontalRevealRequest.endColumn,i=this._horizontalRevealRequest.scrollType;if(e.startLineNumber<=t&&t<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();var o=this._computeScrollLeftToRevealRange(t,n,r);this._isViewportWrapping||this._ensureMaxLineWidth(o.maxHorizontalOffset),0===i?this._context.viewLayout.setScrollPositionSmooth({scrollLeft:o.scrollLeft}):this._context.viewLayout.setScrollPositionNow({scrollLeft:o.scrollLeft})}}this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),this._linesContent.setLayerHinting(this._canUseLayerHinting);var s=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-s),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())},t.prototype._ensureMaxLineWidth=function(e){var t=Math.ceil(e);this._maxLineWidthl&&(l=f.left+f.width)}return i=l,c=Math.max(0,c-t.HORIZONTAL_EXTRA_PX),l+=this._revealHorizontalRightPadding,{scrollLeft:this._computeMinimumScrolling(s,a,c,l),maxHorizontalOffset:i}},t.prototype._computeMinimumScrolling=function(e,t,n,r,i,o){i=!!i,o=!!o;var s=(t|=0)-(e|=0);return(r|=0)-(n|=0)t?Math.max(0,r-s):e:n},t.HORIZONTAL_EXTRA_PX=30,t}(cw),DS=(n(399),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),TS=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._decorationsLeft=n._context.configuration.editor.layoutInfo.decorationsLeft,n._decorationsWidth=n._context.configuration.editor.layoutInfo.decorationsWidth,n._renderResult=null,n._context.addEventHandler(n),n}return DS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.layoutInfo&&(this._decorationsLeft=this._context.configuration.editor.layoutInfo.decorationsLeft,this._decorationsWidth=this._context.configuration.editor.layoutInfo.decorationsWidth),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._getDecorations=function(e){for(var t=e.getDecorationsInViewport(),n=[],r=0,i=0,o=t.length;i
',o=[],s=t;s<=n;s++){for(var a=s-t,u=r[a],c="",l=0,d=u.length;l';i[s]=u}this._renderResult=i},t.prototype.render=function(e,t){return this._renderResult?this._renderResult[t-e]:""},t}(wS),AS=(n(401),function(){function e(t,n,r,i){this.r=e._clamp(t),this.g=e._clamp(n),this.b=e._clamp(r),this.a=e._clamp(i)}return e._clamp=function(e){return e<0?0:e>255?255:0|e},e.Empty=new e(0,0,0,0),e}()),IS=function(){function e(){var e=this;this._onDidChange=new Ht,this.onDidChange=this._onDidChange.event,this._updateColorMap(),Ma.onDidChange((function(t){t.changedColorMap&&e._updateColorMap()}))}return e.getInstance=function(){return this._INSTANCE||(this._INSTANCE=new e),this._INSTANCE},e.prototype._updateColorMap=function(){var e=Ma.getColorMap();if(!e)return this._colors=[AS.Empty],void(this._backgroundIsLight=!0);this._colors=[AS.Empty];for(var t=1;t=.5,this._onDidChange.fire(void 0)},e.prototype.getColor=function(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]},e.prototype.backgroundIsLight=function(){return this._backgroundIsLight},e._INSTANCE=null,e}(),PS=function(){function e(t,n){if(760!==t.length)throw new Error("Invalid x2CharData");if(190!==n.length)throw new Error("Invalid x1CharData");this.x2charData=t,this.x1charData=n,this.x2charDataLight=e.soften(t,.8),this.x1charDataLight=e.soften(n,50/60)}return e.soften=function(e,t){for(var n=new Uint8ClampedArray(e.length),r=0,i=e.length;rt.width||r+4>t.height)console.warn("bad render request outside image data");else{var u=a?this.x2charDataLight:this.x2charData,c=e._getChIndex(i),l=4*t.width,d=s.r,h=s.g,f=s.b,p=o.r-d,g=o.g-h,m=o.b-f,_=t.data,y=4*c*2,v=r*l+4*n,b=u[y]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b;b=u[y+1]/255;_[v+4]=d+p*b,_[v+5]=h+g*b,_[v+6]=f+m*b,v+=l;b=u[y+2]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b;b=u[y+3]/255;_[v+4]=d+p*b,_[v+5]=h+g*b,_[v+6]=f+m*b,v+=l;b=u[y+4]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b;b=u[y+5]/255;_[v+4]=d+p*b,_[v+5]=h+g*b,_[v+6]=f+m*b,v+=l;b=u[y+6]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b;b=u[y+7]/255;_[v+4]=d+p*b,_[v+5]=h+g*b,_[v+6]=f+m*b}},e.prototype.x1RenderChar=function(t,n,r,i,o,s,a){if(n+1>t.width||r+2>t.height)console.warn("bad render request outside image data");else{var u=a?this.x1charDataLight:this.x1charData,c=e._getChIndex(i),l=4*t.width,d=s.r,h=s.g,f=s.b,p=o.r-d,g=o.g-h,m=o.b-f,_=t.data,y=2*c*1,v=r*l+4*n,b=u[y]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b,v+=l;b=u[y+1]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b}},e.prototype.x2BlockRenderChar=function(e,t,n,r,i,o){if(t+2>e.width||n+4>e.height)console.warn("bad render request outside image data");else{var s=4*e.width,a=i.r,u=i.g,c=i.b,l=a+.5*(r.r-a),d=u+.5*(r.g-u),h=c+.5*(r.b-c),f=e.data,p=n*s+4*t;f[p+0]=l,f[p+1]=d,f[p+2]=h,f[p+4]=l,f[p+5]=d,f[p+6]=h,f[(p+=s)+0]=l,f[p+1]=d,f[p+2]=h,f[p+4]=l,f[p+5]=d,f[p+6]=h,f[(p+=s)+0]=l,f[p+1]=d,f[p+2]=h,f[p+4]=l,f[p+5]=d,f[p+6]=h,f[(p+=s)+0]=l,f[p+1]=d,f[p+2]=h,f[p+4]=l,f[p+5]=d,f[p+6]=h}},e.prototype.x1BlockRenderChar=function(e,t,n,r,i,o){if(t+1>e.width||n+2>e.height)console.warn("bad render request outside image data");else{var s=4*e.width,a=i.r,u=i.g,c=i.b,l=a+.5*(r.r-a),d=u+.5*(r.g-u),h=c+.5*(r.b-c),f=e.data,p=n*s+4*t;f[p+0]=l,f[p+1]=d,f[p+2]=h,f[(p+=s)+0]=l,f[p+1]=d,f[p+2]=h}},e}();function RS(e){for(var t=new Uint8ClampedArray(e.length),n=0,r=e.length;n=s+b)return new e(a,u,y,v,l,w=1,s);var w=Math.max(1,Math.floor(n-v*h/f));return c&&c.scrollHeight===u&&(c.scrollTop>a&&(w=Math.min(w,c.startLineNumber)),c.scrollTopzS)n._context.viewLayout.setScrollPositionNow({scrollTop:i.scrollTop});else{var s=e.posy-t;n._context.viewLayout.setScrollPositionNow({scrollTop:i.getDesiredScrollTopFromDelta(s)})}}),(function(){n._slider.toggleClassName("active",!1)}))}})),n}return HS(t,e),t.prototype.dispose=function(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),e.prototype.dispose.call(this)},t.prototype._getMinimapDomNodeClassName=function(){return"always"===this._options.showSlider?"minimap slider-always":"minimap slider-mouseover"},t.prototype.getDomNode=function(){return this._domNode},t.prototype._applyLayout=function(){this._domNode.setLeft(this._options.minimapLeft),this._domNode.setWidth(this._options.minimapWidth),this._domNode.setHeight(this._options.minimapHeight),this._shadow.setHeight(this._options.minimapHeight),this._canvas.setWidth(this._options.canvasOuterWidth),this._canvas.setHeight(this._options.canvasOuterHeight),this._canvas.domNode.width=this._options.canvasInnerWidth,this._canvas.domNode.height=this._options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._options.canvasInnerHeight,this._slider.setWidth(this._options.minimapWidth)},t.prototype._getBuffer=function(){return this._buffers||(this._buffers=new $S(this._canvas.domNode.getContext("2d"),this._options.canvasInnerWidth,this._options.canvasInnerHeight,this._tokensColorTracker.getColor(2))),this._buffers.getBuffer()},t.prototype._onOptionsMaybeChanged=function(){var e=new US(this._context.configuration);return!this._options.equals(e)&&(this._options=e,this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName()),!0)},t.prototype.onConfigurationChanged=function(e){return this._onOptionsMaybeChanged()},t.prototype.onFlushed=function(e){return this._lastRenderData=null,!0},t.prototype.onLinesChanged=function(e){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e)},t.prototype.onLinesDeleted=function(e){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e),!0},t.prototype.onLinesInserted=function(e){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e),!0},t.prototype.onScrollChanged=function(e){return this._renderDecorations=!0,!0},t.prototype.onTokensChanged=function(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)},t.prototype.onTokensColorsChanged=function(e){return this._lastRenderData=null,this._buffers=null,!0},t.prototype.onZonesChanged=function(e){return this._lastRenderData=null,!0},t.prototype.onDecorationsChanged=function(e){return this._renderDecorations=!0,!0},t.prototype.onThemeChanged=function(e){return this._context.model.invalidateMinimapColorCache(),this._renderDecorations=!!this._lastDecorations,!!this._lastDecorations},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){if(0===this._options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");var t=qS.create(this._options,e.visibleRange.startLineNumber,e.visibleRange.endLineNumber,e.viewportHeight,e.viewportData.whitespaceViewportData.length>0,this._context.model.getLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight);var n=e.scrollLeft/this._options.typicalHalfwidthCharacterWidth,r=Math.min(this._options.minimapWidth,Math.round(n*VS(this._options.renderMinimap)/this._options.pixelRatio));this._sliderHorizontal.setLeft(r),this._sliderHorizontal.setWidth(this._options.minimapWidth-r),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)},t.prototype.renderDecorations=function(e){if(this._renderDecorations){this._renderDecorations=!1;var t=this._context.model.getDecorationsInViewport(new Tr(e.startLineNumber,1,e.endLineNumber,this._context.model.getLineMaxColumn(e.endLineNumber))),n=this._options,r=n.renderMinimap,i=n.canvasInnerWidth,o=n.canvasInnerHeight,s=WS(r),a=VS(r),u=this._context.model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,i,o);for(var l=new Map,d=0;di?l.length-1:y-1;if(C>0){var S=l[C]-w||2;this.renderDecoration(e,n.options.minimap,w,c,S,o)}d&&this.renderLineHighlight(e,n.options.minimap,c,o)},t.prototype.renderLineHighlight=function(e,t,n,r){var i=t.getColor(this._context.theme);e.fillStyle=i&&i.transparent(.5).toString()||"",e.fillRect(0,n,e.canvas.width,r)},t.prototype.renderDecoration=function(e,t,n,r,i,o){var s=t.getColor(this._context.theme);e.fillStyle=s&&s.toString()||"",e.fillRect(n,r,i,o)},t.prototype.renderLines=function(e){var n=this._options.renderMinimap,r=e.startLineNumber,i=e.endLineNumber,o=WS(n);if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){var s=this._lastRenderData._get();return new GS(e,s.imageData,s.lines)}for(var a=this._getBuffer(),u=t._renderUntouchedLines(a,r,i,o,this._lastRenderData),c=u[0],l=u[1],d=u[2],h=this._context.model.getMinimapLinesRenderingData(r,i,d),f=h.tabSize,p=this._tokensColorTracker.getColor(2),g=this._tokensColorTracker.backgroundIsLight(),m=0,_=[],y=0,v=i-r+1;y=0&&kh)return;var w=c.charCodeAt(p);if(9===w){var C=a-(p+g)%a;g+=C-1,f+=C*d}else if(32===w)f+=d;else for(var S=Sn(w)?2:1,x=0;xh)return}},t}(cw);Ad((function(e,t){var n=e.getColor(Tl);if(n){var r=n.transparent(.5);t.addRule(".monaco-editor .minimap-slider, .monaco-editor .minimap-slider .minimap-slider-horizontal { background: "+r+"; }")}var i=e.getColor(Nl);if(i){var o=i.transparent(.5);t.addRule(".monaco-editor .minimap-slider:hover, .monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: "+o+"; }")}var s=e.getColor(Ol);if(s){var a=s.transparent(.5);t.addRule(".monaco-editor .minimap-slider.active, .monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: "+a+"; }")}var u=e.getColor(Dl);u&&t.addRule(".monaco-editor .minimap-shadow-visible { box-shadow: "+u+" -6px 0 6px -6px inset; }")}));n(402);var JS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),XS=function(e){function t(t){var n=e.call(this,t)||this;return n._widgets={},n._verticalScrollbarWidth=n._context.configuration.editor.layoutInfo.verticalScrollbarWidth,n._minimapWidth=n._context.configuration.editor.layoutInfo.minimapWidth,n._horizontalScrollbarHeight=n._context.configuration.editor.layoutInfo.horizontalScrollbarHeight,n._editorHeight=n._context.configuration.editor.layoutInfo.height,n._editorWidth=n._context.configuration.editor.layoutInfo.width,n._domNode=bp(document.createElement("div")),lw.write(n._domNode,4),n._domNode.setClassName("overlayWidgets"),n}return JS(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._widgets={}},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){return!!e.layoutInfo&&(this._verticalScrollbarWidth=this._context.configuration.editor.layoutInfo.verticalScrollbarWidth,this._minimapWidth=this._context.configuration.editor.layoutInfo.minimapWidth,this._horizontalScrollbarHeight=this._context.configuration.editor.layoutInfo.horizontalScrollbarHeight,this._editorHeight=this._context.configuration.editor.layoutInfo.height,this._editorWidth=this._context.configuration.editor.layoutInfo.width,!0)},t.prototype.addWidget=function(e){var t=bp(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()},t.prototype.setWidgetPosition=function(e,t){var n=this._widgets[e.getId()];return n.preference!==t&&(n.preference=t,this.setShouldRender(),!0)},t.prototype.removeWidget=function(e){var t=e.getId();if(this._widgets.hasOwnProperty(t)){var n=this._widgets[t].domNode.domNode;delete this._widgets[t],n.parentNode.removeChild(n),this.setShouldRender()}},t.prototype._renderWidget=function(e){var t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){var n=t.domNode.clientHeight;t.setTop(this._editorHeight-n-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setWidth(this._editorWidth);for(var t=Object.keys(this._widgets),n=0,r=t.length;n=3){var i,o,s,a=r-(i=Math.floor(r/3))-(o=Math.floor(r/3)),u=(s=e)+i;return[[0,s,u,s,s+i+a,s,u,s],[0,i,a,i+a,o,i+a+o,a+o,i+a+o]]}if(2===n)return[[0,s=e,s,s,s+(i=Math.floor(r/2)),s,s,s],[0,i,i,i,o=r-i,i+o,i+o,i+o]];return[[0,e,e,e,e,e,e,e],[0,r,r,r,r,r,r,r]]},e.prototype.equals=function(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight},e}(),tx=function(e){function t(t){var n=e.call(this,t)||this;return n._domNode=bp(document.createElement("canvas")),n._domNode.setClassName("decorationsOverviewRuler"),n._domNode.setPosition("absolute"),n._domNode.setLayerHinting(!0),n._domNode.setAttribute("aria-hidden","true"),n._updateSettings(!1),n._tokensColorTrackerListener=Ma.onDidChange((function(e){e.changedColorMap&&n._updateSettings(!0)})),n._cursorPositions=[],n}return QS(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._tokensColorTrackerListener.dispose()},t.prototype._updateSettings=function(e){var t=new ex(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)},t.prototype.onConfigurationChanged=function(e){return this._updateSettings(!1)},t.prototype.onCursorStateChanged=function(e){this._cursorPositions=[];for(var t=0,n=e.selections.length;tt&&(D=t-a),x=D-a,N=D+a;x>y+1||w!==m?(0!==v&&u.fillRect(c[m],_,l[m],y-_),m=w,_=x,y=N):N>y&&(y=N)}u.fillRect(c[m],_,l[m],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){var k=2*this._settings.pixelRatio|0,L=k/2|0,M=this._settings.x[7],E=this._settings.w[7];u.fillStyle=this._settings.cursorColor;for(_=-100,y=-100,v=0,b=this._cursorPositions.length;vt&&(D=t-L);var N=(x=D-L)+k;x>y+1?(0!==v&&u.fillRect(M,_,E,y-_),_=x,y=N):N>y&&(y=N)}u.fillRect(M,_,E,y-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(u.beginPath(),u.lineWidth=1,u.strokeStyle=this._settings.borderColor,u.moveTo(0,0),u.lineTo(0,t),u.stroke(),u.moveTo(0,0),u.lineTo(e,0),u.stroke())},t}(cw),nx=function(){function e(e,t,n){this.from=0|e,this.to=0|t,this.colorId=0|n}return e.compare=function(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId},e}(),rx=function(){function e(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.color=n,this._colorZone=null}return e.compare=function(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.colorn&&(h=n-f);var p=u.color,g=this._color2Id[p];g||(g=++this._lastAssignedId,this._color2Id[p]=g,this._id2Color[g]=p);var m=new nx(h-f,h+f,g);u.setColorZone(m),o.push(m)}return this._colorZonesInvalid=!1,o.sort(nx.compare),o},e}(),ox=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sx=function(e){function t(t,n){var r=e.call(this)||this;return r._context=t,r._domNode=bp(document.createElement("canvas")),r._domNode.setClassName(n),r._domNode.setPosition("absolute"),r._domNode.setLayerHinting(!0),r._zoneManager=new ix((function(e){return r._context.viewLayout.getVerticalOffsetForLineNumber(e)})),r._zoneManager.setDOMWidth(0),r._zoneManager.setDOMHeight(0),r._zoneManager.setOuterHeight(r._context.viewLayout.getScrollHeight()),r._zoneManager.setLineHeight(r._context.configuration.editor.lineHeight),r._zoneManager.setPixelRatio(r._context.configuration.editor.pixelRatio),r._context.addEventHandler(r),r}return ox(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._zoneManager.setLineHeight(this._context.configuration.editor.lineHeight),this._render()),e.pixelRatio&&(this._zoneManager.setPixelRatio(this._context.configuration.editor.pixelRatio),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0},t.prototype.onFlushed=function(e){return this._render(),!0},t.prototype.onScrollChanged=function(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0},t.prototype.onZonesChanged=function(e){return this._render(),!0},t.prototype.getDomNode=function(){return this._domNode.domNode},t.prototype.setLayout=function(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);var t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,(t=this._zoneManager.setDOMHeight(e.height)||t)&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())},t.prototype.setZones=function(e){this._zoneManager.setZones(e),this._render()},t.prototype._render=function(){if(0===this._zoneManager.getOuterHeight())return!1;var e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),i=this._domNode.domNode.getContext("2d");return i.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(i,n,r,e),!0},t.prototype._renderOneLane=function(e,t,n,r){for(var i=0,o=0,s=0,a=0,u=t;a=d?s=Math.max(s,h):(e.fillRect(0,o,r,s-o),o=d,s=h)}e.fillRect(0,o,r,s-o)},t}(aw),ax=(n(403),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ux=function(e){function t(t){var n=e.call(this,t)||this;return n.domNode=bp(document.createElement("div")),n.domNode.setAttribute("role","presentation"),n.domNode.setAttribute("aria-hidden","true"),n.domNode.setClassName("view-rulers"),n._renderedRulers=[],n._rulers=n._context.configuration.editor.viewInfo.rulers,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n}return ax(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return!!(e.viewInfo||e.layoutInfo||e.fontInfo)&&(this._rulers=this._context.configuration.editor.viewInfo.rulers,this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,!0)},t.prototype.onScrollChanged=function(e){return e.scrollHeightChanged},t.prototype.prepareRender=function(e){},t.prototype._ensureRulersCount=function(){var e=this._renderedRulers.length,t=this._rulers.length;if(e!==t)if(e0;){(o=bp(document.createElement("div"))).setClassName("view-ruler"),o.setWidth(n),this.domNode.appendChild(o),this._renderedRulers.push(o),r--}else for(var i=e-t;i>0;){var o=this._renderedRulers.pop();this.domNode.removeChild(o),i--}},t.prototype.render=function(e){this._ensureRulersCount();for(var t=0,n=this._rulers.length;t0;return this._shouldShow!==e&&(this._shouldShow=e,!0)},t.prototype.getDomNode=function(){return this._domNode},t.prototype._updateWidth=function(){var e=this._context.configuration.editor.layoutInfo,t=0;return t=0===e.renderMinimap||e.minimapWidth>0&&0===e.minimapLeft?e.width:e.width-e.minimapWidth-e.verticalScrollbarWidth,this._width!==t&&(this._width=t,!0)},t.prototype.onConfigurationChanged=function(e){var t=!1;return e.viewInfo&&(this._useShadows=this._context.configuration.editor.viewInfo.scrollbar.useShadows),e.layoutInfo&&(t=this._updateWidth()),this._updateShouldShow()||t},t.prototype.onScrollChanged=function(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")},t}(cw);Ad((function(e,t){var n=e.getColor(Dl);n&&t.addRule(".monaco-editor .scroll-decoration { box-shadow: "+n+" 0 6px 6px -6px inset; }")}));n(405);var dx=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hx=function(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null},fx=function(e,t){this.lineNumber=e,this.ranges=t};function px(e){return new hx(e)}function gx(e){return new fx(e.lineNumber,e.ranges.map(px))}var mx=nh,_x=function(e){function t(t){var n=e.call(this)||this;return n._previousFrameVisibleRangesWithStyle=[],n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._roundedSelection=n._context.configuration.editor.viewInfo.roundedSelection,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._selections=[],n._renderResult=null,n._context.addEventHandler(n),n}return dx(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._roundedSelection=this._context.configuration.editor.viewInfo.roundedSelection),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),!0},t.prototype.onCursorStateChanged=function(e){return this._selections=e.selections.slice(0),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._visibleRangesHaveGaps=function(e){for(var t=0,n=e.length;t1)return!0}return!1},t.prototype._enrichVisibleRangesWithStyle=function(e,t,n){var r=this._typicalHalfwidthCharacterWidth/4,i=null,o=null;if(n&&n.length>0&&t.length>0){var s=t[0].lineNumber;if(s===e.startLineNumber)for(var a=0;!i&&a=0;a--)n[a].lineNumber===u&&(o=n[a].ranges[0]);i&&!i.startStyle&&(i=null),o&&!o.startStyle&&(o=null)}a=0;for(var c=t.length;a0){var g=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;yx(d-g)g&&(f.top=1),yx(h-m)'},t.prototype._actualRenderOneSelection=function(e,n,r,i){for(var o=i.length>0&&i[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),u=i.length>0?i[0].lineNumber:0,c=i.length>0?i[i.length-1].lineNumber:0,l=0,d=i.length;l1,c)}}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t.SELECTION_CLASS_NAME="selected-text",t.SELECTION_TOP_LEFT="top-left-radius",t.SELECTION_BOTTOM_LEFT="bottom-left-radius",t.SELECTION_TOP_RIGHT="top-right-radius",t.SELECTION_BOTTOM_RIGHT="bottom-right-radius",t.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",t.ROUNDED_PIECE_WIDTH=10,t}(nC);function yx(e){return e<0?-e:e}Ad((function(e,t){var n=e.getColor(ed);n&&t.addRule(".monaco-editor .focused .selected-text { background-color: "+n+"; }");var r=e.getColor(nd);r&&t.addRule(".monaco-editor .selected-text { background-color: "+r+"; }");var i=e.getColor(td);i&&t.addRule(".monaco-editor .view-line span.inline-selected-text { color: "+i+"; }")}));n(406);var vx=function(e,t,n,r,i,o){this.top=e,this.left=t,this.width=n,this.height=r,this.textContent=i,this.textContentClassName=o},bx=function(){function e(e){this._context=e,this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._lineHeight=this._context.configuration.editor.lineHeight,this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(this._context.configuration.editor.viewInfo.cursorWidth,this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=bp(document.createElement("div")),this._domNode.setClassName("cursor"),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Jb.applyFontInfo(this._domNode,this._context.configuration.editor.fontInfo),this._domNode.setDisplay("none"),this._position=new _t(1,1),this._lastRenderedContent="",this._renderData=null}return e.prototype.getDomNode=function(){return this._domNode},e.prototype.getPosition=function(){return this._position},e.prototype.show=function(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)},e.prototype.hide=function(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)},e.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(Jb.applyFontInfo(this._domNode,this._context.configuration.editor.fontInfo),this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),e.viewInfo&&(this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._lineCursorWidth=Math.min(this._context.configuration.editor.viewInfo.cursorWidth,this._typicalHalfwidthCharacterWidth)),!0},e.prototype.onCursorPositionChanged=function(e){return this._position=e,!0},e.prototype._prepareRender=function(e){var t="",n="";if(this._cursorStyle===Jr.Line||this._cursorStyle===Jr.LineThin){var r,i=e.visibleRangeForPosition(this._position);if(!i)return null;if(this._cursorStyle===Jr.Line){if((r=Mf(this._lineCursorWidth>0?this._lineCursorWidth:2))>2)t=this._context.model.getLineContent(this._position.lineNumber).charAt(this._position.column-1)}else r=Mf(1);var o=i.left;r>=2&&o>=1&&(o-=1);var s=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new vx(s,o,r,this._lineHeight,t,n)}var a=e.linesVisibleRangesForRange(new Tr(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+1),!1);if(!a||0===a.length||0===a[0].ranges.length)return null;var u=a[0].ranges[0],c=u.width<1?this._typicalHalfwidthCharacterWidth:u.width;if(this._cursorStyle===Jr.Block){var l=this._context.model.getViewLineData(this._position.lineNumber);t=l.content.charAt(this._position.column-1),mn(l.content.charCodeAt(this._position.column-1))&&(t+=l.content.charAt(this._position.column));var d=l.tokens.findTokenIndexAtOffset(this._position.column-1);n=l.tokens.getClassName(d)}var h=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,f=this._lineHeight;return this._cursorStyle!==Jr.Underline&&this._cursorStyle!==Jr.UnderlineThin||(h+=this._lineHeight-2,f=2),new vx(h,u.left,c,f,t,n)},e.prototype.prepareRender=function(e){this._renderData=this._prepareRender(e)},e.prototype.render=function(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName("cursor "+this._renderData.textContentClassName),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)},e}(),wx=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cx=function(e){function t(t){var n=e.call(this,t)||this;return n._readOnly=n._context.configuration.editor.readOnly,n._cursorBlinking=n._context.configuration.editor.viewInfo.cursorBlinking,n._cursorStyle=n._context.configuration.editor.viewInfo.cursorStyle,n._cursorSmoothCaretAnimation=n._context.configuration.editor.viewInfo.cursorSmoothCaretAnimation,n._selectionIsEmpty=!0,n._isVisible=!1,n._primaryCursor=new bx(n._context),n._secondaryCursors=[],n._renderData=[],n._domNode=bp(document.createElement("div")),n._domNode.setAttribute("role","presentation"),n._domNode.setAttribute("aria-hidden","true"),n._updateDomClassName(),n._domNode.appendChild(n._primaryCursor.getDomNode()),n._startCursorBlinkAnimation=new Ss,n._cursorFlatBlinkInterval=new xs,n._blinkingEnabled=!1,n._editorHasFocus=!1,n._updateBlinking(),n}return wx(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){e.readOnly&&(this._readOnly=this._context.configuration.editor.readOnly),e.viewInfo&&(this._cursorBlinking=this._context.configuration.editor.viewInfo.cursorBlinking,this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._cursorSmoothCaretAnimation=this._context.configuration.editor.viewInfo.cursorSmoothCaretAnimation),this._primaryCursor.onConfigurationChanged(e),this._updateBlinking(),e.viewInfo&&this._updateDomClassName();for(var t=0,n=this._secondaryCursors.length;tt.length){var o=this._secondaryCursors.length-t.length;for(r=0;rn){var o=t-n;for(i=0;i=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)},e.prototype._getAll=function(){var e=[];e[0]=this.primaryCursor;for(var t=0,n=this.secondaryCursors.length;td&&S.index--}e.splice(d,1),t.splice(l,1),this._removeSecondaryCursor(d-1),i--}}}}},e}(),Fx=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var Yx=function(e,t,n){this.selections=e,this.source=t,this.reason=n},jx=function(){function e(e,t){this.modelVersionId=e.getVersionId(),this.cursorState=t.getAll()}return e.prototype.equals=function(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(var t=0,n=this.cursorState.length;t=t.length)return!1;if(!t[n].strictContainsRange(e[n]))return!1}return!0},e}(),Hx=function(e){function t(t,n,r){var i=e.call(this)||this;i._onDidReachMaxCursorCount=i._register(new Ht),i.onDidReachMaxCursorCount=i._onDidReachMaxCursorCount.event,i._onDidAttemptReadOnlyEdit=i._register(new Ht),i.onDidAttemptReadOnlyEdit=i._onDidAttemptReadOnlyEdit.event,i._onDidChange=i._register(new Ht),i.onDidChange=i._onDidChange.event,i._configuration=t,i._model=n,i._knownModelVersionId=i._model.getVersionId(),i._viewModel=r,i.context=new Ku(i._configuration,i._model,i._viewModel),i._cursors=new Rx(i.context),i._isHandling=!1,i._isDoingComposition=!1,i._columnSelectData=null,i._autoClosedActions=[],i._prevEditOperationType=0,i._register(i._model.onDidChangeRawContent((function(e){if(i._knownModelVersionId=e.versionId,!i._isHandling){var t=e.containsEvent(1);i._onModelContentChanged(t)}}))),i._register(r.addEventListener((function(e){(function(e){for(var t=0,n=e.length;t0)for(var e=this._cursors.getSelections(),t=0;tt.MAX_CURSOR_COUNT&&(r=r.slice(0,t.MAX_CURSOR_COUNT),this._onDidReachMaxCursorCount.fire(void 0));var i=new jx(this._model,this);this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,n,i)},t.prototype.setColumnSelectData=function(e){this._columnSelectData=e},t.prototype.reveal=function(e,t,n){this._revealRange(t,0,e,n)},t.prototype.revealRange=function(e,t,n,r){this.emitCursorRevealRange(t,n,e,r)},t.prototype.scrollTo=function(e){this._viewModel.viewLayout.setScrollPositionSmooth({scrollTop:e})},t.prototype.saveState=function(){for(var e=[],t=this._cursors.getSelections(),n=0,r=t.length;n0&&this._pushAutoClosedAction(n,r),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}},t.prototype._interpretCommandResult=function(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()},t.prototype._emitStateChangedIfNecessary=function(e,t,n){var r=new jx(this._model,this);if(r.equals(n))return!1;var i=this._cursors.getSelections(),o=this._cursors.getViewSelections();try{this._beginEmit().emit(new DC(o))}finally{this._endEmit()}return n&&n.cursorState.length===r.cursorState.length&&!r.cursorState.some((function(e,t){return!e.modelState.equals(n.cursorState[t].modelState)}))||this._onDidChange.fire(new Yx(i,e||"keyboard",t)),!0},t.prototype._revealRange=function(e,t,n,r){var i=this._cursors.getViewPositions(),o=i[0];if(1===e)for(var s=1;s1)return;var a=new Tr(o.lineNumber,o.column,o.lineNumber,o.column);this.emitCursorRevealRange(a,t,n,r)},t.prototype.emitCursorRevealRange=function(e,t,n,r){try{this._beginEmit().emit(new FC(e,t,n,r))}finally{this._endEmit()}},t.prototype._findAutoClosingPairs=function(e){if(!e.length)return null;for(var t=[],n=0,r=e.length;n=0)return null;var o=i.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;var s=o[1],a=this.context.config.autoClosingPairsClose2.get(s);if(!a||1!==a.length)return null;var u=a[0].open,c=i.text.length-o[2].length-1,l=i.text.lastIndexOf(u,c-1);if(-1===l)return null;t.push([l,c])}return t},t.prototype.executeEdits=function(e,t,n){var r=this,i=null;"snippet"===e&&(i=this._findAutoClosingPairs(t)),i&&(t[0]._isTracked=!0);var o=[],s=[],a=this._model.pushEditOperations(this.getSelections(),t,(function(e){if(i)for(var t=0,a=i.length;t0&&this._pushAutoClosedAction(o,s)},t.prototype.trigger=function(e,t,n){var r=xc;if(t!==r.CompositionStart)if(t===r.CompositionEnd&&(this._isDoingComposition=!1),this._configuration.editor.readOnly)this._onDidAttemptReadOnlyEdit.fire(void 0);else{var i=new jx(this._model,this),o=0;t!==r.Undo&&t!==r.Redo&&this._cursors.stopTrackingSelections(),this._cursors.ensureValidState(),this._isHandling=!0;try{switch(t){case r.Type:this._type(e,n.text);break;case r.ReplacePreviousChar:this._replacePreviousChar(n.text,n.replaceCharCnt);break;case r.Paste:o=4,this._paste(n.text,n.pasteOnNewLine,n.multicursorText);break;case r.Cut:this._cut();break;case r.Undo:o=5,this._interpretCommandResult(this._model.undo());break;case r.Redo:o=6,this._interpretCommandResult(this._model.redo());break;case r.ExecuteCommand:this._externalExecuteCommand(n);break;case r.ExecuteCommands:this._externalExecuteCommands(n);break;case r.CompositionEnd:this._interpretCompositionEnd(e)}}catch(e){je(e)}this._isHandling=!1,t!==r.Undo&&t!==r.Redo&&this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,o,i)&&this._revealRange(0,0,!0,0)}else this._isDoingComposition=!0},t.prototype._interpretCompositionEnd=function(e){if(!this._isDoingComposition&&"keyboard"===e){var t=Bx.getAllAutoClosedCharacters(this._autoClosedActions);this._executeEditOperation(vc.compositionEndWithInterceptors(this._prevEditOperationType,this.context.config,this.context.model,this.getSelections(),t))}},t.prototype._type=function(e,t){if(this._isDoingComposition||"keyboard"!==e)this._executeEditOperation(vc.typeWithoutInterceptors(this._prevEditOperationType,this.context.config,this.context.model,this.getSelections(),t));else for(var n=0,r=t.length;n0&&(o[0]._isTracked=!0);var u=e.model.pushEditOperations(e.selectionsBefore,o,(function(n){for(var r=[],i=0;i0?(r[n].sort(u),c[n]=t[n].computeCursorState(e.model,{getInverseEditOperations:function(){return r[n]},getTrackedSelection:function(t){var n=parseInt(t,10),r=e.model._getTrackedRange(e.trackedRanges[n]);return 0===e.trackedRangesDirection[n]?new Or(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn):new Or(r.endLineNumber,r.endColumn,r.startLineNumber,r.startColumn)}})):c[n]=e.selectionsBefore[n]};for(i=0;ii.identifier.major?r.identifier.major:i.identifier.major).toString()]=!0;for(var s=0;s0&&n--}}return t},e}(),Vx=function(){function e(e,t,n,r,i,o){this.id=e,this.label=t,this.alias=n,this._precondition=r,this._run=i,this._contextKeyService=o}return e.prototype.isSupported=function(){return this._contextKeyService.contextMatchesRules(this._precondition)},e.prototype.run=function(){if(!this.isSupported())return Promise.resolve(void 0);var e=this._run();return e||Promise.resolve(void 0)},e}();function zx(e,t,n,r,i,o){for(var s="
",a=r,u=0,c=0,l=t.getCount();c0;)h+=" ",p--;break;case 60:h+="<";break;case 62:h+=">";break;case 38:h+="&";break;case 0:h+="�";break;case 65279:case 8232:h+="�";break;case 13:h+="​";break;case 32:h+=" ";break;default:h+=String.fromCharCode(f)}}if(s+=''+h+"",d>i||a>=i)break}}return s+="
"}var Ux=function(){function e(){this._instanceId=Ln(++e.INSTANCE_COUNT),this._heights=[],this._minWidths=[],this._ids=[],this._afterLineNumbers=[],this._ordinals=[],this._prefixSum=[],this._prefixSumValidIndex=-1,this._whitespaceId2Index={},this._lastWhitespaceId=0,this._minWidth=-1}return e.findInsertionIndex=function(e,t,n,r){for(var i=0,o=e.length;i>>1;t===e[s]?r=t&&(this._whitespaceId2Index[c]=l+1)}this._whitespaceId2Index[e]=t,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)},e.prototype.changeWhitespace=function(e,t,n){t|=0,n|=0;var r=!1;return r=this.changeWhitespaceHeight(e,n)||r,r=this.changeWhitespaceAfterLineNumber(e,t)||r},e.prototype.changeWhitespaceHeight=function(e,t){if(t|=0,this._whitespaceId2Index.hasOwnProperty(e)){var n=this._whitespaceId2Index[e];if(this._heights[n]!==t)return this._heights[n]=t,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1),!0}return!1},e.prototype.changeWhitespaceAfterLineNumber=function(t,n){if(n|=0,this._whitespaceId2Index.hasOwnProperty(t)){var r=this._whitespaceId2Index[t];if(this._afterLineNumbers[r]!==n){var i=this._ordinals[r],o=this._heights[r],s=this._minWidths[r];this.removeWhitespace(t);var a=e.findInsertionIndex(this._afterLineNumbers,n,this._ordinals,i);return this._insertWhitespaceAtIndex(t,a,n,i,o,s),!0}}return!1},e.prototype.removeWhitespace=function(e){if(this._whitespaceId2Index.hasOwnProperty(e)){var t=this._whitespaceId2Index[e];return delete this._whitespaceId2Index[e],this._removeWhitespaceAtIndex(t),this._minWidth=-1,!0}return!1},e.prototype._removeWhitespaceAtIndex=function(e){e|=0,this._heights.splice(e,1),this._minWidths.splice(e,1),this._ids.splice(e,1),this._afterLineNumbers.splice(e,1),this._ordinals.splice(e,1),this._prefixSum.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1);for(var t=Object.keys(this._whitespaceId2Index),n=0,r=t.length;n=e&&(this._whitespaceId2Index[i]=o-1)}},e.prototype.onLinesDeleted=function(e,t){e|=0,t|=0;for(var n=0,r=this._afterLineNumbers.length;nt&&(this._afterLineNumbers[n]-=t-e+1)}},e.prototype.onLinesInserted=function(e,t){e|=0,t|=0;for(var n=0,r=this._afterLineNumbers.length;n=t.length||t[i+1]>=e)return i;n=i+1|0}else r=i-1|0}return-1},e.prototype._findFirstWhitespaceAfterLineNumber=function(e){e|=0;var t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t1?this._lineHeight*(e-1):0)+this._whitespaces.getAccumulatedHeightBeforeLineNumber(e)},e.prototype.getWhitespaceAccumulatedHeightBeforeLineNumber=function(e){return this._whitespaces.getAccumulatedHeightBeforeLineNumber(e)},e.prototype.getWhitespaceMinWidth=function(){return this._whitespaces.getMinWidth()},e.prototype.isAfterLines=function(e){return e>this.getLinesTotalHeight()},e.prototype.getLineNumberAtOrAfterVerticalOffset=function(e){if((e|=0)<0)return 1;for(var t=0|this._lineCount,n=this._lineHeight,r=1,i=t;r=s+n)r=o+1;else{if(e>=s)return o;i=o}}return r>t?t:r},e.prototype.getLinesViewportData=function(e,t){e|=0,t|=0;var n,r,i=this._lineHeight,o=0|this.getLineNumberAtOrAfterVerticalOffset(e),s=0|this.getVerticalOffsetForLineNumber(o),a=0|this._lineCount,u=0|this._whitespaces.getFirstWhitespaceIndexAfterLineNumber(o),c=0|this._whitespaces.getCount();-1===u?(u=c,r=a+1,n=0):(r=0|this._whitespaces.getAfterLineNumberForWhitespaceIndex(u),n=0|this._whitespaces.getHeightForWhitespaceIndex(u));var l=s,d=l,h=0;s>=5e5&&(h=5e5*Math.floor(s/5e5),d-=h=Math.floor(h/i)*i);for(var f=[],p=e+(t-e)/2,g=-1,m=o;m<=a;m++){if(-1===g){(l<=p&&pp)&&(g=m)}for(l+=i,f[m-o]=d,d+=i;r===m;)d+=n,l+=n,++u>=c?r=a+1:(r=0|this._whitespaces.getAfterLineNumberForWhitespaceIndex(u),n=0|this._whitespaces.getHeightForWhitespaceIndex(u));if(l>=t){a=m;break}}-1===g&&(g=a);var _=0|this.getVerticalOffsetForLineNumber(a),y=o,v=a;return yt&&v--,{bigNumbersDelta:h,startLineNumber:o,endLineNumber:a,relativeVerticalOffset:f,centeredLineNumber:g,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:v}},e.prototype.getVerticalOffsetForWhitespaceIndex=function(e){e|=0;var t=this._whitespaces.getAfterLineNumberForWhitespaceIndex(e);return(t>=1?this._lineHeight*t:0)+(e>0?this._whitespaces.getAccumulatedHeight(e-1):0)},e.prototype.getWhitespaceIndexAtOrAfterVerticallOffset=function(e){e|=0;var t,n,r=0,i=this._whitespaces.getCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this._whitespaces.getHeightForWhitespaceIndex(i))return-1;for(;r=(n=this.getVerticalOffsetForWhitespaceIndex(t))+this._whitespaces.getHeightForWhitespaceIndex(t))r=t+1;else{if(e>=n)return t;i=t}return r},e.prototype.getWhitespaceAtVerticalOffset=function(e){e|=0;var t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this._whitespaces.getCount())return null;var n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;var r=this._whitespaces.getHeightForWhitespaceIndex(t);return{id:this._whitespaces.getIdForWhitespaceIndex(t),afterLineNumber:this._whitespaces.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:n,height:r}},e.prototype.getWhitespaceViewportData=function(e,t){e|=0,t|=0;var n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),r=this._whitespaces.getCount()-1;if(n<0)return[];for(var i=[],o=n;o<=r;o++){var s=this.getVerticalOffsetForWhitespaceIndex(o),a=this._whitespaces.getHeightForWhitespaceIndex(o);if(s>=t)break;i.push({id:this._whitespaces.getIdForWhitespaceIndex(o),afterLineNumber:this._whitespaces.getAfterLineNumberForWhitespaceIndex(o),verticalOffset:s,height:a})}return i},e.prototype.getWhitespaces=function(){return this._whitespaces.getWhitespaces(this._lineHeight)},e}(),Kx=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gx=function(e){function t(t,n,r){var i=e.call(this)||this;return i._configuration=t,i._linesLayout=new qx(n,i._configuration.editor.lineHeight),i.scrollable=i._register(new Fp(0,r)),i._configureSmoothScrollDuration(),i.scrollable.setScrollDimensions({width:t.editor.layoutInfo.contentWidth,height:t.editor.layoutInfo.contentHeight}),i.onDidScroll=i.scrollable.onScroll,i._updateHeight(),i}return Kx(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onHeightMaybeChanged=function(){this._updateHeight()},t.prototype._configureSmoothScrollDuration=function(){this.scrollable.setSmoothScrollDuration(this._configuration.editor.viewInfo.smoothScrolling?125:0)},t.prototype.onConfigurationChanged=function(e){e.lineHeight&&this._linesLayout.setLineHeight(this._configuration.editor.lineHeight),e.layoutInfo&&this.scrollable.setScrollDimensions({width:this._configuration.editor.layoutInfo.contentWidth,height:this._configuration.editor.layoutInfo.contentHeight}),e.viewInfo&&this._configureSmoothScrollDuration(),this._updateHeight()},t.prototype.onFlushed=function(e){this._linesLayout.onFlushed(e)},t.prototype.onLinesDeleted=function(e,t){this._linesLayout.onLinesDeleted(e,t)},t.prototype.onLinesInserted=function(e,t){this._linesLayout.onLinesInserted(e,t)},t.prototype._getHorizontalScrollbarHeight=function(e){return 2===this._configuration.editor.viewInfo.scrollbar.horizontal?0:e.width>=e.scrollWidth?0:this._configuration.editor.viewInfo.scrollbar.horizontalScrollbarSize},t.prototype._getTotalHeight=function(){var e=this.scrollable.getScrollDimensions(),t=this._linesLayout.getLinesTotalHeight();return this._configuration.editor.viewInfo.scrollBeyondLastLine?t+=e.height-this._configuration.editor.lineHeight:t+=this._getHorizontalScrollbarHeight(e),Math.max(e.height,t)},t.prototype._updateHeight=function(){this.scrollable.setScrollDimensions({scrollHeight:this._getTotalHeight()})},t.prototype.getCurrentViewport=function(){var e=this.scrollable.getScrollDimensions(),t=this.scrollable.getCurrentScrollPosition();return new Fy(t.scrollTop,t.scrollLeft,e.width,e.height)},t.prototype.getFutureViewport=function(){var e=this.scrollable.getScrollDimensions(),t=this.scrollable.getFutureScrollPosition();return new Fy(t.scrollTop,t.scrollLeft,e.width,e.height)},t.prototype._computeScrollWidth=function(e,t){if(!this._configuration.editor.wrappingInfo.isViewportWrapping){var n=this._configuration.editor.viewInfo.scrollBeyondLastColumn*this._configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,r=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+n,t,r)}return Math.max(e,t)},t.prototype.onMaxLineWidthChanged=function(e){var t=this._computeScrollWidth(e,this.getCurrentViewport().width);this.scrollable.setScrollDimensions({scrollWidth:t}),this._updateHeight()},t.prototype.saveState=function(){var e=this.scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n),scrollLeft:e.scrollLeft}},t.prototype.addWhitespace=function(e,t,n,r){return this._linesLayout.insertWhitespace(e,t,n,r)},t.prototype.changeWhitespace=function(e,t,n){return this._linesLayout.changeWhitespace(e,t,n)},t.prototype.removeWhitespace=function(e){return this._linesLayout.removeWhitespace(e)},t.prototype.getVerticalOffsetForLineNumber=function(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)},t.prototype.isAfterLines=function(e){return this._linesLayout.isAfterLines(e)},t.prototype.getLineNumberAtVerticalOffset=function(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)},t.prototype.getWhitespaceAtVerticalOffset=function(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)},t.prototype.getLinesViewportData=function(){var e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)},t.prototype.getLinesViewportDataAtScrollTop=function(e){var t=this.scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)},t.prototype.getWhitespaceViewportData=function(){var e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)},t.prototype.getWhitespaces=function(){return this._linesLayout.getWhitespaces()},t.prototype.getScrollWidth=function(){return this.scrollable.getScrollDimensions().scrollWidth},t.prototype.getScrollHeight=function(){return this.scrollable.getScrollDimensions().scrollHeight},t.prototype.getCurrentScrollLeft=function(){return this.scrollable.getCurrentScrollPosition().scrollLeft},t.prototype.getCurrentScrollTop=function(){return this.scrollable.getCurrentScrollPosition().scrollTop},t.prototype.validateScrollPosition=function(e){return this.scrollable.validateScrollPosition(e)},t.prototype.setScrollPositionNow=function(e){this.scrollable.setScrollPositionNow(e)},t.prototype.setScrollPositionSmooth=function(e){this.scrollable.setScrollPositionSmooth(e)},t.prototype.deltaScrollNow=function(e,t){var n=this.scrollable.getCurrentScrollPosition();this.scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})},t}(Dt),$x=function(e,t){this.outputLineIndex=e,this.outputOffset=t},Zx=function(){function e(e){this._lines=e}return e.prototype.convertViewPositionToModelPosition=function(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)},e.prototype.convertViewRangeToModelRange=function(e){var t=this._lines.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this._lines.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new Tr(t.lineNumber,t.column,n.lineNumber,n.column)},e.prototype.validateViewPosition=function(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)},e.prototype.validateViewRange=function(e,t){var n=this._lines.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),r=this._lines.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new Tr(n.lineNumber,n.column,r.lineNumber,r.column)},e.prototype.convertModelPositionToViewPosition=function(e){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column)},e.prototype.convertModelRangeToViewRange=function(e){var t=this._lines.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn),n=this._lines.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn);return new Tr(t.lineNumber,t.column,n.lineNumber,n.column)},e.prototype.modelPositionIsVisible=function(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)},e}(),Jx=function(){function e(e,t,n,r,i,o){this.model=e,this._validModelVersionId=-1,this.tabSize=n,this.wrappingColumn=r,this.columnsForFullWidthChar=i,this.wrappingIndent=o,this.linePositionMapperFactory=t,this._constructLines(!0)}return e.prototype.dispose=function(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])},e.prototype.createCoordinatesConverter=function(){return new Zx(this)},e.prototype._ensureValidState=function(){if(this.model.getVersionId()!==this._validModelVersionId)throw new Error("ViewModel is out of sync with Model!");this.lines.length!==this.model.getLineCount()&&this._constructLines(!1)},e.prototype._constructLines=function(e){var t=this;this.lines=[],e&&(this.hiddenAreasIds=[]);for(var n=this.model.getLinesContent(),r=n.length,i=new Uint32Array(r),o=this.hiddenAreasIds.map((function(e){return t.model.getDecorationRange(e)})).sort(Tr.compareRangesUsingStarts),s=1,a=0,u=-1,c=u+1=s&&d<=a,f=tk(this.linePositionMapperFactory,n[l],this.tabSize,this.wrappingColumn,this.columnsForFullWidthChar,this.wrappingIndent,!h);i[l]=f.getViewLineCount(),this.lines[l]=f}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new q_(i)},e.prototype.getHiddenAreas=function(){var e=this;return this.hiddenAreasIds.map((function(t){return e.model.getDecorationRange(t)}))},e.prototype._reduceRanges=function(e){var t=this;if(0===e.length)return[];for(var n=e.map((function(e){return t.model.validateRange(e)})).sort(Tr.compareRangesUsingStarts),r=[],i=n[0].startLineNumber,o=n[0].endLineNumber,s=1,a=n.length;so+1?(r.push(new Tr(i,1,o,1)),i=u.startLineNumber,o=u.endLineNumber):u.endLineNumber>o&&(o=u.endLineNumber)}return r.push(new Tr(i,1,o,1)),r},e.prototype.setHiddenAreas=function(e){var t=this,n=this._reduceRanges(e),r=this.hiddenAreasIds.map((function(e){return t.model.getDecorationRange(e)})).sort(Tr.compareRangesUsingStarts);if(n.length===r.length){for(var i=!1,o=0;o=d&&m<=h?this.lines[o].isVisible()&&(this.lines[o]=this.lines[o].setVisible(!1),_=!0):(g=!0,this.lines[o].isVisible()||(this.lines[o]=this.lines[o].setVisible(!0),_=!0)),_){var y=this.lines[o].getViewLineCount();this.prefixSumComputer.changeValue(o,y)}}return g||this.setHiddenAreas([]),!0},e.prototype.modelPositionIsVisible=function(e,t){return!(e<1||e>this.lines.length)&&this.lines[e-1].isVisible()},e.prototype.setTabSize=function(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1),!0)},e.prototype.setWrappingSettings=function(e,t,n){return(this.wrappingIndent!==e||this.wrappingColumn!==t||this.columnsForFullWidthChar!==n)&&(this.wrappingIndent=e,this.wrappingColumn=t,this.columnsForFullWidthChar=n,this._constructLines(!1),!0)},e.prototype.onModelFlushed=function(){this._constructLines(!0)},e.prototype.onModelLinesDeleted=function(e,t,n){if(e<=this._validModelVersionId)return null;var r=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,i=this.prefixSumComputer.getAccumulatedValue(n-1);return this.lines.splice(t-1,n-t+1),this.prefixSumComputer.removeValues(t-1,n-t+1),new PC(r,i)},e.prototype.onModelLinesInserted=function(e,t,n,r){if(e<=this._validModelVersionId)return null;for(var i=this.getHiddenAreas(),o=!1,s=new _t(t,1),a=0,u=i;aa?(p=(f=(l=(c=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1)+a-1)+1)+(i-a)-1,u=!0):it?t:e},e.prototype.warmUpLookupCache=function(e,t){this.prefixSumComputer.warmUpCache(e-1,t-1)},e.prototype.getActiveIndentGuide=function(e,t,n){this._ensureValidState(),e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);var r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),i=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),o=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),s=this.model.getActiveIndentGuide(r.lineNumber,i.lineNumber,o.lineNumber),a=this.convertModelPositionToViewPosition(s.startLineNumber,1),u=this.convertModelPositionToViewPosition(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:u.lineNumber,indent:s.indent}},e.prototype.getViewLinesIndentGuides=function(e,t){this._ensureValidState(),e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);for(var n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t)),i=[],o=[],s=[],a=n.lineNumber-1,u=r.lineNumber-1,c=null,l=a;l<=u;l++){var d=this.lines[l];if(d.isVisible()){var h=d.getViewLineNumberOfModelPosition(0,l===a?n.column:1),f=d.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(l+1)),p=0;(w=f-h+1)>1&&1===d.getViewLineMinColumn(this.model,l+1,f)&&(p=0===h?1:2),o.push(w),s.push(p),null===c&&(c=new _t(l+1,0))}else null!==c&&(i=i.concat(this.model.getLinesIndentGuides(c.lineNumber,l)),c=null)}null!==c&&(i=i.concat(this.model.getLinesIndentGuides(c.lineNumber,r.lineNumber)),c=null);for(var g=t-e+1,m=new Array(g),_=0,y=0,v=i.length;yt&&(f=!0,h=t-i+1);var p=d+h;if(l.getViewLinesData(this.model,u+1,d,p,i-e,n,a),i+=h,f)break}}return a},e.prototype.validateViewPosition=function(e,t,n){this._ensureValidState(),e=this._toValidViewLineNumber(e);var r=this.prefixSumComputer.getIndexOf(e-1),i=r.index,o=r.remainder,s=this.lines[i],a=s.getViewLineMinColumn(this.model,i+1,o),u=s.getViewLineMaxColumn(this.model,i+1,o);tu&&(t=u);var c=s.getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new _t(i+1,c)).equals(n)?new _t(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)},e.prototype.convertViewPositionToModelPosition=function(e,t){this._ensureValidState(),e=this._toValidViewLineNumber(e);var n=this.prefixSumComputer.getIndexOf(e-1),r=n.index,i=n.remainder,o=this.lines[r].getModelColumnOfViewPosition(i,t);return this.model.validatePosition(new _t(r+1,o))},e.prototype.convertModelPositionToViewPosition=function(e,t){this._ensureValidState();for(var n=this.model.validatePosition(new _t(e,t)),r=n.lineNumber,i=n.column,o=r-1,s=!1;o>0&&!this.lines[o].isVisible();)o--,s=!0;if(0===o&&!this.lines[o].isVisible())return new _t(1,1);var a=1+(0===o?0:this.prefixSumComputer.getAccumulatedValue(o-1));return s?this.lines[o].getViewPositionOfModelPosition(a,this.model.getLineMaxColumn(o+1)):this.lines[r-1].getViewPositionOfModelPosition(a,i)},e.prototype._getViewLineNumberForModelPosition=function(e,t){var n=e-1;if(this.lines[n].isVisible()){var r=1+(0===n?0:this.prefixSumComputer.getAccumulatedValue(n-1));return this.lines[n].getViewLineNumberOfModelPosition(r,t)}for(;n>0&&!this.lines[n].isVisible();)n--;if(0===n&&!this.lines[n].isVisible())return 1;var i=1+(0===n?0:this.prefixSumComputer.getAccumulatedValue(n-1));return this.lines[n].getViewLineNumberOfModelPosition(i,this.model.getLineMaxColumn(n+1))},e.prototype.getAllOverviewRulerDecorations=function(e,t,n){for(var r=this.model.getOverviewRulerDecorations(e,t),i=new ik,o=0,s=r;ot.id?1:0:n}));for(var d=[],h=0,f=null,p=0,g=o;p0&&(o=this.wrappedIndent+o),o},e.prototype.getViewLineLength=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");var r=this.getInputStartOffsetOfOutputLineIndex(n),i=this.getInputEndOffsetOfOutputLineIndex(e,t,n)-r;return n>0&&(i=this.wrappedIndent.length+i),i},e.prototype.getViewLineMinColumn=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");return n>0?this.wrappedIndentLength+1:1},e.prototype.getViewLineMaxColumn=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineContent(e,t,n).length+1},e.prototype.getViewLineData=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");var r=this.getInputStartOffsetOfOutputLineIndex(n),i=this.getInputEndOffsetOfOutputLineIndex(e,t,n),o=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:i+1});n>0&&(o=this.wrappedIndent+o);var s=n>0?this.wrappedIndentLength+1:1,a=o.length+1,u=n+10&&(c=this.wrappedIndentLength);var l=e.getLineTokens(t);return new jy(o,u,s,a,l.sliceAndInflate(r,i,c))},e.prototype.getViewLinesData=function(e,t,n,r,i,o,s){if(!this._isVisible)throw new Error("Not supported");for(var a=n;a0&&(n0&&(i+=this.wrappedIndentLength),new _t(e+r,i)},e.prototype.getViewLineNumberOfModelPosition=function(e,t){if(!this._isVisible)throw new Error("Not supported");return e+this.positionMapper.getOutputPositionOfInputOffset(t-1).outputLineIndex},e}();function tk(e,t,n,r,i,o,s){var a=e.createLineMapping(t,n,r,i,o);return null===a?s?Xx.INSTANCE:Qx.INSTANCE:new ek(a,s)}var nk=function(){function e(e){this._lines=e}return e.prototype._validPosition=function(e){return this._lines.model.validatePosition(e)},e.prototype._validRange=function(e){return this._lines.model.validateRange(e)},e.prototype.convertViewPositionToModelPosition=function(e){return this._validPosition(e)},e.prototype.convertViewRangeToModelRange=function(e){return this._validRange(e)},e.prototype.validateViewPosition=function(e,t){return this._validPosition(t)},e.prototype.validateViewRange=function(e,t){return this._validRange(t)},e.prototype.convertModelPositionToViewPosition=function(e){return this._validPosition(e)},e.prototype.convertModelRangeToViewRange=function(e){return this._validRange(e)},e.prototype.modelPositionIsVisible=function(e){var t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)},e}(),rk=function(){function e(e){this.model=e}return e.prototype.dispose=function(){},e.prototype.createCoordinatesConverter=function(){return new nk(this)},e.prototype.getHiddenAreas=function(){return[]},e.prototype.setHiddenAreas=function(e){return!1},e.prototype.setTabSize=function(e){return!1},e.prototype.setWrappingSettings=function(e,t,n){return!1},e.prototype.onModelFlushed=function(){},e.prototype.onModelLinesDeleted=function(e,t,n){return new PC(t,n)},e.prototype.onModelLinesInserted=function(e,t,n,r){return new RC(t,n)},e.prototype.onModelLineChanged=function(e,t,n){return[!1,new IC(t,t),null,null]},e.prototype.acceptVersionId=function(e){},e.prototype.getViewLineCount=function(){return this.model.getLineCount()},e.prototype.warmUpLookupCache=function(e,t){},e.prototype.getActiveIndentGuide=function(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}},e.prototype.getViewLinesIndentGuides=function(e,t){for(var n=t-e+1,r=new Array(n),i=0;i=t)return void(n>s&&(i[i.length-1]=n));i.push(r,t,n)}else this.result[e]=[r,t,n]},e}(),ok=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sk=function(e){function t(t,n,r){for(var i=e.call(this,0)||this,o=0;o=12352&&t<=12543||t>=13312&&t<=19903||t>=19968&&t<=40959?4:e.prototype.get.call(this,t)},t}(fo),ak=function(){function e(e,t,n){this.classifier=new sk(e,t,n)}return e.nextVisibleColumn=function(e,t,n,r){return e=+e,t=+t,r=+r,n?e+(t-e%t):e+r},e.prototype.createLineMapping=function(t,n,r,i,o){if(-1===r)return null;n=+n,r=+r,i=+i;var s=0,a="",u=-1;if(0!==(o=+o)&&-1!==(u=an(t))){a=t.substring(0,u);for(var c=0;cr&&(a="",s=0)}var d=this.classifier,h=0,f=[],p=0,g=0,m=-1,_=0,y=-1,v=0,b=t.length;for(c=0;c0){var x=t.charCodeAt(c-1);1!==d.get(x)&&(m=c,_=s)}var k=1;if(Sn(w)&&(k=i),(g=e.nextVisibleColumn(g,n,C,k))>r&&0!==c){var L=void 0,M=void 0;-1!==m&&_<=r?(L=m,M=_):-1!==y&&v<=r?(L=y,M=v):(L=c,M=s),f[p++]=L-h,h=L,g=e.nextVisibleColumn(M,n,C,k),m=-1,_=0,y=-1,v=0}if(-1!==m&&(_=e.nextVisibleColumn(_,n,C,k)),-1!==y&&(v=e.nextVisibleColumn(v,n,C,k)),2===S&&(0===o||c>=u)&&(m=c+1,_=s),4===S&&c=2&&e.viewportStartLineTrackedRange){var g=e.model._getTrackedRange(e.viewportStartLineTrackedRange);if(g){var m=e.coordinatesConverter.convertModelPositionToViewPosition(g.getStartPosition()),_=e.viewLayout.getVerticalOffsetForLineNumber(m.lineNumber);e.viewLayout.setScrollPositionNow({scrollTop:_+e.viewportStartLineDelta})}}}))),this._register(this.model.onDidChangeTokens((function(t){for(var n=[],r=0,i=t.ranges.length;ra||(o0&&s[u-1]===s[u]||(a+=this.model.getLineContent(s[u])+i);return a}for(var c=[],l=0,d=o;l'+this._getHTMLToCopy(n,o)+""},t.prototype._getHTMLToCopy=function(e,t){for(var n=e.startLineNumber,r=e.startColumn,i=e.endLineNumber,o=e.endColumn,s=this.getTabSize(),a="",u=n;u<=i;u++){var c=this.model.getLineTokens(u),l=c.getLineContent(),d=u===n?r-1:0,h=u===i?o-1:l.length;a+=""===l?"
":zx(l,c.inflate(),t,d,h,s)}return a},t.prototype._getColorMap=function(){var e=Ma.getColorMap(),t=["#000000"];if(e)for(var n=1,r=e.length;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},yk=function(e,t){return function(n,r){t(n,r,e)}},vk=0,bk="showUnused",wk=function(){function e(e,t,n,r,i,o){this.model=e,this.viewModel=t,this.cursor=n,this.view=r,this.hasRealView=i,this.listenersToRemove=o}return e.prototype.dispose=function(){kt(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.cursor.dispose(),this.viewModel.dispose()},e}(),Ck=function(e){function t(t,n,r,i,o,s,a,u,c,l){var d,h=e.call(this)||this;h._onDidDispose=h._register(new Ht),h.onDidDispose=h._onDidDispose.event,h._onDidChangeModelContent=h._register(new Ht),h.onDidChangeModelContent=h._onDidChangeModelContent.event,h._onDidChangeModelLanguage=h._register(new Ht),h.onDidChangeModelLanguage=h._onDidChangeModelLanguage.event,h._onDidChangeModelLanguageConfiguration=h._register(new Ht),h.onDidChangeModelLanguageConfiguration=h._onDidChangeModelLanguageConfiguration.event,h._onDidChangeModelOptions=h._register(new Ht),h.onDidChangeModelOptions=h._onDidChangeModelOptions.event,h._onDidChangeModelDecorations=h._register(new Ht),h.onDidChangeModelDecorations=h._onDidChangeModelDecorations.event,h._onDidChangeConfiguration=h._register(new Ht),h.onDidChangeConfiguration=h._onDidChangeConfiguration.event,h._onDidChangeModel=h._register(new Ht),h.onDidChangeModel=h._onDidChangeModel.event,h._onDidChangeCursorPosition=h._register(new Ht),h.onDidChangeCursorPosition=h._onDidChangeCursorPosition.event,h._onDidChangeCursorSelection=h._register(new Ht),h.onDidChangeCursorSelection=h._onDidChangeCursorSelection.event,h._onDidAttemptReadOnlyEdit=h._register(new Ht),h.onDidAttemptReadOnlyEdit=h._onDidAttemptReadOnlyEdit.event,h._onDidLayoutChange=h._register(new Ht),h.onDidLayoutChange=h._onDidLayoutChange.event,h._editorTextFocus=h._register(new Sk),h.onDidFocusEditorText=h._editorTextFocus.onDidChangeToTrue,h.onDidBlurEditorText=h._editorTextFocus.onDidChangeToFalse,h._editorWidgetFocus=h._register(new Sk),h.onDidFocusEditorWidget=h._editorWidgetFocus.onDidChangeToTrue,h.onDidBlurEditorWidget=h._editorWidgetFocus.onDidChangeToFalse,h._onWillType=h._register(new Ht),h.onWillType=h._onWillType.event,h._onDidType=h._register(new Ht),h.onDidType=h._onDidType.event,h._onCompositionStart=h._register(new Ht),h.onCompositionStart=h._onCompositionStart.event,h._onCompositionEnd=h._register(new Ht),h.onCompositionEnd=h._onCompositionEnd.event,h._onDidPaste=h._register(new Ht),h.onDidPaste=h._onDidPaste.event,h._onMouseUp=h._register(new Ht),h.onMouseUp=h._onMouseUp.event,h._onMouseDown=h._register(new Ht),h.onMouseDown=h._onMouseDown.event,h._onMouseDrag=h._register(new Ht),h.onMouseDrag=h._onMouseDrag.event,h._onMouseDrop=h._register(new Ht),h.onMouseDrop=h._onMouseDrop.event,h._onContextMenu=h._register(new Ht),h.onContextMenu=h._onContextMenu.event,h._onMouseMove=h._register(new Ht),h.onMouseMove=h._onMouseMove.event,h._onMouseLeave=h._register(new Ht),h.onMouseLeave=h._onMouseLeave.event,h._onMouseWheel=h._register(new Ht),h.onMouseWheel=h._onMouseWheel.event,h._onKeyUp=h._register(new Ht),h.onKeyUp=h._onKeyUp.event,h._onKeyDown=h._register(new Ht),h.onKeyDown=h._onKeyDown.event,h._onDidScrollChange=h._register(new Ht),h.onDidScrollChange=h._onDidScrollChange.event,h._onDidChangeViewZones=h._register(new Ht),h.onDidChangeViewZones=h._onDidChangeViewZones.event,h._domElement=t,h._id=++vk,h._decorationTypeKeysToIds={},h._decorationTypeSubtypes={},h.isSimpleWidget=r.isSimpleWidget||!1,h._telemetryData=r.telemetryData,n=n||{},h._configuration=h._register(h._createConfiguration(n,l)),h._register(h._configuration.onDidChange((function(e){h._onDidChangeConfiguration.fire(e),e.layoutInfo&&h._onDidLayoutChange.fire(h._configuration.editor.layoutInfo),h._configuration.editor.showUnused?h._domElement.classList.add(bk):h._domElement.classList.remove(bk)}))),h._contextKeyService=h._register(a.createScoped(h._domElement)),h._notificationService=c,h._codeEditorService=o,h._commandService=s,h._themeService=u,h._register(new xk(h,h._contextKeyService)),h._register(new kk(h,h._contextKeyService)),h._instantiationService=i.createChild(new fk([jn,h._contextKeyService])),h._modelData=null,h._contributions={},h._actions={},h._focusTracker=new Lk(t),h._focusTracker.onChange((function(){h._editorWidgetFocus.setValue(h._focusTracker.hasFocus())})),h._contentWidgets={},h._overlayWidgets={};for(var f=0,p=(d=Array.isArray(r.contributions)?r.contributions:wr.getEditorContributions()).length;f1),this._hasNonEmptySelection.set(e.some((function(e){return!e.isEmpty()})))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())},t.prototype._updateFromFocus=function(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())},t.prototype._updateFromModel=function(){var e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))},t}(Dt),kk=function(e){function t(t,n){var r=e.call(this)||this;r._editor=t,r._contextKeyService=n,r._langId=wc.languageId.bindTo(n),r._hasCompletionItemProvider=wc.hasCompletionItemProvider.bindTo(n),r._hasCodeActionsProvider=wc.hasCodeActionsProvider.bindTo(n),r._hasCodeLensProvider=wc.hasCodeLensProvider.bindTo(n),r._hasDefinitionProvider=wc.hasDefinitionProvider.bindTo(n),r._hasDeclarationProvider=wc.hasDeclarationProvider.bindTo(n),r._hasImplementationProvider=wc.hasImplementationProvider.bindTo(n),r._hasTypeDefinitionProvider=wc.hasTypeDefinitionProvider.bindTo(n),r._hasHoverProvider=wc.hasHoverProvider.bindTo(n),r._hasDocumentHighlightProvider=wc.hasDocumentHighlightProvider.bindTo(n),r._hasDocumentSymbolProvider=wc.hasDocumentSymbolProvider.bindTo(n),r._hasReferenceProvider=wc.hasReferenceProvider.bindTo(n),r._hasRenameProvider=wc.hasRenameProvider.bindTo(n),r._hasSignatureHelpProvider=wc.hasSignatureHelpProvider.bindTo(n),r._hasDocumentFormattingProvider=wc.hasDocumentFormattingProvider.bindTo(n),r._hasDocumentSelectionFormattingProvider=wc.hasDocumentSelectionFormattingProvider.bindTo(n),r._hasMultipleDocumentFormattingProvider=wc.hasMultipleDocumentFormattingProvider.bindTo(n),r._hasMultipleDocumentSelectionFormattingProvider=wc.hasMultipleDocumentSelectionFormattingProvider.bindTo(n),r._isInWalkThrough=wc.isInEmbeddedEditor.bindTo(n);var i=function(){return r._update()};return r._register(t.onDidChangeModel(i)),r._register(t.onDidChangeModelLanguage(i)),r._register(ua.onDidChange(i)),r._register(va.onDidChange(i)),r._register(ya.onDidChange(i)),r._register(fa.onDidChange(i)),r._register(pa.onDidChange(i)),r._register(ma.onDidChange(i)),r._register(_a.onDidChange(i)),r._register(la.onDidChange(i)),r._register(ha.onDidChange(i)),r._register(da.onDidChange(i)),r._register(sa.onDidChange(i)),r._register(aa.onDidChange(i)),r._register(ba.onDidChange(i)),r._register(wa.onDidChange(i)),r._register(ca.onDidChange(i)),i(),r}return mk(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.reset=function(){var e=this;this._contextKeyService.bufferChangeEvents((function(){e._langId.reset(),e._hasCompletionItemProvider.reset(),e._hasCodeActionsProvider.reset(),e._hasCodeLensProvider.reset(),e._hasDefinitionProvider.reset(),e._hasDeclarationProvider.reset(),e._hasImplementationProvider.reset(),e._hasTypeDefinitionProvider.reset(),e._hasHoverProvider.reset(),e._hasDocumentHighlightProvider.reset(),e._hasDocumentSymbolProvider.reset(),e._hasReferenceProvider.reset(),e._hasRenameProvider.reset(),e._hasDocumentFormattingProvider.reset(),e._hasDocumentSelectionFormattingProvider.reset(),e._hasSignatureHelpProvider.reset(),e._isInWalkThrough.reset()}))},t.prototype._update=function(){var e=this,t=this._editor.getModel();t?this._contextKeyService.bufferChangeEvents((function(){e._langId.set(t.getLanguageIdentifier().language),e._hasCompletionItemProvider.set(ua.has(t)),e._hasCodeActionsProvider.set(va.has(t)),e._hasCodeLensProvider.set(ya.has(t)),e._hasDefinitionProvider.set(fa.has(t)),e._hasDeclarationProvider.set(pa.has(t)),e._hasImplementationProvider.set(ma.has(t)),e._hasTypeDefinitionProvider.set(_a.has(t)),e._hasHoverProvider.set(la.has(t)),e._hasDocumentHighlightProvider.set(ha.has(t)),e._hasDocumentSymbolProvider.set(da.has(t)),e._hasReferenceProvider.set(sa.has(t)),e._hasRenameProvider.set(aa.has(t)),e._hasSignatureHelpProvider.set(ca.has(t)),e._hasDocumentFormattingProvider.set(ba.has(t)||wa.has(t)),e._hasDocumentSelectionFormattingProvider.set(wa.has(t)),e._hasMultipleDocumentFormattingProvider.set(ba.all(t).length+wa.all(t).length>1),e._hasMultipleDocumentSelectionFormattingProvider.set(wa.all(t).length>1),e._isInWalkThrough.set(t.uri.scheme===bh.walkThroughSnippet)})):this.reset()},t}(Dt),Lk=function(e){function t(t){var n=e.call(this)||this;return n._onChange=n._register(new Ht),n.onChange=n._onChange.event,n._hasFocus=!1,n._domFocusTracker=n._register(yf(t)),n._register(n._domFocusTracker.onDidFocus((function(){n._hasFocus=!0,n._onChange.fire(void 0)}))),n._register(n._domFocusTracker.onDidBlur((function(){n._hasFocus=!1,n._onChange.fire(void 0)}))),n}return mk(t,e),t.prototype.hasFocus=function(){return this._hasFocus},t}(Dt),Mk=encodeURIComponent("");function Dk(e){return Mk+encodeURIComponent(e.toString())+Ek}var Tk=encodeURIComponent('');Ad((function(e,t){var n=e.getColor(Hl);n&&t.addRule(".monaco-editor .squiggly-error { border-bottom: 4px double "+n+"; }");var r=e.getColor(Bl);r&&t.addRule('.monaco-editor .squiggly-error { background: url("data:image/svg+xml,'+Dk(r)+'") repeat-x bottom left; }');var i=e.getColor(Vl);i&&t.addRule(".monaco-editor .squiggly-warning { border-bottom: 4px double "+i+"; }");var o=e.getColor(Wl);o&&t.addRule('.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,'+Dk(o)+'") repeat-x bottom left; }');var s=e.getColor(Ul);s&&t.addRule(".monaco-editor .squiggly-info { border-bottom: 4px double "+s+"; }");var a=e.getColor(zl);a&&t.addRule('.monaco-editor .squiggly-info { background: url("data:image/svg+xml,'+Dk(a)+'") repeat-x bottom left; }');var u=e.getColor(Kl);u&&t.addRule(".monaco-editor .squiggly-hint { border-bottom: 2px dotted "+u+"; }");var c=e.getColor(ql);c&&t.addRule('.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,'+(Tk+encodeURIComponent(c.toString())+Nk)+'") no-repeat bottom left; }');var l=e.getColor(vC);l&&t.addRule("."+bk+" .monaco-editor .squiggly-inline-unnecessary { opacity: "+l.rgba.a+"; }");var d=e.getColor(yC);d&&t.addRule("."+bk+" .monaco-editor .squiggly-unnecessary { border-bottom: 2px dashed "+d+"; }");var h=e.getColor($l)||"inherit";t.addRule(".monaco-editor .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: "+h+"}")}));n(407);var Ok=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!1),this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n},Ak=[];var Ik=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pk=pt("IEditorCancelService"),Rk=new Yn("cancellableOperation",!1);!function(e,t,n){Ak.push([e,new Ok(t,[],n)])}(Pk,function(){function e(){this._tokens=new WeakMap}return e.prototype.add=function(e,t){var n,r=this._tokens.get(e);return r||(r=e.invokeWithinContext((function(e){return{key:Rk.bindTo(e.get(jn)),tokens:new Ft}})),this._tokens.set(e,r)),r.key.set(!0),n=r.tokens.push(t),function(){n&&(n(),r.key.set(!r.tokens.isEmpty()),n=void 0)}},e.prototype.cancel=function(e){var t=this._tokens.get(e);if(t){var n=t.tokens.pop();n&&(n.cancel(),t.key.set(!t.tokens.isEmpty()))}},e}(),!0);var Fk=function(e){function t(t,n){var r=e.call(this,n)||this;return r.editor=t,r._unregister=t.invokeWithinContext((function(e){return e.get(Pk).add(t,r)})),r}return Ik(t,e),t.prototype.dispose=function(){this._unregister(),e.prototype.dispose.call(this)},t}(ys);Mr(new(function(e){function t(){return e.call(this,{id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:Rk})||this}return Ik(t,e),t.prototype.runEditorCommand=function(e,t){e.get(Pk).cancel(t)},t}(kr)));var Yk=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jk=(function(){function e(e,t){if(this.flags=t,0!=(1&this.flags)){var n=e.getModel();this.modelVersionId=n?Xt("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;0!=(4&this.flags)?this.position=e.getPosition():this.position=null,0!=(2&this.flags)?this.selection=e.getSelection():this.selection=null,0!=(8&this.flags)?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}e.prototype._equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.modelVersionId===n.modelVersionId&&(this.scrollLeft===n.scrollLeft&&this.scrollTop===n.scrollTop&&(!(!this.position&&n.position||this.position&&!n.position||this.position&&n.position&&!this.position.equals(n.position))&&!(!this.selection&&n.selection||this.selection&&!n.selection||this.selection&&n.selection&&!this.selection.equalsRange(n.selection))))},e.prototype.validate=function(t){return this._equals(new e(t,this.flags))}}(),function(e){function t(t,n,r){var i=e.call(this,t,r)||this;return i.editor=t,i._listener=new Et,4&n&&i._listener.add(t.onDidChangeCursorPosition((function(e){return i.cancel()}))),2&n&&i._listener.add(t.onDidChangeCursorSelection((function(e){return i.cancel()}))),8&n&&i._listener.add(t.onDidScrollChange((function(e){return i.cancel()}))),1&n&&(i._listener.add(t.onDidChangeModel((function(e){return i.cancel()}))),i._listener.add(t.onDidChangeModelContent((function(e){return i.cancel()})))),i}Yk(t,e),t.prototype.dispose=function(){this._listener.dispose(),e.prototype.dispose.call(this)}}(Fk),function(e){function t(t,n){var r=e.call(this,n)||this;return r._listener=t.onDidChangeContent((function(){return r.cancel()})),r}Yk(t,e),t.prototype.dispose=function(){this._listener.dispose(),e.prototype.dispose.call(this)}}(ys),function(){function e(e,t){this._visiblePosition=e,this._visiblePositionScrollDelta=t}return e.capture=function(t){var n=null,r=0;if(0!==t.getScrollTop()){var i=t.getVisibleRanges();if(i.length>0){n=i[0].getStartPosition();var o=t.getTopForPosition(n.lineNumber,n.column);r=t.getScrollTop()-o}}return new e(n,r)},e.prototype.restore=function(e){if(this._visiblePosition){var t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}},e}()),Bk=(n(408),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Hk=function(){function e(e,t,n,r){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=n,this.modifiedLineEnd=r}return e.prototype.getType=function(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0},e}(),Wk=function(e){this.entries=e},Vk=function(e){function t(t){var n=e.call(this)||this;return n._width=0,n._diffEditor=t,n._isVisible=!1,n.shadow=bp(document.createElement("div")),n.shadow.setClassName("diff-review-shadow"),n.actionBarContainer=bp(document.createElement("div")),n.actionBarContainer.setClassName("diff-review-actions"),n._actionBar=n._register(new _p(n.actionBarContainer.domNode)),n._actionBar.push(new Gt("diffreview.close",we("label.close","Close"),"close-diff-review",!0,(function(){return n.hide(),Promise.resolve(null)})),{label:!1,icon:!0}),n.domNode=bp(document.createElement("div")),n.domNode.setClassName("diff-review monaco-editor-background"),n._content=bp(document.createElement("div")),n._content.setClassName("diff-review-content"),n.scrollbar=n._register(new Kp(n._content.domNode,{})),n.domNode.domNode.appendChild(n.scrollbar.getDomNode()),n._register(t.onDidUpdateDiff((function(){n._isVisible&&(n._diffs=n._compute(),n._render())}))),n._register(t.getModifiedEditor().onDidChangeCursorPosition((function(){n._isVisible&&n._render()}))),n._register(t.getOriginalEditor().onDidFocusEditorWidget((function(){n._isVisible&&n.hide()}))),n._register(t.getModifiedEditor().onDidFocusEditorWidget((function(){n._isVisible&&n.hide()}))),n._register(Hh(n.domNode.domNode,"click",(function(e){e.preventDefault();var t=function(e,t,n){for(;e;){if(Ah(e,t))return e;if(n)if("string"==typeof n){if(Ah(e,n))return null}else if(e===n)return null;e=e.parentNode}return null}(e.target,"diff-review-row");t&&n._goToRow(t)}))),n._register(Hh(n.domNode.domNode,"keydown",(function(e){(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),n._goToRow(n._getNextRow())),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),n._goToRow(n._getPrevRow())),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),n.hide()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),n.accept())}))),n._diffs=[],n._currentDiff=null,n}return Bk(t,e),t.prototype.prev=function(){var e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){for(var t=-1,n=0,r=this._diffs.length;n0){var y=e[o-1];m=0===y.originalEndLineNumber?y.originalStartLineNumber+1:y.originalEndLineNumber+1,_=0===y.modifiedEndLineNumber?y.modifiedStartLineNumber+1:y.modifiedEndLineNumber+1}var v=p-3+1,b=g-3+1;if(vS)M+=L=S-M,E+=L;if(E>x)M+=L=x-E,E+=L;h[f++]=new Hk(w,M,C,E),r[i++]=new Wk(h)}var D=r[0].entries,T=[],N=0;for(o=1,s=r.length;od)&&(d=_),0!==y&&(0===h||yf)&&(f=v)}var b=document.createElement("div");b.className="diff-review-row";var w=document.createElement("div");w.className="diff-review-cell diff-review-summary";var C=d-l+1,S=f-h+1;w.appendChild(document.createTextNode(a+1+"/"+this._diffs.length+": @@ -"+l+","+C+" +"+h+","+S+" @@")),b.setAttribute("data-line",String(h));var x=function(e){return 0===e?we("no_lines","no lines"):1===e?we("one_line","1 line"):we("more_lines","{0} lines",e)},k=x(C),L=x(S);b.setAttribute("aria-label",we({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines", "1 line" or "X lines", localized separately.']},"Difference {0} of {1}: original {2}, {3}, modified {4}, {5}",a+1,this._diffs.length,l,k,h,L)),b.appendChild(w),b.setAttribute("role","listitem"),c.appendChild(b);var M=h;for(p=0,g=u.length;p0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]i.modifiedStartLineNumber?we("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):we("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"),void 0,!0,(function(){return Gk(a,void 0,void 0,(function(){return $k(this,(function(e){switch(e.label){case 0:return[4,this._clipboardService.writeText(i.originalContent.join(c)+c)];case 1:return e.sent(),[2]}}))}))})));var d=0,h=void 0;return i.originalEndLineNumber>i.modifiedStartLineNumber&&(h=new Gt("diff.clipboard.copyDeletedLineContent",we("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",i.originalStartLineNumber),void 0,!0,(function(){return Gk(a,void 0,void 0,(function(){return $k(this,(function(e){switch(e.label){case 0:return[4,this._clipboardService.writeText(i.originalContent[d])];case 1:return e.sent(),[2]}}))}))})),l.push(h)),r.getConfiguration().readOnly||l.push(new Gt("diff.inline.revertChange",we("diff.inline.revertChange.label","Revert this change"),void 0,!0,(function(){return Gk(a,void 0,void 0,(function(){var e;return $k(this,(function(t){return 0===i.modifiedEndLineNumber?(e=r.getModel().getLineMaxColumn(i.modifiedStartLineNumber),r.executeEdits("diffEditor",[{range:new Tr(i.modifiedStartLineNumber,e,i.modifiedStartLineNumber,e),text:c+i.originalContent.join(c)}])):(e=r.getModel().getLineMaxColumn(i.modifiedEndLineNumber),r.executeEdits("diffEditor",[{range:new Tr(i.modifiedStartLineNumber,1,i.modifiedEndLineNumber,e),text:i.originalContent.join(c)}])),[2]}))}))}))),a._register(Hh(a._diffActions,"mousedown",(function(e){var t=sf(a._diffActions),n=t.top,r=t.height,o=Math.floor(u/3);e.preventDefault(),a._contextMenuService.showContextMenu({getAnchor:function(){return{x:e.posx,y:n+r+o}},getActions:function(){return h&&(h.label=we("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",i.originalStartLineNumber+d)),l},autoSelectFirstItem:!0})}))),a._register(r.onMouseMove((function(e){8===e.target.type||5===e.target.type?e.target.detail.viewZoneId===a._viewZoneId?(a.visibility=!0,d=a._updateLightBulbPosition(a._marginDomNode,e.event.browserEvent.y,u)):a.visibility=!1:a.visibility=!1}))),a}return Kk(t,e),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._visibility},set:function(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")},enumerable:!0,configurable:!0}),t.prototype._updateLightBulbPosition=function(e,t,n){var r=t-sf(e).top,i=Math.floor(r/n),o=i*n;return this._diffActions.style.top=o+"px",i},t}(Dt),Jk=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xk=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Qk=function(e,t){return function(n,r){t(n,r,e)}},eL=function(){function e(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this.inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}return e.prototype.getForeignViewZones=function(e){var t=this;return e.filter((function(e){return!t._zonesMap[String(e.id)]}))},e.prototype.clean=function(e){var t=this;this._zones.length>0&&e.changeViewZones((function(e){for(var n=0,r=t._zones.length;n0?i/n:0;return{height:Math.max(0,Math.floor(e.contentHeight*o)),top:Math.floor(t*o)}},t.prototype._createDataSource=function(){var e=this;return{getWidth:function(){return e._width},getHeight:function(){return e._height-e._reviewHeight},getContainerDomNode:function(){return e._containerDomElement},relayoutEditors:function(){e._doLayout()},getOriginalEditor:function(){return e.originalEditor},getModifiedEditor:function(){return e.modifiedEditor}}},t.prototype._setStrategy=function(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getTheme()),this._diffComputationResult&&this._updateDecorations(),this._measureDomElement(!0)},t.prototype._getLineChangeAtOrBeforeLineNumber=function(e,t){var n=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===n.length||e=a?r=o+1:(r=o,i=o)}return n[r]},t.prototype._getEquivalentLineForOriginalLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,(function(e){return e.originalStartLineNumber}));if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),r=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),i=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,o=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-n;return s<=i?r+Math.min(s,o):r+o-i+s},t.prototype._getEquivalentLineForModifiedLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,(function(e){return e.modifiedStartLineNumber}));if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),r=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),i=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,o=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-r;return s<=o?n+Math.min(s,i):n+i-o+s},t.prototype.getDiffLineInformationForOriginal=function(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null},t.prototype.getDiffLineInformationForModified=function(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null},t.ONE_OVERVIEW_WIDTH=15,t.ENTIRE_DIFF_OVERVIEW_WIDTH=30,t.UPDATE_DIFF_DECORATIONS_DELAY=200,t=Xk([Qk(3,b_),Qk(4,jn),Qk(5,ht),Qk(6,mt),Qk(7,Ld),Qk(8,Qg),Qk(9,Ug)],t)}(Dt),rL=function(e){function t(t){var n=e.call(this)||this;return n._dataSource=t,n._insertColor=null,n._removeColor=null,n}return Jk(t,e),t.prototype.applyColors=function(e){var t=(e.getColor(fd)||dd).transparent(2),n=(e.getColor(pd)||hd).transparent(2),r=!t.equals(this._insertColor)||!n.equals(this._removeColor);return this._insertColor=t,this._removeColor=n,r},t.prototype.getEditorsDiffDecorations=function(e,t,n,r,i,o,s){i=i.sort((function(e,t){return e.afterLineNumber-t.afterLineNumber})),r=r.sort((function(e,t){return e.afterLineNumber-t.afterLineNumber}));var a=this._getViewZones(e,r,i,o,s,n),u=this._getOriginalEditorDecorations(e,t,n,o,s),c=this._getModifiedEditorDecorations(e,t,n,o,s);return{original:{decorations:u.decorations,overviewZones:u.overviewZones,zones:a.original},modified:{decorations:c.decorations,overviewZones:c.overviewZones,zones:a.modified}}},t}(Dt),iL=function(){function e(e){this._source=e,this._index=-1,this.current=null,this.advance()}return e.prototype.advance=function(){this._index++,this._index0){var n=e[e.length-1];if(n.afterLineNumber===t.afterLineNumber&&null===n.domNode)return void(n.heightInLines+=t.heightInLines)}e.push(t)},d=new iL(this.modifiedForeignVZ),h=new iL(this.originalForeignVZ),f=0,p=this.lineChanges.length;f<=p;f++){var g=f0?-1:0),s=g.modifiedStartLineNumber+(g.modifiedEndLineNumber>0?-1:0),i=g.originalEndLineNumber>0?g.originalEndLineNumber-g.originalStartLineNumber+1:0,r=g.modifiedEndLineNumber>0?g.modifiedEndLineNumber-g.modifiedStartLineNumber+1:0,a=Math.max(g.originalStartLineNumber,g.originalEndLineNumber),u=Math.max(g.modifiedStartLineNumber,g.modifiedEndLineNumber)):(a=o+=1e7+i,u=s+=1e7+r);for(var m,_=[],y=[];d.current&&d.current.afterLineNumber<=u;){var v=void 0;v=d.current.afterLineNumber<=s?o-s+d.current.afterLineNumber:a;var b=null;g&&g.modifiedStartLineNumber<=d.current.afterLineNumber&&d.current.afterLineNumber<=g.modifiedEndLineNumber&&(b=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),_.push({afterLineNumber:v,heightInLines:d.current.heightInLines,domNode:null,marginDomNode:b}),d.advance()}for(;h.current&&h.current.afterLineNumber<=a;){v=void 0;v=h.current.afterLineNumber<=o?s-o+h.current.afterLineNumber:u,y.push({afterLineNumber:v,heightInLines:h.current.heightInLines,domNode:null}),h.advance()}if(null!==g&&hL(g))(m=this._produceOriginalFromDiff(g,i,r))&&_.push(m);if(null!==g&&fL(g))(m=this._produceModifiedFromDiff(g,i,r))&&y.push(m);var w=0,C=0;for(_=_.sort(c),y=y.sort(c);w<_.length&&C=x.heightInLines?(S.heightInLines-=x.heightInLines,C++):(x.heightInLines-=S.heightInLines,w++)}for(;w<_.length;)l(t,_[w]),w++;for(;C2*t.MINIMUM_EDITOR_WIDTH?(rn-t.MINIMUM_EDITOR_WIDTH&&(r=n-t.MINIMUM_EDITOR_WIDTH)):r=i,this._sashPosition!==r&&(this._sashPosition=r,this._sash.layout()),this._sashPosition},t.prototype.onSashDragStart=function(){this._startSashPosition=this._sashPosition},t.prototype.onSashDrag=function(e){var t=this._dataSource.getWidth()-nL.ENTIRE_DIFF_OVERVIEW_WIDTH,n=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=n/t,this._dataSource.relayoutEditors()},t.prototype.onSashDragEnd=function(){this._sash.layout()},t.prototype.onSashReset=function(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()},t.prototype.getVerticalSashTop=function(e){return 0},t.prototype.getVerticalSashLeft=function(e){return this._sashPosition},t.prototype.getVerticalSashHeight=function(e){return this._dataSource.getHeight()},t.prototype._getViewZones=function(e,t,n,r,i){return new cL(e,t,n).getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,r,i){for(var o=String(this._removeColor),s={decorations:[],overviewZones:[]},a=r.getModel(),u=0,c=e.length;ut?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:n-t,domNode:null}:null},t.prototype._produceModifiedFromDiff=function(e,t,n){return t>n?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-n,domNode:null}:null},t}(oL),lL=function(e){function t(t,n){var r=e.call(this,t)||this;return r.decorationsLeft=t.getOriginalEditor().getLayoutInfo().decorationsLeft,r._register(t.getOriginalEditor().onDidLayoutChange((function(e){r.decorationsLeft!==e.decorationsLeft&&(r.decorationsLeft=e.decorationsLeft,t.relayoutEditors())}))),r}return Jk(t,e),t.prototype.setEnableSplitViewResizing=function(e){},t.prototype._getViewZones=function(e,t,n,r,i,o){return new dL(e,t,n,r,i,o).getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,r,i){for(var o=String(this._removeColor),s={decorations:[],overviewZones:[]},a=0,u=e.length;a'])}h+=this.modifiedEditorConfiguration.viewInfo.scrollBeyondLastColumn;var m=document.createElement("div");m.className="view-lines line-delete",m.innerHTML=a.build(),Jb.applyFontInfoSlow(m,this.modifiedEditorConfiguration.fontInfo);var _=document.createElement("div");return _.className="inline-deleted-margin-view-zone",_.innerHTML=u.join(""),Jb.applyFontInfoSlow(_,this.modifiedEditorConfiguration.fontInfo),{shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:h*d,domNode:m,marginDomNode:_,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalContent:f}}},t.prototype._renderOriginalLine=function(e,t,n,r,i,o,s){var a=t.getLineTokens(i),u=a.getLineContent(),c=xy.filter(o,i,1,u.length+1);s.appendASCIIString('
');var l=By.isBasicASCII(u,t.mightContainNonBasicASCII()),d=By.containsRTL(u,l,t.mightContainRTL()),h=Ay(new Ty(n.fontInfo.isMonospace&&!n.viewInfo.disableMonospaceOptimizations,n.fontInfo.canUseHalfwidthRightwardsArrow,u,!1,l,d,0,a,c,r,n.fontInfo.spaceWidth,n.viewInfo.stopRenderingLineAfter,n.viewInfo.renderWhitespace,n.viewInfo.renderControlCharacters,n.viewInfo.fontLigatures,null),s);s.appendASCIIString("
");var f=h.characterMapping.getAbsoluteOffsets();return f.length>0?f[f.length-1]:0},t}(oL);function hL(e){return e.modifiedEndLineNumber>0}function fL(e){return e.originalEndLineNumber>0}Ad((function(e,t){var n=e.getColor(fd);n&&(t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-editor .inline-added-margin-view-zone { background-color: "+n+"; }"));var r=e.getColor(pd);r&&(t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { background-color: "+r+"; }"),t.addRule(".monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: "+r+"; }"),t.addRule(".monaco-editor .inline-deleted-margin-view-zone { background-color: "+r+"; }"));var i=e.getColor(gd);i&&t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+i+"; }");var o=e.getColor(md);o&&t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+o+"; }");var s=e.getColor(Dl);s&&t.addRule(".monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px "+s+"; }");var a=e.getColor(_d);a&&t.addRule(".monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid "+a+"; }")}));var pL=pt("themeService"),gL=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mL=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},_L=function(e,t){return function(n,r){t(n,r,e)}},yL=0,vL=!1;function bL(){var e;vL||(vL=!0,e=document.body,(Uf=document.createElement("div")).className="monaco-aria-container",(qf=document.createElement("div")).className="monaco-alert",qf.setAttribute("role","alert"),qf.setAttribute("aria-atomic","true"),Uf.appendChild(qf),(Kf=document.createElement("div")).className="monaco-status",Kf.setAttribute("role","status"),Kf.setAttribute("aria-atomic","true"),Uf.appendChild(Kf),e.appendChild(Uf))}var wL=function(e){function t(t,n,r,i,o,s,a,u,c,l){var d=this;return(n=n||{}).ariaLabel=n.ariaLabel||yb.editorViewAccessibleLabel,n.ariaLabel=n.ariaLabel+";"+(eh?yb.accessibilityHelpMessageIE:yb.accessibilityHelpMessage),(d=e.call(this,t,n,{},r,i,o,s,u,c,l)||this)._standaloneKeybindingService=a instanceof Ab?a:null,bL(),d}return gL(t,e),t.prototype.addCommand=function(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;var r="DYNAMIC_"+ ++yL,i=En.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,i),r},t.prototype.createContextKey=function(e,t){return this._contextKeyService.createKey(e,t)},t.prototype.addAction=function(e){var t=this;if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Dt.None;var n=e.id,r=e.label,i=En.and(En.equals("editorId",this.getId()),En.deserialize(e.precondition)),o=e.keybindings,s=En.and(i,En.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,u=e.contextMenuOrder||0,c=function(){return Promise.resolve(e.run(t))},l=new Et,d=this.getId()+":"+n;if(l.add(Zn.registerCommand(d,c)),a){var h={command:{id:d,title:r},when:i,group:a,order:u};l.add(rr.appendMenuItem(7,h))}if(Array.isArray(o))for(var f=0,p=o;f=0}}(e);DL.push(n),n.userConfigured?NL.push(n):TL.push(n),t&&!n.userConfigured&&DL.forEach((function(e){e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn("Overwriting extension <<"+n.extension+">> to now point to mime <<"+n.mime+">>"),n.filename&&e.filename===n.filename&&console.warn("Overwriting filename <<"+n.filename+">> to now point to mime <<"+n.mime+">>"),n.filepattern&&e.filepattern===n.filepattern&&console.warn("Overwriting filepattern <<"+n.filepattern+">> to now point to mime <<"+n.mime+">>"),n.firstline&&e.firstline===n.firstline&&console.warn("Overwriting firstline <<"+n.firstline+">> to now point to mime <<"+n.mime+">>"))}))}function AL(e,t){var n;if(e)switch(e.scheme){case bh.file:n=e.fsPath;break;case bh.data:n=e_.parseMetaData(e).get(e_.META_DATA_LABEL);break;default:n=e.path}if(!n)return[EL];n=n.toLowerCase();var r=ds(n),i=IL(n,r,NL);if(i)return[i,ML];var o=IL(n,r,TL);if(o)return[o,ML];if(t){var s=function(e){kn(e)&&(e=e.substr(1));if(e.length>0)for(var t=DL.length-1;t>=0;t--){var n=DL[t];if(n.firstline){var r=e.match(n.firstline);if(r&&r.length>0)return n.mime}}return null}(t);if(s)return[s,ML]}return[EL]}function IL(e,t,n){for(var r=null,i=null,o=null,s=n.length-1;s>=0;s--){var a=n[s];if(t===a.filenameLowercase){r=a;break}if(a.filepattern&&(!i||a.filepattern.length>i.filepattern.length)){var u=a.filepatternOnPath?e:t;Ks(a.filepatternLowercase,u)&&(i=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&rn(t,a.extensionLowercase)&&(o=a)}return r?r.mime:i?i.mime:o?o.mime:null}var PL=new(function(){function e(){this._onDidChangeLanguages=new Ht,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[],this._dynamicLanguages=[]}return e.prototype.registerLanguage=function(e){this._languages.push(e),this._onDidChangeLanguages.fire(void 0)},e.prototype.getLanguages=function(){return[].concat(this._languages).concat(this._dynamicLanguages)},e}());yr.add("editor.modesRegistry",PL);var RL=new na("plaintext",1);PL.registerLanguage({id:"plaintext",extensions:[".txt",".gitignore"],aliases:[we("plainText.alias","Plain Text"),"text"],mimetypes:["text/plain"]}),vu.register(RL,{brackets:[["(",")"],["[","]"],["{","}"]]});var FL=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),YL=Object.prototype.hasOwnProperty,jL=function(e){function t(t,n){void 0===t&&(t=!0),void 0===n&&(n=!1);var r=e.call(this)||this;return r._onDidChange=r._register(new Ht),r.onDidChange=r._onDidChange.event,r._warnOnOverwrite=n,r._nextLanguageId2=1,r._languageIdToLanguage=[],r._languageToLanguageId=Object.create(null),r._languages={},r._mimeTypesMap={},r._nameMap={},r._lowercaseNameMap={},t&&(r._initializeFromRegistry(),r._register(PL.onDidChangeLanguages((function(e){return r._initializeFromRegistry()})))),r}return FL(t,e),t.prototype._initializeFromRegistry=function(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={};var e=PL.getLanguages();this._registerLanguages(e)},t.prototype._registerLanguages=function(e){for(var t=this,n=0,r=e;n0&&((n=e.mimetypes).push.apply(n,t.mimetypes),o=t.mimetypes[0]),o||(o="text/x-"+i,e.mimetypes.push(o)),Array.isArray(t.extensions))for(var s=0,a=t.extensions;s0){var p=t.firstLine;"^"!==p.charAt(0)&&(p="^"+p);try{var g=new RegExp(p);"^"!==(r=g).source&&"^$"!==r.source&&"$"!==r.source&&"^\\s*$"!==r.source&&r.exec("")&&0===r.lastIndex||OL({id:i,mime:o,firstline:g},this._warnOnOverwrite)}catch(e){je(e)}}e.aliases.push(i);var m=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(m=0===t.aliases.length?[null]:t.aliases),null!==m)for(var _=0,y=m;_0;if(b&&null===m[0]);else{var w=(b?m[0]:null)||i;!b&&e.name||(e.name=w)}t.configuration&&e.configurationFiles.push(t.configuration)},t.prototype.isRegisteredMode=function(e){return!!YL.call(this._mimeTypesMap,e)||YL.call(this._languages,e)},t.prototype.getModeIdForLanguageNameLowercase=function(e){return YL.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null},t.prototype.extractModeIds=function(e){var t=this;return e?e.split(",").map((function(e){return e.trim()})).map((function(e){return YL.call(t._mimeTypesMap,e)?t._mimeTypesMap[e].language:e})).filter((function(e){return YL.call(t._languages,e)})):[]},t.prototype.getLanguageIdentifier=function(e){if("vs.editor.nullMode"===e||0===e)return Ia;var t;if("string"==typeof e)t=e;else if(!(t=this._languageIdToLanguage[e]))return null;return YL.call(this._languages,t)?this._languages[t].identifier:null},t.prototype.getModeIdsFromFilepathOrFirstLine=function(e,t){if(!e&&!t)return[];var n=AL(e,t);return this.extractModeIds(n.join(","))},t}(Dt),BL=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),HL=function(e){function t(t,n){var r=e.call(this)||this;return r._onDidChange=r._register(new Ht),r.onDidChange=r._onDidChange.event,r._selector=n,r.languageIdentifier=r._selector(),r._register(t((function(){return r._evaluate()}))),r}return BL(t,e),t.prototype._evaluate=function(){var e=this._selector();e.id!==this.languageIdentifier.id&&(this.languageIdentifier=e,this._onDidChange.fire(this.languageIdentifier))},t}(Dt),WL=function(){function e(e){var t=this;void 0===e&&(e=!1),this._onDidCreateMode=new Ht,this.onDidCreateMode=this._onDidCreateMode.event,this._onLanguagesMaybeChanged=new Ht,this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,this._instantiatedModes={},this._registry=new jL(!0,e),this._registry.onDidChange((function(){return t._onLanguagesMaybeChanged.fire()}))}return e.prototype.isRegisteredMode=function(e){return this._registry.isRegisteredMode(e)},e.prototype.getModeIdForLanguageName=function(e){return this._registry.getModeIdForLanguageNameLowercase(e)},e.prototype.getModeIdByFilepathOrFirstLine=function(e,t){var n=this._registry.getModeIdsFromFilepathOrFirstLine(e,t);return n.length>0?n[0]:null},e.prototype.getModeId=function(e){var t=this._registry.extractModeIds(e);return t.length>0?t[0]:null},e.prototype.getLanguageIdentifier=function(e){return this._registry.getLanguageIdentifier(e)},e.prototype.create=function(e){var t=this;return new HL(this.onLanguagesMaybeChanged,(function(){var n=t.getModeId(e);return t._createModeAndGetLanguageIdentifier(n)}))},e.prototype.createByFilepathOrFirstLine=function(e,t){var n=this;return new HL(this.onLanguagesMaybeChanged,(function(){var r=n.getModeIdByFilepathOrFirstLine(e,t);return n._createModeAndGetLanguageIdentifier(r)}))},e.prototype._createModeAndGetLanguageIdentifier=function(e){var t=this.getLanguageIdentifier(e||"plaintext")||Ia;return this._getOrCreateMode(t.language),t},e.prototype.triggerMode=function(e){var t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")},e.prototype._getOrCreateMode=function(e){if(!this._instantiatedModes.hasOwnProperty(e)){var t=this.getLanguageIdentifier(e)||Ia;this._instantiatedModes[e]=new LL(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]},e}(),VL=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zL=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},UL=function(e,t){return function(n,r){t(n,r,e)}};function qL(e){return e.toString()}var KL=function(){function e(e,t,n){this._modelEventListeners=new Et,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose((function(){return t(e)}))),this._modelEventListeners.add(e.onDidChangeLanguage((function(t){return n(e,t)})))}return e.prototype._disposeLanguageSelection=function(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null),this._languageSelection&&(this._languageSelection.dispose(),this._languageSelection=null)},e.prototype.dispose=function(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()},e.prototype.setLanguage=function(e){var t=this;this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange((function(){return t.model.setMode(e.languageIdentifier)})),this.model.setMode(e.languageIdentifier)},e}(),GL=Ge.c||Ge.d?1:2,$L=function(e){function t(t,n){var r=e.call(this)||this;return r._onModelAdded=r._register(new Ht),r.onModelAdded=r._onModelAdded.event,r._onModelRemoved=r._register(new Ht),r.onModelRemoved=r._onModelRemoved.event,r._onModelModeChanged=r._register(new Ht),r.onModelModeChanged=r._onModelModeChanged.event,r._configurationService=t,r._resourcePropertiesService=n,r._models={},r._modelCreationOptionsByLanguageAndResource=Object.create(null),r._configurationServiceSubscription=r._configurationService.onDidChangeConfiguration((function(e){return r._updateModelOptions()})),r._updateModelOptions(),r}return VL(t,e),t._readModelOptions=function(e,t){var n=pi.tabSize;if(e.editor&&void 0!==e.editor.tabSize){var r=parseInt(e.editor.tabSize,10);isNaN(r)||(n=r),n<1&&(n=1)}var i=n;if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){var o=parseInt(e.editor.indentSize,10);isNaN(o)||(i=o),i<1&&(i=1)}var s=pi.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(s="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));var a=GL,u=e.eol;"\r\n"===u?a=2:"\n"===u&&(a=1);var c=pi.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(c="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));var l=pi.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(l="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));var d=pi.largeFileOptimizations;return e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations)),{isForSimpleWidget:t,tabSize:n,indentSize:i,insertSpaces:s,detectIndentation:l,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:d}},t.prototype.getCreationOptions=function(e,n,r){var i=this._modelCreationOptionsByLanguageAndResource[e+n];if(!i){var o=this._configurationService.getValue("editor",{overrideIdentifier:e,resource:n}),s=this._resourcePropertiesService.getEOL(n,e);i=t._readModelOptions({editor:o,eol:s},r),this._modelCreationOptionsByLanguageAndResource[e+n]=i}return i},t.prototype._updateModelOptions=function(){var e=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);for(var n=Object.keys(this._models),r=0,i=n.length;r=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},eM=function(e,t){return function(n,r){t(n,r,e)}},tM=function(e){function t(t,n){void 0===n&&(n=hf());var r=e.call(this)||this;return r._decorationOptionProviders=new Map,r._styleSheet=n,r._themeService=t,r}return XL(t,e),t.prototype.registerDecorationType=function(e,t,n){var r=this._decorationOptionProviders.get(e);if(!r){var i={styleSheet:this._styleSheet,key:e,parentTypeKey:n,options:t||Object.create(null)};r=n?new nM(this._themeService,i):new rM(this._themeService,i),this._decorationOptionProviders.set(e,r)}r.refCount++},t.prototype.removeDecorationType=function(e){var t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((function(t){return t.removeDecorations(e)}))))},t.prototype.resolveDecorationOptions=function(e,t){var n=this._decorationOptionProviders.get(e);if(!n)throw new Error("Unknown decoration type key: "+e);return n.getOptions(this,t)},t=QL([eM(0,Ld)],t)}(JL),nM=function(){function e(e,t){this._parentTypeKey=t.parentTypeKey,this.refCount=0,this._beforeContentRules=new oM(3,t,e),this._afterContentRules=new oM(4,t,e)}return e.prototype.getOptions=function(e,t){var n=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(n.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(n.afterContentClassName=this._afterContentRules.className),n},e.prototype.dispose=function(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null)},e}(),rM=function(){function e(e,t){var n=this;this._disposables=new Et,this.refCount=0;var r=function(r){var i=new oM(r,t,e);if(n._disposables.add(i),i.hasContent)return i.className};this.className=r(0);var i,o=(i=new oM(1,t,e),n._disposables.add(i),i.hasContent?{className:i.className,hasLetterSpacing:i.hasLetterSpacing}:null);o&&(this.inlineClassName=o.className,this.inlineClassNameAffectsLetterSpacing=o.hasLetterSpacing),this.beforeContentClassName=r(3),this.afterContentClassName=r(4),this.glyphMarginClassName=r(2);var s=t.options;this.isWholeLine=Boolean(s.isWholeLine),this.stickiness=s.rangeBehavior;var a=s.light&&s.light.overviewRulerColor||s.overviewRulerColor,u=s.dark&&s.dark.overviewRulerColor||s.overviewRulerColor;void 0===a&&void 0===u||(this.overviewRuler={color:a||u,darkColor:u||a,position:s.overviewRulerLane||ui.Center})}return e.prototype.getOptions=function(e,t){return t?{inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness}:this},e.prototype.dispose=function(){this._disposables.dispose()},e}(),iM={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",width:"width:{0};",height:"height:{0};"},oM=function(){function e(e,t,n){var r=this;this._theme=n.getTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;var i=sM.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(i=i+" "+sM.getClassName(this._providerArgs.parentTypeKey,e)),this._className=i,this._unThemedSelector=sM.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=n.onThemeChange((function(e){r._theme=n.getTheme(),r._removeCSS(),r._buildCSS()})):this._themeListener=null}return e.prototype.dispose=function(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)},Object.defineProperty(e.prototype,"hasContent",{get:function(){return this._hasContent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasLetterSpacing",{get:function(){return this._hasLetterSpacing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._className},enumerable:!0,configurable:!0}),e.prototype._buildCSS=function(){var e,t,n,r=this._providerArgs.options;switch(this._ruleType){case 0:e=this.getCSSTextForModelDecorationClassName(r),t=this.getCSSTextForModelDecorationClassName(r.light),n=this.getCSSTextForModelDecorationClassName(r.dark);break;case 1:e=this.getCSSTextForModelDecorationInlineClassName(r),t=this.getCSSTextForModelDecorationInlineClassName(r.light),n=this.getCSSTextForModelDecorationInlineClassName(r.dark);break;case 2:e=this.getCSSTextForModelDecorationGlyphMarginClassName(r),t=this.getCSSTextForModelDecorationGlyphMarginClassName(r.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(r.dark);break;case 3:e=this.getCSSTextForModelDecorationContentClassName(r.before),t=this.getCSSTextForModelDecorationContentClassName(r.light&&r.light.before),n=this.getCSSTextForModelDecorationContentClassName(r.dark&&r.dark.before);break;case 4:e=this.getCSSTextForModelDecorationContentClassName(r.after),t=this.getCSSTextForModelDecorationContentClassName(r.light&&r.light.after),n=this.getCSSTextForModelDecorationContentClassName(r.dark&&r.dark.after);break;default:throw new Error("Unknown rule type: "+this._ruleType)}var i=this._providerArgs.styleSheet.sheet,o=!1;e.length>0&&(i.insertRule(this._unThemedSelector+" {"+e+"}",0),o=!0),t.length>0&&(i.insertRule(".vs"+this._unThemedSelector+" {"+t+"}",0),o=!0),n.length>0&&(i.insertRule(".vs-dark"+this._unThemedSelector+", .hc-black"+this._unThemedSelector+" {"+n+"}",0),o=!0),this._hasContent=o},e.prototype._removeCSS=function(){!function(e,t){if(void 0===t&&(t=pf()),t){for(var n=function(e){return e&&e.sheet&&e.sheet.rules?e.sheet.rules:e&&e.sheet&&e.sheet.cssRules?e.sheet.cssRules:[]}(t),r=[],i=0;i=0;i--)t.sheet.deleteRule(r[i])}}(this._unThemedSelector,this._providerArgs.styleSheet)},e.prototype.getCSSTextForModelDecorationClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")},e.prototype.getCSSTextForModelDecorationInlineClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")},e.prototype.getCSSTextForModelDecorationContentClassName=function(e){if(!e)return"";var t=[];if(void 0!==e){if(this.collectBorderSettingsCSSText(e,t),void 0!==e.contentIconPath&&t.push(Xt(iM.contentIconPath,Df(it.revive(e.contentIconPath)))),"string"==typeof e.contentText){var n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(Xt(iM.contentText,n))}this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","color","opacity","backgroundColor","margin"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")},e.prototype.getCSSTextForModelDecorationGlyphMarginClassName=function(e){if(!e)return"";var t=[];return void 0!==e.gutterIconPath&&(t.push(Xt(iM.gutterIconPath,Df(it.revive(e.gutterIconPath)))),void 0!==e.gutterIconSize&&t.push(Xt(iM.gutterIconSize,e.gutterIconSize))),t.join("")},e.prototype.collectBorderSettingsCSSText=function(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push(Xt("box-sizing: border-box;")),!0)},e.prototype.collectCSSText=function(e,t,n){for(var r=n.length,i=0,o=t;it)return 1;return 0}(e.token,t.token);return 0!==n?n:e.index-t.index}));for(var n=0,r="000000",i="ffffff";e.length>=1&&""===e[0].token;){var o=e.shift();-1!==o.fontStyle&&(n=o.fontStyle),null!==o.foreground&&(r=o.foreground),null!==o.background&&(i=o.background)}for(var s=new hM,a=0,u=t;a>>0,this._cache.set(t,n)}return(n|e<<0)>>>0},e}(),pM=/\b(comment|string|regex|regexp)\b/;var gM,mM,_M,yM=function(){function e(e,t,n){this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}return e.prototype.clone=function(){return new e(this._fontStyle,this._foreground,this._background)},e.prototype.acceptOverwrite=function(e,t,n){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==n&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0},e}(),vM=function(){function e(e){this._mainRule=e,this._children=new Map}return e.prototype.match=function(e){if(""===e)return this._mainRule;var t,n,r=e.indexOf(".");-1===r?(t=e,n=""):(t=e.substring(0,r),n=e.substring(r+1));var i=this._children.get(t);return void 0!==i?i.match(n):this._mainRule},e.prototype.insert=function(t,n,r,i){if(""!==t){var o,s,a=t.indexOf(".");-1===a?(o=t,s=""):(o=t.substring(0,a),s=t.substring(a+1));var u=this._children.get(o);void 0===u&&(u=new e(this._mainRule.clone()),this._children.set(o,u)),u.insert(s,n,r,i)}else this._mainRule.acceptOverwrite(n,r,i)},e}();var bM={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"09885A"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"09885A"},{token:"attribute.value.unit",foreground:"09885A"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"FF00FF"}],colors:(gM={},gM[Gl]="#FFFFFE",gM[$l]="#000000",gM[nd]="#E5EBF1",gM[lC]="#D3D3D3",gM[dC]="#939393",gM[rd]="#ADD6FF4D",gM)},wM={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:(mM={},mM[Gl]="#1E1E1E",mM[$l]="#D4D4D4",mM[nd]="#3A3D41",mM[lC]="#404040",mM[dC]="#707070",mM[rd]="#ADD6FF26",mM)},CM={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:(_M={},_M[Gl]="#000000",_M[$l]="#FFFFFF",_M[lC]="#FFFFFF",_M[dC]="#FFFFFF",_M)},SM="vs",xM="vs-dark",kM="hc-black",LM=yr.as(Wc),MM=yr.as(Nd),EM=function(){function e(e,t){this.themeData=t;var n=t.base;e.length>0?(this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}return Object.defineProperty(e.prototype,"base",{get:function(){return this.themeData.base},enumerable:!0,configurable:!0}),e.prototype.notifyBaseUpdated=function(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)},e.prototype.getColors=function(){if(!this.colors){var e=new Map;for(var t in this.themeData.colors)e.set(t,xu.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){var n=TM(this.themeData.base);for(var t in n.colors)e.has(t)||e.set(t,xu.fromHex(n.colors[t]))}this.colors=e}return this.colors},e.prototype.getColor=function(e,t){var n=this.getColors().get(e);return n||(!1!==t?this.getDefault(e):void 0)},e.prototype.getDefault=function(e){var t=this.defaultColors[e];return t||(t=LM.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)},e.prototype.defines=function(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)},Object.defineProperty(e.prototype,"type",{get:function(){switch(this.base){case SM:return"light";case kM:return"hc";default:return"dark"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tokenTheme",{get:function(){if(!this._tokenTheme){var e=[],t=[];if(this.themeData.inherit){var n=TM(this.themeData.base);e=n.rules,n.encodedTokensColors&&(t=n.encodedTokensColors)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=fM.createFromRawTokenTheme(e,t)}return this._tokenTheme},enumerable:!0,configurable:!0}),e}();function DM(e){return e===SM||e===xM||e===kM}function TM(e){switch(e){case SM:return bM;case xM:return wM;case kM:return CM}}function NM(e){var t=TM(e);return new EM(e,t)}var OM=function(){function e(){this.environment=Object.create(null),this._onThemeChange=new Ht,this._onIconThemeChange=new Ht,this._knownThemes=new Map,this._knownThemes.set(SM,NM(SM)),this._knownThemes.set(xM,NM(xM)),this._knownThemes.set(kM,NM(kM)),this._styleElement=hf(),this._styleElement.className="monaco-colors",this.setTheme(SM)}return Object.defineProperty(e.prototype,"onThemeChange",{get:function(){return this._onThemeChange.event},enumerable:!0,configurable:!0}),e.prototype.defineTheme=function(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!DM(t.base)&&!DM(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new EM(e,t)),DM(e)&&this._knownThemes.forEach((function(t){t.base===e&&t.notifyBaseUpdated()})),this._theme&&this._theme.themeName===e&&this.setTheme(e)},e.prototype.getTheme=function(){return this._theme},e.prototype.setTheme=function(e){var t,n=this;if(t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(SM),this._theme===t)return t.id;this._theme=t;var r=[],i={},o={addRule:function(e){i[e]||(r.push(e),i[e]=!0)}};MM.getThemingParticipants().forEach((function(e){return e(t,o,n.environment)}));var s=t.tokenTheme.getColorMap();return o.addRule(function(e){for(var t=[],n=1,r=e.length;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},PM=function(e,t){return function(n,r){t(n,r,e)}},RM="data-keybinding-context",FM=function(){function e(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}return e.prototype.setValue=function(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)},e.prototype.removeValue=function(e){return e in this._value&&(delete this._value[e],!0)},e.prototype.getValue=function(e){var t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t},e}(),YM=function(e){function t(){return e.call(this,-1,null)||this}return AM(t,e),t.prototype.setValue=function(e,t){return!1},t.prototype.removeValue=function(e){return!1},t.prototype.getValue=function(e){},t.INSTANCE=new t,t}(FM),jM=function(e){function t(t,n,r){var i=e.call(this,t,null)||this;return i._configurationService=n,i._values=new Map,i._listener=i._configurationService.onDidChangeConfiguration((function(e){if(6===e.source){var t=Wn(i._values);i._values.clear(),r.fire(new WM(t))}else{for(var n=[],o=0,s=e.affectedKeys;o1){var r=n.shift();r&&(i.focusItemByElement(r.container),n.push(r)),i.mnemonics.set(t,n)}}}))),Ge.c&&i._register(Bh(o,gf.KEY_DOWN,(function(e){var t=new gh(e);t.equals(14)||t.equals(11)?(i.focusedItem=i.viewItems.length-1,i.focusNext(),mf.stop(e,!0)):(t.equals(13)||t.equals(12))&&(i.focusedItem=0,i.focusPrevious(),mf.stop(e,!0))}))),i._register(Bh(i.domNode,gf.MOUSE_OUT,(function(e){df(e.relatedTarget,i.domNode)||(i.focusedItem=void 0,i.scrollTopHold=i.menuElement.scrollTop,i.updateFocus(),e.stopPropagation())}))),i._register(Bh(i.domNode,gf.MOUSE_UP,(function(e){mf.stop(e,!0)}))),i._register(Bh(i.actionsList,gf.MOUSE_OVER,(function(e){var t=e.target;if(t&&df(t,i.actionsList)&&t!==i.actionsList){for(;t.parentElement!==i.actionsList&&null!==t.parentElement;)t=t.parentElement;if(Ah(t,"action-item")){var n=i.focusedItem;i.scrollTopHold=i.menuElement.scrollTop,i.setFocusedItem(t),n!==i.focusedItem&&i.updateFocus()}}})));var s={parent:i};return i.mnemonics=new Map,i.push(n,{icon:!0,label:!0,isMenu:!0}),i.scrollableElement=i._register(new Kp(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0})),i.scrollableElement.getDomNode().style.position=null,o.style.maxHeight=Math.max(10,window.innerHeight-t.getBoundingClientRect().top-30)+"px",i.menuDisposables.add(i.scrollableElement.onScroll((function(){i._onScroll.fire()}),i)),i._register(Bh(i.menuElement,gf.SCROLL,(function(e){void 0!==i.scrollTopHold&&(i.menuElement.scrollTop=i.scrollTopHold,i.scrollTopHold=void 0),i.scrollableElement.scanDomNode()}))),t.appendChild(i.scrollableElement.getDomNode()),i.scrollableElement.scanDomNode(),i.viewItems.filter((function(e){return!(e instanceof eE)})).forEach((function(e,t,n){e.updatePositionInSet(t+1,n.length)})),i}return KM(t,e),t.prototype.style=function(e){var t=this.getContainer(),n=e.foregroundColor?""+e.foregroundColor:null,r=e.backgroundColor?""+e.backgroundColor:null,i=e.borderColor?"2px solid "+e.borderColor:null,o=e.shadowColor?"0 2px 4px "+e.shadowColor:null;t.style.border=i,this.domNode.style.color=n,this.domNode.style.backgroundColor=r,t.style.boxShadow=o,this.viewItems&&this.viewItems.forEach((function(t){(t instanceof XM||t instanceof eE)&&t.style(e)}))},t.prototype.getContainer=function(){return this.scrollableElement.getDomNode()},Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollOffset",{get:function(){return this.menuElement.scrollTop},enumerable:!0,configurable:!0}),t.prototype.focusItemByElement=function(e){var t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()},t.prototype.setFocusedItem=function(e){for(var t=0;t
  • \n\t\t\t\t\t\t\tMermaid Documentation\n\t\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\tMermaid on GitHub\n\t\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\tLive Editor on GitHub\n\t\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\tMermaid CLI\n\t\t\t\t\t\t
  • ',S(t,"classname","marketing-links")},m(e,n){_(e,t,n)},d(e){e&&y(t)}}}function BA(e){let t;const n=new xA({});return{c(){K(n.$$.fragment)},m(e,r){G(n,e,r),t=!0},i(e){t||(z(n.$$.fragment,e),t=!0)},o(e){U(n.$$.fragment,e),t=!1},d(e){$(n,e)}}}function HA(e){let t;const n=new PA({});return{c(){K(n.$$.fragment)},m(e,r){G(n,e,r),t=!0},i(e){t||(z(n.$$.fragment,e),t=!0)},o(e){U(n.$$.fragment,e),t=!1},d(e){$(n,e)}}}function WA(e){let t;return{c(){t=b(e[0])},m(e,n){_(e,t,n)},p(e,n){1&n&&x(t,e[0])},d(e){e&&y(t)}}}function VA(e){let t,n,r,i,o,s,a,u,c,l,d,h,f,p;const g=new MA({props:{title:"Code",noPadding:"true",$$slots:{default:[FA]},$$scope:{ctx:e}}}),C=new MA({props:{title:"Mermaid Configuration",$$slots:{default:[YA]},$$scope:{ctx:e}}}),x=new MA({props:{title:"Links",$$slots:{default:[jA]},$$scope:{ctx:e}}}),k=new MA({props:{title:"Preview",$$slots:{default:[BA]},$$scope:{ctx:e}}}),L=new MA({props:{title:"Actions",$$slots:{default:[HA]},$$scope:{ctx:e}}}),M=new TA({props:{color:"green",$$slots:{default:[WA]},$$scope:{ctx:e}}});return{c(){t=v("div"),(n=v("h1")).textContent="Mermaid Live Editor",r=w(),i=v("div"),o=v("div"),K(g.$$.fragment),s=w(),K(C.$$.fragment),a=w(),K(x.$$.fragment),u=w(),c=v("div"),K(k.$$.fragment),l=w(),K(L.$$.fragment),d=w(),h=v("div"),f=b("Powered by mermaid "),K(M.$$.fragment),S(n,"id","app-title"),S(n,"class","svelte-1cfasmi"),S(o,"id","col1"),S(o,"class","svelte-1cfasmi"),S(h,"id","power"),S(h,"class","svelte-1cfasmi"),S(c,"id","col2"),S(c,"class","svelte-1cfasmi"),S(i,"id","editor-root"),S(i,"class","svelte-1cfasmi")},m(e,y){_(e,t,y),m(t,n),m(t,r),m(t,i),m(i,o),G(g,o,null),m(o,s),G(C,o,null),m(o,a),G(x,o,null),m(i,u),m(i,c),G(k,c,null),m(c,l),G(L,c,null),m(c,d),m(c,h),m(h,f),G(M,h,null),p=!0},p(e,[t]){const n={};6&t&&(n.$$scope={dirty:t,ctx:e}),g.$set(n);const r={};4&t&&(r.$$scope={dirty:t,ctx:e}),C.$set(r);const i={};4&t&&(i.$$scope={dirty:t,ctx:e}),x.$set(i);const o={};4&t&&(o.$$scope={dirty:t,ctx:e}),k.$set(o);const s={};4&t&&(s.$$scope={dirty:t,ctx:e}),L.$set(s);const a={};5&t&&(a.$$scope={dirty:t,ctx:e}),M.$set(a)},i(e){p||(z(g.$$.fragment,e),z(C.$$.fragment,e),z(x.$$.fragment,e),z(k.$$.fragment,e),z(L.$$.fragment,e),z(M.$$.fragment,e),p=!0)},o(e){U(g.$$.fragment,e),U(C.$$.fragment,e),U(x.$$.fragment,e),U(k.$$.fragment,e),U(L.$$.fragment,e),U(M.$$.fragment,e),p=!1},d(e){e&&y(t),$(g),$(C),$(x),$(k),$(L),$(M)}}}function zA(){JA("FlowChart")}function UA(){JA("SequenceDiagram")}function qA(){JA("ClassDiagram")}function KA(){JA("StateDiagram")}function GA(){JA("GanttChart")}function $A(){JA("PieChart")}function ZA(){JA("ERDiagram")}function JA(e){let t="";switch(e){case"FlowChart":t="graph TD\n\tA[Christmas] --\x3e|Get money| B(Go shopping)\n\tB --\x3e C{Let me think}\n\tC --\x3e|One| D[Laptop]\n\tC --\x3e|Two| E[iPhone]\n\tC --\x3e|Three| F[fa:fa-car Car]\n\t\t\t\t\t";break;case"SequenceDiagram":t="sequenceDiagram\n\tAlice->>+John: Hello John, how are you?\n\tAlice->>+John: John, can you hear me?\n\tJohn--\x3e>-Alice: Hi Alice, I can hear you!\n\tJohn--\x3e>-Alice: I feel great!\n\t\t\t\t\t";break;case"ClassDiagram":t="classDiagram\n\tAnimal <|-- Duck\n\tAnimal <|-- Fish\n\tAnimal <|-- Zebra\n\tAnimal : +int age\n\tAnimal : +String gender\n\tAnimal: +isMammal()\n\tAnimal: +mate()\n\tclass Duck{\n\t\t+String beakColor\n\t\t+swim()\n\t\t+quack()\n\t}\n\tclass Fish{\n\t\t-int sizeInFeet\n\t\t-canEat()\n\t}\n\tclass Zebra{\n\t\t+bool is_wild\n\t\t+run()\n\t}\n\t\t\t\t\t";break;case"StateDiagram":t="stateDiagram\n\t[*] --\x3e Still\n\tStill --\x3e [*]\n\n\tStill --\x3e Moving\n\tMoving --\x3e Still\n\tMoving --\x3e Crash\n\tCrash --\x3e [*]\n\t\t\t\t\t";break;case"GanttChart":t="gantt\n\ttitle A Gantt Diagram\n\tdateFormat YYYY-MM-DD\n\tsection Section\n\tA task :a1, 2014-01-01, 30d\n\tAnother task :after a1 , 20d\n\tsection Another\n\tTask in sec :2014-01-12 , 12d\n\tanother task : 24d\n\t\t\t\t\t";break;case"PieChart":t='pie title Pets adopted by volunteers\n\t"Dogs" : 386\n\t"Cats" : 85\n\t"Rats" : 15\n\t\t\t\t\t';break;case"ERDiagram":t='erDiagram\n CUSTOMER }|..|{ DELIVERY-ADDRESS : has\n CUSTOMER ||--o{ ORDER : places\n CUSTOMER ||--o{ INVOICE : "liable for"\n DELIVERY-ADDRESS ||--o{ ORDER : receives\n INVOICE ||--|{ ORDER : covers\n ORDER ||--|{ ORDER-ITEM : includes\n PRODUCT-CATEGORY ||--|{ PRODUCT : contains\n PRODUCT ||--o{ ORDER-ITEM : "ordered in"\n\t\t\t\t\t'}fe({code:t,mermaid:{theme:"default"},updateEditor:!0})}function XA(e,t,n){let{mermaidVersion:r=RA.version}=t;D(async()=>{ga("send","pageview"),ga("send","event","version",r,r),he(i.data)});let{params:i={}}=t;return e.$set=e=>{"mermaidVersion"in e&&n(0,r=e.mermaidVersion),"params"in e&&n(1,i=e.params)},[r,i]}var QA=class extends J{constructor(e){super(),Z(this,e,XA,VA,l,{mermaidVersion:0,params:1})}};n(716);function eI(e){let t,n;const r=new xA({});return{c(){t=v("div"),K(r.$$.fragment),S(t,"id","view-page"),S(t,"class","svelte-ylwsal")},m(e,i){_(e,t,i),G(r,t,null),n=!0},p:o,i(e){n||(z(r.$$.fragment,e),n=!0)},o(e){U(r.$$.fragment,e),n=!1},d(e){e&&y(t),$(r)}}}function tI(e,t,n){D(async()=>{he(r.data),ga("send","pageview")});let{params:r={}}=t;return e.$set=e=>{"params"in e&&n(0,r=e.params)},[r]}var nI=class extends J{constructor(e){super(),Z(this,e,tI,eI,l,{params:0})}};function rI(e){let t;const n=new ce({props:{routes:e[0]}});return{c(){K(n.$$.fragment)},m(e,r){G(n,e,r),t=!0},p:o,i(e){t||(z(n.$$.fragment,e),t=!0)},o(e){U(n.$$.fragment,e),t=!1},d(e){$(n,e)}}}function iI(e){return[{"/":QA,"/edit/:data":QA,"/view/:data":nI,"*":QA}]}const oI=new class extends J{constructor(e){super(),Z(this,e,iI,rI,l,{})}}({target:document.body,props:{name:"world"}});window.app=oI;t.default=oI}]); \ No newline at end of file +!function(e){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=void 0,r=n={VERSION:[2,5,3],content:[],cache:{},snakeskinRgxp:null,symbols:null,replace:E,paste:T},i={'"':!0,"'":!0,"`":!0},o={"/":!0};for(var s in i){if(!i.hasOwnProperty(s))break;o[s]=!0}var a={"//":!0,"//*":!0,"//!":!0,"//#":!0,"//@":!0,"//$":!0},u={"/*":!0,"/**":!0,"/*!":!0,"/*#":!0,"/*@":!0,"/*$":!0},c=[],l={};for(var d in o){if(!o.hasOwnProperty(d))break;c.push(d),l[d]=!0}for(var h in a){if(!a.hasOwnProperty(h))break;c.push(h),l[h]=!0}for(var f in u){if(!u.hasOwnProperty(f))break;c.push(f),l[f]=!0}var p=[],g={g:!0,m:!0,i:!0,y:!0,u:!0};for(var m in g){if(!g.hasOwnProperty(m))break;p.push(m)}var _={"-":!0,"+":!0,"*":!0,"%":!0,"~":!0,">":!0,"<":!0,"^":!0,",":!0,";":!0,"=":!0,"|":!0,"&":!0,"!":!0,"?":!0,":":!0,"(":!0,"{":!0,"[":!0},y={return:!0,yield:!0,await:!0,typeof:!0,void:!0,instanceof:!0,delete:!0,in:!0,new:!0,of:!0};function v(e,t,n){for(var r in e){if(!e.hasOwnProperty(r))break;r in t==0&&(t[r]=n)}}var b=void 0,w=void 0,C=/[^\s/]/,S=/[a-z]/,x=/\s/,k=/[\r\n]/,L=/\${pos}/g,M={object:!0,function:!0};function E(e,r,s,d){b=b||n.symbols||"a-z",w=w||n.snakeskinRgxp||new RegExp("[!$"+b+"_]","i");var h=n,f=h.cache,m=h.content,E=Boolean(r&&M[void 0===r?"undefined":t(r)]),D=E?Object(r):{};function T(e){return D["@label"]?D["@label"].replace(L,e):"__ESCAPER_QUOT__"+e+"_"}var N=!1;"boolean"==typeof r&&(N=Boolean(r)),"@comments"in D&&(v(u,D,D["@comments"]),v(a,D,D["@comments"]),delete D["@comments"]),"@strings"in D&&(v(i,D,D["@strings"]),delete D["@strings"]),"@literals"in D&&(v(o,D,D["@literals"]),delete D["@literals"]),"@all"in D&&(v(l,D,D["@all"]),delete D["@all"]);for(var O="",A=-1;++A2&&u[B])&&(D[B]&&(U=e.substring(H,$+1),-1===D[B]?q="":(q=T(R.length),R.push(U)),e=e.substring(0,H)+q+e.substring($+1),$+=q.length-U.length),B=!1);else{if(!F){if("/"===Z&&((a[X]||u[X])&&(B=a[Q]||u[Q]?Q:X),B)){H=$;continue}_[Z]||y[G]?(Y=!0,G=""):C.test(Z)&&(Y=!1),S.test(Z)?K+=Z:(G=K,K="");var ee=!1;d&&("|"===Z&&w.test(J)?(z=!0,Y=!1,ee=!0):z&&x.test(Z)&&(z=!1,Y=!0,ee=!0)),ee||(_[Z]?Y=!0:C.test(Z)&&(Y=!1))}if("/"!==F||j||("["===Z?W=!0:"]"===Z&&(W=!1)),!F&&V&&("}"===Z?V--:"{"===Z&&V++,V||(Z="`")),"`"!==F||j||"${"!==X||(Z="`",$++,V++),!l[Z]||"/"===Z&&!Y||F){if(F&&("\\"===Z||j))j=!j;else if(l[Z]&&F===Z&&!j&&("/"!==F||!W)){if("/"===Z)for(var te=-1;++ten.unsubscribe():n}function h(e,t,n,r){if(e){const i=f(e,t,n,r);return e[0](i)}}function f(e,t,n,r){return e[1]&&r?function(e,t){for(const n in t)e[n]=t[n];return e}(n.ctx.slice(),e[1](r(t))):n.ctx}function p(e,t,n,r){return e[2]&&r?t.dirty|e[2](r(n)):t.dirty}function g(e){return null==e?"":e}new Set;function m(e,t){e.appendChild(t)}function _(e,t,n){e.insertBefore(t,n||null)}function y(e){e.parentNode.removeChild(e)}function v(e){return document.createElement(e)}function b(e){return document.createTextNode(e)}function w(){return b(" ")}function C(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function S(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function x(e,t){t=""+t,e.data!==t&&(e.data=t)}function k(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}let L;function M(e){L=e}function E(){if(!L)throw new Error("Function called outside component initialization");return L}function D(e){E().$$.on_mount.push(e)}const T=[],N=[],O=[],A=[],I=Promise.resolve();let P=!1;function R(){P||(P=!0,I.then(Y))}function F(e){O.push(e)}function Y(){const e=new Set;do{for(;T.length;){const e=T.shift();M(e),j(e.$$)}for(;N.length;)N.pop()();for(let t=0;t{B.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}"undefined"!=typeof window?window:global;new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]);let q;function K(e){e&&e.c()}function G(e,t,n){const{fragment:r,on_mount:i,on_destroy:o,after_update:a}=e.$$;r&&r.m(t,n),F(()=>{const t=i.map(s).filter(c);o?o.push(...t):u(t),e.$$.on_mount=[]}),a.forEach(F)}function $(e,t){const n=e.$$;null!==n.fragment&&(u(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Z(e,t,n,r,i,s,c=[-1]){const l=L;M(e);const d=t.props||{},h=e.$$={fragment:null,ctx:null,props:s,update:o,not_equal:i,bound:a(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:[]),callbacks:a(),dirty:c};let f=!1;var p;h.ctx=n?n(e,d,(t,n,r=n)=>(h.ctx&&i(h.ctx[t],h.ctx[t]=r)&&(h.bound[t]&&h.bound[t](r),f&&function(e,t){-1===e.$$.dirty[0]&&(T.push(e),R(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(){}});class J{$destroy(){$(this,1),this.$destroy=o}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(){}}const X=[];function Q(e,t){return{subscribe:ee(e,t).subscribe}}function ee(e,t=o){let n;const r=[];function i(t){if(l(e,t)&&(e=t,n)){const t=!X.length;for(let t=0;t{const e=r.indexOf(u);-1!==e&&r.splice(e,1),0===r.length&&(n(),n=null)}}}}function te(e,t,n){const r=!Array.isArray(e),i=r?[e]:e,s=t.length<2;return Q(n,e=>{let n=!1;const a=[];let l=0,d=o;const h=()=>{if(l)return;d();const n=t(r?a[0]:a,e);s?e(n):d=c(n)?n:o},f=i.map((e,t)=>e.subscribe(e=>{a[t]=e,l&=~(1<{l|=1<{$(e,1)}),V()}r?(K((o=new r(i(e))).$$.fragment),z(o.$$.fragment,1),G(o,t.parentNode,t)):o=null}else r&&o.$set(s)},i(e){n||(o&&z(o.$$.fragment,e),n=!0)},o(e){o&&U(o.$$.fragment,e),n=!1},d(e){e&&y(t),o&&$(o,e)}}}function ie(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let r="";return n>-1&&(r=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:r}}const oe=Q(ie(),(function(e){const t=()=>{e(ie())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}}));te(oe,e=>e.location),te(oe,e=>e.querystring);function se(e){if(!e||e.length<1||"/"!=e.charAt(0)&&0!==e.indexOf("#/"))throw Error("Invalid parameter location");setTimeout(()=>{const t=("#"==e.charAt(0)?"":"#")+e;history.replaceState(void 0,void 0,t),window.dispatchEvent(new Event("hashchange"))},0)}function ae(e){if(!e||!e.tagName||"a"!=e.tagName.toLowerCase())throw Error('Action "link" can only be used with tags');const t=e.getAttribute("href");if(!t||t.length<1||"/"!=t.charAt(0))throw Error('Invalid value for "href" attribute');e.setAttribute("href","#"+t)}function ue(e,t,n){let r,i=o;!function(e,t,n){e.$$.on_destroy.push(d(t,n))}(e,oe,e=>n(3,r=e)),e.$$.on_destroy.push(()=>i());let{routes:s={}}=t;class a{constructor(e,t){if(!t||"function"!=typeof t&&("object"!=typeof t||!0!==t._sveltesparouter))throw Error("Invalid component object");if(!e||"string"==typeof e&&(e.length<1||"/"!=e.charAt(0)&&"*"!=e.charAt(0))||"object"==typeof e&&!(e instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:n,keys:r}=ne(e);this.path=e,"object"==typeof t&&!0===t._sveltesparouter?(this.component=t.route,this.conditions=t.conditions||[]):(this.component=t,this.conditions=[]),this._pattern=n,this._keys=r}match(e){const t=this._pattern.exec(e);if(null===t)return null;if(!1===this._keys)return t;const n={};let r=0;for(;r{const r=e.$$.callbacks[t];if(r){const i=k(t,n);r.slice().forEach(t=>{t.call(e,i)})}}}(),p=(e,t)=>{setTimeout(()=>{f(e,t)},0)};return e.$set=e=>{"routes"in e&&n(2,s=e.routes)},e.$$.update=()=>{if(9&e.$$.dirty){n(0,l=null);let e=0;for(;!l&&e{let t,n;const r=window.matchMedia("(prefers-color-scheme: dark)").matches&&!1;try{let r=le.Base64.decode(e);n=JSON.parse(r),console.log("state from url",n),n.code,t=n.code}catch(e){n={code:t="graph TD\n A[Christmas] --\x3e|Get money| B(Go shopping)\n B --\x3e C{Let me think}\n C --\x3e|One| D[Laptop]\n C --\x3e|Two| E[iPhone]\n C --\x3e|Three| F[fa:fa-car Car]\n\t\t",mermaid:{theme:r?"dark":"default"}}}de.set(n)},fe=e=>{de.set(e),se("/edit/"+le.Base64.encodeURI(JSON.stringify(e)))},pe=ee(void 0);var ge=n(31),me=n.n(ge);n(377);function _e(e){let t,n,r;return{c(){t=v("div"),n=b(e[1]),S(t,"id","error"),S(t,"class",r=g(e[0])+" svelte-ardmue")},m(e,r){_(e,t,r),m(t,n)},p(e,[i]){2&i&&x(n,e[1]),1&i&&r!==(r=g(e[0])+" svelte-ardmue")&&S(t,"class",r)},i:o,o:o,d(e){e&&y(t)}}}function ye(e,t,n){D(async()=>{});let{classes:r=""}=t,{errorText:i=""}=t;return e.$set=e=>{"classes"in e&&n(0,r=e.classes),"errorText"in e&&n(1,i=e.errorText)},[r,i]}var ve=class extends J{constructor(e){super(),Z(this,e,ye,_e,l,{classes:0,errorText:1})}};const be=e=>{e.languages.register({id:"mermaid"}),e.languages.setMonarchTokensProvider("mermaid",{typeKeywords:["graph","stateDiagram","sequenceDiagram","classDiagram","pie","flowchart","gantt"],keywords:["patricipant","as"],arrows:["---","===","--\x3e","==>"],tokenizer:{root:[[/[{}]/,"delimiter.bracket"],[/[a-z_$][\w$]*/,{cases:{"@typeKeywords":"keyword","@keywords":"keyword"}}],[/[-=>ox]+/,{cases:{"@arrows":"transition"}}],[/[\[\{\(}]+.+?[\)\]\}]+/,"string"],[/\".*\"/,"string"]]},whitespace:[[/[ \t\r\n]+/,"white"],[/\%\%.*$/,"comment"]]}),e.editor.defineTheme("myCoolTheme",{base:"vs",inherit:!1,rules:[{token:"keyword",foreground:"880000",fontStyle:"bold"},{token:"custom-error",foreground:"ff0000",fontStyle:"bold"},{token:"string",foreground:"AA8500"},{token:"transition",foreground:"008800",fontStyle:"bold"},{token:"delimiter.bracket",foreground:"000000",fontStyle:"bold"}]}),e.languages.registerCompletionItemProvider("mermaid",{provideCompletionItems:()=>{return{suggestions:[{label:"simpleText",kind:e.languages.CompletionItemKind.Text,insertText:"simpleText"},{label:"testing",kind:e.languages.CompletionItemKind.Keyword,insertText:"testing(${1:condition})",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"ifelse",kind:e.languages.CompletionItemKind.Snippet,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"If-Else Statement"}]}}})};function we(e,t){for(var n=[],r=2;r=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o)-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),void 0!==n&&(n+=e.charAt(i));else{void 0===n&&(n=e.substr(0,i));var s=at[o];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),n+=s):-1===r&&(r=i)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function ct(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?e.path[1].toLowerCase()+e.path.substr(2):e.path,Ge.g&&(t=t.replace(/\//g,"\\")),t}function dt(e,t){var n=t?ct:ut,r="",i=e.scheme,o=e.authority,s=e.path,a=e.query,u=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=nt,r+=nt),o){var c=o.indexOf("@");if(-1!==c){var l=o.substr(0,c);o=o.substr(c+1),-1===(c=l.indexOf(":"))?r+=n(l,!1):(r+=n(l.substr(0,c),!1),r+=":",r+=n(l.substr(c+1),!1)),r+="@"}-1===(c=(o=o.toLowerCase()).indexOf(":"))?r+=n(o,!1):(r+=n(o.substr(0,c),!1),r+=o.substr(c))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(d=s.charCodeAt(1))>=65&&d<=90&&(s="/"+String.fromCharCode(d+32)+":"+s.substr(3));else if(s.length>=2&&58===s.charCodeAt(1)){var d;(d=s.charCodeAt(0))>=65&&d<=90&&(s=String.fromCharCode(d+32)+":"+s.substr(2))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),u&&(r+="#",r+=t?u:ut(u,!1)),r}!function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(et||(et={}));var ht=pt("instantiationService");function ft(e,t,n,r){t[et.DI_TARGET]===t?t[et.DI_DEPENDENCIES].push({id:e,index:n,optional:r}):(t[et.DI_DEPENDENCIES]=[{id:e,index:n,optional:r}],t[et.DI_TARGET]=t)}function pt(e){if(et.serviceIds.has(e))return et.serviceIds.get(e);var t=function(e,n,r){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ft(t,e,r,!1)};return t.toString=function(){return e},et.serviceIds.set(e,t),t}function gt(e){return function(t,n,r){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");ft(e,t,r,!0)}}var mt=pt("codeEditorService"),_t=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.with=function(t,n){return void 0===t&&(t=this.lineNumber),void 0===n&&(n=this.column),t===this.lineNumber&&n===this.column?this:new e(t,n)},e.prototype.delta=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=0),this.with(this.lineNumber+e,this.column+t)},e.prototype.equals=function(t){return e.equals(this,t)},e.equals=function(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column},e.prototype.isBefore=function(t){return e.isBefore(this,t)},e.isBefore=function(e,t){return e.lineNumber=n?At:{done:!1,value:e[t++]}}}},e.from=function(t){return t?Array.isArray(t)?e.fromArray(t):t:e.empty()},e.map=function(e,t){return{next:function(){var n=e.next();return n.done?At:{done:!1,value:t(n.value)}}}},e.filter=function(e,t){return{next:function(){for(;;){var n=e.next();if(n.done)return At;if(t(n.value))return{done:!1,value:n.value}}}}},e.forEach=function(e,t){for(var n=e.next();!n.done;n=e.next())t(n.value)},e.collect=function(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY);var n=[];if(0===t)return n;for(var r=0,i=e.next();!i.done&&(n.push(i.value),!(++r>=t));i=e.next());return n},e.concat=function(){for(var e=[],t=0;t=e.length)return At;var t=e[n].next();return t.done?(n++,this.next()):t}}}}(Nt||(Nt={}));var It,Pt=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===r&&(r=t.length),void 0===i&&(i=n-1),e.call(this,t,n,r,i)||this}return Ot(t,e),t.prototype.current=function(){return e.prototype.current.call(this)},t.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},t.prototype.first=function(){return this.index=this.start,this.current()},t.prototype.last=function(){return this.index=this.end-1,this.current()},t.prototype.parent=function(){return null},t}(function(){function e(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=e.length),void 0===r&&(r=t-1),this.items=e,this.start=t,this.end=n,this.index=r}return e.prototype.first=function(){return this.index=this.start,this.current()},e.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},e.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},e}()),Rt=(function(){function e(e,t){this.iterator=e,this.fn=t}e.prototype.next=function(){return this.fn(this.iterator.next())}}(),function(){function e(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}return e.Undefined=new e(void 0),e}()),Ft=function(){function e(){this._first=Rt.Undefined,this._last=Rt.Undefined,this._size=0}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return this._first===Rt.Undefined},e.prototype.clear=function(){this._first=Rt.Undefined,this._last=Rt.Undefined,this._size=0},e.prototype.unshift=function(e){return this._insert(e,!1)},e.prototype.push=function(e){return this._insert(e,!0)},e.prototype._insert=function(e,t){var n=this,r=new Rt(e);if(this._first===Rt.Undefined)this._first=r,this._last=r;else if(t){var i=this._last;this._last=r,r.prev=i,i.next=r}else{var o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;var s=!1;return function(){s||(s=!0,n._remove(r))}},e.prototype.shift=function(){if(this._first!==Rt.Undefined){var e=this._first.element;return this._remove(this._first),e}},e.prototype.pop=function(){if(this._last!==Rt.Undefined){var e=this._last.element;return this._remove(this._last),e}},e.prototype._remove=function(e){if(e.prev!==Rt.Undefined&&e.next!==Rt.Undefined){var t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Rt.Undefined&&e.next===Rt.Undefined?(this._first=Rt.Undefined,this._last=Rt.Undefined):e.next===Rt.Undefined?(this._last=this._last.prev,this._last.next=Rt.Undefined):e.prev===Rt.Undefined&&(this._first=this._first.next,this._first.prev=Rt.Undefined);this._size-=1},e.prototype.iterator=function(){var e,t=this._first;return{next:function(){return t===Rt.Undefined?At:(e?e.value=t.element:e={done:!1,value:t.element},t=t.next,e)}}},e.prototype.toArray=function(){for(var e=[],t=this._first;t!==Rt.Undefined;t=t.next)e.push(t.element);return e},e}(),Yt=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){function t(e){return function(t,n,r){void 0===n&&(n=null);var i,o=!1;return i=e((function(e){if(!o)return i?i.dispose():o=!0,t.call(n,e)}),null,r),o&&i.dispose(),i}}function n(e,t){return s((function(n,r,i){return void 0===r&&(r=null),e((function(e){return n.call(r,t(e))}),null,i)}))}function r(e,t){return s((function(n,r,i){return void 0===r&&(r=null),e((function(e){t(e),n.call(r,e)}),null,i)}))}function i(e,t){return s((function(n,r,i){return void 0===r&&(r=null),e((function(e){return t(e)&&n.call(r,e)}),null,i)}))}function o(e,t,r){var i=r;return n(e,(function(e){return i=t(i,e)}))}function s(e){var t,n=new Ht({onFirstListenerAdd:function(){t=e(n.fire,n)},onLastListenerRemove:function(){t.dispose()}});return n.event}function a(e){var t,n=!0;return i(e,(function(e){var r=n||e!==t;return n=!1,t=e,r}))}e.None=function(){return Dt.None},e.once=t,e.map=n,e.forEach=r,e.filter=i,e.signal=function(e){return e},e.any=function(){for(var e=[],t=0;t1)&&c.fire(e),u=0}),n)}))},onLastListenerRemove:function(){o.dispose()}});return c.event},e.stopwatch=function(e){var r=(new Date).getTime();return n(t(e),(function(e){return(new Date).getTime()-r}))},e.latch=a,e.buffer=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=[]);var r=n.slice(),i=e((function(e){r?r.push(e):s.fire(e)})),o=function(){r&&r.forEach((function(e){return s.fire(e)})),r=null},s=new Ht({onFirstListenerAdd:function(){i||(i=e((function(e){return s.fire(e)})))},onFirstListenerDidAdd:function(){r&&(t?setTimeout(o):o())},onLastListenerRemove:function(){i&&i.dispose(),i=null}});return s.event};var u=function(){function e(e){this.event=e}return e.prototype.map=function(t){return new e(n(this.event,t))},e.prototype.forEach=function(t){return new e(r(this.event,t))},e.prototype.filter=function(t){return new e(i(this.event,t))},e.prototype.reduce=function(t,n){return new e(o(this.event,t,n))},e.prototype.latch=function(){return new e(a(this.event))},e.prototype.on=function(e,t,n){return this.event(e,t,n)},e.prototype.once=function(e,n,r){return t(this.event)(e,n,r)},e}();e.chain=function(e){return new u(e)},e.fromNodeEventEmitter=function(e,t,n){void 0===n&&(n=function(e){return e});var r=function(){for(var e=[],t=0;t0?new Bt(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(e.prototype,"event",{get:function(){var t=this;return this._event||(this._event=function(n,r,i){t._listeners||(t._listeners=new Ft);var o=t._listeners.isEmpty();o&&t._options&&t._options.onFirstListenerAdd&&t._options.onFirstListenerAdd(t);var s,a,u=t._listeners.push(r?[n,r]:n);return o&&t._options&&t._options.onFirstListenerDidAdd&&t._options.onFirstListenerDidAdd(t),t._options&&t._options.onListenerDidAdd&&t._options.onListenerDidAdd(t,n,r),t._leakageMon&&(s=t._leakageMon.check(t._listeners.size)),a={dispose:function(){(s&&s(),a.dispose=e._noop,t._disposed)||(u(),t._options&&t._options.onLastListenerRemove&&(t._listeners&&!t._listeners.isEmpty()||t._options.onLastListenerRemove(t)))}},i instanceof Et?i.add(a):Array.isArray(i)&&i.push(a),a}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new Ft);for(var t=this._listeners.iterator(),n=t.next();!n.done;n=t.next())this._deliveryQueue.push([n.value,e]);for(;this._deliveryQueue.size>0;){var r=this._deliveryQueue.shift(),i=r[0],o=r[1];try{"function"==typeof i?i.call(void 0,o):i[0].call(i[1],o)}catch(n){je(n)}}}},e.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},e._noop=function(){},e}(),Wt=function(e){function t(t){var n=e.call(this,t)||this;return n._isPaused=0,n._eventQueue=new Ft,n._mergeFn=t&&t.merge,n}return Yt(t,e),t.prototype.pause=function(){this._isPaused++},t.prototype.resume=function(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){var t=this._eventQueue.toArray();this._eventQueue.clear(),e.prototype.fire.call(this,this._mergeFn(t))}else for(;!this._isPaused&&0!==this._eventQueue.size;)e.prototype.fire.call(this,this._eventQueue.shift())},t.prototype.fire=function(t){this._listeners&&(0!==this._isPaused?this._eventQueue.push(t):e.prototype.fire.call(this,t))},t}(Ht),Vt=(function(){function e(){var e=this;this.hasListeners=!1,this.events=[],this.emitter=new Ht({onFirstListenerAdd:function(){return e.onFirstListenerAdd()},onLastListenerRemove:function(){return e.onLastListenerRemove()}})}Object.defineProperty(e.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this,n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);return Mt(function(e){var t,n=this,r=!1;return function(){return r?t:(r=!0,t=e.apply(n,arguments))}}((function(){t.hasListeners&&t.unhook(n);var e=t.events.indexOf(n);t.events.splice(e,1)})))},e.prototype.onFirstListenerAdd=function(){var e=this;this.hasListeners=!0,this.events.forEach((function(t){return e.hook(t)}))},e.prototype.onLastListenerRemove=function(){var e=this;this.hasListeners=!1,this.events.forEach((function(t){return e.unhook(t)}))},e.prototype.hook=function(e){var t=this;e.listener=e.event((function(e){return t.emitter.fire(e)}))},e.prototype.unhook=function(e){e.listener&&e.listener.dispose(),e.listener=null},e.prototype.dispose=function(){this.emitter.dispose()}}(),function(){function e(){this.buffers=[]}return e.prototype.wrapEvent=function(e){var t=this;return function(n,r,i){return e((function(e){var i=t.buffers[t.buffers.length-1];i?i.push((function(){return n.call(r,e)})):n.call(r,e)}),void 0,i)}},e.prototype.bufferEvents=function(e){var t=[];this.buffers.push(t);var n=e();return this.buffers.pop(),t.forEach((function(e){return e()})),n},e}()),zt=function(){function e(){var e=this;this.listening=!1,this.inputEvent=It.None,this.inputEventListener=Dt.None,this.emitter=new Ht({onFirstListenerDidAdd:function(){e.listening=!0,e.inputEventListener=e.inputEvent(e.emitter.fire,e.emitter)},onLastListenerRemove:function(){e.listening=!1,e.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(e.prototype,"input",{set:function(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},e}(),Ut=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(s,a)}u((r=r.apply(e,t||[])).next())}))},Kt=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length?e:t[r]}))}function Qt(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function en(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\[\]\(\)\#]/g,"\\$&")}function tn(e,t){if(!e||!t)return e;var n=t.length;if(0===n||0===e.length)return e;for(var r=0;e.indexOf(t,r)===r;)r+=n;return e.substring(r)}function nn(e,t){if(e.length0?e.indexOf(t,n)===n:0===n&&e===t}function on(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("Cannot create regex from empty string");t||(e=en(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));var r="";return n.global&&(r+="g"),n.matchCase||(r+="i"),n.multiline&&(r+="m"),n.unicode&&(r+="u"),new RegExp(e,r)}function sn(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function an(e){for(var t=0,n=e.length;t=0;n--){var r=e.charCodeAt(n);if(32!==r&&9!==r)return n}return-1}function ln(e){return e>=97&&e<=122}function dn(e){return e>=65&&e<=90}function hn(e){return ln(e)||dn(e)}function fn(e,t){return(e?e.length:0)===(t?t.length:0)&&pn(e,t)}function pn(e,t,n){if(void 0===n&&(n=e.length),"string"!=typeof e||"string"!=typeof t)return!1;for(var r=0;re.length)&&pn(e,t,n)}function mn(e){return 55296<=e&&e<=56319}function _n(e){return 56320<=e&&e<=57343}var yn=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function vn(e){return yn.test(e)}var bn=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEF8]|\uD83E[\uDD00-\uDDE6])/;var wn=/^[\t\n\r\x20-\x7E]*$/;function Cn(e){return wn.test(e)}function Sn(e){return(e=+e)>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}var xn=String.fromCharCode(65279);function kn(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Ln(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}var Mn=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),En=function(){function e(){}return e.has=function(e){return Tn.create(e)},e.equals=function(e,t){return Nn.create(e,t)},e.regex=function(e,t){return In.create(e,t)},e.not=function(e){return An.create(e)},e.and=function(){for(var e=[],t=0;t=0){var n=e.split("!=");return On.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("==")>=0){n=e.split("==");return Nn.create(n[0].trim(),this._deserializeValue(n[1],t))}if(e.indexOf("=~")>=0){n=e.split("=~");return In.create(n[0].trim(),this._deserializeRegexValue(n[1],t))}return/^\!\s*/.test(e)?An.create(e.substr(1).trim()):Tn.create(e)},e._deserializeValue=function(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;var n=/^'([^']*)'$/.exec(e);return n?n[1].trim():e},e._deserializeRegexValue=function(e,t){if(!(n=e)||"string"!=typeof n||0===n.trim().length){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var n,r=e.indexOf("/"),i=e.lastIndexOf("/");if(r===i||r<0){if(t)throw new Error("bad regexp-value '"+e+"', missing /-enclosure");return console.warn("bad regexp-value '"+e+"', missing /-enclosure"),null}var o=e.slice(r+1,i),s="i"===e[i+1]?"i":"";try{return new RegExp(o,s)}catch(n){if(t)throw new Error("bad regexp-value '"+e+"', parse error: "+n);return console.warn("bad regexp-value '"+e+"', parse error: "+n),null}},e}();function Dn(e,t){var n=e.getType(),r=t.getType();if(n!==r)return n-r;switch(n){case 1:case 2:case 3:case 4:case 6:case 7:case 5:return e.cmp(t);default:throw new Error("Unknown ContextKeyExpr!")}}var Tn=function(){function e(e){this.key=e}return e.create=function(t){return new e(t)},e.prototype.getType=function(){return 1},e.prototype.cmp=function(e){return this.keye.key?1:0},e.prototype.equals=function(t){return t instanceof e&&this.key===t.key},e.prototype.evaluate=function(e){return!!e.getValue(this.key)},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return An.create(this.key)},e}(),Nn=function(){function e(e,t){this.key=e,this.value=t}return e.create=function(t,n){return"boolean"==typeof n?n?Tn.create(t):An.create(t):new e(t,n)},e.prototype.getType=function(){return 3},e.prototype.cmp=function(e){return this.keye.key?1:this.valuee.value?1:0},e.prototype.equals=function(t){return t instanceof e&&(this.key===t.key&&this.value===t.value)},e.prototype.evaluate=function(e){return e.getValue(this.key)==this.value},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return On.create(this.key,this.value)},e}(),On=function(){function e(e,t){this.key=e,this.value=t}return e.create=function(t,n){return"boolean"==typeof n?n?An.create(t):Tn.create(t):new e(t,n)},e.prototype.getType=function(){return 4},e.prototype.cmp=function(e){return this.keye.key?1:this.valuee.value?1:0},e.prototype.equals=function(t){return t instanceof e&&(this.key===t.key&&this.value===t.value)},e.prototype.evaluate=function(e){return e.getValue(this.key)!=this.value},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return Nn.create(this.key,this.value)},e}(),An=function(){function e(e){this.key=e}return e.create=function(t){return new e(t)},e.prototype.getType=function(){return 2},e.prototype.cmp=function(e){return this.keye.key?1:0},e.prototype.equals=function(t){return t instanceof e&&this.key===t.key},e.prototype.evaluate=function(e){return!e.getValue(this.key)},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return Tn.create(this.key)},e}(),In=function(){function e(e,t){this.key=e,this.regexp=t}return e.create=function(t,n){return new e(t,n)},e.prototype.getType=function(){return 6},e.prototype.cmp=function(e){if(this.keye.key)return 1;var t=this.regexp?this.regexp.source:"",n=e.regexp?e.regexp.source:"";return tn?1:0},e.prototype.equals=function(t){if(t instanceof e){var n=this.regexp?this.regexp.source:"",r=t.regexp?t.regexp.source:"";return this.key===t.key&&n===r}return!1},e.prototype.evaluate=function(e){var t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)},e.prototype.keys=function(){return[this.key]},e.prototype.negate=function(){return Pn.create(this)},e}(),Pn=function(){function e(e){this._actual=e}return e.create=function(t){return new e(t)},e.prototype.getType=function(){return 7},e.prototype.cmp=function(e){return this._actual.cmp(e._actual)},e.prototype.equals=function(t){return t instanceof e&&this._actual.equals(t._actual)},e.prototype.evaluate=function(e){return!this._actual.evaluate(e)},e.prototype.keys=function(){return this._actual.keys()},e.prototype.negate=function(){return this._actual},e}(),Rn=function(){function e(e){this.expr=e}return e.create=function(t){var n=e._normalizeArr(t);if(0!==n.length)return 1===n.length?n[0]:new e(n)},e.prototype.getType=function(){return 5},e.prototype.cmp=function(e){if(this.expr.lengthe.expr.length)return 1;for(var t=0,n=this.expr.length;t1;){for(var s=t.shift(),a=t.shift(),u=[],c=0,l=o(s);c0)n.left||(n.left=new Un,n.left.segment=r.value()),n=n.left;else if(i<0)n.right||(n.right=new Un,n.right.segment=r.value()),n=n.right;else{if(!r.hasNext())break;r.next(),n.mid||(n.mid=new Un,n.mid.segment=r.value()),n=n.mid}}var o=n.value;return n.value=t,n.key=e,o},e.prototype.get=function(e){for(var t=this._iter.reset(e),n=this._root;n;){var r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else{if(!t.hasNext())break;t.next(),n=n.mid}}return n?n.value:void 0},e.prototype.findSubstr=function(e){for(var t=this._iter.reset(e),n=this._root,r=void 0;n;){var i=t.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else{if(!t.hasNext())break;t.next(),r=n.value||r,n=n.mid}}return n&&n.value||r},e.prototype.forEach=function(e){this._forEach(this._root,e)},e.prototype._forEach=function(e,t){e&&(this._forEach(e.left,t),e.value&&t(e.value,e.key),this._forEach(e.mid,t),this._forEach(e.right,t))},e}(),Kn=function(){function e(){this.map=new Map,this.ignoreCase=!1}return e.prototype.set=function(e,t){this.map.set(this.toKey(e),t)},e.prototype.get=function(e){return this.map.get(this.toKey(e))},e.prototype.toKey=function(e){var t=e.toString();return this.ignoreCase&&(t=t.toLowerCase()),t},e}(),Gn=function(e){function t(t,n){void 0===n&&(n=1);var r=e.call(this)||this;return r._limit=t,r._ratio=Math.min(Math.max(0,n),1),r}return Bn(t,e),t.prototype.get=function(t){return e.prototype.get.call(this,t,2)},t.prototype.peek=function(t){return e.prototype.get.call(this,t,0)},t.prototype.set=function(t,n){e.prototype.set.call(this,t,n,2),this.checkTrim()},t.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},t}(function(){function e(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return e.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.get=function(e,t){void 0===t&&(t=0);var n=this._map.get(e);if(n)return 0!==t&&this.touch(n,t),n.value},e.prototype.set=function(e,t,n){void 0===n&&(n=0);var r=this._map.get(e);if(r)r.value=t,0!==n&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:default:this.addItemLast(r)}this._map.set(e,r),this._size++}},e.prototype.delete=function(e){return!!this.remove(e)},e.prototype.remove=function(e){var t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value},e.prototype.forEach=function(e,t){for(var n=this._head;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.next},e.prototype.trimOld=function(e){if(!(e>=this.size))if(0!==e){for(var t=this._head,n=this.size;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0)}else this.clear()},e.prototype.addItemFirst=function(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e},e.prototype.addItemLast=function(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e},e.prototype.removeItem=function(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{var t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0},e.prototype.touch=function(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;var n=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(n.previous=r,r.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e}else if(2===t){if(e===this._tail)return;n=e.next,r=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=r,r.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e}},e.prototype.toJSON=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),e},e}()),$n=pt("commandService"),Zn=new(function(){function e(){this._commands=new Map,this._onDidRegisterCommand=new Ht,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return e.prototype.registerCommand=function(e,t){var n=this;if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){for(var r=[],i=0,o=e.description.args;i=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Qn=function(e,t){return function(n,r){t(n,r,e)}};function er(e){return void 0!==e.command}var tr,nr=pt("menuService"),rr=new(function(){function e(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ht,this.onDidChangeMenu=this._onDidChangeMenu.event}return e.prototype.addCommand=function(e){var t=this;return this._commands.set(e.id,e),this._onDidChangeMenu.fire(0),{dispose:function(){t._commands.delete(e.id)&&t._onDidChangeMenu.fire(0)}}},e.prototype.getCommand=function(e){return this._commands.get(e)},e.prototype.getCommands=function(){var e=new Map;return this._commands.forEach((function(t,n){return e.set(n,t)})),e},e.prototype.appendMenuItem=function(e,t){var n=this,r=this._menuItems.get(e);return r?r.push(t):(r=[t],this._menuItems.set(e,r)),this._onDidChangeMenu.fire(e),{dispose:function(){var i=r.indexOf(t);i>=0&&(r.splice(i,1),n._onDidChangeMenu.fire(e))}}},e.prototype.getMenuItems=function(e){var t=(this._menuItems.get(e)||[]).slice(0);return 0===e&&this._appendImplicitItems(t),t},e.prototype._appendImplicitItems=function(e){for(var t=new Set,n=0,r=e.filter((function(e){return er(e)}));n>>0,r=(4294901760&e)>>>16;return new pr(0!==r?[hr(n,t),hr(r,t)]:[hr(n,t)])}function hr(e,t){var n=!!(2048&e),r=!!(256&e);return new fr(2===t?r:n,!!(1024&e),!!(512&e),2===t?n:r,255&e)}!function(){function e(e,t,n,r){void 0===n&&(n=t),void 0===r&&(r=n),ur.define(e,t),cr.define(e,n),lr.define(e,r)}e(0,"unknown"),e(1,"Backspace"),e(2,"Tab"),e(3,"Enter"),e(4,"Shift"),e(5,"Ctrl"),e(6,"Alt"),e(7,"PauseBreak"),e(8,"CapsLock"),e(9,"Escape"),e(10,"Space"),e(11,"PageUp"),e(12,"PageDown"),e(13,"End"),e(14,"Home"),e(15,"LeftArrow","Left"),e(16,"UpArrow","Up"),e(17,"RightArrow","Right"),e(18,"DownArrow","Down"),e(19,"Insert"),e(20,"Delete"),e(21,"0"),e(22,"1"),e(23,"2"),e(24,"3"),e(25,"4"),e(26,"5"),e(27,"6"),e(28,"7"),e(29,"8"),e(30,"9"),e(31,"A"),e(32,"B"),e(33,"C"),e(34,"D"),e(35,"E"),e(36,"F"),e(37,"G"),e(38,"H"),e(39,"I"),e(40,"J"),e(41,"K"),e(42,"L"),e(43,"M"),e(44,"N"),e(45,"O"),e(46,"P"),e(47,"Q"),e(48,"R"),e(49,"S"),e(50,"T"),e(51,"U"),e(52,"V"),e(53,"W"),e(54,"X"),e(55,"Y"),e(56,"Z"),e(57,"Meta"),e(58,"ContextMenu"),e(59,"F1"),e(60,"F2"),e(61,"F3"),e(62,"F4"),e(63,"F5"),e(64,"F6"),e(65,"F7"),e(66,"F8"),e(67,"F9"),e(68,"F10"),e(69,"F11"),e(70,"F12"),e(71,"F13"),e(72,"F14"),e(73,"F15"),e(74,"F16"),e(75,"F17"),e(76,"F18"),e(77,"F19"),e(78,"NumLock"),e(79,"ScrollLock"),e(80,";",";","OEM_1"),e(81,"=","=","OEM_PLUS"),e(82,",",",","OEM_COMMA"),e(83,"-","-","OEM_MINUS"),e(84,".",".","OEM_PERIOD"),e(85,"/","/","OEM_2"),e(86,"`","`","OEM_3"),e(110,"ABNT_C1"),e(111,"ABNT_C2"),e(87,"[","[","OEM_4"),e(88,"\\","\\","OEM_5"),e(89,"]","]","OEM_6"),e(90,"'","'","OEM_7"),e(91,"OEM_8"),e(92,"OEM_102"),e(93,"NumPad0"),e(94,"NumPad1"),e(95,"NumPad2"),e(96,"NumPad3"),e(97,"NumPad4"),e(98,"NumPad5"),e(99,"NumPad6"),e(100,"NumPad7"),e(101,"NumPad8"),e(102,"NumPad9"),e(103,"NumPad_Multiply"),e(104,"NumPad_Add"),e(105,"NumPad_Separator"),e(106,"NumPad_Subtract"),e(107,"NumPad_Decimal"),e(108,"NumPad_Divide")}(),function(e){e.toString=function(e){return ur.keyCodeToStr(e)},e.fromString=function(e){return ur.strToKeyCode(e)},e.toUserSettingsUS=function(e){return cr.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return lr.keyCodeToStr(e)},e.fromUserSettings=function(e){return cr.strToKeyCode(e)||lr.strToKeyCode(e)}}(tr||(tr={}));var fr=function(){function e(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}return e.prototype.equals=function(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode},e.prototype.isModifierKey=function(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode},e.prototype.toChord=function(){return new pr([this])},e.prototype.isDuplicateModifierCase=function(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode},e}(),pr=function(){function e(e){if(0===e.length)throw ze("parts");this.parts=e}return e.prototype.equals=function(e){if(null===e)return!1;if(this.parts.length!==e.parts.length)return!1;for(var t=0;t=21&&e<=30||(e>=31&&e<=56||(80===e||81===e||82===e||83===e||84===e||85===e||86===e||110===e||111===e||87===e||88===e||89===e||90===e||91===e||92===e))},e.prototype._assertNoCtrlAlt=function(t,n){t.ctrlKey&&t.altKey&&!t.metaKey&&e._mightProduceChar(t.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",t," for ",n)},e.prototype._registerDefaultKeybinding=function(e,t,n,r,i,o){1===Ge.a&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e,command:t,commandArgs:n,when:o,weight1:r,weight2:i}),this._cachedMergedKeybindings=null},e.prototype.getDefaultKeybindings=function(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(br)),this._cachedMergedKeybindings.slice(0)},e}());function br(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.commandt.command?1:e.weight2-t.weight2}yr.add("platform.keybindingsRegistry",vr);var wr,Cr=pt("telemetryService"),Sr=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xr=function(){function e(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menubarOpts=e.menubarOpts,this._description=e.description}return e.prototype.register=function(){var e=this;if(this._menubarOpts&&rr.appendMenuItem(this._menubarOpts.menuId,{group:this._menubarOpts.group,command:{id:this.id,title:this._menubarOpts.title},when:this._menubarOpts.when,order:this._menubarOpts.order}),this._kbOpts){var t=this._kbOpts.kbExpr;this.precondition&&(t=t?En.and(t,this.precondition):this.precondition),vr.registerCommandAndKeybindingRule({id:this.id,handler:function(t,n){return e.runCommand(t,n)},weight:this._kbOpts.weight,when:t,primary:this._kbOpts.primary,secondary:this._kbOpts.secondary,win:this._kbOpts.win,linux:this._kbOpts.linux,mac:this._kbOpts.mac,description:this._description})}else Zn.registerCommand({id:this.id,handler:function(t,n){return e.runCommand(t,n)},description:this._description})},e}(),kr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Sr(t,e),t.bindToContribution=function(e){return function(t){function n(e){var n=t.call(this,e)||this;return n._callback=e.handler,n}return Sr(n,t),n.prototype.runEditorCommand=function(t,n,r){e(n)&&this._callback(e(n),r)},n}(t)},t.prototype.runCommand=function(e,t){var n=this,r=e.get(mt),i=r.getFocusedCodeEditor()||r.getActiveCodeEditor();if(i)return i.invokeWithinContext((function(e){if(e.get(jn).contextMatchesRules(Re(n.precondition)))return n.runEditorCommand(e,i,t)}))},t}(xr),Lr=function(e){function t(t){var n=e.call(this,t)||this;return n.label=t.label,n.alias=t.alias,n.menuOpts=t.menuOpts,n}return Sr(t,e),t.prototype.register=function(){this.menuOpts&&rr.appendMenuItem(7,{command:{id:this.id,title:this.label},when:En.and(this.precondition,this.menuOpts.when),group:this.menuOpts.group,order:this.menuOpts.order}),e.prototype.register.call(this)},t.prototype.runEditorCommand=function(e,t,n){return this.reportTelemetry(e,t),this.run(e,t,n||{})},t.prototype.reportTelemetry=function(e,t){e.get(Cr).publicLog2("editorActionInvoked",{name:this.label,id:this.id})},t}(kr);function Mr(e){return Dr.INSTANCE.registerEditorCommand(e),e}function Er(e){Dr.INSTANCE.registerEditorAction(new e)}!function(e){e.getEditorCommand=function(e){return Dr.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return Dr.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return Dr.INSTANCE.getEditorContributions()}}(wr||(wr={}));var Dr=function(){function e(){this.editorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}return e.prototype.registerEditorContribution=function(e){this.editorContributions.push(e)},e.prototype.registerEditorAction=function(e){e.register(),this.editorActions.push(e)},e.prototype.getEditorContributions=function(){return this.editorContributions.slice(0)},e.prototype.getEditorActions=function(){return this.editorActions.slice(0)},e.prototype.registerEditorCommand=function(e){e.register(),this.editorCommands[e.id]=e},e.prototype.getEditorCommand=function(e){return this.editorCommands[e]||null},e.INSTANCE=new e,e}();yr.add("editor.contributions",Dr.INSTANCE);var Tr=function(){function e(e,t,n,r){e>n||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}return e.prototype.isEmpty=function(){return e.isEmpty(this)},e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.prototype.containsPosition=function(t){return e.containsPosition(this,t)},e.containsPosition=function(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))},e.prototype.containsRange=function(t){return e.containsRange(this,t)},e.containsRange=function(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))},e.prototype.strictContainsRange=function(t){return e.strictContainsRange(this,t)},e.strictContainsRange=function(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))},e.prototype.plusRange=function(t){return e.plusRange(this,t)},e.plusRange=function(t,n){var r,i,o,s;return n.startLineNumbert.endLineNumber?(o=n.endLineNumber,s=n.endColumn):n.endLineNumber===t.endLineNumber?(o=n.endLineNumber,s=Math.max(n.endColumn,t.endColumn)):(o=t.endLineNumber,s=t.endColumn),new e(r,i,o,s)},e.prototype.intersectRanges=function(t){return e.intersectRanges(this,t)},e.intersectRanges=function(t,n){var r=t.startLineNumber,i=t.startColumn,o=t.endLineNumber,s=t.endColumn,a=n.startLineNumber,u=n.startColumn,c=n.endLineNumber,l=n.endColumn;return rc?(o=c,s=l):o===c&&(s=Math.min(s,l)),r>o?null:r===o&&i>s?null:new e(r,i,o,s)},e.prototype.equalsRange=function(t){return e.equalsRange(this,t)},e.equalsRange=function(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.prototype.getEndPosition=function(){return new _t(this.endLineNumber,this.endColumn)},e.prototype.getStartPosition=function(){return new _t(this.startLineNumber,this.startColumn)},e.prototype.toString=function(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"},e.prototype.setEndPosition=function(t,n){return new e(this.startLineNumber,this.startColumn,t,n)},e.prototype.setStartPosition=function(t,n){return new e(t,n,this.endLineNumber,this.endColumn)},e.prototype.collapseToStart=function(){return e.collapseToStart(this)},e.collapseToStart=function(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)},e.fromPositions=function(t,n){return void 0===n&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e.lift=function(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null},e.isIRange=function(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn},e.areIntersectingOrTouching=function(e,t){return!(e.endLineNumbere.startLineNumber},e}(),Nr=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Or=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r,i)||this;return o.selectionStartLineNumber=t,o.selectionStartColumn=n,o.positionLineNumber=r,o.positionColumn=i,o}return Nr(t,e),t.prototype.clone=function(){return new t(this.selectionStartLineNumber,this.selectionStartColumn,this.positionLineNumber,this.positionColumn)},t.prototype.toString=function(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"},t.prototype.equalsSelection=function(e){return t.selectionsEqual(this,e)},t.selectionsEqual=function(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn},t.prototype.getDirection=function(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1},t.prototype.setEndPosition=function(e,n){return 0===this.getDirection()?new t(this.startLineNumber,this.startColumn,e,n):new t(e,n,this.startLineNumber,this.startColumn)},t.prototype.getPosition=function(){return new _t(this.positionLineNumber,this.positionColumn)},t.prototype.setStartPosition=function(e,n){return 0===this.getDirection()?new t(e,n,this.endLineNumber,this.endColumn):new t(this.endLineNumber,this.endColumn,e,n)},t.fromPositions=function(e,n){return void 0===n&&(n=e),new t(e.lineNumber,e.column,n.lineNumber,n.column)},t.liftSelection=function(e){return new t(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)},t.selectionsArrEqual=function(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(var n=0,r=e.length;nr?e[u]=o[a++]:a>i?e[u]=o[s++]:t(o[a],o[s])<0?e[u]=o[a++]:e[u]=o[s++]}(t,n,r,s,i,o)}(e,t,0,e.length-1,[]),e}function Rr(e,t){if(!t)return e.filter((function(t,n){return e.indexOf(t)===n}));var n=Object.create(null);return e.filter((function(e){var r=t(e);return!n[r]&&(n[r]=!0,!0)}))}function Fr(e){var t=new Set;return e.filter((function(e){return!t.has(e)&&(t.add(e),!0)}))}function Yr(e,t){for(var n=0;nt;i--)r.push(i);return r}function Hr(e,t,n){var r=e.slice(0,t),i=e.slice(t);return r.concat(n,i)}function Wr(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;var t=Array.isArray(e)?[]:{};return Object.keys(e).forEach((function(n){e[n]&&"object"==typeof e[n]?t[n]=Wr(e[n]):t[n]=e[n]})),t}var Vr=Object.prototype.hasOwnProperty;function zr(e,t,n){return void 0===n&&(n=!0),xe(e)?(xe(t)&&Object.keys(t).forEach((function(r){r in e?n&&(xe(e[r])&&xe(t[r])?zr(e[r],t[r],n):e[r]=t[r]):e[r]=t[r]})),e):t}function Ur(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n/?";var Gr=function(e){void 0===e&&(e="");for(var t="(-?\\d*\\.\\d\\w*)|([^",n=0,r=Kr;n=0||(t+="\\"+i)}return t+="\\s]+)",new RegExp(t,"g")}();function $r(e){var t=Gr;if(e&&e instanceof RegExp)if(e.global)t=e;else{var 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}function Zr(e,t,n,r){t.lastIndex=0;var i=t.exec(n);if(!i)return null;var o=i[0].indexOf(" ")>=0?function(e,t,n,r){var i,o=e-1-r;for(t.lastIndex=0;i=t.exec(n);){var s=i.index||0;if(s>o)return null;if(t.lastIndex>=o)return{word:i[0],startColumn:r+1+s,endColumn:r+1+t.lastIndex}}return null}(e,t,n,r):function(e,t,n,r){var i,o=e-1-r,s=n.lastIndexOf(" ",o-1)+1;for(t.lastIndex=s;i=t.exec(n);){var a=i.index||0;if(a<=o&&t.lastIndex>=o)return{word:i[0],startColumn:r+1+a,endColumn:r+1+t.lastIndex}}return null}(e,t,n,r);return t.lastIndex=0,o}var Jr,Xr=function(){return(Xr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=2?(S=_?2:4,O=2/v):(S=_?1:3,O=1/v),(k=Math.max(0,Math.floor((N-d-2)*O/(c+O))))/O>y&&(k=Math.floor(y*O)),L=N-k,"left"===m?(x=0,M+=k,E+=k,D+=k,T+=k):x=t-k-d}else x=0,k=0,S=0,L=N;var A=h?f:0;return{width:t,height:n,glyphMarginLeft:M,glyphMarginWidth:C,glyphMarginHeight:n,lineNumbersLeft:E,lineNumbersWidth:b,lineNumbersHeight:n,decorationsLeft:D,decorationsWidth:u,decorationsHeight:n,contentLeft:T,contentWidth:L,contentHeight:n,renderMinimap:S,minimapLeft:x,minimapWidth:k,viewportColumn:Math.max(1,Math.floor((L-d-2)/c)),verticalScrollbarWidth:d,horizontalScrollbarHeight:p,overviewRuler:{top:A,width:d,height:n-2*A,right:0}}},e}(),fi={fontFamily:Ge.d?"Menlo, Monaco, 'Courier New', monospace":Ge.c?"'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:Ge.d?12:14,lineHeight:0,letterSpacing:0},pi={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},gi={inDiffEditor:!1,wordSeparators:Kr,lineNumbersMinChars:5,lineDecorationsWidth:10,readOnly:!1,mouseStyle:"text",disableLayerHinting:!1,automaticLayout:!1,wordWrap:"off",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:1,wordWrapBreakBeforeCharacters:"([{‘“〈《「『【〔([{「£¥$£¥++",wordWrapBreakAfterCharacters:" \t})]?|/&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」",wordWrapBreakObtrusiveCharacters:".",autoClosingBrackets:"languageDefined",autoClosingQuotes:"languageDefined",autoClosingOvertype:"auto",autoSurround:"languageDefined",autoIndent:!0,dragAndDrop:!0,emptySelectionClipboard:!0,copyWithSyntaxHighlighting:!0,useTabStops:!0,multiCursorModifier:"altKey",multiCursorMergeOverlapping:!0,accessibilitySupport:"auto",showUnused:!0,viewInfo:{extraEditorClassName:"",disableMonospaceOptimizations:!1,rulers:[],ariaLabel:we("editorViewAccessibleLabel","Editor content"),renderLineNumbers:1,renderCustomLineNumbers:null,cursorSurroundingLines:0,renderFinalNewline:!0,selectOnLineNumbers:!0,glyphMargin:!0,revealHorizontalRightPadding:30,roundedSelection:!0,overviewRulerLanes:2,overviewRulerBorder:!0,cursorBlinking:1,mouseWheelZoom:!1,cursorSmoothCaretAnimation:!1,cursorStyle:Jr.Line,cursorWidth:0,hideCursorInOverviewRuler:!1,scrollBeyondLastLine:!0,scrollBeyondLastColumn:5,smoothScrolling:!1,stopRenderingLineAfter:1e4,renderWhitespace:"none",renderControlCharacters:!1,fontLigatures:!1,renderIndentGuides:!0,highlightActiveIndentGuide:!0,renderLineHighlight:"line",scrollbar:{vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:10,horizontalSliderSize:10,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,mouseWheelScrollSensitivity:1,fastScrollSensitivity:5},minimap:{enabled:!0,side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120},fixedOverflowWidgets:!1},contribInfo:{selectionClipboard:!0,hover:{enabled:!0,delay:300,sticky:!0},links:!0,contextmenu:!0,quickSuggestions:{other:!0,comments:!1,strings:!1},quickSuggestionsDelay:10,parameterHints:{enabled:!0,cycle:!1},formatOnType:!1,formatOnPaste:!1,suggestOnTriggerCharacters:!0,acceptSuggestionOnEnter:"on",acceptSuggestionOnCommitCharacter:!0,wordBasedSuggestions:!0,suggestSelection:"recentlyUsed",suggestFontSize:0,suggestLineHeight:0,tabCompletion:"off",suggest:{filterGraceful:!0,snippets:"inline",snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,maxVisibleSuggestions:12,filteredTypes:Object.create(null)},gotoLocation:{multiple:"peek"},selectionHighlight:!0,occurrencesHighlight:!0,codeLens:!0,folding:!0,foldingStrategy:"auto",showFoldingControls:"mouseover",matchBrackets:!0,find:{seedSearchStringFromSelection:!0,autoFindInSelection:!1,globalFindClipboard:!1,addExtraSpaceOnTop:!0},colorDecorators:!0,lightbulbEnabled:!0,codeActionsOnSave:{},codeActionsOnSaveTimeout:750}};!function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(ui||(ui={})),function(e){e[e.Inline=1]="Inline"}(ci||(ci={}));var mi=function(){function e(e){this.tabSize=0|e.tabSize,this.indentSize=0|e.tabSize,this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace)}return e.prototype.equals=function(e){return this.tabSize===e.tabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace},e.prototype.createChangeEvent=function(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}},e}(),_i=function(e,t){this.range=e,this.matches=t},yi=function(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n},vi=function(){function e(e,t){this.beforeVersionId=e,this.beforeCursorState=t,this.afterCursorState=null,this.afterVersionId=-1,this.editOperations=[]}return e.prototype.undo=function(e){for(var t=this.editOperations.length-1;t>=0;t--)this.editOperations[t]={operations:e.applyEdits(this.editOperations[t].operations)}},e.prototype.redo=function(e){for(var t=0;t0){var e=this.past.pop();try{e.undo(this.model)}catch(e){return je(e),this.clear(),null}return this.future.push(e),{selections:e.beforeCursorState,recordedVersionId:e.beforeVersionId}}return null},e.prototype.canUndo=function(){return this.past.length>0||null!==this.currentOpenStackElement},e.prototype.redo=function(){if(this.future.length>0){var e=this.future.pop();try{e.redo(this.model)}catch(e){return je(e),this.clear(),null}return this.past.push(e),{selections:e.afterCursorState,recordedVersionId:e.afterVersionId}}return null},e.prototype.canRedo=function(){return this.future.length>0},e}(),Si=function(){this.spacesDiff=0,this.looksLikeAlignment=!1};function xi(e,t,n,r,i){var o;for(i.spacesDiff=0,i.looksLikeAlignment=!1,o=0;o0&&a>0||c>0&&l>0)){var d=Math.abs(a-l),h=Math.abs(s-c);if(0===d)return i.spacesDiff=h,void(h>0&&0<=c-1&&c-10?i++:m>1&&o++,xi(s,a,h,g,c),!c.looksLikeAlignment||n&&t===c.spacesDiff)){var w=c.spacesDiff;w<=8&&u[w]++,s=h,a=g}}var C=n;i!==o&&(C=ix&&(x=t,S=e)})),4===S&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(S=2)}return{insertSpaces:C,tabSize:S}}function Li(e){return(1&e.metadata)>>>0}function Mi(e,t){e.metadata=254&e.metadata|t<<0}function Ei(e){return(2&e.metadata)>>>1==1}function Di(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function Ti(e){return(4&e.metadata)>>>2==1}function Ni(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function Oi(e){return(8&e.metadata)>>>3==1}function Ai(e,t){e.metadata=247&e.metadata|(t?1:0)<<3}function Ii(e,t){e.metadata=207&e.metadata|t<<4}function Pi(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}var Ri=function(){function e(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Mi(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,Ni(this,!1),Ii(this,1),Ai(this,!1),Pi(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,Di(this,!1)}return e.prototype.reset=function(e,t,n,r){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=r},e.prototype.setOptions=function(e){this.options=e;var t=this.options.className;Ni(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),Ii(this,this.options.stickiness),Ai(this,!(!this.options.overviewRuler||!this.options.overviewRuler.color)),Pi(this,this.options.collapseOnReplaceEdit)},e.prototype.setCachedOffsets=function(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t},e.prototype.detach=function(){this.parent=null,this.left=null,this.right=null},e}(),Fi=new Ri(null,0,0);Fi.parent=Fi,Fi.left=Fi,Fi.right=Fi,Mi(Fi,0);var Yi=function(){function e(){this.root=Fi,this.requestNormalizeDelta=!1}return e.prototype.intervalSearch=function(e,t,n,r,i){return this.root===Fi?[]:function(e,t,n,r,i,o){var s=e.root,a=0,u=0,c=0,l=[],d=0;for(;s!==Fi;)if(Ei(s))Di(s.left,!1),Di(s.right,!1),s===s.parent.right&&(a-=s.parent.delta),s=s.parent;else{if(!Ei(s.left)){if(a+s.maxEndn)Di(s,!0);else{if((c=a+s.end)>=t){s.setCachedOffsets(u,c,o);var h=!0;r&&s.ownerId&&s.ownerId!==r&&(h=!1),i&&Ti(s)&&(h=!1),h&&(l[d++]=s)}Di(s,!0),s.right===Fi||Ei(s.right)||(a+=s.delta,s=s.right)}}return Di(e.root,!1),l}(this,e,t,n,r,i)},e.prototype.search=function(e,t,n){return this.root===Fi?[]:function(e,t,n,r){var i=e.root,o=0,s=0,a=0,u=[],c=0;for(;i!==Fi;)if(Ei(i))Di(i.left,!1),Di(i.right,!1),i===i.parent.right&&(o-=i.parent.delta),i=i.parent;else if(i.left===Fi||Ei(i.left)){s=o+i.start,a=o+i.end,i.setCachedOffsets(s,a,r);var l=!0;t&&i.ownerId&&i.ownerId!==t&&(l=!1),n&&Ti(i)&&(l=!1),l&&(u[c++]=i),Di(i,!0),i.right===Fi||Ei(i.right)||(o+=i.delta,i=i.right)}else i=i.left;return Di(e.root,!1),u}(this,e,t,n)},e.prototype.collectNodesFromOwner=function(e){return function(e,t){var n=e.root,r=[],i=0;for(;n!==Fi;)Ei(n)?(Di(n.left,!1),Di(n.right,!1),n=n.parent):n.left===Fi||Ei(n.left)?(n.ownerId===t&&(r[i++]=n),Di(n,!0),n.right===Fi||Ei(n.right)||(n=n.right)):n=n.left;return Di(e.root,!1),r}(this,e)},e.prototype.collectNodesPostOrder=function(){return function(e){var t=e.root,n=[],r=0;for(;t!==Fi;)Ei(t)?(Di(t.left,!1),Di(t.right,!1),t=t.parent):t.left===Fi||Ei(t.left)?t.right===Fi||Ei(t.right)?(n[r++]=t,Di(t,!0)):t=t.right:t=t.left;return Di(e.root,!1),n}(this)},e.prototype.insert=function(e){Hi(this,e),this._normalizeDeltaIfNecessary()},e.prototype.delete=function(e){Wi(this,e),this._normalizeDeltaIfNecessary()},e.prototype.resolveNode=function(e,t){for(var n=e,r=0;e!==this.root;)e===e.parent.right&&(r+=e.parent.delta),e=e.parent;var i=n.start+r,o=n.end+r;n.setCachedOffsets(i,o,t)},e.prototype.acceptReplace=function(e,t,n,r){for(var i=function(e,t,n){var r=e.root,i=0,o=0,s=0,a=[],u=0;for(;r!==Fi;)if(Ei(r))Di(r.left,!1),Di(r.right,!1),r===r.parent.right&&(i-=r.parent.delta),r=r.parent;else{if(!Ei(r.left)){if(i+r.maxEndn?Di(r,!0):((s=i+r.end)>=t&&(r.setCachedOffsets(o,s,0),a[u++]=r),Di(r,!0),r.right===Fi||Ei(r.right)||(i+=r.delta,r=r.right))}return Di(e.root,!1),a}(this,e,e+t),o=0,s=i.length;on?(i.start+=s,i.end+=s,i.delta+=s,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),Di(i,!0)):(Di(i,!0),i.right===Fi||Ei(i.right)||(o+=i.delta,i=i.right))}Di(e.root,!1)}(this,e,e+t,n),this._normalizeDeltaIfNecessary();for(o=0,s=i.length;on)&&(1!==r&&(2===r||t))}function Bi(e,t,n,r,i){var o=function(e){return(48&e.metadata)>>>4}(e),s=0===o||2===o,a=1===o||2===o,u=n-t,c=r,l=Math.min(u,c),d=e.start,h=!1,f=e.end,p=!1;t<=d&&f<=n&&function(e){return(64&e.metadata)>>>6==1}(e)&&(e.start=t,h=!0,e.end=t,p=!0);var g=i?1:u>0?2:0;if(!h&&ji(d,s,t,g)&&(h=!0),!p&&ji(f,a,t,g)&&(p=!0),l>0&&!i){g=u>c?2:0;!h&&ji(d,s,t+l,g)&&(h=!0),!p&&ji(f,a,t+l,g)&&(p=!0)}g=i?1:0;!h&&ji(d,s,n,g)&&(e.start=t+c,h=!0),!p&&ji(f,a,n,g)&&(e.end=t+c,p=!0);var m=c-u;h||(e.start=Math.max(0,d+m)),p||(e.end=Math.max(0,f+m)),e.start>e.end&&(e.end=e.start)}function Hi(e,t){if(e.root===Fi)return t.parent=Fi,t.left=Fi,t.right=Fi,Mi(t,0),e.root=t,e.root;!function(e,t){var n=0,r=e.root,i=t.start,o=t.end;for(;;){if($i(i,o,r.start+n,r.end+n)<0){if(r.left===Fi){t.start-=n,t.end-=n,t.maxEnd-=n,r.left=t;break}r=r.left}else{if(r.right===Fi){t.start-=n+r.delta,t.end-=n+r.delta,t.maxEnd-=n+r.delta,r.right=t;break}n+=r.delta,r=r.right}}t.parent=r,t.left=Fi,t.right=Fi,Mi(t,1)}(e,t),Gi(t.parent);for(var n=t;n!==e.root&&1===Li(n.parent);){var r;if(n.parent===n.parent.parent.left)1===Li(r=n.parent.parent.right)?(Mi(n.parent,0),Mi(r,0),Mi(n.parent.parent,1),n=n.parent.parent):(n===n.parent.right&&zi(e,n=n.parent),Mi(n.parent,0),Mi(n.parent.parent,1),Ui(e,n.parent.parent));else 1===Li(r=n.parent.parent.left)?(Mi(n.parent,0),Mi(r,0),Mi(n.parent.parent,1),n=n.parent.parent):(n===n.parent.left&&Ui(e,n=n.parent),Mi(n.parent,0),Mi(n.parent.parent,1),zi(e,n.parent.parent))}return Mi(e.root,0),t}function Wi(e,t){var n,r;if(t.left===Fi?(r=t,(n=t.right).delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta):t.right===Fi?(n=t.left,r=t):((n=(r=function(e){for(;e.left!==Fi;)e=e.left;return e}(t.right)).right).start+=r.delta,n.end+=r.delta,n.delta+=r.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),r.start+=t.delta,r.end+=t.delta,r.delta=t.delta,(r.delta<-1073741824||r.delta>1073741824)&&(e.requestNormalizeDelta=!0)),r===e.root)return e.root=n,Mi(n,0),t.detach(),Vi(),Ki(n),void(e.root.parent=Fi);var i,o=1===Li(r);if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===t?n.parent=r.parent:(r.parent===t?n.parent=r:n.parent=r.parent,r.left=t.left,r.right=t.right,r.parent=t.parent,Mi(r,Li(t)),t===e.root?e.root=r:t===t.parent.left?t.parent.left=r:t.parent.right=r,r.left!==Fi&&(r.left.parent=r),r.right!==Fi&&(r.right.parent=r)),t.detach(),o)return Gi(n.parent),r!==t&&(Gi(r),Gi(r.parent)),void Vi();for(Gi(n),Gi(n.parent),r!==t&&(Gi(r),Gi(r.parent));n!==e.root&&0===Li(n);)n===n.parent.left?(1===Li(i=n.parent.right)&&(Mi(i,0),Mi(n.parent,1),zi(e,n.parent),i=n.parent.right),0===Li(i.left)&&0===Li(i.right)?(Mi(i,1),n=n.parent):(0===Li(i.right)&&(Mi(i.left,0),Mi(i,1),Ui(e,i),i=n.parent.right),Mi(i,Li(n.parent)),Mi(n.parent,0),Mi(i.right,0),zi(e,n.parent),n=e.root)):(1===Li(i=n.parent.left)&&(Mi(i,0),Mi(n.parent,1),Ui(e,n.parent),i=n.parent.left),0===Li(i.left)&&0===Li(i.right)?(Mi(i,1),n=n.parent):(0===Li(i.left)&&(Mi(i.right,0),Mi(i,1),zi(e,i),i=n.parent.left),Mi(i,Li(n.parent)),Mi(n.parent,0),Mi(i.left,0),Ui(e,n.parent),n=e.root));Mi(n,0),Vi()}function Vi(){Fi.parent=Fi,Fi.delta=0,Fi.start=0,Fi.end=0}function zi(e,t){var n=t.right;n.delta+=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,t.right=n.left,n.left!==Fi&&(n.left.parent=t),n.parent=t.parent,t.parent===Fi?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n,Ki(t),Ki(n)}function Ui(e,t){var n=t.left;t.delta-=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=n.delta,t.end-=n.delta,t.left=n.right,n.right!==Fi&&(n.right.parent=t),n.parent=t.parent,t.parent===Fi?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n,Ki(t),Ki(n)}function qi(e){var t=e.end;if(e.left!==Fi){var n=e.left.maxEnd;n>t&&(t=n)}if(e.right!==Fi){var r=e.right.maxEnd+e.delta;r>t&&(t=r)}return t}function Ki(e){e.maxEnd=qi(e)}function Gi(e){for(;e!==Fi;){var t=qi(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function $i(e,t,n,r){return e===n?t-r:e-n}var Zi=function(){function e(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}return e.prototype.next=function(){if(this.right!==Ji)return Xi(this.right);for(var e=this;e.parent!==Ji&&e.parent.left!==e;)e=e.parent;return e.parent===Ji?Ji:e.parent},e.prototype.prev=function(){if(this.left!==Ji)return Qi(this.left);for(var e=this;e.parent!==Ji&&e.parent.right!==e;)e=e.parent;return e.parent===Ji?Ji:e.parent},e.prototype.detach=function(){this.parent=null,this.left=null,this.right=null},e}(),Ji=new Zi(null,0);function Xi(e){for(;e.left!==Ji;)e=e.left;return e}function Qi(e){for(;e.right!==Ji;)e=e.right;return e}function eo(e){return e===Ji?0:e.size_left+e.piece.length+eo(e.right)}function to(e){return e===Ji?0:e.lf_left+e.piece.lineFeedCnt+to(e.right)}function no(){Ji.parent=Ji}function ro(e,t){var n=t.right;n.size_left+=t.size_left+(t.piece?t.piece.length:0),n.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=n.left,n.left!==Ji&&(n.left.parent=t),n.parent=t.parent,t.parent===Ji?e.root=n:t.parent.left===t?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}function io(e,t){var n=t.left;t.left=n.right,n.right!==Ji&&(n.right.parent=t),n.parent=t.parent,t.size_left-=n.size_left+(n.piece?n.piece.length:0),t.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),t.parent===Ji?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}function oo(e,t){var n,r;if(n=t.left===Ji?(r=t).right:t.right===Ji?(r=t).left:(r=Xi(t.right)).right,r===e.root)return e.root=n,n.color=0,t.detach(),no(),void(e.root.parent=Ji);var i=1===r.color;if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===t?(n.parent=r.parent,uo(e,n)):(r.parent===t?n.parent=r:n.parent=r.parent,uo(e,n),r.left=t.left,r.right=t.right,r.parent=t.parent,r.color=t.color,t===e.root?e.root=r:t===t.parent.left?t.parent.left=r:t.parent.right=r,r.left!==Ji&&(r.left.parent=r),r.right!==Ji&&(r.right.parent=r),r.size_left=t.size_left,r.lf_left=t.lf_left,uo(e,r)),t.detach(),n.parent.left===n){var o=eo(n),s=to(n);if(o!==n.parent.size_left||s!==n.parent.lf_left){var a=o-n.parent.size_left,u=s-n.parent.lf_left;n.parent.size_left=o,n.parent.lf_left=s,ao(e,n.parent,a,u)}}if(uo(e,n.parent),i)no();else{for(var c;n!==e.root&&0===n.color;)n===n.parent.left?(1===(c=n.parent.right).color&&(c.color=0,n.parent.color=1,ro(e,n.parent),c=n.parent.right),0===c.left.color&&0===c.right.color?(c.color=1,n=n.parent):(0===c.right.color&&(c.left.color=0,c.color=1,io(e,c),c=n.parent.right),c.color=n.parent.color,n.parent.color=0,c.right.color=0,ro(e,n.parent),n=e.root)):(1===(c=n.parent.left).color&&(c.color=0,n.parent.color=1,io(e,n.parent),c=n.parent.left),0===c.left.color&&0===c.right.color?(c.color=1,n=n.parent):(0===c.left.color&&(c.right.color=0,c.color=1,ro(e,c),c=n.parent.left),c.color=n.parent.color,n.parent.color=0,c.left.color=0,io(e,n.parent),n=e.root));n.color=0,no()}}function so(e,t){for(uo(e,t);t!==e.root&&1===t.parent.color;){var n;if(t.parent===t.parent.parent.left)1===(n=t.parent.parent.right).color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&ro(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,io(e,t.parent.parent));else 1===(n=t.parent.parent.left).color?(t.parent.color=0,n.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&io(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,ro(e,t.parent.parent))}e.root.color=0}function ao(e,t,n,r){for(;t!==e.root&&t!==Ji;)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}function uo(e,t){var n=0,r=0;if(t!==e.root){if(0===n){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t===e.root)return;n=eo((t=t.parent).left)-t.size_left,r=to(t.left)-t.lf_left,t.size_left+=n,t.lf_left+=r}for(;t!==e.root&&(0!==n||0!==r);)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}}Ji.parent=Ji,Ji.left=Ji,Ji.right=Ji,Ji.color=0;var co=function(){function e(e,t,n){for(var r=new Uint8Array(e*t),i=0,o=e*t;i255?255:0|e}function ho(e){return e<0?0:e>4294967295?4294967295:0|e}var fo=function(){function e(t){var n=lo(t);this._defaultValue=n,this._asciiMap=e._createAsciiMap(n),this._map=new Map}return e._createAsciiMap=function(e){for(var t=new Uint8Array(256),n=0;n<256;n++)t[n]=e;return t},e.prototype.set=function(e,t){var n=lo(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)},e.prototype.get=function(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue},e}(),po=(function(){function e(){this._actual=new fo(0)}e.prototype.add=function(e){this._actual.set(e,1)},e.prototype.has=function(e){return 1===this._actual.get(e)}}(),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),go=function(e){function t(t){for(var n=e.call(this,0)||this,r=0,i=t.length;r=n)break;var r=e.charCodeAt(t);if(110===r||114===r||87===r)return!0}}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;var t=null;try{t=on(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0})}catch(e){return null}if(!t)return null;var n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new bo(t,this.wordSeparators?yo(this.wordSeparators):null,n?this.searchString:null)},e}();var bo=function(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n};function wo(e,t,n){if(!n)return new _i(e,null);for(var r=[],i=0,o=t.length;i>0);t[i]>=e?r=i-1:t[i+1]>=e?(n=i,r=i):n=i+1}return n+1},e}(),So=function(){function e(){}return e.findMatches=function(e,t,n,r,i){var o=t.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(e,n,new ko(o.wordSeparators,o.regex),r,i):this._doFindMatchesLineByLine(e,n,o,r,i):[]},e._getMultilineMatchRange=function(e,t,n,r,i,o){var s,a,u=0;if(s=r?t+i+(u=r.findLineFeedCountBeforeOffset(i)):t+i,r){var c=r.findLineFeedCountBeforeOffset(i+o.length)-u;a=s+o.length+c}else a=s+o.length;var l=e.getPositionAt(s),d=e.getPositionAt(a);return new Tr(l.lineNumber,l.column,d.lineNumber,d.column)},e._doFindMatchesMultiline=function(e,t,n,r,i){var o,s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),u="\r\n"===e.getEOL()?new Co(a):null,c=[],l=0;for(n.reset(0);o=n.next(a);)if(c[l++]=wo(this._getMultilineMatchRange(e,s,a,u,o.index,o[0]),o,r),l>=i)return c;return c},e._doFindMatchesLineByLine=function(e,t,n,r,i){var o=[],s=0;if(t.startLineNumber===t.endLineNumber){var a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return s=this._findMatchesInLine(n,a,t.startLineNumber,t.startColumn-1,s,o,r,i),o}var u=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);s=this._findMatchesInLine(n,u,t.startLineNumber,t.startColumn-1,s,o,r,i);for(var c=t.startLineNumber+1;c=a))return i;return i}var f,p=new ko(e.wordSeparators,e.regex);p.reset(0);do{if((f=p.next(t))&&(o[i++]=wo(new Tr(n,f.index+1+r,n,f.index+1+f[0].length+r),f,s),i>=a))return i}while(f);return i},e.findNextMatch=function(e,t,n,r){var i=t.parseSearchRequest();if(!i)return null;var o=new ko(i.wordSeparators,i.regex);return i.regex.multiline?this._doFindNextMatchMultiline(e,n,o,r):this._doFindNextMatchLineByLine(e,n,o,r)},e._doFindNextMatchMultiline=function(e,t,n,r){var i=new _t(t.lineNumber,1),o=e.getOffsetAt(i),s=e.getLineCount(),a=e.getValueInRange(new Tr(i.lineNumber,i.column,s,e.getLineMaxColumn(s)),1),u="\r\n"===e.getEOL()?new Co(a):null;n.reset(t.column-1);var c=n.next(a);return c?wo(this._getMultilineMatchRange(e,o,a,u,c.index,c[0]),c,r):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new _t(1,1),n,r):null},e._doFindNextMatchLineByLine=function(e,t,n,r){var i=e.getLineCount(),o=t.lineNumber,s=e.getLineContent(o),a=this._findFirstMatchInLine(n,s,o,t.column,r);if(a)return a;for(var u=1;u<=i;u++){var c=(o+u-1)%i,l=e.getLineContent(c+1),d=this._findFirstMatchInLine(n,l,c+1,1,r);if(d)return d}return null},e._findFirstMatchInLine=function(e,t,n,r,i){e.reset(r-1);var o=e.next(t);return o?wo(new Tr(n,o.index+1,n,o.index+1+o[0].length),o,i):null},e.findPreviousMatch=function(e,t,n,r){var i=t.parseSearchRequest();if(!i)return null;var o=new ko(i.wordSeparators,i.regex);return i.regex.multiline?this._doFindPreviousMatchMultiline(e,n,o,r):this._doFindPreviousMatchLineByLine(e,n,o,r)},e._doFindPreviousMatchMultiline=function(e,t,n,r){var i=this._doFindMatchesMultiline(e,new Tr(1,1,t.lineNumber,t.column),n,r,9990);if(i.length>0)return i[i.length-1];var o=e.getLineCount();return t.lineNumber!==o||t.column!==e.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(e,new _t(o,e.getLineMaxColumn(o)),n,r):null},e._doFindPreviousMatchLineByLine=function(e,t,n,r){var i=e.getLineCount(),o=t.lineNumber,s=e.getLineContent(o).substring(0,t.column-1),a=this._findLastMatchInLine(n,s,o,r);if(a)return a;for(var u=1;u<=i;u++){var c=(i+o-u-1)%i,l=e.getLineContent(c+1),d=this._findLastMatchInLine(n,l,c+1,r);if(d)return d}return null},e._findLastMatchInLine=function(e,t,n,r){var i,o=null;for(e.reset(0);i=e.next(t);)o=wo(new Tr(n,i.index+1,n,i.index+1+i[0].length),i,r);return o},e}();function xo(e,t,n,r,i){return function(e,t,n,r,i){if(0===r)return!0;var o=t.charCodeAt(r-1);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(i>0){var s=t.charCodeAt(r);if(0!==e.get(s))return!0}return!1}(e,t,0,r,i)&&function(e,t,n,r,i){if(r+i===n)return!0;var o=t.charCodeAt(r+i);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(i>0){var s=t.charCodeAt(r+i-1);if(0!==e.get(s))return!0}return!1}(e,t,n,r,i)}var ko=function(){function e(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}return e.prototype.reset=function(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0},e.prototype.next=function(e){var t,n=e.length;do{if(this._prevMatchStartIndex+this._prevMatchLength===n)return null;if(!(t=this._searchRegex.exec(e)))return null;var r=t.index,i=t[0].length;if(r===this._prevMatchStartIndex&&i===this._prevMatchLength){if(0===i){this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=i,!this._wordSeparators||xo(this._wordSeparators,e,n,r,i))return t}while(t);return null},e}();function Lo(e){var t;return(t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length)).set(e,0),t}var Mo=function(e,t,n,r,i){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=i};function Eo(e,t){void 0===t&&(t=!0);for(var n=[0],r=1,i=0,o=e.length;i=0;t--){var n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null},e.prototype.get2=function(e){for(var t=this._cache.length-1;t>=0;t--){var n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber=e)return n}return null},e.prototype.set=function(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)},e.prototype.valdiate=function(e){for(var t=!1,n=this._cache,r=0;r=e)&&(n[r]=null,t=!0)}if(t){for(var o=[],s=0,a=n;s0){e[i].lineStarts||(e[i].lineStarts=Eo(e[i].buffer));var s=new Do(i+1,{line:0,column:0},{line:e[i].lineStarts.length-1,column:e[i].buffer.length-e[i].lineStarts[e[i].lineStarts.length-1]},e[i].lineStarts.length-1,e[i].buffer.length);this._buffers.push(e[i]),r=this.rbInsertRight(r,s)}this._searchCache=new No(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()},e.prototype.normalizeEOL=function(e){var t=this,n=65535-Math.floor(21845),r=2*n,i="",o=0,s=[];if(this.iterate(this.root,(function(a){var u=t.getNodeContent(a),c=u.length;if(o<=n||o+c0){var a=i.replace(/\r\n|\r|\n/g,e);s.push(new To(a,Eo(a)))}this.create(s,e,!0)},e.prototype.getEOL=function(){return this._EOL},e.prototype.setEOL=function(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)},e.prototype.getOffsetAt=function(e,t){for(var n=0,r=this.root;r!==Ji;)if(r.left!==Ji&&r.lf_left+1>=e)r=r.left;else{if(r.lf_left+r.piece.lineFeedCnt+1>=e)return(n+=r.size_left)+(this.getAccumulatedValue(r,e-r.lf_left-2)+t-1);e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right}return n},e.prototype.getPositionAt=function(e){e=Math.floor(e),e=Math.max(0,e);for(var t=this.root,n=0,r=e;t!==Ji;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){var i=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+i.index,0===i.index){var o=this.getOffsetAt(n+1,1);return new _t(n+1,r-o+1)}return new _t(n+1,i.remainder+1)}if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===Ji){o=this.getOffsetAt(n+1,1);return new _t(n+1,r-e-o+1)}t=t.right}return new _t(1,1)},e.prototype.getValueInRange=function(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";var n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),i=this.getValueInRange2(n,r);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?i:i.replace(/\r\n|\r|\n/g,t):i},e.prototype.getValueInRange2=function(e,t){if(e.node===t.node){var n=e.node,r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r.substring(i+e.remainder,i+t.remainder)}var o=e.node,s=this._buffers[o.piece.bufferIndex].buffer,a=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start),u=s.substring(a+e.remainder,a+o.piece.length);for(o=o.next();o!==Ji;){var c=this._buffers[o.piece.bufferIndex].buffer,l=this.offsetInBuffer(o.piece.bufferIndex,o.piece.start);if(o===t.node){u+=c.substring(l,l+t.remainder);break}u+=c.substr(l,o.piece.length),o=o.next()}return u},e.prototype.getLinesContent=function(){return this.getContentOfSubTree(this.root).split(/\r\n|\r|\n/)},e.prototype.getLength=function(){return this._length},e.prototype.getLineCount=function(){return this._lineCnt},e.prototype.getLineContent=function(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)},e.prototype.getLineCharCode=function(e,t){var n=this.nodeAt2(e,t+1);if(n.remainder===n.node.piece.length){var r=n.node.next();if(!r)return 0;var i=this._buffers[r.piece.bufferIndex],o=this.offsetInBuffer(r.piece.bufferIndex,r.piece.start);return i.buffer.charCodeAt(o)}i=this._buffers[n.node.piece.bufferIndex];var s=(o=this.offsetInBuffer(n.node.piece.bufferIndex,n.node.piece.start))+n.remainder;return i.buffer.charCodeAt(s)},e.prototype.getLineLength=function(e){if(e===this.getLineCount()){var t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength},e.prototype.findMatchesInNode=function(e,t,n,r,i,o,s,a,u,c,l){var d,h=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,i),g=this.offsetInBuffer(e.piece.bufferIndex,o);t.reset(p);var m={line:0,column:0};do{if(d=t.next(h.buffer)){if(d.index>=g)return c;this.positionInBuffer(e,d.index-f,m);var _=this.getLineFeedCnt(e.piece.bufferIndex,i,m),y=m.line===i.line?m.column-i.column+r:m.column+1,v=y+d[0].length;if(l[c++]=wo(new Tr(n+_,y,n+_,v),d,a),d.index+d[0].length>=g)return c;if(c>=u)return c}}while(d);return c},e.prototype.findMatchesLineByLine=function(e,t,n,r){var i=[],o=0,s=new ko(t.wordSeparators,t.regex),a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];var u=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===u)return[];var c=this.positionInBuffer(a.node,a.remainder),l=this.positionInBuffer(u.node,u.remainder);if(a.node===u.node)return this.findMatchesInNode(a.node,s,e.startLineNumber,e.startColumn,c,l,t,n,r,o,i),i;for(var d=e.startLineNumber,h=a.node;h!==u.node;){var f=this.getLineFeedCnt(h.piece.bufferIndex,c,h.piece.end);if(f>=1){var p=this._buffers[h.piece.bufferIndex].lineStarts,g=this.offsetInBuffer(h.piece.bufferIndex,h.piece.start),m=p[c.line+f],_=d===e.startLineNumber?e.startColumn:1;if((o=this.findMatchesInNode(h,s,d,_,c,this.positionInBuffer(h,m-g),t,n,r,o,i))>=r)return i;d+=f}var y=d===e.startLineNumber?e.startColumn-1:0;if(d===e.endLineNumber){var v=this.getLineContent(d).substring(y,e.endColumn-1);return o=this._findMatchesInLine(t,s,v,e.endLineNumber,y,o,i,n,r),i}if((o=this._findMatchesInLine(t,s,this.getLineContent(d).substr(y),d,y,o,i,n,r))>=r)return i;d++,h=(a=this.nodeAt2(d,1)).node,c=this.positionInBuffer(a.node,a.remainder)}if(d===e.endLineNumber){var b=d===e.startLineNumber?e.startColumn-1:0;v=this.getLineContent(d).substring(b,e.endColumn-1);return o=this._findMatchesInLine(t,s,v,e.endLineNumber,b,o,i,n,r),i}var w=d===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(u.node,s,d,w,c,l,t,n,r,o,i),i},e.prototype._findMatchesInLine=function(e,t,n,r,i,o,s,a,u){var c,l=e.wordSeparators;if(!a&&e.simpleSearch){for(var d=e.simpleSearch,h=d.length,f=n.length,p=-h;-1!==(p=n.indexOf(d,p+h));)if((!l||xo(l,n,f,p,h))&&(s[o++]=new _i(new Tr(r,p+1+i,r,p+1+h+i),null),o>=u))return o;return o}t.reset(0);do{if((c=t.next(n))&&(s[o++]=wo(new Tr(r,c.index+1+i,r,c.index+1+c[0].length+i),c,a),o>=u))return o}while(c);return o},e.prototype.insert=function(e,t,n){if(void 0===n&&(n=!1),this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ji){var r=this.nodeAt(e),i=r.node,o=r.remainder,s=r.nodeStartOffset,a=i.piece,u=a.bufferIndex,c=this.positionInBuffer(i,o);if(0===i.piece.bufferIndex&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.length<65535)return this.appendToNode(i,t),void this.computeBufferMetadata();if(s===e)this.insertContentToNodeLeft(t,i),this._searchCache.valdiate(e);else if(s+i.piece.length>e){var l=[],d=new Do(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(u,a.end)-this.offsetInBuffer(u,c));if(this.shouldCheckCRLF()&&this.endWithCR(t))if(10===this.nodeCharCodeAt(i,o)){var h={line:d.start.line+1,column:0};d=new Do(d.bufferIndex,h,d.end,this.getLineFeedCnt(d.bufferIndex,h,d.end),d.length-1),t+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(13===this.nodeCharCodeAt(i,o-1)){var f=this.positionInBuffer(i,o-1);this.deleteNodeTail(i,f),t="\r"+t,0===i.piece.length&&l.push(i)}else this.deleteNodeTail(i,c);else this.deleteNodeTail(i,c);var p=this.createNewPieces(t);d.length>0&&this.rbInsertRight(i,d);for(var g=i,m=0;m=0;u--)a=this.rbInsertLeft(a,s[u]);this.validateCRLFWithPrevNode(a),this.deleteNodes(n)},e.prototype.insertContentToNodeRight=function(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");for(var n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]),i=r,o=1;o=l))break;a=c+1}return n?(n.line=c,n.column=s-d,null):{line:c,column:s-d}},e.prototype.getLineFeedCnt=function(e,t,n){if(0===n.column)return n.line-t.line;var r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;var i=r[n.line+1],o=r[n.line]+n.column;if(i>o+1)return n.line-t.line;var s=o-1;return 13===this._buffers[e].buffer.charCodeAt(s)?n.line-t.line+1:n.line-t.line},e.prototype.offsetInBuffer=function(e,t){return this._buffers[e].lineStarts[t.line]+t.column},e.prototype.deleteNodes=function(e){for(var t=0;t65535){for(var t=[];e.length>65535;){var n=e.charCodeAt(65534),r=void 0;13===n||n>=55296&&n<=56319?(r=e.substring(0,65534),e=e.substring(65534)):(r=e.substring(0,65535),e=e.substring(65535));var i=Eo(r);t.push(new Do(this._buffers.length,{line:0,column:0},{line:i.length-1,column:r.length-i[i.length-1]},i.length-1,r.length)),this._buffers.push(new To(r,i))}var o=Eo(e);return t.push(new Do(this._buffers.length,{line:0,column:0},{line:o.length-1,column:e.length-o[o.length-1]},o.length-1,e.length)),this._buffers.push(new To(e,o)),t}var s=this._buffers[0].buffer.length,a=Eo(e,!1),u=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===s&&0!==s&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},u=this._lastChangeBufferPos;for(var c=0;c=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){o=this.getAccumulatedValue(n,e-n.lf_left-2),u=this.getAccumulatedValue(n,e-n.lf_left-1),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return c+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:c,nodeStartLineNumber:l-(e-1-n.lf_left)}),s.substring(a+o,a+u-t)}if(n.lf_left+n.piece.lineFeedCnt===e-1){o=this.getAccumulatedValue(n,e-n.lf_left-2),s=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=s.substring(a+o,a+n.piece.length);break}e-=n.lf_left+n.piece.lineFeedCnt,c+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==Ji;){s=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){u=this.getAccumulatedValue(n,0),a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=s.substring(a,a+u-t)}a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=s.substr(a,n.piece.length),n=n.next()}return r},e.prototype.computeBufferMetadata=function(){for(var e=this.root,t=1,n=0;e!==Ji;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.valdiate(this._length)},e.prototype.getIndexOf=function(e,t){var n=e.piece,r=this.positionInBuffer(e,t),i=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){var o=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(o!==i)return{index:o,remainder:0}}return{index:i,remainder:r.column}},e.prototype.getAccumulatedValue=function(e,t){if(t<0)return 0;var n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,i=n.start.line+t+1;return i>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[i]-r[n.start.line]-n.start.column},e.prototype.deleteNodeTail=function(e,t){var n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.end),o=t,s=this.offsetInBuffer(n.bufferIndex,o),a=this.getLineFeedCnt(n.bufferIndex,n.start,o),u=a-r,c=s-i,l=n.length+c;e.piece=new Do(n.bufferIndex,n.start,o,a,l),ao(this,e,c,u)},e.prototype.deleteNodeHead=function(e,t){var n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.start),o=t,s=this.getLineFeedCnt(n.bufferIndex,o,n.end),a=s-r,u=i-this.offsetInBuffer(n.bufferIndex,o),c=n.length+u;e.piece=new Do(n.bufferIndex,o,n.end,s,c),ao(this,e,u,a)},e.prototype.shrinkNode=function(e,t,n){var r=e.piece,i=r.start,o=r.end,s=r.length,a=r.lineFeedCnt,u=t,c=this.getLineFeedCnt(r.bufferIndex,r.start,u),l=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,i);e.piece=new Do(r.bufferIndex,r.start,u,c,l),ao(this,e,l-s,c-a);var d=new Do(r.bufferIndex,n,o,this.getLineFeedCnt(r.bufferIndex,n,o),this.offsetInBuffer(r.bufferIndex,o)-this.offsetInBuffer(r.bufferIndex,n)),h=this.rbInsertRight(e,d);this.validateCRLFWithPrevNode(h)},e.prototype.appendToNode=function(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");var n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;for(var i=Eo(t,!1),o=0;oe)t=t.left;else{if(t.size_left+t.piece.length>=e){r+=t.size_left;var i={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right}return null},e.prototype.nodeAt2=function(e,t){for(var n=this.root,r=0;n!==Ji;)if(n.left!==Ji&&n.lf_left>=e-1)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt>e-1){var i=this.getAccumulatedValue(n,e-n.lf_left-2),o=this.getAccumulatedValue(n,e-n.lf_left-1);return r+=n.size_left,{node:n,remainder:Math.min(i+t-1,o),nodeStartOffset:r}}if(n.lf_left+n.piece.lineFeedCnt===e-1){if((i=this.getAccumulatedValue(n,e-n.lf_left-2))+t-1<=n.piece.length)return{node:n,remainder:i+t-1,nodeStartOffset:r};t-=n.piece.length-i;break}e-=n.lf_left+n.piece.lineFeedCnt,r+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==Ji;){if(n.piece.lineFeedCnt>0){o=this.getAccumulatedValue(n,0);var s=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,o),nodeStartOffset:s}}if(n.piece.length>=t-1)return{node:n,remainder:t-1,nodeStartOffset:this.offsetOfNode(n)};t-=n.piece.length,n=n.next()}return null},e.prototype.nodeCharCodeAt=function(e,t){if(e.piece.lineFeedCnt<1)return-1;var n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(r)},e.prototype.offsetOfNode=function(e){if(!e)return 0;for(var t=e.size_left;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t},e.prototype.shouldCheckCRLF=function(){return!(this._EOLNormalized&&"\n"===this._EOL)},e.prototype.startWithLF=function(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===Ji||0===e.piece.lineFeedCnt)return!1;var t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,i=n[r]+t.start.column;return r!==n.length-1&&(!(n[r+1]>i+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(i))},e.prototype.endWithCR=function(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==Ji&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)},e.prototype.validateCRLFWithPrevNode=function(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){var t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}},e.prototype.validateCRLFWithNextNode=function(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){var t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}},e.prototype.fixCRLF=function(e,t){var n,r=[],i=this._buffers[e.piece.bufferIndex].lineStarts;n=0===e.piece.end.column?{line:e.piece.end.line-1,column:i[e.piece.end.line]-i[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};var o=e.piece.length-1,s=e.piece.lineFeedCnt-1;e.piece=new Do(e.piece.bufferIndex,e.piece.start,n,s,o),ao(this,e,-1,-1),0===e.piece.length&&r.push(e);var a={line:t.piece.start.line+1,column:0},u=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new Do(t.piece.bufferIndex,a,t.piece.end,c,u),ao(this,t,-1,-1),0===t.piece.length&&r.push(t);var l=this.createNewPieces("\r\n");this.rbInsertRight(e,l[0]);for(var d=0;d0){g.sort((function(e,t){return t.lineNumber-e.lineNumber})),w=[];a=0;for(var C=g.length;a0&&g[a-1].lineNumber===_)){var S=g[a].oldContent,x=this.getLineContent(_);0!==x.length&&x!==S&&-1===an(x)&&w.push(_)}}}return new yi(v,b,w)},e.prototype._reduceOperations=function(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]},e.prototype._toSingleEditOperation=function(e){for(var t=!1,n=e[0].range,r=e[e.length-1].range,i=new Tr(n.startLineNumber,n.startColumn,r.endLineNumber,r.endColumn),o=n.startLineNumber,s=n.startColumn,a=[],u=0,c=e.length;u0){var d=a.lines.length,h=a.lines[0],f=a.lines[d-1];l=1===d?new Tr(u,c,u,c+h.length):new Tr(u,c,u+d-1,f.length+1)}else l=new Tr(u,c,u,c);n=l.endLineNumber,r=l.endColumn,t.push(l),i=a}return t},e._sortOpsAscending=function(e,t){var n=Tr.compareRangesUsingEnds(e.range,t.range);return 0===n?e.sortIndex-t.sortIndex:n},e._sortOpsDescending=function(e,t){var n=Tr.compareRangesUsingEnds(e.range,t.range);return 0===n?t.sortIndex-e.sortIndex:-n},e}(),Io=function(){function e(e,t,n,r,i,o,s,a){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=i,this._containsRTL=o,this._isBasicASCII=s,this._normalizeEOL=a}return e.prototype._getEOL=function(e){var t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":n>t/2?"\r\n":"\n"},e.prototype.create=function(e){var t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(var r=0,i=n.length;r=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}},e.prototype._acceptChunk1=function(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))},e.prototype._acceptChunk2=function(e){var t=function(e,t){e.length=0,e[0]=0;for(var n=1,r=0,i=0,o=0,s=!0,a=0,u=t.length;a126)&&(s=!1)}var l=new Mo(Lo(e),r,i,o,s);return e.length=0,l}(this._tmpLineStarts,e);this.chunks.push(new To(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=vn(e))},e.prototype.finish=function(e){return void 0===e&&(e=!0),this._finish(),new Io(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.isBasicASCII,e)},e.prototype._finish=function(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;var e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);var t=Eo(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}},e}(),Ro=function(){this.changeType=1},Fo=function(e,t){this.changeType=2,this.lineNumber=e,this.detail=t},Yo=function(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t},jo=function(e,t,n){this.changeType=4,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n},Bo=function(){this.changeType=5},Ho=function(){function e(e,t,n,r){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=r}return e.prototype.containsEvent=function(e){for(var t=0,n=this.changes.length;t=Uo&&e<=Ko||e>=qo&&e<=Go}function rs(e,t,n,r){for(var i,o="",s=0,a=-1,u=0,c=0;c<=e.length;++c){if(c2){var l=o.lastIndexOf(n);-1===l?(o="",s=0):s=(o=o.slice(0,l)).length-1-o.lastIndexOf(n),a=c,u=0;continue}if(2===o.length||1===o.length){o="",s=0,a=c,u=0;continue}}t&&(o.length>0?o+=n+"..":o="..",s=2)}else o.length>0?o+=n+e.slice(a+1,c):o=e.slice(a+1,c),s=c-a-1;a=c,u=0}else i===$o&&-1!==u?++u:u=-1}return o}function is(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}var os={resolve:function(){for(var e=[],t=0;t=-1;o--){var s=void 0;if(o>=0?s=e[o]:n?void 0!==(s=Vo.b["="+n]||Vo.a())&&s.slice(0,3).toLowerCase()===n.toLowerCase()+"\\"||(s=n+"\\"):s=Vo.a(),Qo(s,"path"),0!==s.length){var a=s.length,u=0,c="",l=!1,d=s.charCodeAt(0);if(a>1)if(es(d))if(l=!0,es(s.charCodeAt(1))){for(var h=2,f=h;h2&&es(s.charCodeAt(2))&&(l=!0,u=3));else es(d)&&(u=1,l=!0);if(!(c.length>0&&n.length>0&&c.toLowerCase()!==n.toLowerCase())&&(0===n.length&&c.length>0&&(n=c),i||(r=s.slice(u)+"\\"+r,i=l),n.length>0&&i))break}}return n+(i?"\\":"")+(r=rs(r,!i,"\\",es))||"."},normalize:function(e){Qo(e,"path");var t=e.length;if(0===t)return".";var n,r,i=0,o=!1,s=e.charCodeAt(0);if(t>1)if(es(s))if(o=!0,es(e.charCodeAt(1))){for(var a=2,u=a;a2&&es(e.charCodeAt(2))&&(o=!0,i=3));else if(es(s))return"\\";return 0!==(r=i0&&es(e.charCodeAt(t-1))&&(r+="\\"),void 0===n?o?r.length>0?"\\"+r:"\\":r.length>0?r:"":o?r.length>0?n+"\\"+r:n+"\\":r.length>0?n+r:n},isAbsolute:function(e){Qo(e,"path");var t=e.length;if(0===t)return!1;var n=e.charCodeAt(0);return!!es(n)||!!(ns(n)&&t>2&&58===e.charCodeAt(1)&&es(e.charCodeAt(2)))},join:function(){for(var e,t,n=[],r=0;r0&&(void 0===e?e=t=o:e+="\\"+o)}if(void 0===e)return".";var s=!0,a=0;if("string"==typeof t&&es(t.charCodeAt(0))){++a;var u=t.length;u>1&&es(t.charCodeAt(1))&&(++a,u>2&&(es(t.charCodeAt(2))?++a:s=!1))}if(s){for(;a=2&&(e="\\"+e.slice(a))}return os.normalize(e)},relative:function(e,t){if(Qo(e,"from"),Qo(t,"to"),e===t)return"";var n=os.resolve(e),r=os.resolve(t);if(n===r)return"";if((e=n.toLowerCase())===(t=r.toLowerCase()))return"";for(var i=0;ii&&e.charCodeAt(o-1)===Jo;--o);for(var s=o-i,a=0;aa&&t.charCodeAt(u-1)===Jo;--u);for(var c=u-a,l=sl){if(t.charCodeAt(a+h)===Jo)return r.slice(a+h+1);if(2===h)return r.slice(a+h)}s>l&&(e.charCodeAt(i+h)===Jo?d=h:2===h&&(d=3));break}var f=e.charCodeAt(i+h);if(f!==t.charCodeAt(a+h))break;f===Jo&&(d=h)}if(h!==l&&-1===d)return r;var p="";for(-1===d&&(d=0),h=i+d+1;h<=o;++h)h!==o&&e.charCodeAt(h)!==Jo||(0===p.length?p+="..":p+="\\..");return p.length>0?p+r.slice(a+d,u):(a+=d,r.charCodeAt(a)===Jo&&++a,r.slice(a,u))},toNamespacedPath:function(e){if("string"!=typeof e)return e;if(0===e.length)return"";var t=os.resolve(e);if(t.length>=3)if(t.charCodeAt(0)===Jo){if(t.charCodeAt(1)===Jo){var n=t.charCodeAt(2);if(63!==n&&n!==$o)return"\\\\?\\UNC\\"+t.slice(2)}}else if(ns(t.charCodeAt(0))&&58===t.charCodeAt(1)&&t.charCodeAt(2)===Jo)return"\\\\?\\"+t;return e},dirname:function(e){Qo(e,"path");var t=e.length;if(0===t)return".";var n=-1,r=-1,i=!0,o=0,s=e.charCodeAt(0);if(t>1)if(es(s)){if(n=o=1,es(e.charCodeAt(1))){for(var a=2,u=a;a2&&es(e.charCodeAt(2))&&(n=o=3));else if(es(s))return e;for(var c=t-1;c>=o;--c)if(es(e.charCodeAt(c))){if(!i){r=c;break}}else i=!1;if(-1===r){if(-1===n)return".";r=n}return e.slice(0,r)},basename:function(e,t){void 0!==t&&Qo(t,"ext"),Qo(e,"path");var n,r=0,i=-1,o=!0;e.length>=2&&(ns(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(r=2));if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,a=-1;for(n=e.length-1;n>=r;--n){var u=e.charCodeAt(n);if(es(u)){if(!o){r=n+1;break}}else-1===a&&(o=!1,a=n+1),s>=0&&(u===t.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=a))}return r===i?i=a:-1===i&&(i=e.length),e.slice(r,i)}for(n=e.length-1;n>=r;--n)if(es(e.charCodeAt(n))){if(!o){r=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":e.slice(r,i)},extname:function(e){Qo(e,"path");var t=0,n=-1,r=0,i=-1,o=!0,s=0;e.length>=2&&58===e.charCodeAt(1)&&ns(e.charCodeAt(0))&&(t=r=2);for(var a=e.length-1;a>=t;--a){var u=e.charCodeAt(a);if(es(u)){if(!o){r=a+1;break}}else-1===i&&(o=!1,i=a+1),u===$o?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1)}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new Xo("pathObject","Object",e);return is("\\",e)},parse:function(e){Qo(e,"path");var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n=e.length,r=0,i=e.charCodeAt(0);if(n>1){if(es(i)){if(r=1,es(e.charCodeAt(1))){for(var o=2,s=o;o2))return t.root=t.dir=e,t;if(es(e.charCodeAt(2))){if(3===n)return t.root=t.dir=e,t;r=3}}}else if(es(i))return t.root=t.dir=e,t;r>0&&(t.root=e.slice(0,r));for(var a=-1,u=r,c=-1,l=!0,d=e.length-1,h=0;d>=r;--d)if(es(i=e.charCodeAt(d))){if(!l){u=d+1;break}}else-1===c&&(l=!1,c=d+1),i===$o?-1===a?a=d:1!==h&&(h=1):-1!==a&&(h=-1);return-1===a||-1===c||0===h||1===h&&a===c-1&&a===u+1?-1!==c&&(t.base=t.name=e.slice(u,c)):(t.name=e.slice(u,a),t.base=e.slice(u,c),t.ext=e.slice(a,c)),t.dir=u>0&&u!==r?e.slice(0,u-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},ss={resolve:function(){for(var e=[],t=0;t=-1&&!r;i--){var o=void 0;Qo(o=i>=0?e[i]:Vo.a(),"path"),0!==o.length&&(n=o+"/"+n,r=o.charCodeAt(0)===Zo)}return n=rs(n,!r,"/",ts),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(Qo(e,"path"),0===e.length)return".";var t=e.charCodeAt(0)===Zo,n=e.charCodeAt(e.length-1)===Zo;return 0!==(e=rs(e,!t,"/",ts)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return Qo(e,"path"),e.length>0&&e.charCodeAt(0)===Zo},join:function(){for(var e,t=[],n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":ss.normalize(e)},relative:function(e,t){if(Qo(e,"from"),Qo(t,"to"),e===t)return"";if((e=ss.resolve(e))===(t=ss.resolve(t)))return"";for(var n=1;na){if(t.charCodeAt(o+c)===Zo)return t.slice(o+c+1);if(0===c)return t.slice(o+c)}else i>a&&(e.charCodeAt(n+c)===Zo?u=c:0===c&&(u=0));break}var l=e.charCodeAt(n+c);if(l!==t.charCodeAt(o+c))break;l===Zo&&(u=c)}var d="";for(c=n+u+1;c<=r;++c)c!==r&&e.charCodeAt(c)!==Zo||(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(o+u):(o+=u,t.charCodeAt(o)===Zo&&++o,t.slice(o))},toNamespacedPath:function(e){return e},dirname:function(e){if(Qo(e,"path"),0===e.length)return".";for(var t=e.charCodeAt(0)===Zo,n=-1,r=!0,i=e.length-1;i>=1;--i)if(e.charCodeAt(i)===Zo){if(!r){n=i;break}}else r=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)},basename:function(e,t){void 0!==t&&Qo(t,"ext"),Qo(e,"path");var n,r=0,i=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(u===Zo){if(!o){r=n+1;break}}else-1===a&&(o=!1,a=n+1),s>=0&&(u===t.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=a))}return r===i?i=a:-1===i&&(i=e.length),e.slice(r,i)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===Zo){if(!o){r=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":e.slice(r,i)},extname:function(e){Qo(e,"path");for(var t=-1,n=0,r=-1,i=!0,o=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(a!==Zo)-1===r&&(i=!1,r=s+1),a===$o?-1===t?t=s:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=s+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)},format:function(e){if(null===e||"object"!=typeof e)throw new Xo("pathObject","Object",e);return is("/",e)},parse:function(e){Qo(e,"path");var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,r=e.charCodeAt(0)===Zo;r?(t.root="/",n=1):n=0;for(var i=-1,o=0,s=-1,a=!0,u=e.length-1,c=0;u>=n;--u){var l=e.charCodeAt(u);if(l!==Zo)-1===s&&(a=!1,s=u+1),l===$o?-1===i?i=u:1!==c&&(c=1):-1!==i&&(c=-1);else if(!a){o=u+1;break}}return-1===i||-1===s||0===c||1===c&&i===s-1&&i===o+1?-1!==s&&(t.base=t.name=0===o&&r?e.slice(1,s):e.slice(o,s)):(0===o&&r?(t.name=e.slice(1,i),t.base=e.slice(1,s)):(t.name=e.slice(o,i),t.base=e.slice(o,s)),t.ext=e.slice(i,s)),o>0?t.dir=e.slice(0,o-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};ss.win32=os.win32=os,ss.posix=os.posix=ss;var as="win32"===Vo.c?os.normalize:ss.normalize,us="win32"===Vo.c?os.join:ss.join,cs="win32"===Vo.c?os.relative:ss.relative,ls="win32"===Vo.c?os.dirname:ss.dirname,ds="win32"===Vo.c?os.basename:ss.basename,hs="win32"===Vo.c?os.extname:ss.extname,fs="win32"===Vo.c?os.sep:ss.sep;var ps,gs,ms=Object.freeze((function(e,t){var n=setTimeout(e.bind(t),0);return{dispose:function(){clearTimeout(n)}}}));(gs=ps||(ps={})).isCancellationToken=function(e){return e===gs.None||e===gs.Cancelled||e instanceof _s||!(!e||"object"!=typeof e)&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},gs.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:It.None}),gs.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ms});var _s=function(){function e(){this._isCancelled=!1,this._emitter=null}return e.prototype.cancel=function(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))},Object.defineProperty(e.prototype,"isCancellationRequested",{get:function(){return this._isCancelled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onCancellationRequested",{get:function(){return this._isCancelled?ms:(this._emitter||(this._emitter=new Ht),this._emitter.event)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._emitter&&(this._emitter.dispose(),this._emitter=null)},e}(),ys=function(){function e(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}return Object.defineProperty(e.prototype,"token",{get:function(){return this._token||(this._token=new _s),this._token},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this._token?this._token instanceof _s&&this._token.cancel():this._token=ps.Cancelled},e.prototype.dispose=function(){this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof _s&&this._token.dispose():this._token=ps.None},e}();function vs(e){var t=new ys,n=e(t.token),r=new Promise((function(e,r){t.token.onCancellationRequested((function(){r(Ve())})),Promise.resolve(n).then((function(n){t.dispose(),e(n)}),(function(e){t.dispose(),r(e)}))}));return new(function(){function e(){}return e.prototype.cancel=function(){t.cancel()},e.prototype.then=function(e,t){return r.then(e,t)},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(e){return r.finally(e)},e}())}var bs=function(){function e(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,this.task=null}return e.prototype.trigger=function(e,t){var n=this;return void 0===t&&(t=this.defaultDelay),this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((function(e,t){n.doResolve=e,n.doReject=t})).then((function(){n.completionPromise=null,n.doResolve=null;var e=n.task;return n.task=null,e()}))),this.timeout=setTimeout((function(){n.timeout=null,n.doResolve(null)}),t),this.completionPromise},e.prototype.isTriggered=function(){return null!==this.timeout},e.prototype.cancel=function(){this.cancelTimeout(),this.completionPromise&&(this.doReject(Ve()),this.completionPromise=null)},e.prototype.cancelTimeout=function(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},e.prototype.dispose=function(){this.cancelTimeout()},e}();function ws(e,t){void 0===t&&(t=0);var n=setTimeout(e,t);return Mt((function(){return clearTimeout(n)}))}var Cs,Ss=function(){function e(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}return e.prototype.dispose=function(){this.cancel()},e.prototype.cancel=function(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)},e.prototype.cancelAndSet=function(e,t){var n=this;this.cancel(),this._token=setTimeout((function(){n._token=-1,e()}),t)},e.prototype.setIfNotSet=function(e,t){var n=this;-1===this._token&&(this._token=setTimeout((function(){n._token=-1,e()}),t))},e}(),xs=function(){function e(){this._token=-1}return e.prototype.dispose=function(){this.cancel()},e.prototype.cancel=function(){-1!==this._token&&(clearInterval(this._token),this._token=-1)},e.prototype.cancelAndSet=function(e,t){this.cancel(),this._token=setInterval((function(){e()}),t)},e}(),ks=function(){function e(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}return e.prototype.dispose=function(){this.cancel(),this.runner=null},e.prototype.cancel=function(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)},e.prototype.schedule=function(e){void 0===e&&(e=this.timeout),this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)},e.prototype.isScheduled=function(){return-1!==this.timeoutToken},e.prototype.onTimeout=function(){this.timeoutToken=-1,this.runner&&this.doRun()},e.prototype.doRun=function(){this.runner&&this.runner()},e}();!function(){if("function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback){var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});Cs=function(t){var n=setTimeout((function(){return t(e)})),r=!1;return{dispose:function(){r||(r=!0,clearTimeout(n))}}}}else Cs=function(e,t){var n=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0),r=!1;return{dispose:function(){r||(r=!0,cancelIdleCallback(n))}}}}();var Ls=function(){function e(e){var t=this;this._didRun=!1,this._executor=function(){try{t._value=e()}catch(e){t._error=e}finally{t._didRun=!0}},this._handle=Cs((function(){return t._executor()}))}return e.prototype.dispose=function(){this._handle.dispose()},e.prototype.getValue=function(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value},e}(),Ms="**",Es="/",Ds="[/\\\\]",Ts="[^/\\\\]",Ns=/\//g;function Os(e){switch(e){case 0:return"";case 1:return Ts+"*?";default:return"(?:"+Ds+"|"+Ts+"+"+Ds+"|"+Ds+Ts+"+)*?"}}function As(e,t){if(!e)return[];for(var n=[],r=!1,i=!1,o="",s=0,a=e;se.length)return!1;if(n){if(!gn(e,t))return!1;if(t.length===e.length)return!0;var i=t.length;return t.charAt(t.length-1)===r&&i--,e.charAt(i)===r}return t.charAt(t.length-1)!==r&&(t+=r),0===e.indexOf(t)}(n,t.base)?e(cs(t.base,n),r):null}}function Us(e,t){return t.trimForExclusions&&rn(e,"/**")?e.substr(0,e.length-2):e}function qs(e,t,n){var r=fs!==ss.sep?e.replace(Ns,fs):e,i=fs+r,o=n?function(e,n){return"string"!=typeof e||e!==r&&!rn(e,i)?null:t}:function(e,n){return"string"==typeof e&&e===r?t:null};return o.allPaths=[(n?"*/":"./")+e],o}function Ks(e,t,n){return!(!e||"string"!=typeof t)&&function(e,t){void 0===t&&(t={});if(!e)return Hs;if("string"==typeof e||(i=e,o=i,o&&"string"==typeof o.base&&"string"==typeof o.pattern)){var n=Vs(e,t);if(n===Ws)return Hs;var r=function(e,t){return!!n(e,t)};return n.allBasenames&&(r.allBasenames=n.allBasenames),n.allPaths&&(r.allPaths=n.allPaths),r}var i,o;return function(e,t){var n=Gs(Object.getOwnPropertyNames(e).map((function(n){return function(e,t,n){if(!1===t)return Ws;var r=Vs(e,n);if(r===Ws)return Ws;if("boolean"==typeof t)return r;if(t){var i=t.when;if("string"==typeof i){var o=function(t,n,o,s){if(!s||!r(t,n))return null;var a,u=s(i.replace("$(basename)",o));return(a=u)&&"function"==typeof a.then?u.then((function(t){return t?e:null})):u?e:null};return o.requiresSiblings=!0,o}}return r}(n,e[n],t)})).filter((function(e){return e!==Ws}))),r=n.length;if(!r)return Ws;if(!n.some((function(e){return!!e.requiresSiblings}))){if(1===r)return n[0];var i=function(e,t){for(var r=0,i=n.length;r0;n--){var o=e.charCodeAt(n-1);if(47===o||92===o)break}t=e.substr(n)}var s=i.indexOf(t);return-1!==s?r[s]:null};a.basenames=i,a.patterns=r,a.allBasenames=i;var u=e.filter((function(e){return!e.basenames}));return u.push(a),u}function $s(e,t,n,r){if(Array.isArray(e)){for(var i=0,o=0,s=e;oi&&(i=a)}return i}if("string"==typeof e)return r?"*"===e?5:e===n?10:0:0;if(e){var u=e.language,c=e.pattern,l=e.scheme,d=e.hasAccessToAllModels;if(!r&&!d)return 0;i=0;if(l)if(l===t.scheme)i=10;else{if("*"!==l)return 0;i=5}if(u)if(u===n)i=10;else{if("*"!==u)return 0;i=Math.max(i,5)}if(c){if(c!==t.fsPath&&!Ks(c,t.fsPath))return 0;i=10}return i}return 0}function Zs(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(Zs):!!e.exclusive)}var Js,Xs,Qs,ea=function(){function e(){this._clock=0,this._entries=[],this._onDidChange=new Ht}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this,r={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(r),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Mt((function(){if(r){var e=n._entries.indexOf(r);e>=0&&(n._entries.splice(e,1),n._lastCandidate=void 0,n._onDidChange.fire(n._entries.length),r=void 0)}}))},e.prototype.has=function(e){return this.all(e).length>0},e.prototype.all=function(e){if(!e)return[];this._updateScores(e);for(var t=[],n=0,r=this._entries;n0&&t.push(i.provider)}return t},e.prototype.ordered=function(e){var t=[];return this._orderedForEach(e,(function(e){return t.push(e.provider)})),t},e.prototype.orderedGroups=function(e){var t,n,r=[];return this._orderedForEach(e,(function(e){t&&n===e._score?t.push(e.provider):(n=e._score,t=[e.provider],r.push(t))})),r},e.prototype._orderedForEach=function(e,t){if(e){this._updateScores(e);for(var n=0,r=this._entries;n0&&t(i)}}},e.prototype._updateScores=function(t){var n={uri:t.uri.toString(),language:t.getLanguageIdentifier().language};if(!this._lastCandidate||this._lastCandidate.language!==n.language||this._lastCandidate.uri!==n.uri){this._lastCandidate=n;for(var r=0,i=this._entries;r0){for(var s=0,a=this._entries;st._score?-1:e._timet._time?-1:0},e}(),ta=function(){function e(){this._map=new Map,this._promises=new Map,this._onDidChange=new Ht,this.onDidChange=this._onDidChange.event,this._colorMap=null}return e.prototype.fire=function(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})},e.prototype.register=function(e,t){var n=this;return this._map.set(e,t),this.fire([e]),Mt((function(){n._map.get(e)===t&&(n._map.delete(e),n.fire([e]))}))},e.prototype.registerPromise=function(e,t){var n=this,r=null,i=!1;return this._promises.set(e,t.then((function(t){n._promises.delete(e),!i&&t&&(r=n.register(e,t))}))),Mt((function(){i=!0,r&&r.dispose()}))},e.prototype.getPromise=function(e){var t=this,n=this.get(e);if(n)return Promise.resolve(n);var r=this._promises.get(e);return r?r.then((function(n){return t.get(e)})):null},e.prototype.get=function(e){return Fe(this._map.get(e))},e.prototype.setColorMap=function(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Wn(this._map),changedColorMap:!0})},e.prototype.getColorMap=function(){return this._colorMap},e.prototype.getDefaultBackground=function(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null},e}(),na=function(e,t){this.language=e,this.id=t},ra=function(){function e(){}return e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(1792&e)>>>8},e.getFontStyle=function(e){return(14336&e)>>>11},e.getForeground=function(e){return(8372224&e)>>>14},e.getBackground=function(e){return(4286578688&e)>>>23},e.getClassNameFromMetadata=function(e){var t="mtk"+this.getForeground(e),n=this.getFontStyle(e);return 1&n&&(t+=" mtki"),2&n&&(t+=" mtkb"),4&n&&(t+=" mtku"),t},e.getInlineStyleFromMetadata=function(e,t){var n=this.getForeground(e),r=this.getFontStyle(e),i="color: "+t[n]+";";return 1&r&&(i+="font-style: italic;"),2&r&&(i+="font-weight: bold;"),4&r&&(i+="text-decoration: underline;"),i},e}();(Js=Object.create(null))[0]="method",Js[1]="function",Js[2]="constructor",Js[3]="field",Js[4]="variable",Js[5]="class",Js[6]="struct",Js[7]="interface",Js[8]="module",Js[9]="property",Js[10]="event",Js[11]="operator",Js[12]="unit",Js[13]="value",Js[14]="constant",Js[15]="enum",Js[16]="enum-member",Js[17]="keyword",Js[25]="snippet",Js[18]="text",Js[19]="color",Js[20]="file",Js[21]="reference",Js[22]="customcolor",Js[23]="folder",Js[24]="type-parameter",function(){var e=Object.create(null);e.method=0,e.function=1,e.constructor=2,e.field=3,e.variable=4,e.class=5,e.struct=6,e.interface=7,e.module=8,e.property=9,e.event=10,e.operator=11,e.unit=12,e.value=13,e.constant=14,e.enum=15,e["enum-member"]=16,e.enumMember=16,e.keyword=17,e.snippet=25,e.text=18,e.color=19,e.file=20,e.reference=21,e.customcolor=22,e.folder=23,e["type-parameter"]=24,e.typeParameter=24}();!function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(Xs||(Xs={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(Qs||(Qs={}));(ia=Object.create(null))[0]="file",ia[1]="module",ia[2]="namespace",ia[3]="package",ia[4]="class",ia[5]="method",ia[6]="property",ia[7]="field",ia[8]="constructor",ia[9]="enum",ia[10]="interface",ia[11]="function",ia[12]="variable",ia[13]="constant",ia[14]="string",ia[15]="number",ia[16]="boolean",ia[17]="array",ia[18]="object",ia[19]="key",ia[20]="null",ia[21]="enum-member",ia[22]="struct",ia[23]="event",ia[24]="operator",ia[25]="type-parameter";var ia,oa=function(){function e(e){this.value=e}return e.Comment=new e("comment"),e.Imports=new e("imports"),e.Region=new e("region"),e}();var sa=new ea,aa=new ea,ua=new ea,ca=new ea,la=new ea,da=new ea,ha=new ea,fa=new ea,pa=new ea,ma=new ea,_a=new ea,ya=new ea,va=new ea,ba=new ea,wa=new ea,Ca=new ea,Sa=new ea,xa=new ea,ka=new ea,La=new ea,Ma=new ta,Ea=function(){function e(e,t){this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t}return e.prototype.equals=function(t){return t instanceof e&&this.slicedEquals(t,0,this._tokensCount)},e.prototype.slicedEquals=function(e,t,n){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;for(var r=t<<1,i=r+(n<<1),o=r;o0?this._tokens[e-1<<1]:0},e.prototype.getLanguageId=function(e){var t=this._tokens[1+(e<<1)];return ra.getLanguageId(t)},e.prototype.getStandardTokenType=function(e){var t=this._tokens[1+(e<<1)];return ra.getTokenType(t)},e.prototype.getForeground=function(e){var t=this._tokens[1+(e<<1)];return ra.getForeground(t)},e.prototype.getClassName=function(e){var t=this._tokens[1+(e<<1)];return ra.getClassNameFromMetadata(t)},e.prototype.getInlineStyle=function(e,t){var n=this._tokens[1+(e<<1)];return ra.getInlineStyleFromMetadata(n,t)},e.prototype.getEndOffset=function(e){return this._tokens[e<<1]},e.prototype.findTokenIndexAtOffset=function(t){return e.findIndexInTokensArray(this._tokens,t)},e.prototype.inflate=function(){return this},e.prototype.sliceAndInflate=function(e,t,n){return new Da(this,e,t,n)},e.convertToEndOffset=function(e,t){for(var n=(e.length>>>1)-1,r=0;r>>1)-1;nt&&(r=i)}return n},e}(),Da=function(){function e(e,t,n,r){this._source=e,this._startOffset=t,this._endOffset=n,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(var i=this._firstTokenIndex,o=e.getCount();i=n)break;this._tokensCount++}}return e.prototype.equals=function(t){return t instanceof e&&(this._startOffset===t._startOffset&&this._endOffset===t._endOffset&&this._deltaOffset===t._deltaOffset&&this._source.slicedEquals(t._source,this._firstTokenIndex,this._tokensCount))},e.prototype.getCount=function(){return this._tokensCount},e.prototype.getForeground=function(e){return this._source.getForeground(this._firstTokenIndex+e)},e.prototype.getEndOffset=function(e){var t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset},e.prototype.getClassName=function(e){return this._source.getClassName(this._firstTokenIndex+e)},e.prototype.getInlineStyle=function(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)},e.prototype.findTokenIndexAtOffset=function(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex},e}(),Ta=function(){function e(e,t,n){this.offset=0|e,this.type=t,this.language=n}return e.prototype.toString=function(){return"("+this.offset+", "+this.type+")"},e}(),Na=function(e,t){this.tokens=e,this.endState=t},Oa=function(e,t){this.tokens=e,this.endState=t},Aa=new(function(){function e(){}return e.prototype.clone=function(){return this},e.prototype.equals=function(e){return this===e},e}()),Ia=new na("vs.editor.nullMode",0);function Pa(e,t,n,r){var i=new Uint32Array(2);return i[0]=r,i[1]=(16384|e<<0|2<<23)>>>0,new Oa(i,null===n?Aa:n)}var Ra=Ge.b.performance&&"function"==typeof Ge.b.performance.now,Fa=function(){function e(e){this._highResolution=Ra&&e,this._startTime=this._now(),this._stopTime=-1}return e.create=function(t){return void 0===t&&(t=!0),new e(t)},e.prototype.stop=function(){this._stopTime=this._now()},e.prototype.elapsed=function(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime},e.prototype._now=function(){return this._highResolution?Ge.b.performance.now():(new Date).getTime()},e}();function Ya(e){for(var t=0,n=0,r=0,i=e.length;r>>0}var Ba=new Uint32Array(0).buffer,Ha=function(){function e(){this.tokens=[]}return e.prototype.add=function(e,t){if(this.tokens.length>0){var n=this.tokens[this.tokens.length-1];if(n.startLineNumber+n.tokens.length-1+1===e)return void n.tokens.push(t)}this.tokens.push(new Wa(e,[t]))},e}(),Wa=function(e,t){this.startLineNumber=e,this.tokens=t};function Va(e){return e instanceof Uint32Array?e:new Uint32Array(e)}var za,Ua=function(){function e(){this._lineTokens=[],this._len=0}return e.prototype.flush=function(){this._lineTokens=[],this._len=0},e.prototype.getTokens=function(e,t,n){var r=null;if(t1&&(i=ra.getLanguageId(r[1])!==e),!i)return Ba}if(!r||0===r.length){var o=new Uint32Array(2);return o[0]=t,o[1]=ja(e),o.buffer}return r[r.length-2]=t,0===r.byteOffset&&r.byteLength===r.buffer.byteLength?r.buffer:r},e.prototype._ensureLine=function(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++},e.prototype._deleteLines=function(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)},e.prototype._insertLines=function(e,t){if(0!==t){for(var n=[],r=0;r=this._len))if(t.startLineNumber!==t.endLineNumber){this._lineTokens[n]=e._deleteEnding(this._lineTokens[n],t.startColumn-1);var r=t.endLineNumber-1,i=null;r=this._len||(0!==n?(this._lineTokens[i]=e._deleteEnding(this._lineTokens[i],t.column-1),this._lineTokens[i]=e._insert(this._lineTokens[i],t.column-1,r),this._insertLines(t.lineNumber,n)):this._lineTokens[i]=e._insert(this._lineTokens[i],t.column-1,r))}},e._deleteBeginning=function(t,n){return null===t||t===Ba?t:e._delete(t,0,n)},e._deleteEnding=function(t,n){if(null===t||t===Ba)return t;var r=Va(t),i=r[r.length-2];return e._delete(t,n,i)},e._delete=function(e,t,n){if(null===e||e===Ba||t===n)return e;var r=Va(e),i=r.length>>>1;if(0===t&&r[r.length-2]===n)return Ba;var o,s,a=Ea.findIndexInTokensArray(r,t),u=a>0?r[a-1<<1]:0;if(ns&&(r[o++]=f,r[o++]=r[1+(h<<1)],s=f)}if(o===r.length)return e;var p=new Uint32Array(o);return p.set(r.subarray(0,o),0),p.buffer},e._append=function(e,t){if(t===Ba)return e;if(e===Ba)return t;if(null===e)return e;if(null===t)return null;var n=Va(e),r=Va(t),i=r.length>>>1,o=new Uint32Array(n.length+r.length);o.set(n,0);for(var s=n.length,a=n[n.length-2],u=0;u>>1,o=Ea.findIndexInTokensArray(r,t);o>0&&(r[o-1<<1]===t&&o--);for(var s=o;s=this._len;)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++},e.prototype._deleteLines=function(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)},e.prototype._insertLines=function(e,t){if(0!==t){for(var n=[],r=[],i=0;i=0;i--)this._invalidateLine(e.startLineNumber+i-1);this._acceptDeleteRange(e),this._acceptInsertText(new _t(e.startLineNumber,e.startColumn),t)},e.prototype._acceptDeleteRange=function(e){e.startLineNumber-1>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)},e.prototype._acceptInsertText=function(e,t){e.lineNumber-1>=this._len||this._insertLines(e.lineNumber,t)},e}(),Ga=function(e){function t(t){var n=e.call(this)||this;return n._textModel=t,n._tokenizationStateStore=new Ka,n._revalidateTokensTimeout=-1,n._tokenizationSupport=null,n._register(Ma.onDidChange((function(e){var t=n._textModel.getLanguageIdentifier();-1!==e.changedLanguages.indexOf(t.language)&&(n._resetTokenizationState(),n._textModel.clearTokens())}))),n._register(n._textModel.onDidChangeRawContentFast((function(e){e.containsEvent(1)&&n._resetTokenizationState()}))),n._register(n._textModel.onDidChangeContentFast((function(e){for(var t=0,r=e.changes.length;t20);){if(this._tokenizeOneInvalidLine(t)>=e)break}this._beginBackgroundTokenization(),this._textModel.setTokens(t.tokens)},t.prototype.tokenizeViewport=function(e,t){var n=new Ha;this._tokenizeViewport(n,e,t),this._textModel.setTokens(n.tokens)},t.prototype.reset=function(){this._resetTokenizationState(),this._textModel.clearTokens()},t.prototype.forceTokenization=function(e){var t=new Ha;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens)},t.prototype.isCheapToTokenize=function(e){if(!this._tokenizationSupport)return!0;var t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e0&&s>=1;s--){var a=this._textModel.getLineFirstNonWhitespaceColumn(s);if(0!==a&&a=0;s--){c=(h=$a(u,this._tokenizationSupport,i[s],c)).endState}for(var l=t;l<=n;l++){var d=this._textModel.getLineContent(l),h=$a(u,this._tokenizationSupport,d,c);e.add(l,h.tokens),this._tokenizationStateStore.setFakeTokens(l-1),c=h.endState}}},t}(Dt);function $a(e,t,n,r){var i=null;if(t)try{i=t.tokenize2(n,r.clone(),0)}catch(e){je(e)}return i||(i=Pa(e.id,0,r,0)),Ea.convertToEndOffset(i.tokens,n.length),i}!function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(za||(za={}));var Za=function(){function e(e){if(this.open=e.open,this.close=e.close,this._standardTokenMask=0,Array.isArray(e.notIn))for(var t=0,n=e.notIn.length;t0&&e.getLanguageId(s-1)===i;)s--;return new Xa(e,i,s,o+1,e.getStartOffset(s),e.getEndOffset(o))}var Xa=function(){function e(e,t,n,r,i,o){this._actual=e,this.languageId=t,this._firstTokenIndex=n,this._lastTokenIndex=r,this.firstCharOffset=i,this._lastCharOffset=o}return e.prototype.getLineContent=function(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)},e.prototype.getTokenCount=function(){return this._lastTokenIndex-this._firstTokenIndex},e.prototype.findTokenIndexAtOffset=function(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex},e.prototype.getStandardTokenType=function(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)},e}();function Qa(e){return 0!=(7&e)}var eu=function(){function e(t){if(t.autoClosingPairs?this._autoClosingPairs=t.autoClosingPairs.map((function(e){return new Za(e)})):t.brackets?this._autoClosingPairs=t.brackets.map((function(e){return new Za({open:e[0],close:e[1]})})):this._autoClosingPairs=[],t.__electricCharacterSupport&&t.__electricCharacterSupport.docComment){var n=t.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Za({open:n.open,close:n.close||""}))}this._autoCloseBefore="string"==typeof t.autoCloseBefore?t.autoCloseBefore:e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=t.surroundingPairs||this._autoClosingPairs}return e.prototype.getAutoClosingPairs=function(){return this._autoClosingPairs},e.prototype.getAutoCloseBeforeSet=function(){return this._autoCloseBefore},e.shouldAutoClosePair=function(e,t,n){if(0===t.getTokenCount())return!0;var r=t.findTokenIndexAtOffset(n-2),i=t.getStandardTokenType(r);return e.isOK(i)},e.prototype.getSurroundingPairs=function(){return this._surroundingPairs},e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t",e}(),tu=function(e,t,n,r,i){this.languageIdentifier=e,this.open=t,this.close=n,this.forwardRegex=r,this.reversedRegex=i},nu=function(e,t){var n=this;this.brackets=t.map((function(t){return new tu(e,t[0],t[1],iu({open:t[0],close:t[1]}),ou({open:t[0],close:t[1]}))})),this.forwardRegex=su(this.brackets),this.reversedRegex=au(this.brackets),this.textIsBracket={},this.textIsOpenBracket={};var r=0;this.brackets.forEach((function(e){n.textIsBracket[e.open.toLowerCase()]=e,n.textIsBracket[e.close.toLowerCase()]=e,n.textIsOpenBracket[e.open.toLowerCase()]=!0,n.textIsOpenBracket[e.close.toLowerCase()]=!1,r=Math.max(r,e.open.length),r=Math.max(r,e.close.length)})),this.maxBracketLength=r};function ru(e,t){var n={};return function(r){var i=e(r);return n.hasOwnProperty(i)||(n[i]=t(r)),n[i]}}var iu=ru((function(e){return e.open+";"+e.close}),(function(e){return cu([e.open,e.close])})),ou=ru((function(e){return e.open+";"+e.close}),(function(e){return cu([hu(e.open),hu(e.close)])})),su=ru((function(e){return e.map((function(e){return e.open+";"+e.close})).join(";")}),(function(e){var t=[];return e.forEach((function(e){t.push(e.open),t.push(e.close)})),cu(t)})),au=ru((function(e){return e.map((function(e){return e.open+";"+e.close})).join(";")}),(function(e){var t=[];return e.forEach((function(e){t.push(hu(e.open)),t.push(hu(e.close))})),cu(t)}));function uu(e){var t=/^[\w]+$/.test(e);return e=en(e),t?"\\b"+e+"\\b":e}function cu(e){return on("("+e.map(uu).join(")|(")+")",!0)}var lu,du,hu=(lu=null,du=null,function(e){return lu!==e&&(du=function(e){for(var t="",n=e.length-1;n>=0;n--)t+=e.charAt(n);return t}(lu=e)),du}),fu=function(){function e(){}return e._findPrevBracketInText=function(e,t,n,r){var i=n.match(e);if(!i)return null;var o=n.length-(i.index||0),s=i[0].length,a=r+o;return new Tr(t,a-s+1,t,a+1)},e.findPrevBracketInToken=function(e,t,n,r,i){var o=hu(n).substring(n.length-i,n.length-r);return this._findPrevBracketInText(e,t,o,r)},e.findNextBracketInText=function(e,t,n,r){var i=n.match(e);if(!i)return null;var o=i.index||0,s=i[0].length;if(0===s)return null;var a=r+o;return new Tr(t,a+1,t,a+1+s)},e.findNextBracketInToken=function(e,t,n,r,i){var o=n.substring(r,i);return this.findNextBracketInText(e,t,o,r)},e}(),pu=function(){function e(e){this._richEditBrackets=e}return e.prototype.getElectricCharacters=function(){var e=[];if(this._richEditBrackets)for(var t=0,n=this._richEditBrackets.brackets.length;t0&&n.length>0)for(r=0,i=this._brackets.length;r0)for(r=0,i=this._brackets.length;r1){var i=void 0,o=-1;for(i=t-1;i>=1;i--){if(e.getLanguageIdAtPosition(i,0)!==r)return o;var s=e.getLineContent(i);if(!n.shouldIgnore(s)&&!/^\s+$/.test(s)&&""!==s)return i;o=i}}return-1},e.prototype.getInheritIndentForLine=function(e,t,n){void 0===n&&(n=!0);var r=this.getIndentRulesSupport(e.getLanguageIdentifier().id);if(!r)return null;if(t<=1)return{indentation:"",action:null};var i=this.getPrecedingValidLine(e,t,r);if(i<0)return null;if(i<1)return{indentation:"",action:null};var o=e.getLineContent(i);if(r.shouldIncrease(o)||r.shouldIndentNextLine(o))return{indentation:un(o),action:za.Indent,line:i};if(r.shouldDecrease(o))return{indentation:un(o),action:null,line:i};if(1===i)return{indentation:un(e.getLineContent(i)),action:null,line:i};var s=i-1,a=r.getIndentMetadata(e.getLineContent(s));if(!(3&a)&&4&a){for(var u=0,c=s-1;c>0;c--)if(!r.shouldIndentNextLine(e.getLineContent(c))){u=c;break}return{indentation:un(e.getLineContent(u+1)),action:null,line:u+1}}if(n)return{indentation:un(e.getLineContent(i)),action:null,line:i};for(c=i;c>0;c--){var l=e.getLineContent(c);if(r.shouldIncrease(l))return{indentation:un(l),action:za.Indent,line:c};if(r.shouldIndentNextLine(l)){u=0;for(var d=c-1;d>0;d--)if(!r.shouldIndentNextLine(e.getLineContent(c))){u=d;break}return{indentation:un(e.getLineContent(u+1)),action:null,line:u+1}}if(r.shouldDecrease(l))return{indentation:un(l),action:null,line:c}}return{indentation:un(e.getLineContent(1)),action:null,line:1}},e.prototype.getGoodIndentForLine=function(e,t,n,r){var i=this.getIndentRulesSupport(t);if(!i)return null;var o=this.getInheritIndentForLine(e,n),s=e.getLineContent(n);if(o){var a=o.line;if(void 0!==a){var u=this._getOnEnterSupport(t),c=null;try{u&&(c=u.onEnter("",e.getLineContent(a),""))}catch(e){je(e)}if(c){var l=un(e.getLineContent(a));return c.removeText&&(l=l.substring(0,l.length-c.removeText)),c.indentAction===za.Indent||c.indentAction===za.IndentOutdent?l=r.shiftIndent(l):c.indentAction===za.Outdent&&(l=r.unshiftIndent(l)),i.shouldDecrease(s)&&(l=r.unshiftIndent(l)),c.appendText&&(l+=c.appendText),un(l)}}return i.shouldDecrease(s)?o.action===za.Indent?o.indentation:r.unshiftIndent(o.indentation):o.action===za.Indent?r.shiftIndent(o.indentation):o.indentation}return null},e.prototype.getIndentForEnter=function(e,t,n,r){e.forceTokenization(t.startLineNumber);var i,o,s=e.getLineTokens(t.startLineNumber),a=Ja(s,t.startColumn-1),u=a.getLineContent(),c=!1;(a.firstCharOffset>0&&s.getLanguageId(0)!==a.languageId?(c=!0,i=u.substr(0,t.startColumn-1-a.firstCharOffset)):i=s.getLineContent().substring(0,t.startColumn-1),t.isEmpty())?o=u.substr(t.startColumn-1-a.firstCharOffset):o=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-a.firstCharOffset);var l=this.getIndentRulesSupport(a.languageId);if(!l)return null;var d=i,h=un(i);if(!r&&!c){var f=this.getInheritIndentForLine(e,t.startLineNumber);l.shouldDecrease(i)&&f&&(h=f.indentation,f.action!==za.Indent&&(h=n.unshiftIndent(h))),d=h+tn(tn(i," "),"\t")}var p={getLineTokens:function(t){return e.getLineTokens(t)},getLanguageIdentifier:function(){return e.getLanguageIdentifier()},getLanguageIdAtPosition:function(t,n){return e.getLanguageIdAtPosition(t,n)},getLineContent:function(n){return n===t.startLineNumber?d:e.getLineContent(n)}},g=un(s.getLineContent()),m=this.getInheritIndentForLine(p,t.startLineNumber+1);if(!m){var _=c?g:h;return{beforeEnter:_,afterEnter:_}}var y=c?g:m.indentation;return m.action===za.Indent&&(y=n.shiftIndent(y)),l.shouldDecrease(o)&&(y=n.unshiftIndent(y)),{beforeEnter:c?g:h,afterEnter:y}},e.prototype.getIndentActionForType=function(e,t,n,r){var i=this.getScopedLineTokens(e,t.startLineNumber,t.startColumn),o=this.getIndentRulesSupport(i.languageId);if(!o)return null;var s,a=i.getLineContent(),u=a.substr(0,t.startColumn-1-i.firstCharOffset);t.isEmpty()?s=a.substr(t.startColumn-1-i.firstCharOffset):s=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-i.firstCharOffset);if(!o.shouldDecrease(u+s)&&o.shouldDecrease(u+n+s)){var c=this.getInheritIndentForLine(e,t.startLineNumber,!1);if(!c)return null;var l=c.indentation;return c.action!==za.Indent&&(l=r.unshiftIndent(l)),l}return null},e.prototype.getIndentMetadata=function(e,t){var n=this.getIndentRulesSupport(e.getLanguageIdentifier().id);return n?t<1||t>e.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null},e.prototype._getOnEnterSupport=function(e){var t=this._getRichEditSupport(e);return t&&t.onEnter||null},e.prototype.getRawEnterActionAtPosition=function(e,t,n){var r=this.getEnterAction(e,new Tr(t,n,t,n));return r?r.enterAction:null},e.prototype.getEnterAction=function(e,t){var n=this.getIndentationAtPosition(e,t.startLineNumber,t.startColumn),r=this.getScopedLineTokens(e,t.startLineNumber,t.startColumn),i=this._getOnEnterSupport(r.languageId);if(!i)return null;var o,s=r.getLineContent(),a=s.substr(0,t.startColumn-1-r.firstCharOffset);t.isEmpty()?o=s.substr(t.startColumn-1-r.firstCharOffset):o=this.getScopedLineTokens(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);var u=t.startLineNumber,c="";if(u>1&&0===r.firstCharOffset){var l=this.getScopedLineTokens(e,u-1);l.languageId===r.languageId&&(c=l.getLineContent())}var d=null;try{d=i.onEnter(c,a,o)}catch(e){je(e)}return d?(d.appendText||(d.indentAction===za.Indent||d.indentAction===za.IndentOutdent?d.appendText="\t":d.appendText=""),d.removeText&&(n=n.substring(0,n.length-d.removeText)),{enterAction:d,indentation:n}):null},e.prototype.getIndentationAtPosition=function(e,t,n){var r=un(e.getLineContent(t));return r.length>n-1&&(r=r.substring(0,n-1)),r},e.prototype.getScopedLineTokens=function(e,t,n){return e.forceTokenization(t),Ja(e.getLineTokens(t),void 0===n?e.getLineMaxColumn(t)-1:n-1)},e.prototype.getBracketsSupport=function(e){var t=this._getRichEditSupport(e);return t&&t.brackets||null},e}());function bu(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}var wu=function(){function e(e,t,n,r){void 0===r&&(r=1),this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,n)),this.a=bu(Math.max(Math.min(1,r),0),3)}return e.equals=function(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a},e}(),Cu=function(){function e(e,t,n,r){this.h=0|Math.max(Math.min(360,e),0),this.s=bu(Math.max(Math.min(1,t),0),3),this.l=bu(Math.max(Math.min(1,n),0),3),this.a=bu(Math.max(Math.min(1,r),0),3)}return e.equals=function(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a},e.fromRGBA=function(t){var n=t.r/255,r=t.g/255,i=t.b/255,o=t.a,s=Math.max(n,r,i),a=Math.min(n,r,i),u=0,c=0,l=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(l<=.5?d/(2*l):d/(2-2*l),1),s){case n:u=(r-i)/d+(r1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},e.toRGBA=function(t){var n,r,i,o=t.h/360,s=t.s,a=t.l,u=t.a;if(0===s)n=r=i=a;else{var c=a<.5?a*(1+s):a+s-a*s,l=2*a-c;n=e._hue2rgb(l,c,o+1/3),r=e._hue2rgb(l,c,o),i=e._hue2rgb(l,c,o-1/3)}return new wu(Math.round(255*n),Math.round(255*r),Math.round(255*i),u)},e}(),Su=function(){function e(e,t,n,r){this.h=0|Math.max(Math.min(360,e),0),this.s=bu(Math.max(Math.min(1,t),0),3),this.v=bu(Math.max(Math.min(1,n),0),3),this.a=bu(Math.max(Math.min(1,r),0),3)}return e.equals=function(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a},e.fromRGBA=function(t){var n,r=t.r/255,i=t.g/255,o=t.b/255,s=Math.max(r,i,o),a=s-Math.min(r,i,o),u=0===s?0:a/s;return n=0===a?0:s===r?((i-o)/a%6+6)%6:s===i?(o-r)/a+2:(r-i)/a+4,new e(Math.round(60*n),u,s,t.a)},e.toRGBA=function(e){var t=e.h,n=e.s,r=e.v,i=e.a,o=r*n,s=o*(1-Math.abs(t/60%2-1)),a=r-o,u=[0,0,0],c=u[0],l=u[1],d=u[2];return t<60?(c=o,l=s):t<120?(c=s,l=o):t<180?(l=o,d=s):t<240?(l=s,d=o):t<300?(c=s,d=o):t<360&&(c=o,d=s),c=Math.round(255*(c+a)),l=Math.round(255*(l+a)),d=Math.round(255*(d+a)),new wu(c,l,d,i)},e}(),xu=function(){function e(e){if(!e)throw new Error("Color needs a value");if(e instanceof wu)this.rgba=e;else if(e instanceof Cu)this._hsla=e,this.rgba=Cu.toRGBA(e);else{if(!(e instanceof Su))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=Su.toRGBA(e)}}return e.fromHex=function(t){return e.Format.CSS.parseHex(t)||e.red},Object.defineProperty(e.prototype,"hsla",{get:function(){return this._hsla?this._hsla:Cu.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hsva",{get:function(){return this._hsva?this._hsva:Su.fromRGBA(this.rgba)},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){return!!e&&wu.equals(this.rgba,e.rgba)&&Cu.equals(this.hsla,e.hsla)&&Su.equals(this.hsva,e.hsva)},e.prototype.getRelativeLuminance=function(){return bu(.2126*e._relativeLuminanceForComponent(this.rgba.r)+.7152*e._relativeLuminanceForComponent(this.rgba.g)+.0722*e._relativeLuminanceForComponent(this.rgba.b),4)},e._relativeLuminanceForComponent=function(e){var t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},e.prototype.isLighter=function(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128},e.prototype.isLighterThan=function(e){return this.getRelativeLuminance()>e.getRelativeLuminance()},e.prototype.isDarkerThan=function(e){return this.getRelativeLuminance()t.LARGE_FILE_SIZE_THRESHOLD||a>t.LARGE_FILE_LINE_COUNT_THRESHOLD:s._isTooLargeForTokenization=!1,s._isTooLargeForSyncing=u>t.MODEL_SYNC_LIMIT,s._versionId=1,s._alternativeVersionId=1,s._isDisposed=!1,s._isDisposing=!1,s._languageIdentifier=i||Ia,s._languageRegistryListener=vu.onDidChange((function(e){e.languageIdentifier.id===s._languageIdentifier.id&&s._onDidChangeLanguageConfiguration.fire({})})),s._instanceId=Ln(Eu),s._lastDecorationId=0,s._decorations=Object.create(null),s._decorationsTree=new Nu,s._commandManager=new Ci(s),s._isUndoing=!1,s._isRedoing=!1,s._trimAutoWhitespaceLines=null,s._tokens=new Ua,s._tokenization=new Ga(s),s}return ku(t,e),t.createFromString=function(e,n,r,i){return void 0===n&&(n=t.DEFAULT_CREATION_OPTIONS),void 0===r&&(r=null),void 0===i&&(i=null),new t(e,n,r,i)},t.resolveOptions=function(e,t){if(t.detectIndentation){var n=ki(e,t.tabSize,t.insertSpaces);return new mi({tabSize:n.tabSize,indentSize:n.tabSize,insertSpaces:n.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new mi({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})},t.prototype.onDidChangeRawContentFast=function(e){return this._eventEmitter.fastEvent((function(t){return e(t.rawContentChangedEvent)}))},t.prototype.onDidChangeRawContent=function(e){return this._eventEmitter.slowEvent((function(t){return e(t.rawContentChangedEvent)}))},t.prototype.onDidChangeContentFast=function(e){return this._eventEmitter.fastEvent((function(t){return e(t.contentChangedEvent)}))},t.prototype.onDidChangeContent=function(e){return this._eventEmitter.slowEvent((function(t){return e(t.contentChangedEvent)}))},t.prototype.dispose=function(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,e.prototype.dispose.call(this),this._isDisposing=!1},t.prototype._assertNotDisposed=function(){if(this._isDisposed)throw new Error("Model is disposed!")},t.prototype._emitContentChangedEvent=function(e,t){this._isDisposing||this._eventEmitter.fire(new Wo(e,t))},t.prototype.setValue=function(e){if(this._assertNotDisposed(),null!==e){var t=Mu(e,this._options.defaultEOL);this.setValueFromTextBuffer(t)}},t.prototype._createContentChanged2=function(e,t,n,r,i,o,s){return{changes:[{range:e,rangeOffset:t,rangeLength:n,text:r}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:i,isRedoing:o,isFlush:s}},t.prototype.setValueFromTextBuffer=function(e){if(this._assertNotDisposed(),null!==e){var t=this.getFullModelRange(),n=this.getValueLengthInRange(t),r=this.getLineCount(),i=this.getLineMaxColumn(r);this._buffer=e,this._increaseVersionId(),this._tokens.flush(),this._decorations=Object.create(null),this._decorationsTree=new Nu,this._commandManager=new Ci(this),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Ho([new Ro],this._versionId,!1,!1),this._createContentChanged2(new Tr(1,1,r,i),0,n,this.getValue(),!1,!1,!0))}},t.prototype.setEOL=function(e){this._assertNotDisposed();var t=1===e?"\r\n":"\n";if(this._buffer.getEOL()!==t){var n=this.getFullModelRange(),r=this.getValueLengthInRange(n),i=this.getLineCount(),o=this.getLineMaxColumn(i);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Ho([new Bo],this._versionId,!1,!1),this._createContentChanged2(new Tr(1,1,i,o),0,r,this.getValue(),!1,!1,!1))}},t.prototype._onBeforeEOLChange=function(){var e=this.getVersionId(),t=this._decorationsTree.search(0,!1,!1,e);this._ensureNodesHaveRanges(t)},t.prototype._onAfterEOLChange=function(){for(var e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder(),n=0,r=t.length;n0},t.prototype.getAttachedEditorCount=function(){return this._attachedEditorCount},t.prototype.isTooLargeForSyncing=function(){return this._isTooLargeForSyncing},t.prototype.isTooLargeForTokenization=function(){return this._isTooLargeForTokenization},t.prototype.isDisposed=function(){return this._isDisposed},t.prototype.isDominatedByLongLines=function(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;for(var e=0,t=0,n=this._buffer.getLineCount(),r=1;r<=n;r++){var i=this._buffer.getLineLength(r);i>=1e4?t+=i:e+=i}return t>e},Object.defineProperty(t.prototype,"uri",{get:function(){return this._associatedResource},enumerable:!0,configurable:!0}),t.prototype.getOptions=function(){return this._assertNotDisposed(),this._options},t.prototype.getFormattingOptions=function(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}},t.prototype.updateOptions=function(e){this._assertNotDisposed();var t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,n=void 0!==e.indentSize?e.indentSize:this._options.indentSize,r=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,i=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=new mi({tabSize:t,indentSize:n,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:i});if(!this._options.equals(o)){var s=this._options.createChangeEvent(o);this._options=o,this._onDidChangeOptions.fire(s)}},t.prototype.detectIndentation=function(e,t){this._assertNotDisposed();var n=ki(this._buffer,t,e);this.updateOptions({insertSpaces:n.insertSpaces,tabSize:n.tabSize,indentSize:n.tabSize})},t._normalizeIndentationFromWhitespace=function(e,t,n){for(var r=0,i=0;ithis.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)},t.prototype.getLineLength=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)},t.prototype.getLinesContent=function(){return this._assertNotDisposed(),this._buffer.getLinesContent()},t.prototype.getEOL=function(){return this._assertNotDisposed(),this._buffer.getEOL()},t.prototype.getLineMinColumn=function(e){return this._assertNotDisposed(),1},t.prototype.getLineMaxColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1},t.prototype.getLineFirstNonWhitespaceColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)},t.prototype.getLineLastNonWhitespaceColumn=function(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)},t.prototype._validateRangeRelaxedNoAllocations=function(e){var t,n,r=this._buffer.getLineCount(),i=e.startLineNumber,o=e.startColumn;if(i<1)t=1,n=1;else if(i>r)t=r,n=this.getLineMaxColumn(t);else{if(t=0|i,o<=1)n=1;else n=o>=(l=this.getLineMaxColumn(t))?l:0|o}var s,a,u=e.endLineNumber,c=e.endColumn;if(u<1)s=1,a=1;else if(u>r)s=r,a=this.getLineMaxColumn(s);else{var l;if(s=0|u,c<=1)a=1;else a=c>=(l=this.getLineMaxColumn(s))?l:0|c}return i===t&&o===n&&u===s&&c===a&&e instanceof Tr&&!(e instanceof Or)?e:new Tr(t,n,s,a)},t.prototype._isValidPosition=function(e,t,n){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(t>this.getLineMaxColumn(e))return!1;if(n&&(t>1&&mn(this._buffer.getLineCharCode(e,t-2))))return!1;return!0},t.prototype._validatePosition=function(e,t,n){var r=Math.floor("number"!=typeof e||isNaN(e)?1:e),i=Math.floor("number"!=typeof t||isNaN(t)?1:t),o=this._buffer.getLineCount();if(r<1)return new _t(1,1);if(r>o)return new _t(o,this.getLineMaxColumn(o));if(i<=1)return new _t(r,1);var s=this.getLineMaxColumn(r);if(i>=s)return new _t(r,s);if(n&&mn(this._buffer.getLineCharCode(r,i-2)))return new _t(r,i-1);return new _t(r,i)},t.prototype.validatePosition=function(e){return this._assertNotDisposed(),e instanceof _t&&this._isValidPosition(e.lineNumber,e.column,!0)?e:this._validatePosition(e.lineNumber,e.column,!0)},t.prototype._isValidRange=function(e,t){var n=e.startLineNumber,r=e.startColumn,i=e.endLineNumber,o=e.endColumn;if(!this._isValidPosition(n,r,!1))return!1;if(!this._isValidPosition(i,o,!1))return!1;if(t){var s=r>1?this._buffer.getLineCharCode(n,r-2):0,a=o>1&&o<=this._buffer.getLineLength(i)?this._buffer.getLineCharCode(i,o-2):0,u=mn(s),c=mn(a);return!u&&!c}return!0},t.prototype.validateRange=function(e){if(this._assertNotDisposed(),e instanceof Tr&&!(e instanceof Or)&&this._isValidRange(e,!0))return e;var t=this._validatePosition(e.startLineNumber,e.startColumn,!1),n=this._validatePosition(e.endLineNumber,e.endColumn,!1),r=t.lineNumber,i=t.column,o=n.lineNumber,s=n.column,a=i>1?this._buffer.getLineCharCode(r,i-2):0,u=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,c=mn(a),l=mn(u);return c||l?r===o&&i===s?new Tr(r,i-1,o,s-1):c&&l?new Tr(r,i-1,o,s+1):c?new Tr(r,i-1,o,s):new Tr(r,i,o,s+1):new Tr(r,i,o,s)},t.prototype.modifyPosition=function(e,t){this._assertNotDisposed();var n=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,n)))},t.prototype.getFullModelRange=function(){this._assertNotDisposed();var e=this.getLineCount();return new Tr(1,1,e,this.getLineMaxColumn(e))},t.prototype.findMatchesLineByLine=function(e,t,n,r){return this._buffer.findMatchesLineByLine(e,t,n,r)},t.prototype.findMatches=function(e,t,n,r,i,o,s){var a;if(void 0===s&&(s=999),this._assertNotDisposed(),a=Tr.isIRange(t)?this.validateRange(t):this.getFullModelRange(),!n&&e.indexOf("\n")<0){var u=new vo(e,n,r,i).parseSearchRequest();return u?this.findMatchesLineByLine(a,u,o,s):[]}return So.findMatches(this,new vo(e,n,r,i),a,o,s)},t.prototype.findNextMatch=function(e,t,n,r,i,o){this._assertNotDisposed();var s=this.validatePosition(t);if(!n&&e.indexOf("\n")<0){var a=new vo(e,n,r,i).parseSearchRequest();if(!a)return null;var u=this.getLineCount(),c=new Tr(s.lineNumber,s.column,u,this.getLineMaxColumn(u)),l=this.findMatchesLineByLine(c,a,o,1);return So.findNextMatch(this,new vo(e,n,r,i),s,o),l.length>0?l[0]:(c=new Tr(1,1,s.lineNumber,this.getLineMaxColumn(s.lineNumber)),(l=this.findMatchesLineByLine(c,a,o,1)).length>0?l[0]:null)}return So.findNextMatch(this,new vo(e,n,r,i),s,o)},t.prototype.findPreviousMatch=function(e,t,n,r,i,o){this._assertNotDisposed();var s=this.validatePosition(t);return So.findPreviousMatch(this,new vo(e,n,r,i),s,o)},t.prototype.pushStackElement=function(){this._commandManager.pushStackElement()},t.prototype.pushEOL=function(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype.pushEditOperations=function(e,t,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,t,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype._pushEditOperations=function(e,t,n){var r=this;if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){for(var i=t.map((function(e){return{range:r.validateRange(e.range),text:e.text}})),o=!0,s=0,a=e.length;su.endLineNumber,f=u.startLineNumber>_.endLineNumber;if(!h&&!f){c=!0;break}}if(!c){o=!1;break}}if(o)for(s=0,a=this._trimAutoWhitespaceLines.length;s_.endLineNumber)&&!(p===_.startLineNumber&&_.startColumn===g&&_.isEmpty()&&y&&y.length>0&&"\n"===y.charAt(0)||p===_.startLineNumber&&1===_.startColumn&&_.isEmpty()&&y&&y.length>0&&"\n"===y.charAt(y.length-1))){m=!1;break}}m&&t.push({range:new Tr(p,1,p,g),text:null})}this._trimAutoWhitespaceLines=null}return this._commandManager.pushEditOperation(e,t,n)},t.prototype.applyEdits=function(e){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._applyEdits(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}},t.prototype._applyEdits=function(e){for(var t=0,n=e.length;t=0;v--){var b=f+v,w=o-u-y+b;a.push(new Fo(b,this.getLineContent(w)))}if(_this.getLineCount()?[]:this.getLinesDecorations(e,e,t,n)},t.prototype.getLinesDecorations=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);var i=this.getLineCount(),o=Math.min(i,Math.max(1,e)),s=Math.min(i,Math.max(1,t)),a=this.getLineMaxColumn(s);return this._getDecorationsInRange(new Tr(o,1,s,a),n,r)},t.prototype.getDecorationsInRange=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=!1);var r=this.validateRange(e);return this._getDecorationsInRange(r,t,n)},t.prototype.getOverviewRulerDecorations=function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var n=this.getVersionId(),r=this._decorationsTree.search(e,t,!0,n);return this._ensureNodesHaveRanges(r)},t.prototype.getAllDecorations=function(e,t){void 0===e&&(e=0),void 0===t&&(t=!1);var n=this.getVersionId(),r=this._decorationsTree.search(e,t,!1,n);return this._ensureNodesHaveRanges(r)},t.prototype._getDecorationsInRange=function(e,t,n){var r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),i=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn),o=this.getVersionId(),s=this._decorationsTree.intervalSearch(r,i,t,n,o);return this._ensureNodesHaveRanges(s)},t.prototype._ensureNodesHaveRanges=function(e){for(var t=0,n=e.length;tthis.getLineCount())throw new Error("Illegal value for lineNumber");this._tokens.setTokens(this._languageIdentifier.id,e-1,this._buffer.getLineLength(e),t)},t.prototype.setTokens=function(e){if(0!==e.length){for(var t=[],n=0,r=e.length;nthis.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)},t.prototype.isCheapToTokenize=function(e){return this._tokenization.isCheapToTokenize(e)},t.prototype.tokenizeIfCheap=function(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)},t.prototype.getLineTokens=function(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)},t.prototype._getLineTokens=function(e){var t=this.getLineContent(e);return this._tokens.getTokens(this._languageIdentifier.id,e-1,t)},t.prototype.getLanguageIdentifier=function(){return this._languageIdentifier},t.prototype.getModeId=function(){return this._languageIdentifier.language},t.prototype.setMode=function(e){if(this._languageIdentifier.id!==e.id){var t={oldLanguage:this._languageIdentifier.language,newLanguage:e.language};this._languageIdentifier=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}},t.prototype.getLanguageIdAtPosition=function(e,t){var n=this.validatePosition(new _t(e,t)),r=this.getLineTokens(n.lineNumber);return r.getLanguageId(r.findTokenIndexAtOffset(n.column-1))},t.prototype.getWordAtPosition=function(e){this._assertNotDisposed();var n=this.validatePosition(e),r=this.getLineContent(n.lineNumber),i=this._getLineTokens(n.lineNumber),o=i.findTokenIndexAtOffset(n.column-1),s=t._findLanguageBoundaries(i,o),a=s[0],u=s[1],c=Zr(n.column,vu.getWordDefinition(i.getLanguageId(o)),r.substring(a,u),a);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c;if(o>0&&a===n.column-1){var l=t._findLanguageBoundaries(i,o-1),d=l[0],h=l[1],f=Zr(n.column,vu.getWordDefinition(i.getLanguageId(o-1)),r.substring(d,h),d);if(f&&f.startColumn<=e.column&&e.column<=f.endColumn)return f}return null},t._findLanguageBoundaries=function(e,t){for(var n=e.getLanguageId(t),r=0,i=t;i>=0&&e.getLanguageId(i)===n;i--)r=e.getStartOffset(i);for(var o=e.getLineContent().length,s=(i=t,e.getCount());i0&&n.getStartOffset(i)===e.column-1){a=n.getStartOffset(i);i--;var c=vu.getBracketsSupport(n.getLanguageId(i));if(c&&!Qa(n.getStandardTokenType(i))){var l,d,h;s=Math.max(n.getStartOffset(i),e.column-1-c.maxBracketLength);if((l=fu.findPrevBracketInToken(c.reversedRegex,t,r,s,a))&&l.startColumn<=e.column&&e.column<=l.endColumn)if(d=(d=r.substring(l.startColumn-1,l.endColumn-1)).toLowerCase(),h=this._matchFoundBracket(l,c.textIsBracket[d],c.textIsOpenBracket[d]))return h}}return null},t.prototype._matchFoundBracket=function(e,t,n){if(!t)return null;var r;if(n){if(r=this._findMatchingBracketDown(t,e.getEndPosition()))return[e,r]}else if(r=this._findMatchingBracketUp(t,e.getStartPosition()))return[e,r];return null},t.prototype._findMatchingBracketUp=function(e,t){for(var n=e.languageIdentifier.id,r=e.reversedRegex,i=-1,o=t.lineNumber;o>=1;o--){var s=this._getLineTokens(o),a=s.getCount(),u=this._buffer.getLineContent(o),c=a-1,l=-1;for(o===t.lineNumber&&(c=s.findTokenIndexAtOffset(t.column-1),l=t.column-1);c>=0;c--){var d=s.getLanguageId(c),h=s.getStandardTokenType(c),f=s.getStartOffset(c),p=s.getEndOffset(c);if(-1===l&&(l=p),d===n&&!Qa(h))for(;;){var g=fu.findPrevBracketInToken(r,o,u,f,l);if(!g)break;var m=u.substring(g.startColumn-1,g.endColumn-1);if((m=m.toLowerCase())===e.open?i++:m===e.close&&i--,0===i)return g;l=g.startColumn-1}l=-1}}return null},t.prototype._findMatchingBracketDown=function(e,t){for(var n=e.languageIdentifier.id,r=e.forwardRegex,i=1,o=t.lineNumber,s=this.getLineCount();o<=s;o++){var a=this._getLineTokens(o),u=a.getCount(),c=this._buffer.getLineContent(o),l=0,d=0;for(o===t.lineNumber&&(l=a.findTokenIndexAtOffset(t.column-1),d=t.column-1);l=1;i--){var o=this._getLineTokens(i),s=o.getCount(),a=this._buffer.getLineContent(i),u=s-1,c=-1;for(i===t.lineNumber&&(u=o.findTokenIndexAtOffset(t.column-1),c=t.column-1);u>=0;u--){var l=o.getLanguageId(u),d=o.getStandardTokenType(u),h=o.getStartOffset(u),f=o.getEndOffset(u);if(-1===c&&(c=f),n!==l&&(n=l,r=vu.getBracketsSupport(n)),r&&!Qa(d)){var p=fu.findPrevBracketInToken(r.reversedRegex,i,a,h,c);if(p)return this._toFoundBracket(r,p)}c=-1}}return null},t.prototype.findNextBracket=function(e){for(var t=this.validatePosition(e),n=-1,r=null,i=t.lineNumber,o=this.getLineCount();i<=o;i++){var s=this._getLineTokens(i),a=s.getCount(),u=this._buffer.getLineContent(i),c=0,l=0;for(i===t.lineNumber&&(c=s.findTokenIndexAtOffset(t.column-1),l=t.column-1);ci)throw new Error("Illegal value for lineNumber");for(var o=vu.getFoldingRules(this._languageIdentifier.id),s=Boolean(o&&o.offSide),a=-2,u=-1,c=-2,l=-1,d=function(e){if(-1!==a&&(-2===a||a>e-1)){a=-1,u=-1;for(var t=e-2;t>=0;t--){var n=r._computeIndentLevel(t);if(n>=0){a=t,u=n;break}}}if(-2===c){c=-1,l=-1;for(t=e;t=0){c=t,l=o;break}}}},h=-2,f=-1,p=-2,g=-1,m=function(e){if(-2===h){h=-1,f=-1;for(var t=e-2;t>=0;t--){var n=r._computeIndentLevel(t);if(n>=0){h=t,f=n;break}}}if(-1!==p&&(-2===p||p=0){p=t,g=o;break}}}},_=0,y=!0,v=0,b=!0,w=0,C=0;y||b;C++){var S=e-C,x=e+C;if(0!==C&&(S<1||Si||x>n)&&(b=!1),C>5e4&&(y=!1,b=!1),y){var k=void 0;if((L=this._computeIndentLevel(S-1))>=0?(c=S-1,l=L,k=Math.ceil(L/this._options.indentSize)):(d(S),k=this._getIndentLevelForWhitespaceLine(s,u,l)),0===C){if(_=S,v=x,0===(w=k))return{startLineNumber:_,endLineNumber:v,indent:w};continue}k>=w?_=S:y=!1}if(b){var L,M=void 0;(L=this._computeIndentLevel(x-1))>=0?(h=x-1,f=L,M=Math.ceil(L/this._options.indentSize)):(m(x),M=this._getIndentLevelForWhitespaceLine(s,f,g)),M>=w?v=x:b=!1}}return{startLineNumber:_,endLineNumber:v,indent:w}},t.prototype.getLinesIndentGuides=function(e,t){this._assertNotDisposed();var n=this.getLineCount();if(e<1||e>n)throw new Error("Illegal value for startLineNumber");if(t<1||t>n)throw new Error("Illegal value for endLineNumber");for(var r=vu.getFoldingRules(this._languageIdentifier.id),i=Boolean(r&&r.offSide),o=new Array(t-e+1),s=-2,a=-1,u=-2,c=-1,l=e;l<=t;l++){var d=l-e,h=this._computeIndentLevel(l-1);if(h>=0)s=l-1,a=h,o[d]=Math.ceil(h/this._options.indentSize);else{if(-2===s){s=-1,a=-1;for(var f=l-2;f>=0;f--){if((p=this._computeIndentLevel(f))>=0){s=f,a=p;break}}}if(-1!==u&&(-2===u||u=0){u=f,c=p;break}}}o[d]=this._getIndentLevelForWhitespaceLine(i,a,c)}}return o},t.prototype._getIndentLevelForWhitespaceLine=function(e,t,n){return-1===t||-1===n?0:t0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))},t}(Dt),Hu=function(){return!0},Wu=function(){return!1},Vu=function(e){return" "===e||"\t"===e};function zu(e,t,n){e.has(t)?e.get(t).push(n):e.set(t,[n])}var Uu=function(){function e(t,n,r){this._languageIdentifier=t;var i=r.editor;this.readOnly=i.readOnly,this.tabSize=n.tabSize,this.indentSize=n.indentSize,this.insertSpaces=n.insertSpaces,this.pageSize=Math.max(1,Math.floor(i.layoutInfo.height/i.fontInfo.lineHeight)-2),this.lineHeight=i.lineHeight,this.useTabStops=i.useTabStops,this.wordSeparators=i.wordSeparators,this.emptySelectionClipboard=i.emptySelectionClipboard,this.copyWithSyntaxHighlighting=i.copyWithSyntaxHighlighting,this.multiCursorMergeOverlapping=i.multiCursorMergeOverlapping,this.autoClosingBrackets=i.autoClosingBrackets,this.autoClosingQuotes=i.autoClosingQuotes,this.autoClosingOvertype=i.autoClosingOvertype,this.autoSurround=i.autoSurround,this.autoIndent=i.autoIndent,this.autoClosingPairsOpen2=new Map,this.autoClosingPairsClose2=new Map,this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:e._getShouldAutoClose(t,this.autoClosingQuotes),bracket:e._getShouldAutoClose(t,this.autoClosingBrackets)};var o=e._getAutoClosingPairs(t);if(o)for(var s=0,a=o;s=r.length)&&_n(r.charCodeAt(n))},e.isHighSurrogate=function(e,t,n){var r=e.getLineContent(t);return!(n<0||n>=r.length)&&mn(r.charCodeAt(n))},e.isInsideSurrogatePair=function(e,t,n){return this.isHighSurrogate(e,t,n-2)},e.visibleColumnFromColumn=function(e,t,n){var r=e.length;r>t-1&&(r=t-1);for(var i=0,o=0;o=t)return a-ts?s:i},e.nextRenderTabStop=function(e,t){return e+t-e%t},e.nextIndentTabStop=function(e,t){return e+t-e%t},e.prevRenderTabStop=function(e,t){return e-1-(e-1)%t},e.prevIndentTabStop=function(e,t){return e-1-(e-1)%t},e}();function Qu(e){return"'"===e||'"'===e||"`"===e}var ec=function(){function e(){}return e.columnSelect=function(e,t,n,r,i,o){for(var s=Math.abs(i-n)+1,a=n>i,u=r>o,c=ro)continue;if(mr)continue;if(g1&&i--,e.columnSelect(t,n,r.fromViewLineNumber,r.fromViewVisualColumn,r.toViewLineNumber,i)},e.columnSelectRight=function(e,t,n){for(var r=0,i=Math.min(n.fromViewLineNumber,n.toViewLineNumber),o=Math.max(n.fromViewLineNumber,n.toViewLineNumber),s=i;s<=o;s++){var a=t.getLineMaxColumn(s),u=Xu.visibleColumnFromColumn2(e,t,new _t(s,a));r=Math.max(r,u)}var c=n.toViewVisualColumn;return ct.getLineMinColumn(n)?Xu.isLowSurrogate(t,n,r-2)?r-=2:r-=1:n>1&&(n-=1,r=t.getLineMaxColumn(n)),new oc(n,r,0)},e.moveLeft=function(t,n,r,i,o){var s,a;if(r.hasSelection()&&!i)s=r.selection.startLineNumber,a=r.selection.startColumn;else{var u=e.left(t,n,r.position.lineNumber,r.position.column-(o-1));s=u.lineNumber,a=u.column}return r.move(i,s,a,0)},e.right=function(e,t,n,r){return ru?(n=u,s?r=t.getLineMaxColumn(n):(r=Math.min(t.getLineMaxColumn(n),r),Xu.isInsideSurrogatePair(t,n,r)&&(r-=1))):(r=Xu.columnFromVisibleColumn2(e,t,n,a),Xu.isInsideSurrogatePair(t,n,r)&&(r-=1)),i=a-Xu.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize),new oc(n,r,i)},e.moveDown=function(t,n,r,i,o){var s,a;r.hasSelection()&&!i?(s=r.selection.endLineNumber,a=r.selection.endColumn):(s=r.position.lineNumber,a=r.position.column);var u=e.down(t,n,s,a,r.leftoverVisibleColumns,o,!0);return r.move(i,u.lineNumber,u.column,u.leftoverVisibleColumns)},e.translateDown=function(t,n,r){var i=r.selection,o=e.down(t,n,i.selectionStartLineNumber,i.selectionStartColumn,r.selectionStartLeftoverVisibleColumns,1,!1),s=e.down(t,n,i.positionLineNumber,i.positionColumn,r.leftoverVisibleColumns,1,!1);return new qu(new Tr(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new _t(s.lineNumber,s.column),s.leftoverVisibleColumns)},e.up=function(e,t,n,r,i,o,s){var a=Xu.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize)+i;return(n-=o)<1?(n=1,s?r=t.getLineMinColumn(n):(r=Math.min(t.getLineMaxColumn(n),r),Xu.isInsideSurrogatePair(t,n,r)&&(r-=1))):(r=Xu.columnFromVisibleColumn2(e,t,n,a),Xu.isInsideSurrogatePair(t,n,r)&&(r-=1)),i=a-Xu.visibleColumnFromColumn(t.getLineContent(n),r,e.tabSize),new oc(n,r,i)},e.moveUp=function(t,n,r,i,o){var s,a;r.hasSelection()&&!i?(s=r.selection.startLineNumber,a=r.selection.startColumn):(s=r.position.lineNumber,a=r.position.column);var u=e.up(t,n,s,a,r.leftoverVisibleColumns,o,!0);return r.move(i,u.lineNumber,u.column,u.leftoverVisibleColumns)},e.translateUp=function(t,n,r){var i=r.selection,o=e.up(t,n,i.selectionStartLineNumber,i.selectionStartColumn,r.selectionStartLeftoverVisibleColumns,1,!1),s=e.up(t,n,i.positionLineNumber,i.positionColumn,r.leftoverVisibleColumns,1,!1);return new qu(new Tr(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new _t(s.lineNumber,s.column),s.leftoverVisibleColumns)},e.moveToBeginningOfLine=function(e,t,n,r){var i,o=n.position.lineNumber,s=t.getLineMinColumn(o),a=t.getLineFirstNonWhitespaceColumn(o)||s;return i=n.position.column===a?s:a,n.move(r,o,i,0)},e.moveToEndOfLine=function(e,t,n,r){var i=n.position.lineNumber,o=t.getLineMaxColumn(i);return n.move(r,i,o,0)},e.moveToBeginningOfBuffer=function(e,t,n,r){return n.move(r,1,1,0)},e.moveToEndOfBuffer=function(e,t,n,r){var i=t.getLineCount(),o=t.getLineMaxColumn(i);return n.move(r,i,o,0)},e}(),ac=function(){function e(){}return e.deleteRight=function(e,t,n,r){for(var i=[],o=3!==e,s=0,a=r.length;s1){var d=n.getLineContent(l.lineNumber),h=an(d),f=-1===h?d.length+1:h+1;if(l.column<=f){var p=Xu.visibleColumnFromColumn2(t,n,l),g=Xu.prevIndentTabStop(p,t.indentSize),m=Xu.columnFromVisibleColumn2(t,n,l.lineNumber,g);c=new Tr(l.lineNumber,m,l.lineNumber,l.column)}else c=new Tr(l.lineNumber,l.column-1,l.lineNumber,l.column)}else{var _=sc.left(t,n,l.lineNumber,l.column);c=new Tr(_.lineNumber,_.column,l.lineNumber,l.column)}}c.isEmpty()?i[s]=null:(c.startLineNumber!==c.endLineNumber&&(o=!0),i[s]=new tc(c,""))}return[o,i]},e.cut=function(e,t,n){for(var r=[],i=0,o=n.length;i1?(u=a.lineNumber-1,c=t.getLineMaxColumn(a.lineNumber-1),l=a.lineNumber,d=t.getLineMaxColumn(a.lineNumber)):(u=a.lineNumber,c=1,l=a.lineNumber,d=t.getLineMaxColumn(a.lineNumber));var h=new Tr(u,c,l,d);h.isEmpty()?r[i]=null:r[i]=new tc(h,"")}else r[i]=null;else r[i]=new tc(s,"")}return new Ju(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})},e}(),uc=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cc=function(){function e(){}return e._createWord=function(e,t,n,r,i){return{start:r,end:i,wordType:t,nextCharClass:n}},e._findPreviousWordOnLine=function(e,t,n){var r=t.getLineContent(n.lineNumber);return this._doFindPreviousWordOnLine(r,e,n)},e._doFindPreviousWordOnLine=function(e,t,n){for(var r=0,i=n.column-2;i>=0;i--){var o=e.charCodeAt(i),s=t.get(o);if(0===s){if(2===r)return this._createWord(e,r,s,i+1,this._findEndOfWord(e,t,r,i+1));r=1}else if(2===s){if(1===r)return this._createWord(e,r,s,i+1,this._findEndOfWord(e,t,r,i+1));r=2}else if(1===s&&0!==r)return this._createWord(e,r,s,i+1,this._findEndOfWord(e,t,r,i+1))}return 0!==r?this._createWord(e,r,1,0,this._findEndOfWord(e,t,r,0)):null},e._findEndOfWord=function(e,t,n,r){for(var i=e.length,o=r;o=0;i--){var o=e.charCodeAt(i),s=t.get(o);if(1===s)return i+1;if(1===n&&2===s)return i+1;if(2===n&&0===s)return i+1}return 0},e.moveWordLeft=function(t,n,r,i){var o=r.lineNumber,s=r.column,a=!1;1===s&&o>1&&(a=!0,o-=1,s=n.getLineMaxColumn(o));var u=e._findPreviousWordOnLine(t,n,new _t(o,s));if(0===i){if(u&&!a)if(n.getLineLastNonWhitespaceColumn(o)1?new _t(n-1,e.getLineMaxColumn(n-1)):t;for(var i=e.getLineContent(n),o=t.column-1;o>1;o--){var s=i.charCodeAt(o-2),a=i.charCodeAt(o-1);if(95!==s&&95===a)return new _t(n,o);if(ln(s)&&dn(a))return new _t(n,o);if(dn(s)&&dn(a))if(o+1=u.start+1&&(u=e._findNextWordOnLine(t,n,new _t(o,u.end+1))),s=u?u.start+1:n.getLineMaxColumn(o);return new _t(o,s)},e._moveWordPartRight=function(e,t){var n=t.lineNumber,r=e.getLineMaxColumn(n);if(t.column===r)return n1?u=1:(a--,u=n.getLineMaxColumn(a)):(l&&u<=l.end+1&&(l=e._findPreviousWordOnLine(t,n,new _t(a,l.start+1))),l?u=l.end+1:u>1?u=1:(a--,u=n.getLineMaxColumn(a))),new Tr(a,u,s.lineNumber,s.column)},e._deleteWordPartLeft=function(t,n){if(!n.isEmpty())return n;var r=n.getPosition(),i=e._moveWordPartLeft(t,r);return new Tr(r.lineNumber,r.column,i.lineNumber,i.column)},e._findFirstNonWhitespaceChar=function(e,t){for(var n=e.length,r=t;r=h.start+1&&(h=e._findNextWordOnLine(t,n,new _t(a,h.end+1))),h?u=h.start+1:ua&&(u=a,c=e.model.getLineMaxColumn(u)),Zu.fromModelState(new qu(new Tr(o.lineNumber,1,u,c),0,new _t(u,c),0))}var l=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumberl){a=e.viewModel.getLineCount();var d=s.lineNumber+1,h=1;return d>a&&(d=a,h=e.viewModel.getLineMaxColumn(d)),Zu.fromViewState(t.viewState.move(t.modelState.hasSelection(),d,h,0))}var f=t.modelState.selectionStart.getEndPosition();return Zu.fromModelState(t.modelState.move(t.modelState.hasSelection(),f.lineNumber,f.column,0))},e.word=function(e,t,n,r){var i=e.model.validatePosition(r);return Zu.fromModelState(cc.word(e.config,e.model,t.modelState,n,i))},e.cancelSelection=function(e,t){if(!t.modelState.hasSelection())return new Zu(t.modelState,t.viewState);var n=t.viewState.position.lineNumber,r=t.viewState.position.column;return Zu.fromViewState(new qu(new Tr(n,r,n,r),0,new _t(n,r),0))},e.moveTo=function(e,t,n,r,i){var o=e.model.validatePosition(r),s=i?e.validateViewPosition(new _t(i.lineNumber,i.column),o):e.convertModelPositionToViewPosition(o);return Zu.fromViewState(t.viewState.move(n,s.lineNumber,s.column,0))},e.move=function(e,t,n){var r=n.select,i=n.value;switch(n.direction){case 0:return 4===n.unit?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,i);case 1:return 4===n.unit?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,i);case 2:return 2===n.unit?this._moveUpByViewLines(e,t,r,i):this._moveUpByModelLines(e,t,r,i);case 3:return 2===n.unit?this._moveDownByViewLines(e,t,r,i):this._moveDownByModelLines(e,t,r,i);case 4:return this._moveToViewMinColumn(e,t,r);case 5:return this._moveToViewFirstNonWhitespaceColumn(e,t,r);case 6:return this._moveToViewCenterColumn(e,t,r);case 7:return this._moveToViewMaxColumn(e,t,r);case 8:return this._moveToViewLastNonWhitespaceColumn(e,t,r);case 9:var o=t[0],s=e.getCompletelyVisibleModelRange(),a=this._firstLineNumberInRange(e.model,s,i),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,o,r,a,u)];case 11:o=t[0],s=e.getCompletelyVisibleModelRange(),a=this._lastLineNumberInRange(e.model,s,i),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,o,r,a,u)];case 10:o=t[0],s=e.getCompletelyVisibleModelRange(),a=Math.round((s.startLineNumber+s.endLineNumber)/2),u=e.model.getLineFirstNonWhitespaceColumn(a);return[this._moveToModelPosition(e,o,r,a,u)];case 12:for(var c=e.getCompletelyVisibleViewRange(),l=[],d=0,h=t.length;dn.endLineNumber-1&&(i=n.endLineNumber-1),i1)if(Xu.visibleColumnFromColumn(v,f+1,s)%a!=0&&t.isCheapToTokenize(h-1)){var p=vu.getRawEnterActionAtPosition(t,h-1,t.getLineMaxColumn(h-1));if(p){if(d=l,p.appendText)for(var g=0,m=p.appendText.length;g1){var a=void 0;for(a=r-1;a>=1;a--){if(cn(n.getLineContent(a))>=0)break}if(a<1)return null;var u=n.getLineMaxColumn(a),c=vu.getEnterAction(n,new Tr(a,u,a,u));c&&(o=c.indentation,(i=c.enterAction)&&(o+=i.appendText))}return i&&(i===za.Indent&&(o=e.shiftIndent(t,o)),i===za.Outdent&&(o=e.unshiftIndent(t,o)),o=t.normalizeIndentation(o)),o||null},e._replaceJumpToNextIndent=function(e,t,n,r){var i="",o=n.getStartPosition();if(e.insertSpaces)for(var s=Xu.visibleColumnFromColumn2(e,t,o),a=e.indentSize,u=a-s%a,c=0;c=0?i.setEndPosition(i.endLineNumber,Math.max(i.endColumn,b+1)):i.setEndPosition(i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),r)return new nc(i,v+t.normalizeIndentation(p.afterEnter),!0);var w=0;return y<=b+1&&(t.insertSpaces||(_=Math.ceil(_/t.indentSize)),w=Math.min(_+1-t.normalizeIndentation(p.afterEnter).length-1,0)),new rc(i,v+t.normalizeIndentation(p.afterEnter),0,w,!0)}return e._typeCommand(i,"\n"+t.normalizeIndentation(m),r)},e._isAutoIndentType=function(e,t,n){if(!e.autoIndent)return!1;for(var r=0,i=n.length;ro.open.length){for(var c=!0,l=0,d=n;lf.column-1){var g=p.charAt(f.column-1);if(!e._isBeforeClosingBrace(t,u,g)&&!c(g))return null}if(!n.isCheapToTokenize(f.lineNumber))return null;if(1===u.open.length&&s&&"always"!==a){var m=yo(t.wordSeparators);if(o&&f.column>1&&0===m.get(p.charCodeAt(f.column-2)))return null;if(!o&&f.column>2&&0===m.get(p.charCodeAt(f.column-3)))return null}n.forceTokenization(f.lineNumber);var _=n.getLineTokens(f.lineNumber),y=!1;try{y=vu.shouldAutoClosePair(u,_,o?f.column:f.column-1)}catch(e){je(e)}if(!y)return null}return u},e._runAutoClosingOpenCharType=function(e,t,n,r,i,o,s){for(var a=[],u=0,c=r.length;u1)for(var o=n.modelState?n.modelState.position:null,s=n.viewState?n.viewState.position:null,a=0,u=i.length;ai&&(r=i);var o=new Tr(r,1,r,e.context.model.getLineMaxColumn(r)),s=0;if(n.at)switch(n.at){case Mc.RawAtArgument.Top:s=3;break;case Mc.RawAtArgument.Center:s=1;break;case Mc.RawAtArgument.Bottom:s=4}var a=e.context.convertModelRangeToViewRange(o);e.revealRange(!1,a,s,0)},t}(Pc))),e.SelectAll=Mr(new(function(e){function t(){return e.call(this,{id:"selectAll",precondition:void 0})||this}return Ac(t,e),t.prototype.runCoreEditorCommand=function(e,t){e.context.model.pushStackElement(),e.setStates(t.source,3,[fc.selectAll(e.context,e.getPrimaryCursor())])},t}(Pc))),e.SetSelection=Mr(new(function(e){function t(){return e.call(this,{id:"setSelection",precondition:void 0})||this}return Ac(t,e),t.prototype.runCoreEditorCommand=function(e,t){e.context.model.pushStackElement(),e.setStates(t.source,3,[Zu.fromModelSelection(t.selection)])},t}(Pc)))}(Dc||(Dc={})),Nc=Tc||(Tc={}),Oc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ac(t,e),t.prototype.runEditorCommand=function(e,t,n){var r=t._getCursors();r&&this.runCoreEditingCommand(t,r,n||{})},t}(kr),Nc.CoreEditingCommand=Oc,Nc.LineBreakInsert=Mr(new(function(e){function t(){return e.call(this,{id:"lineBreakInsert",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:0,mac:{primary:301}}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,vc.lineBreakInsert(t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection}))))},t}(Oc))),Nc.Outdent=Mr(new(function(e){function t(){return e.call(this,{id:"outdent",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:En.and(wc.editorTextFocus,wc.tabDoesNotMoveFocus),primary:1026}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,vc.outdent(t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection})))),e.pushUndoStop()},t}(Oc))),Nc.Tab=Mr(new(function(e){function t(){return e.call(this,{id:"tab",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:En.and(wc.editorTextFocus,wc.tabDoesNotMoveFocus),primary:2}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){e.pushUndoStop(),e.executeCommands(this.id,vc.tab(t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection})))),e.pushUndoStop()},t}(Oc))),Nc.DeleteLeft=Mr(new(function(e){function t(){return e.call(this,{id:"deleteLeft",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){var r=ac.deleteLeft(t.getPrevEditOperationType(),t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection}))),i=r[0],o=r[1];i&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)},t}(Oc))),Nc.DeleteRight=Mr(new(function(e){function t(){return e.call(this,{id:"deleteRight",precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})||this}return Ac(t,e),t.prototype.runCoreEditingCommand=function(e,t,n){var r=ac.deleteRight(t.getPrevEditOperationType(),t.context.config,t.context.model,t.getAll().map((function(e){return e.modelState.selection}))),i=r[0],o=r[1];i&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)},t}(Oc)));var Fc=function(e){function t(t){var n=e.call(this,t)||this;return n._editorHandler=t.editorHandler,n._inputHandler=t.inputHandler,n}return Ac(t,e),t.prototype.runCommand=function(e,t){var n=e.get(mt).getFocusedCodeEditor();if(n&&n.hasTextFocus())return this._runEditorHandler(e,n,t);var r=document.activeElement;if(!(r&&["input","textarea"].indexOf(r.tagName.toLowerCase())>=0)){var i=e.get(mt).getActiveCodeEditor();return i?(i.focus(),this._runEditorHandler(e,i,t)):void 0}document.execCommand(this._inputHandler)},t.prototype._runEditorHandler=function(e,t,n){var r=this._editorHandler;"string"==typeof r?t.trigger("keyboard",r,n):((n=n||{}).source="keyboard",r.runEditorCommand(e,t,n))},t}(xr),Yc=function(e){function t(t,n,r){var i=e.call(this,{id:t,precondition:void 0,description:r})||this;return i._handlerId=n,i}return Ac(t,e),t.prototype.runCommand=function(e,t){var n=e.get(mt).getFocusedCodeEditor();n&&n.trigger("keyboard",this._handlerId,t)},t}(xr);function jc(e,t){Rc(new Yc("default:"+e,e)),Rc(new Yc(e,e,t))}Rc(new Fc({editorHandler:Dc.SelectAll,inputHandler:"selectAll",id:"editor.action.selectAll",precondition:wc.textInputFocus,kbOpts:{weight:Ic,kbExpr:null,primary:2079},menubarOpts:{menuId:22,group:"1_basic",title:we({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1}})),Rc(new Fc({editorHandler:xc.Undo,inputHandler:"undo",id:xc.Undo,precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:2104},menubarOpts:{menuId:14,group:"1_do",title:we({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1}})),Rc(new Yc("default:"+xc.Undo,xc.Undo)),Rc(new Fc({editorHandler:xc.Redo,inputHandler:"redo",id:xc.Redo,precondition:wc.writable,kbOpts:{weight:Ic,kbExpr:wc.textInputFocus,primary:2103,secondary:[3128],mac:{primary:3128}},menubarOpts:{menuId:14,group:"1_do",title:we({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2}})),Rc(new Yc("default:"+xc.Redo,xc.Redo)),jc(xc.Type,{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),jc(xc.ReplacePreviousChar),jc(xc.CompositionStart),jc(xc.CompositionEnd),jc(xc.Paste),jc(xc.Cut);var Bc="base.contributions.json";var Hc=new(function(){function e(){this._onDidChangeSchema=new Ht,this.schemasById={}}return e.prototype.registerSchema=function(e,t){var n;this.schemasById[(n=e,n.length>0&&"#"===n.charAt(n.length-1)?n.substring(0,n.length-1):n)]=t,this._onDidChangeSchema.fire(e)},e.prototype.notifySchemaChanged=function(e){this._onDidChangeSchema.fire(e)},e}());yr.add(Bc,Hc);var Wc="base.contributions.colors",Vc=new(function(){function e(){this._onDidChangeSchema=new Ht,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}return e.prototype.registerColor=function(e,t,n,r,i){void 0===r&&(r=!1);var o={id:e,description:n,defaults:t,needsTransparency:r,deprecationMessage:i};this.colorsById[e]=o;var s={type:"string",description:n,format:"color-hex",default:"#ff0000"};return i&&(s.deprecationMessage=i),this.colorSchema.properties[e]=s,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(n),this._onDidChangeSchema.fire(),e},e.prototype.resolveDefaultColor=function(e,t){var n=this.colorsById[e];if(n&&n.defaults)return Sd(n.defaults[t.type],t)},e.prototype.getColorSchema=function(){return this.colorSchema},e.prototype.toString=function(){var e=this;return Object.keys(this.colorsById).sort((function(e,t){var n=-1===e.indexOf(".")?0:1,r=-1===t.indexOf(".")?0:1;return n!==r?n-r:e.localeCompare(t)})).map((function(t){return"- `"+t+"`: "+e.colorsById[t].description})).join("\n")},e}());function zc(e,t,n,r,i){return Vc.registerColor(e,t,n,r,i)}yr.add(Wc,Vc);var Uc,qc,Kc=zc("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},we("foreground","Overall foreground color. This color is only used if not overridden by a component.")),Gc=zc("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},we("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),$c=zc("focusBorder",{dark:xu.fromHex("#0E639C").transparent(.8),light:xu.fromHex("#007ACC").transparent(.4),hc:"#F38518"},we("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Zc=zc("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},we("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Jc=zc("contrastActiveBorder",{light:null,dark:null,hc:$c},we("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),Xc=(zc("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},we("textLinkForeground","Foreground color for links in text.")),zc("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:xu.black},we("textCodeBlockBackground","Background color for code blocks in text.")),zc("widget.shadow",{dark:"#000000",light:"#A8A8A8",hc:null},we("widgetShadow","Shadow color of widgets such as find/replace inside the editor."))),Qc=zc("input.background",{dark:"#3C3C3C",light:xu.white,hc:xu.black},we("inputBoxBackground","Input box background.")),el=zc("input.foreground",{dark:Kc,light:Kc,hc:Kc},we("inputBoxForeground","Input box foreground.")),tl=zc("input.border",{dark:null,light:null,hc:Zc},we("inputBoxBorder","Input box border.")),nl=zc("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:Zc},we("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),rl=zc("inputOption.activeBackground",{dark:wd($c,.5),light:wd($c,.3),hc:null},we("inputOption.activeBackground","Background color of activated options in input fields.")),il=zc("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:xu.black},we("inputValidationInfoBackground","Input validation background color for information severity.")),ol=zc("inputValidation.infoForeground",{dark:null,light:null,hc:null},we("inputValidationInfoForeground","Input validation foreground color for information severity.")),sl=zc("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:Zc},we("inputValidationInfoBorder","Input validation border color for information severity.")),al=zc("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:xu.black},we("inputValidationWarningBackground","Input validation background color for warning severity.")),ul=zc("inputValidation.warningForeground",{dark:null,light:null,hc:null},we("inputValidationWarningForeground","Input validation foreground color for warning severity.")),cl=zc("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:Zc},we("inputValidationWarningBorder","Input validation border color for warning severity.")),ll=zc("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:xu.black},we("inputValidationErrorBackground","Input validation background color for error severity.")),dl=zc("inputValidation.errorForeground",{dark:null,light:null,hc:null},we("inputValidationErrorForeground","Input validation foreground color for error severity.")),hl=zc("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:Zc},we("inputValidationErrorBorder","Input validation border color for error severity.")),fl=zc("dropdown.background",{dark:"#3C3C3C",light:xu.white,hc:xu.black},we("dropdownBackground","Dropdown background.")),pl=zc("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:xu.white},we("dropdownForeground","Dropdown foreground.")),gl=zc("list.focusBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},we("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),ml=zc("list.focusForeground",{dark:null,light:null,hc:null},we("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_l=zc("list.activeSelectionBackground",{dark:"#094771",light:"#0074E8",hc:null},we("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),yl=zc("list.activeSelectionForeground",{dark:xu.white,light:xu.white,hc:null},we("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),vl=zc("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},we("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),bl=zc("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},we("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),wl=zc("list.inactiveFocusBackground",{dark:null,light:null,hc:null},we("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Cl=zc("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},we("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Sl=zc("list.hoverForeground",{dark:null,light:null,hc:null},we("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),xl=zc("list.dropBackground",{dark:gl,light:gl,hc:null},we("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),kl=(zc("list.highlightForeground",{dark:"#0097fb",light:"#0066BF",hc:$c},we("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),zc("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:xu.black},we("listFilterWidgetBackground","Background color of the type filter widget in lists and trees."))),Ll=zc("listFilterWidget.outline",{dark:xu.transparent,light:xu.transparent,hc:"#f38518"},we("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Ml=zc("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:Zc},we("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),El=zc("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},we("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Dl=(zc("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:xu.white},we("pickerGroupForeground","Quick picker color for grouping labels.")),zc("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:xu.white},we("pickerGroupBorder","Quick picker color for grouping borders.")),zc("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:xu.black},we("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),zc("badge.foreground",{dark:xu.white,light:"#333",hc:xu.white},we("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),zc("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},we("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled."))),Tl=zc("scrollbarSlider.background",{dark:xu.fromHex("#797979").transparent(.4),light:xu.fromHex("#646464").transparent(.4),hc:wd(Zc,.6)},we("scrollbarSliderBackground","Scrollbar slider background color.")),Nl=zc("scrollbarSlider.hoverBackground",{dark:xu.fromHex("#646464").transparent(.7),light:xu.fromHex("#646464").transparent(.7),hc:wd(Zc,.8)},we("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),Ol=zc("scrollbarSlider.activeBackground",{dark:xu.fromHex("#BFBFBF").transparent(.4),light:xu.fromHex("#000000").transparent(.6),hc:Zc},we("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),Al=(zc("progressBar.background",{dark:xu.fromHex("#0E70C0"),light:xu.fromHex("#0E70C0"),hc:Zc},we("progressBarBackground","Background color of the progress bar that can show for long running operations.")),zc("menu.border",{dark:null,light:null,hc:Zc},we("menuBorder","Border color of menus."))),Il=zc("menu.foreground",{dark:pl,light:Kc,hc:pl},we("menuForeground","Foreground color of menu items.")),Pl=zc("menu.background",{dark:fl,light:fl,hc:fl},we("menuBackground","Background color of menu items.")),Rl=zc("menu.selectionForeground",{dark:yl,light:yl,hc:yl},we("menuSelectionForeground","Foreground color of the selected menu item in menus.")),Fl=zc("menu.selectionBackground",{dark:_l,light:_l,hc:_l},we("menuSelectionBackground","Background color of the selected menu item in menus.")),Yl=zc("menu.selectionBorder",{dark:null,light:null,hc:Jc},we("menuSelectionBorder","Border color of the selected menu item in menus.")),jl=zc("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:Zc},we("menuSeparatorBackground","Color of a separator menu item in menus.")),Bl=zc("editorError.foreground",{dark:"#F48771",light:"#E51400",hc:null},we("editorError.foreground","Foreground color of error squigglies in the editor.")),Hl=zc("editorError.border",{dark:null,light:null,hc:xu.fromHex("#E47777").transparent(.8)},we("errorBorder","Border color of error boxes in the editor.")),Wl=zc("editorWarning.foreground",{dark:"#CCA700",light:"#E9A700",hc:null},we("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Vl=zc("editorWarning.border",{dark:null,light:null,hc:xu.fromHex("#FFCC00").transparent(.8)},we("warningBorder","Border color of warning boxes in the editor.")),zl=zc("editorInfo.foreground",{dark:"#75BEFF",light:"#75BEFF",hc:null},we("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Ul=zc("editorInfo.border",{dark:null,light:null,hc:xu.fromHex("#75BEFF").transparent(.8)},we("infoBorder","Border color of info boxes in the editor.")),ql=zc("editorHint.foreground",{dark:xu.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},we("editorHint.foreground","Foreground color of hint squigglies in the editor.")),Kl=zc("editorHint.border",{dark:null,light:null,hc:xu.fromHex("#eeeeee").transparent(.8)},we("hintBorder","Border color of hint boxes in the editor.")),Gl=zc("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:xu.black},we("editorBackground","Editor background color.")),$l=zc("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:xu.white},we("editorForeground","Editor default foreground color.")),Zl=zc("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},we("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Jl=zc("editorWidget.foreground",{dark:Kc,light:Kc,hc:Kc},we("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Xl=zc("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:Zc},we("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),Ql=zc("editorWidget.resizeBorder",{light:null,dark:null,hc:null},we("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),ed=zc("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},we("editorSelectionBackground","Color of the editor selection.")),td=zc("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},we("editorSelectionForeground","Color of the selected text for high contrast.")),nd=zc("editor.inactiveSelectionBackground",{light:wd(ed,.5),dark:wd(ed,.5),hc:wd(ed,.5)},we("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),rd=zc("editor.selectionHighlightBackground",{light:Cd(ed,Gl,.3,.6),dark:Cd(ed,Gl,.3,.6),hc:null},we("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),id=(zc("editor.selectionHighlightBorder",{light:null,dark:null,hc:Jc},we("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),zc("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},we("editorFindMatch","Color of the current search match."))),od=zc("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},we("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),sd=zc("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},we("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),ad=zc("editor.findMatchBorder",{light:null,dark:null,hc:Jc},we("editorFindMatchBorder","Border color of the current search match.")),ud=zc("editor.findMatchHighlightBorder",{light:null,dark:null,hc:Jc},we("findMatchHighlightBorder","Border color of the other search matches.")),cd=zc("editor.findRangeHighlightBorder",{dark:null,light:null,hc:wd(Jc,.4)},we("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),ld=(zc("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},we("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),zc("editorHoverWidget.background",{light:Zl,dark:Zl,hc:Zl},we("hoverBackground","Background color of the editor hover."))),dd=(zc("editorHoverWidget.border",{light:Xl,dark:Xl,hc:Xl},we("hoverBorder","Border color of the editor hover.")),zc("editorHoverWidget.statusBarBackground",{dark:(Uc=ld,qc=.2,function(e){var t=Sd(Uc,e);if(t)return t.lighten(qc)}),light:bd(ld,.05),hc:Zl},we("statusBarBackground","Background color of the editor hover status bar.")),zc("editorLink.activeForeground",{dark:"#4E94CE",light:xu.blue,hc:xu.cyan},we("activeLinkForeground","Color of active links.")),new xu(new wu(155,185,85,.2))),hd=new xu(new wu(255,0,0,.2)),fd=zc("diffEditor.insertedTextBackground",{dark:dd,light:dd,hc:null},we("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),pd=zc("diffEditor.removedTextBackground",{dark:hd,light:hd,hc:null},we("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),gd=zc("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},we("diffEditorInsertedOutline","Outline color for the text that got inserted.")),md=zc("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},we("diffEditorRemovedOutline","Outline color for text that got removed.")),_d=zc("diffEditor.border",{dark:null,light:null,hc:Zc},we("diffEditorBorder","Border color between the two text editors.")),yd=(zc("editor.snippetTabstopHighlightBackground",{dark:new xu(new wu(124,124,124,.3)),light:new xu(new wu(10,50,100,.2)),hc:new xu(new wu(124,124,124,.3))},we("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),zc("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},we("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),zc("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},we("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),zc("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new xu(new wu(10,50,100,.5)),hc:"#525252"},we("snippetFinalTabstopHighlightBorder","Highlight border color of the final stabstop of a snippet.")),zc("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},we("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0)),vd=(zc("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},we("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),zc("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},we("minimapFindMatchHighlight","Minimap marker color for find matches."),!0));function bd(e,t){return function(n){var r=Sd(e,n);if(r)return r.darken(t)}}function wd(e,t){return function(n){var r=Sd(e,n);if(r)return r.transparent(t)}}function Cd(e,t,n,r){return function(i){var o=Sd(e,i);if(o){var s=Sd(t,i);return s?o.isDarkerThan(s)?xu.getLighterColor(o,s,n).transparent(r):xu.getDarkerColor(o,s,n).transparent(r):o.transparent(n*r)}}}function Sd(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?xu.fromHex(e):t.getColor(e):e instanceof xu?e:"function"==typeof e?e(t):void 0}var xd=yr.as(Bc);xd.registerSchema("vscode://schemas/workbench-colors",Vc.getColorSchema());var kd=new ks((function(){return xd.notifySchemaChanged("vscode://schemas/workbench-colors")}),200);Vc.onDidChangeSchema((function(){kd.isScheduled()||kd.schedule()}));var Ld=pt("themeService");function Md(e){return{id:e}}var Ed="dark",Dd="hc";function Td(e){switch(e){case Ed:return"vs-dark";case Dd:return"hc-black";default:return"vs"}}var Nd="base.contributions.theming",Od=new(function(){function e(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Ht}return e.prototype.onThemeChange=function(e){var t=this;return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Mt((function(){var n=t.themingParticipants.indexOf(e);t.themingParticipants.splice(n,1)}))},e.prototype.getThemingParticipants=function(){return this.themingParticipants},e}());function Ad(e){return Od.onThemeChange(e)}yr.add(Nd,Od);var Id=function(){function e(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationId=null,this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}return e.prototype.dispose=function(){this._editor.deltaDecorations(this._allDecorations(),[]),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationId=null,this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null},e.prototype.reset=function(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationId=null,this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null},e.prototype.getCount=function(){return this._decorations.length},e.prototype.getFindScope=function(){return this._findScopeDecorationId?this._editor.getModel().getDecorationRange(this._findScopeDecorationId):null},e.prototype.getStartPosition=function(){return this._startPosition},e.prototype.setStartPosition=function(e){this._startPosition=e,this.setCurrentFindMatch(null)},e.prototype._getDecorationIndex=function(e){var t=this._decorations.indexOf(e);return t>=0?t+1:1},e.prototype.getCurrentMatchesPosition=function(t){for(var n=0,r=this._editor.getModel().getDecorationsInRange(t);n1e3){o=e._FIND_MATCH_NO_OVERVIEW_DECORATION;for(var a=r._editor.getModel().getLineCount(),u=r._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/u)),l=t[0].range.startLineNumber,d=t[0].range.endLineNumber,h=1,f=t.length;h=p.startLineNumber?p.endLineNumber>d&&(d=p.endLineNumber):(s.push({range:new Tr(l,1,d,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),l=p.startLineNumber,d=p.endLineNumber)}s.push({range:new Tr(l,1,d,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}var g=new Array(t.length);for(h=0,f=t.length;h=0;t--){var n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(r&&!(r.endLineNumber>e.lineNumber)){if(r.endLineNumbere.column))return r}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])},e.prototype.matchAfterPosition=function(e){if(0===this._decorations.length)return null;for(var t=0,n=this._decorations.length;te.lineNumber)return i;if(!(i.startColumn0){for(var n=[],r=0;r0;){if(e0},e.prototype._cannotFind=function(){if(!this._hasMatches()){var e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1},e.prototype._setCurrentFindMatch=function(e){var t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)},e.prototype._prevSearchPosition=function(e){var t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),n=e.lineNumber,r=e.column,i=this._editor.getModel();return t||1===r?(1===n?n=i.getLineCount():n--,r=i.getLineMaxColumn(n)):r--,new _t(n,r)},e.prototype._moveToPrevMatch=function(t,n){if(void 0===n&&(n=!1),this._decorations.getCount()<19999){var r=this._decorations.matchBeforePosition(t);return r&&r.isEmpty()&&r.getStartPosition().equals(t)&&(t=this._prevSearchPosition(t),r=this._decorations.matchBeforePosition(t)),void(r&&this._setCurrentFindMatch(r))}if(!this._cannotFind()){var i=this._decorations.getFindScope(),o=e._getSearchRange(this._editor.getModel(),i);o.getEndPosition().isBefore(t)&&(t=o.getEndPosition()),t.isBefore(o.getStartPosition())&&(t=o.getEndPosition());var s=t.lineNumber,a=t.column,u=this._editor.getModel(),c=new _t(s,a),l=u.findPreviousMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1);if(l&&l.range.isEmpty()&&l.range.getStartPosition().equals(c)&&(c=this._prevSearchPosition(c),l=u.findPreviousMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1)),l)return n||o.containsRange(l.range)?void this._setCurrentFindMatch(l.range):this._moveToPrevMatch(l.range.getStartPosition(),!0)}},e.prototype.moveToPrevMatch=function(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())},e.prototype._nextSearchPosition=function(e){var t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),n=e.lineNumber,r=e.column,i=this._editor.getModel();return t||r===i.getLineMaxColumn(n)?(n===i.getLineCount()?n=1:n++,r=1):r++,new _t(n,r)},e.prototype._moveToNextMatch=function(e){if(this._decorations.getCount()<19999){var t=this._decorations.matchAfterPosition(e);return t&&t.isEmpty()&&t.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),t=this._decorations.matchAfterPosition(e)),void(t&&this._setCurrentFindMatch(t))}var n=this._getNextMatch(e,!1,!0);n&&this._setCurrentFindMatch(n.range)},e.prototype._getNextMatch=function(t,n,r,i){if(void 0===i&&(i=!1),this._cannotFind())return null;var o=this._decorations.getFindScope(),s=e._getSearchRange(this._editor.getModel(),o);s.getEndPosition().isBefore(t)&&(t=s.getStartPosition()),t.isBefore(s.getStartPosition())&&(t=s.getStartPosition());var a=t.lineNumber,u=t.column,c=this._editor.getModel(),l=new _t(a,u),d=c.findNextMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,n);return r&&d&&d.range.isEmpty()&&d.range.getStartPosition().equals(l)&&(l=this._nextSearchPosition(l),d=c.findNextMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,n)),d?i||s.containsRange(d.range)?d:this._getNextMatch(d.range.getEndPosition(),n,r,!0):null},e.prototype.moveToNextMatch=function(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())},e.prototype._getReplacePattern=function(){return this._state.isRegex?function(e){if(!e||0===e.length)return new jd(null);for(var t=new Hd(e),n=0,r=e.length;n=r)break;if(36===(a=e.charCodeAt(n))){t.emitUnchanged(n-1),t.emitStatic("$",n+1);continue}if(48===a||38===a){t.emitUnchanged(n-1),t.emitMatchIndex(0,n+1);continue}if(49<=a&&a<=57){var o=a-48;if(n+1=r)break;var a;switch(a=e.charCodeAt(n)){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic("\n",n+1);break;case 116:t.emitUnchanged(n-1),t.emitStatic("\t",n+1)}}}return t.finalize()}(this._state.replaceString):jd.fromStaticValue(this._state.replaceString)},e.prototype.replace=function(){if(this._hasMatches()){var e=this._getReplacePattern(),t=this._editor.getSelection(),n=this._getNextMatch(t.getStartPosition(),!0,!1);if(n)if(t.equalsRange(n.range)){var r=e.buildReplaceString(n.matches,this._state.preserveCase),i=new tc(t,r);this._executeEditorCommand("replace",i),this._decorations.setStartPosition(new _t(t.startLineNumber,t.startColumn+r.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(n.range)}},e.prototype._findMatches=function(t,n,r){var i=e._getSearchRange(this._editor.getModel(),t);return this._editor.getModel().findMatches(this._state.searchString,i,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null,n,r)},e.prototype.replaceAll=function(){if(this._hasMatches()){var e=this._decorations.getFindScope();null===e&&this._state.matchesCount>=19999?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}},e.prototype._largeReplaceAll=function(){var e=new vo(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getConfiguration().wordSeparators:null).parseSearchRequest();if(e){var t=e.regex;if(!t.multiline){var n="m";t.ignoreCase&&(n+="i"),t.global&&(n+="g"),t=new RegExp(t.source,n)}var r,i=this._editor.getModel(),o=i.getValue(1),s=i.getFullModelRange(),a=this._getReplacePattern(),u=this._state.preserveCase;r=a.hasReplacementPatterns||u?o.replace(t,(function(){return a.buildReplaceString(arguments,u)})):o.replace(t,a.buildReplaceString(null,u));var c=new ic(s,r,this._editor.getSelection());this._executeEditorCommand("replaceAll",c)}},e.prototype._regularReplaceAll=function(e){for(var t=this._getReplacePattern(),n=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),r=[],i=0,o=n.length;i=0,th=Qd.indexOf("Edge/")>=0,nh=eh||th,rh=Qd.indexOf("Firefox")>=0,ih=Qd.indexOf("AppleWebKit")>=0,oh=Qd.indexOf("Chrome")>=0,sh=!oh&&Qd.indexOf("Safari")>=0,ah=!oh&&!sh&&ih,uh=Qd.indexOf("iPad")>=0,ch=th&&Qd.indexOf("WebView/")>=0;var lh=function(e,t,n){var r=function(e){return i.fire(e)},i=new Ht({onFirstListenerAdd:function(){e.addEventListener(t,r,n)},onLastListenerRemove:function(){e.removeEventListener(t,r,n)}});return i.event};var dh=new Array(230),hh=new Array(112);!function(){for(var e=0;e0;)Kh.sort(Jh.sort),Kh.shift().execute();$h=!1},zh=function(e,t){void 0===t&&(t=0);var n,r=new Jh(e,t);return qh.push(r),Gh||(Gh=!0,n=Zh,Uh||(Uh=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||function(e){return setTimeout((function(){return e((new Date).getTime())}),0)}),Uh.call(self,n)),r},Vh=function(e,t){if($h){var n=new Jh(e,t);return Kh.push(n),n}return zh(e,t)};var Xh=16,Qh=function(e,t){return t},ef=function(e){function t(t,n,r,i,o){void 0===i&&(i=Qh),void 0===o&&(o=Xh);var s=e.call(this)||this,a=null,u=0,c=s._register(new Ss),l=function(){u=(new Date).getTime(),r(a),a=null};return s._register(Bh(t,n,(function(e){a=i(a,e);var t=(new Date).getTime()-u;t>=o?(c.cancel(),l()):c.setIfNotSet(l,o-t)}))),s}return Lh(t,e),t}(Dt);function tf(e,t,n,r,i){return new ef(e,t,n,r,i)}function nf(e){return document.defaultView.getComputedStyle(e,null)}var rf=function(){function e(){}return e.convertToPixels=function(e,t){return parseFloat(t)||0},e.getDimension=function(t,n,r){var i=nf(t),o="0";return i&&(o=i.getPropertyValue?i.getPropertyValue(n):i.getAttribute(r)),e.convertToPixels(t,o)},e.getBorderLeftWidth=function(t){return e.getDimension(t,"border-left-width","borderLeftWidth")},e.getBorderRightWidth=function(t){return e.getDimension(t,"border-right-width","borderRightWidth")},e.getBorderTopWidth=function(t){return e.getDimension(t,"border-top-width","borderTopWidth")},e.getBorderBottomWidth=function(t){return e.getDimension(t,"border-bottom-width","borderBottomWidth")},e.getPaddingLeft=function(t){return e.getDimension(t,"padding-left","paddingLeft")},e.getPaddingRight=function(t){return e.getDimension(t,"padding-right","paddingRight")},e.getPaddingTop=function(t){return e.getDimension(t,"padding-top","paddingTop")},e.getPaddingBottom=function(t){return e.getDimension(t,"padding-bottom","paddingBottom")},e.getMarginLeft=function(t){return e.getDimension(t,"margin-left","marginLeft")},e.getMarginTop=function(t){return e.getDimension(t,"margin-top","marginTop")},e.getMarginRight=function(t){return e.getDimension(t,"margin-right","marginRight")},e.getMarginBottom=function(t){return e.getDimension(t,"margin-bottom","marginBottom")},e}();function of(e){for(var t=e.offsetParent,n=e.offsetTop,r=e.offsetLeft;null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement;){n-=e.scrollTop;var i=nf(e);i&&(r-="rtl"!==i.direction?e.scrollLeft:-e.scrollLeft),e===t&&(r+=rf.getBorderLeftWidth(e),n+=rf.getBorderTopWidth(e),n+=e.offsetTop,r+=e.offsetLeft,t=e.offsetParent)}return{left:r,top:n}}function sf(e){var t=e.getBoundingClientRect();return{left:t.left+af.scrollX,top:t.top+af.scrollY,width:t.width,height:t.height}}var af=new(function(){function e(){}return Object.defineProperty(e.prototype,"scrollX",{get:function(){return"number"==typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollY",{get:function(){return"number"==typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop},enumerable:!0,configurable:!0}),e}());function uf(e){var t=rf.getMarginLeft(e)+rf.getMarginRight(e);return e.offsetWidth+t}function cf(e){var t=rf.getBorderLeftWidth(e)+rf.getBorderRightWidth(e),n=rf.getPaddingLeft(e)+rf.getPaddingRight(e);return e.offsetWidth-t-n}function lf(e){var t=rf.getMarginTop(e)+rf.getMarginBottom(e);return e.offsetHeight+t}function df(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function hf(e){void 0===e&&(e=document.getElementsByTagName("head")[0]);var t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}var ff=null;function pf(){return ff||(ff=hf()),ff}var gf={CLICK:"click",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:ih?"webkitAnimationStart":"animationstart",ANIMATION_END:ih?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:ih?"webkitAnimationIteration":"animationiteration"},mf={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}};var _f=function(e){function t(t){var n=e.call(this)||this;n._onDidFocus=n._register(new Ht),n.onDidFocus=n._onDidFocus.event,n._onDidBlur=n._register(new Ht),n.onDidBlur=n._onDidBlur.event;var r=df(document.activeElement,t),i=!1;return n._register(lh(t,gf.FOCUS,!0)((function(){i=!1,r||(r=!0,n._onDidFocus.fire())}))),n._register(lh(t,gf.BLUR,!0)((function(){r&&(i=!0,window.setTimeout((function(){i&&(i=!1,r=!1,n._onDidBlur.fire())}),0))}))),n}return Lh(t,e),t}(Dt);function yf(e){return new _f(e)}function vf(e){for(var t=[],n=1;nt&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,r.matchesPosition=!0,i=!0),this._matchesCount!==t&&(this._matchesCount=t,r.matchesCount=!0,i=!0),void 0!==n&&(Tr.equalsRange(this._currentMatch,n)||(this._currentMatch=n,r.currentMatch=!0,i=!0)),i&&this._onFindReplaceStateChange.fire(r)},e.prototype.change=function(e,t,n){void 0===n&&(n=!0);var r={moveCursor:t,updateHistory:n,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1},i=!1,o=this.isRegex,s=this.wholeWord,a=this.matchCase,u=this.preserveCase;void 0!==e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,r.searchString=!0,i=!0),void 0!==e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,r.replaceString=!0,i=!0),void 0!==e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,r.isRevealed=!0,i=!0),void 0!==e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,r.isReplaceRevealed=!0,i=!0),void 0!==e.isRegex&&(this._isRegex=e.isRegex),void 0!==e.wholeWord&&(this._wholeWord=e.wholeWord),void 0!==e.matchCase&&(this._matchCase=e.matchCase),void 0!==e.preserveCase&&(this._preserveCase=e.preserveCase),void 0!==e.searchScope&&(Tr.equalsRange(this._searchScope,e.searchScope)||(this._searchScope=e.searchScope,r.searchScope=!0,i=!0)),this._isRegexOverride=void 0!==e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride=void 0!==e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride=void 0!==e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride=void 0!==e.preserveCaseOverride?e.preserveCaseOverride:0,o!==this.isRegex&&(i=!0,r.isRegex=!0),s!==this.wholeWord&&(i=!0,r.wholeWord=!0),a!==this.matchCase&&(i=!0,r.matchCase=!0),u!==this.preserveCase&&(i=!0,r.preserveCase=!0),i&&this._onFindReplaceStateChange.fire(r)},e}();n(380),n(381);function $f(e,t){Qf(qf,e,t)}function Zf(e,t){Ge.d?$f(e,t):Qf(Kf,e,t)}var Jf=0,Xf=void 0;function Qf(e,t,n){if(Uf){if(!n)switch(Xf===t?Jf++:(Xf=t,Jf=0),Jf){case 0:break;case 1:t=we("repeated","{0} (occurred again)",t);break;default:t=we("repeatedNtimes","{0} (occurred {1} times)",t,Jf)}Eh(e),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}}n(382);function ep(e,t,n){var r=null,i=null;if("function"==typeof n.value?(r="value",0!==(i=n.value).length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof n.get&&(r="get",i=n.get),!i)throw new Error("not supported");var o="$memoize$"+t;n[r]=function(){for(var e=[],t=0;t=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};!function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}(tp||(tp={}));var ip=function(e){function t(){var t=e.call(this)||this;return t.dispatched=!1,t.activeTouches={},t.handle=null,t.targets=[],t._register(Bh(document,"touchstart",(function(e){return t.onTouchStart(e)}))),t._register(Bh(document,"touchend",(function(e){return t.onTouchEnd(e)}))),t._register(Bh(document,"touchmove",(function(e){return t.onTouchMove(e)}))),t}return np(t,e),t.addTarget=function(e){t.isTouchDevice()&&(t.INSTANCE||(t.INSTANCE=new t),t.INSTANCE.targets.push(e))},t.isTouchDevice=function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0},t.prototype.dispose=function(){this.handle&&(this.handle.dispose(),this.handle=null),e.prototype.dispose.call(this)},t.prototype.onTouchStart=function(e){var t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(var n=0,r=e.targetTouches.length;n=t.HOLD_DELAY&&Math.abs(u.initialPageX-Ar(u.rollingPageX))<30&&Math.abs(u.initialPageY-Ar(u.rollingPageY))<30){var l;(l=o.newGestureEvent(tp.Contextmenu,u.initialTarget)).pageX=Ar(u.rollingPageX),l.pageY=Ar(u.rollingPageY),o.dispatchEvent(l)}else if(1===r){var d=Ar(u.rollingPageX),h=Ar(u.rollingPageY),f=Ar(u.rollingTimestamps)-u.rollingTimestamps[0],p=d-u.rollingPageX[0],g=h-u.rollingPageY[0],m=o.targets.filter((function(e){return u.initialTarget instanceof Node&&e.contains(u.initialTarget)}));o.inertia(m,n,Math.abs(p)/f,p>0?1:-1,d,Math.abs(g)/f,g>0?1:-1,h)}o.dispatchEvent(o.newGestureEvent(tp.End,u.initialTarget)),delete o.activeTouches[a.identifier]},o=this,s=0,a=e.changedTouches.length;s0&&(p=!1,h=i*r*d),s>0&&(p=!1,f=a*s*d);var g=c.newGestureEvent(tp.Change);g.translationX=h,g.translationY=f,e.forEach((function(e){return e.dispatchEvent(g)})),p||c.inertia(e,l,r,i,o+h,s,a,u+f)}))},t.prototype.onTouchMove=function(e){for(var t=Date.now(),n=0,r=e.changedTouches.length;n3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(i.pageX),o.rollingPageY.push(i.pageY),o.rollingTimestamps.push(t)}else console.warn("end of an UNKNOWN touch",i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)},t.SCROLL_FRICTION=-.005,t.HOLD_DELAY=700,rp([ep],t,"isTouchDevice",null),t}(Dt),op=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sp=!1,ap=function(e){function t(t,n,r){void 0===r&&(r={});var i=e.call(this)||this;return i._state=3,i._onDidEnablementChange=i._register(new Ht),i.onDidEnablementChange=i._onDidEnablementChange.event,i._onDidStart=i._register(new Ht),i.onDidStart=i._onDidStart.event,i._onDidChange=i._register(new Ht),i.onDidChange=i._onDidChange.event,i._onDidReset=i._register(new Ht),i.onDidReset=i._onDidReset.event,i._onDidEnd=i._register(new Ht),i.onDidEnd=i._onDidEnd.event,i.linkedSash=void 0,i.orthogonalStartSashDisposables=i._register(new Et),i.orthogonalEndSashDisposables=i._register(new Et),i.el=vf(t,Sf(".monaco-sash")),Ge.d&&Ih(i.el,"mac"),i._register(lh(i.el,"mousedown")(i.onMouseDown,i)),i._register(lh(i.el,"dblclick")(i.onMouseDoubleClick,i)),ip.addTarget(i.el),i._register(lh(i.el,tp.Start)(i.onTouchStart,i)),uh&&Ih(i.el,"touch"),i.setOrientation(r.orientation||0),i.hidden=!1,i.layoutProvider=n,i.orthogonalStartSash=r.orthogonalStartSash,i.orthogonalEndSash=r.orthogonalEndSash,Yh(i.el,"debug",sp),i}return op(t,e),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){this._state!==e&&(Yh(this.el,"disabled",0===e),Yh(this.el,"minimum",1===e),Yh(this.el,"maximum",2===e),this._state=e,this._onDidEnablementChange.fire(e))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"orthogonalStartSash",{get:function(){return this._orthogonalStartSash},set:function(e){this.orthogonalStartSashDisposables.clear(),e?(this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange,this)),this.onOrthogonalStartSashEnablementChange(e.state)):this.onOrthogonalStartSashEnablementChange(0),this._orthogonalStartSash=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"orthogonalEndSash",{get:function(){return this._orthogonalEndSash},set:function(e){this.orthogonalEndSashDisposables.clear(),e?(this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange,this)),this.onOrthogonalEndSashEnablementChange(e.state)):this.onOrthogonalEndSashEnablementChange(0),this._orthogonalEndSash=e},enumerable:!0,configurable:!0}),t.prototype.setOrientation=function(e){this.orientation=e,1===this.orientation?(Ih(this.el,"horizontal"),Rh(this.el,"vertical")):(Rh(this.el,"horizontal"),Ih(this.el,"vertical")),this.layoutProvider&&this.layout()},t.prototype.onMouseDown=function(e){var t=this;mf.stop(e,!1);var n=!1;if(!e.__orthogonalSashEvent){var r=this.getOrthogonalSash(e);r&&(n=!0,e.__orthogonalSashEvent=!0,r.onMouseDown(e))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onMouseDown(e)),this.state){for(var i=Lf("iframe").concat(Lf("webview")),o=0,s=i;o=this.el.clientHeight-4)return this.orthogonalEndSash}else{if(e.offsetX<=4)return this.orthogonalStartSash;if(e.offsetX>=this.el.clientWidth-4)return this.orthogonalEndSash}},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.el&&this.el.parentElement&&this.el.parentElement.removeChild(this.el),this.el=null},t}(Dt);n(131),n(383);function up(e,t){void 0===t&&(t={});var n=cp(t);return function e(t,n,r){var i;if(2===n.type)i=document.createTextNode(n.content||"");else if(3===n.type)i=document.createElement("b");else if(4===n.type)i=document.createElement("i");else if(5===n.type&&r){var o=document.createElement("a");o.href="#",r.disposeables.add(Hh(o,"click",(function(e){r.callback(String(n.index),e)}))),i=o}else 7===n.type?i=document.createElement("br"):1===n.type&&(i=t);i&&t!==i&&t.appendChild(i);i&&Array.isArray(n.children)&&n.children.forEach((function(t){e(i,t,r)}))}(n,function(e){var t={type:1,children:[]},n=0,r=t,i=[],o=new lp(e);for(;!o.eos();){var s=o.next(),a="\\"===s&&0!==dp(o.peek());if(a&&(s=o.next()),a||0===dp(s)||s!==o.peek())if("\n"===s)2===r.type&&(r=i.pop()),r.children.push({type:7});else if(2!==r.type){var u={type:2,content:s};r.children.push(u),i.push(r),r=u}else r.content+=s;else{o.advance(),2===r.type&&(r=i.pop());var c=dp(s);if(r.type===c||5===r.type&&6===c)r=i.pop();else{var l={type:c,children:[]};5===c&&(l.index=n,n++),r.children.push(l),i.push(r),r=l}}}2===r.type&&(r=i.pop());i.length;return t}(e),t.actionHandler),n}function cp(e){var t=e.inline?"span":"div",n=document.createElement(t);return e.className&&(n.className=e.className),n}var lp=function(){function e(e){this.source=e,this.index=0}return e.prototype.eos=function(){return this.index>=this.source.length},e.prototype.next=function(){var e=this.peek();return this.advance(),e},e.prototype.peek=function(){return this.source[this.index]},e.prototype.advance=function(){this.index++},e}();function dp(e){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;default:return 0}}n(384);var hp=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fp=function(e){function t(t,n,r){var i=e.call(this)||this;return i.options=r,i._context=t||i,i._action=n,n instanceof Gt&&i._register(n.onDidChange((function(e){i.element&&i.handleActionChangeEvent(e)}))),i}return hp(t,e),t.prototype.handleActionChangeEvent=function(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()},Object.defineProperty(t.prototype,"actionRunner",{get:function(){return this._actionRunner},set:function(e){this._actionRunner=e},enumerable:!0,configurable:!0}),t.prototype.getAction=function(){return this._action},t.prototype.isEnabled=function(){return this._action.enabled},t.prototype.setActionContext=function(e){this._context=e},t.prototype.render=function(e){var t=this;this.element=e,ip.addTarget(e);var n=this.options&&this.options.draggable;n&&(e.draggable=!0),this._register(Bh(this.element,tp.Tap,(function(e){return t.onClick(e)}))),this._register(Bh(this.element,gf.MOUSE_DOWN,(function(e){n||mf.stop(e,!0),t._action.enabled&&0===e.button&&t.element&&Ih(t.element,"active")}))),this._register(Bh(this.element,gf.CLICK,(function(e){mf.stop(e,!0),t.options&&t.options.isMenu?t.onClick(e):Ge.h((function(){return t.onClick(e)}))}))),this._register(Bh(this.element,gf.DBLCLICK,(function(e){mf.stop(e,!0)}))),[gf.MOUSE_UP,gf.MOUSE_OUT].forEach((function(e){t._register(Bh(t.element,e,(function(e){mf.stop(e),Rh(t.element,"active")})))}))},t.prototype.onClick=function(e){var t;mf.stop(e,!0),Ee(this._context)?t=e:xe(t=this._context)&&(t.event=e),this._actionRunner.run(this._action,t)},t.prototype.focus=function(){this.element&&(this.element.focus(),Ih(this.element,"focused"))},t.prototype.blur=function(){this.element&&(this.element.blur(),Rh(this.element,"focused"))},t.prototype.updateEnabled=function(){},t.prototype.updateLabel=function(){},t.prototype.updateTooltip=function(){},t.prototype.updateClass=function(){},t.prototype.updateChecked=function(){},t.prototype.dispose=function(){this.element&&(Dh(this.element),this.element=void 0),e.prototype.dispose.call(this)},t}(Dt),pp=function(e){function t(n){var r=e.call(this,t.ID,n,n?"separator text":"separator")||this;return r.checked=!1,r.radio=!1,r.enabled=!1,r}return hp(t,e),t.ID="vs.actions.separator",t}(Gt),gp=function(e){function t(t,n,r){void 0===r&&(r={});var i=e.call(this,t,n,r)||this;return i.options=r,i.options.icon=void 0!==r.icon&&r.icon,i.options.label=void 0===r.label||r.label,i.cssClass="",i}return hp(t,e),t.prototype.render=function(t){e.prototype.render.call(this,t),this.element&&(this.label=vf(this.element,Sf("a.action-label"))),this._action.id===pp.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button"),this.options.label&&this.options.keybinding&&this.element&&(vf(this.element,Sf("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()},t.prototype.focus=function(){e.prototype.focus.call(this),this.label.focus()},t.prototype.updateLabel=function(){this.options.label&&(this.label.textContent=this.getAction().label)},t.prototype.updateTooltip=function(){var e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=we({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&(this.label.title=e)},t.prototype.updateClass=function(){this.cssClass&&Fh(this.label,this.cssClass),this.options.icon?(this.cssClass=this.getAction().class,Ih(this.label,"icon"),this.cssClass&&Ph(this.label,this.cssClass),this.updateEnabled()):Rh(this.label,"icon")},t.prototype.updateEnabled=function(){this.getAction().enabled?(this.label.removeAttribute("aria-disabled"),this.element&&Rh(this.element,"disabled"),Rh(this.label,"disabled"),this.label.tabIndex=0):(this.label.setAttribute("aria-disabled","true"),this.element&&Ih(this.element,"disabled"),Ih(this.label,"disabled"),kf(this.label))},t.prototype.updateChecked=function(){this.getAction().checked?Ih(this.label,"checked"):Rh(this.label,"checked")},t}(fp),mp={orientation:0,context:null,triggerKeys:{keys:[3,10],keyDown:!1}},_p=function(e){function t(t,n){void 0===n&&(n=mp);var r,i,o=e.call(this)||this;switch(o._onDidBlur=o._register(new Ht),o.onDidBlur=o._onDidBlur.event,o._onDidCancel=o._register(new Ht),o.onDidCancel=o._onDidCancel.event,o._onDidRun=o._register(new Ht),o.onDidRun=o._onDidRun.event,o._onDidBeforeRun=o._register(new Ht),o.onDidBeforeRun=o._onDidBeforeRun.event,o.options=n,o._context=n.context,o.options.triggerKeys||(o.options.triggerKeys=mp.triggerKeys),o.options.actionRunner?o._actionRunner=o.options.actionRunner:(o._actionRunner=new $t,o._register(o._actionRunner)),o._register(o._actionRunner.onDidRun((function(e){return o._onDidRun.fire(e)}))),o._register(o._actionRunner.onDidBeforeRun((function(e){return o._onDidBeforeRun.fire(e)}))),o.viewItems=[],o.focusedItem=void 0,o.domNode=document.createElement("div"),o.domNode.className="monaco-action-bar",!1!==n.animated&&Ih(o.domNode,"animated"),o.options.orientation){case 0:r=15,i=17;break;case 1:r=17,i=15,o.domNode.className+=" reverse";break;case 2:r=16,i=18,o.domNode.className+=" vertical";break;case 3:r=18,i=16,o.domNode.className+=" vertical reverse"}return o._register(Bh(o.domNode,gf.KEY_DOWN,(function(e){var t=new gh(e),n=!0;t.equals(r)?o.focusPrevious():t.equals(i)?o.focusNext():t.equals(9)?o.cancel():o.isTriggerKeyEvent(t)?o.options.triggerKeys&&o.options.triggerKeys.keyDown&&o.doTrigger(t):n=!1,n&&(t.preventDefault(),t.stopPropagation())}))),o._register(Bh(o.domNode,gf.KEY_UP,(function(e){var t=new gh(e);o.isTriggerKeyEvent(t)?(o.options.triggerKeys&&!o.options.triggerKeys.keyDown&&o.doTrigger(t),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&o.updateFocusedItem()}))),o.focusTracker=o._register(yf(o.domNode)),o._register(o.focusTracker.onDidBlur((function(){document.activeElement!==o.domNode&&df(document.activeElement,o.domNode)||(o._onDidBlur.fire(),o.focusedItem=void 0)}))),o._register(o.focusTracker.onDidFocus((function(){return o.updateFocusedItem()}))),o.actionsList=document.createElement("ul"),o.actionsList.className="actions-container",o.actionsList.setAttribute("role","toolbar"),o.options.ariaLabel&&o.actionsList.setAttribute("aria-label",o.options.ariaLabel),o.domNode.appendChild(o.actionsList),t.appendChild(o.domNode),o}return hp(t,e),t.prototype.isTriggerKeyEvent=function(e){var t=!1;return this.options.triggerKeys&&this.options.triggerKeys.keys.forEach((function(n){t=t||e.equals(n)})),t},t.prototype.updateFocusedItem=function(){for(var e=0;e=n.actionsList.children.length?(n.actionsList.appendChild(o),n.viewItems.push(r)):(n.actionsList.insertBefore(o,n.actionsList.children[i]),n.viewItems.splice(i,0,r),i++)}))},t.prototype.clear=function(){this.viewItems=kt(this.viewItems),Eh(this.actionsList)},t.prototype.isEmpty=function(){return 0===this.viewItems.length},t.prototype.focus=function(e){var t=!1,n=void 0;void 0===e?t=!0:"number"==typeof e?n=e:"boolean"==typeof e&&(t=e),t&&void 0===this.focusedItem?(this.focusedItem=this.viewItems.length-1,this.focusNext()):(void 0!==n&&(this.focusedItem=n),this.updateFocus())},t.prototype.focusNext=function(){void 0===this.focusedItem&&(this.focusedItem=this.viewItems.length-1);var e,t=this.focusedItem;do{this.focusedItem=(this.focusedItem+1)%this.viewItems.length,e=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&!e.isEnabled());this.focusedItem!==t||e.isEnabled()||(this.focusedItem=void 0),this.updateFocus()},t.prototype.focusPrevious=function(){void 0===this.focusedItem&&(this.focusedItem=0);var e,t=this.focusedItem;do{this.focusedItem=this.focusedItem-1,this.focusedItem<0&&(this.focusedItem=this.viewItems.length-1),e=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&!e.isEnabled());this.focusedItem!==t||e.isEnabled()||(this.focusedItem=void 0),this.updateFocus(!0)},t.prototype.updateFocus=function(e){void 0===this.focusedItem&&this.actionsList.focus();for(var t=0;tthis._limit&&this._initialize(e.slice(e.length-this._limit))},e.prototype._initialize=function(e){this._history=new Set;for(var t=0,n=e;t140)n._setDesiredScrollPositionNow(o.getScrollPosition());else{var a=n._sliderMousePosition(e)-r;n._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(a))}}),(function(){n.slider.toggleClassName("active",!1),n._host.onDragEnd(),t()})),this._host.onDragStart()},t.prototype._setDesiredScrollPositionNow=function(e){var t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)},t}(Nf),Tp=function(){function e(e,t,n){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=0,this._scrollSize=0,this._scrollPosition=0,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}return e.prototype.clone=function(){var t=new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize);return t.setVisibleSize(this._visibleSize),t.setScrollSize(this._scrollSize),t.setScrollPosition(this._scrollPosition),t},e.prototype.setVisibleSize=function(e){var t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)},e.prototype.setScrollSize=function(e){var t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)},e.prototype.setScrollPosition=function(e){var t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)},e._computeValues=function(e,t,n,r,i){var o=Math.max(0,n-e),s=Math.max(0,o-2*t),a=r>0&&r>n;if(!a)return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(s),computedSliderRatio:0,computedSliderPosition:0};var u=Math.round(Math.max(20,Math.floor(n*s/r))),c=(s-u)/(r-n),l=i*c;return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(u),computedSliderRatio:c,computedSliderPosition:Math.round(l)}},e.prototype._refreshComputedValues=function(){var t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition},e.prototype.getArrowSize=function(){return this._arrowSize},e.prototype.getScrollPosition=function(){return this._scrollPosition},e.prototype.getRectangleLargeSize=function(){return this._computedAvailableSize},e.prototype.getRectangleSmallSize=function(){return this._scrollbarSize},e.prototype.isNeeded=function(){return this._computedIsNeeded},e.prototype.getSliderSize=function(){return this._computedSliderSize},e.prototype.getSliderPosition=function(){return this._computedSliderPosition},e.prototype.getDesiredScrollPositionFromOffset=function(e){if(!this._computedIsNeeded)return 0;var t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)},e.prototype.getDesiredScrollPositionFromDelta=function(e){if(!this._computedIsNeeded)return 0;var t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)},e}(),Np=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Op=function(e){function t(t,n,r){var i=e.call(this,{lazyRender:n.lazyRender,host:r,scrollbarState:new Tp(n.horizontalHasArrows?n.arrowSize:0,2===n.horizontal?0:n.horizontalScrollbarSize,2===n.vertical?0:n.verticalScrollbarSize),visibility:n.horizontal,extraScrollbarClassName:"horizontal",scrollable:t})||this;if(n.horizontalHasArrows){var o=(n.arrowSize-xp)/2,s=(n.horizontalScrollbarSize-xp)/2;i._createArrow({className:"left-arrow",top:s,left:o,bottom:void 0,right:void 0,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return i._host.onMouseWheel(new xh(null,1,0))}}),i._createArrow({className:"right-arrow",top:s,left:void 0,bottom:void 0,right:o,bgWidth:n.arrowSize,bgHeight:n.horizontalScrollbarSize,onActivate:function(){return i._host.onMouseWheel(new xh(null,-1,0))}})}return i._createSlider(Math.floor((n.horizontalScrollbarSize-n.horizontalSliderSize)/2),0,void 0,n.horizontalSliderSize),i}return Np(t,e),t.prototype._updateSlider=function(e,t){this.slider.setWidth(e),this.slider.setLeft(t)},t.prototype._renderDomNode=function(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)},t.prototype.onDidScroll=function(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender},t.prototype._mouseDownRelativePosition=function(e,t){return e},t.prototype._sliderMousePosition=function(e){return e.posx},t.prototype._sliderOrthogonalMousePosition=function(e){return e.posy},t.prototype.writeScrollPosition=function(e,t){e.scrollLeft=t},t}(Dp),Ap=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ip=function(e){function t(t,n,r){var i=e.call(this,{lazyRender:n.lazyRender,host:r,scrollbarState:new Tp(n.verticalHasArrows?n.arrowSize:0,2===n.vertical?0:n.verticalScrollbarSize,0),visibility:n.vertical,extraScrollbarClassName:"vertical",scrollable:t})||this;if(n.verticalHasArrows){var o=(n.arrowSize-xp)/2,s=(n.verticalScrollbarSize-xp)/2;i._createArrow({className:"up-arrow",top:o,left:s,bottom:void 0,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return i._host.onMouseWheel(new xh(null,0,1))}}),i._createArrow({className:"down-arrow",top:void 0,left:s,bottom:o,right:void 0,bgWidth:n.verticalScrollbarSize,bgHeight:n.arrowSize,onActivate:function(){return i._host.onMouseWheel(new xh(null,0,-1))}})}return i._createSlider(0,Math.floor((n.verticalScrollbarSize-n.verticalSliderSize)/2),n.verticalSliderSize,void 0),i}return Ap(t,e),t.prototype._updateSlider=function(e,t){this.slider.setHeight(e),this.slider.setTop(t)},t.prototype._renderDomNode=function(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)},t.prototype.onDidScroll=function(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender},t.prototype._mouseDownRelativePosition=function(e,t){return t},t.prototype._sliderMousePosition=function(e){return e.posy},t.prototype._sliderOrthogonalMousePosition=function(e){return e.posx},t.prototype.writeScrollPosition=function(e,t){e.scrollTop=t},t}(Dp),Pp=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rp=function(){function e(e,t,n,r,i,o){(e|=0)<0&&(e=0),(n|=0)+e>(t|=0)&&(n=t-e),n<0&&(n=0),(r|=0)<0&&(r=0),(o|=0)+r>(i|=0)&&(o=i-r),o<0&&(o=0),this.width=e,this.scrollWidth=t,this.scrollLeft=n,this.height=r,this.scrollHeight=i,this.scrollTop=o}return e.prototype.equals=function(e){return this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop},e.prototype.withScrollDimensions=function(t){return new e(void 0!==t.width?t.width:this.width,void 0!==t.scrollWidth?t.scrollWidth:this.scrollWidth,this.scrollLeft,void 0!==t.height?t.height:this.height,void 0!==t.scrollHeight?t.scrollHeight:this.scrollHeight,this.scrollTop)},e.prototype.withScrollPosition=function(t){return new e(this.width,this.scrollWidth,void 0!==t.scrollLeft?t.scrollLeft:this.scrollLeft,this.height,this.scrollHeight,void 0!==t.scrollTop?t.scrollTop:this.scrollTop)},e.prototype.createScrollEvent=function(e){var t=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,i=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:t,scrollWidthChanged:n,scrollLeftChanged:r,heightChanged:i,scrollHeightChanged:o,scrollTopChanged:s}},e}(),Fp=function(e){function t(t,n){var r=e.call(this)||this;return r._onScroll=r._register(new Ht),r.onScroll=r._onScroll.event,r._smoothScrollDuration=t,r._scheduleAtNextAnimationFrame=n,r._state=new Rp(0,0,0,0,0,0),r._smoothScrolling=null,r}return Pp(t,e),t.prototype.dispose=function(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),e.prototype.dispose.call(this)},t.prototype.setSmoothScrollDuration=function(e){this._smoothScrollDuration=e},t.prototype.validateScrollPosition=function(e){return this._state.withScrollPosition(e)},t.prototype.getScrollDimensions=function(){return this._state},t.prototype.setScrollDimensions=function(e){var t=this._state.withScrollDimensions(e);this._setState(t),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)},t.prototype.getFutureScrollPosition=function(){return this._smoothScrolling?this._smoothScrolling.to:this._state},t.prototype.getCurrentScrollPosition=function(){return this._state},t.prototype.setScrollPositionNow=function(e){var t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t)},t.prototype.setScrollPositionSmooth=function(e){var t=this;if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};var n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;var r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration);this._smoothScrolling.dispose(),this._smoothScrolling=r}else{n=this._state.withScrollPosition(e);this._smoothScrolling=Bp.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((function(){t._smoothScrolling&&(t._smoothScrolling.animationFrameDisposable=null,t._performSmoothScrolling())}))},t.prototype._performSmoothScrolling=function(){var e=this;if(this._smoothScrolling){var t=this._smoothScrolling.tick(),n=this._state.withScrollPosition(t);if(this._setState(n),t.isDone)return this._smoothScrolling.dispose(),void(this._smoothScrolling=null);this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((function(){e._smoothScrolling&&(e._smoothScrolling.animationFrameDisposable=null,e._performSmoothScrolling())}))}},t.prototype._setState=function(e){var t=this._state;t.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(t)))},t}(Dt),Yp=function(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n};function jp(e,t){var n=t-e;return function(t){return e+n*(1-function(e){return Math.pow(e,3)}(1-t))}}var Bp=function(){function e(e,t,n,r){this.from=e,this.to=t,this.duration=r,this._startTime=n,this.animationFrameDisposable=null,this._initAnimations()}return e.prototype._initAnimations=function(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)},e.prototype._initAnimation=function(e,t,n){var r,i,o;if(Math.abs(e-t)>2.5*n){var s=void 0,a=void 0;return e0&&Math.abs(e.deltaY)>0)return 1;var t=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return(Math.abs(e.deltaX-Math.round(e.deltaX))>0||Math.abs(e.deltaY-Math.round(e.deltaY))>0)&&(t+=.25),Math.min(Math.max(t,0),1)},e.INSTANCE=new e,e}(),zp=function(e){function t(t,n,r){var i=e.call(this)||this;i._onScroll=i._register(new Ht),i.onScroll=i._onScroll.event,t.style.overflow="hidden",i._options=Gp(n),i._scrollable=r,i._register(i._scrollable.onScroll((function(e){i._onDidScroll(e),i._onScroll.fire(e)})));var o={onMouseWheel:function(e){return i._onMouseWheel(e)},onDragStart:function(){return i._onDragStart()},onDragEnd:function(){return i._onDragEnd()}};return i._verticalScrollbar=i._register(new Ip(i._scrollable,i._options,o)),i._horizontalScrollbar=i._register(new Op(i._scrollable,i._options,o)),i._domNode=document.createElement("div"),i._domNode.className="monaco-scrollable-element "+i._options.className,i._domNode.setAttribute("role","presentation"),i._domNode.style.position="relative",i._domNode.style.overflow="hidden",i._domNode.appendChild(t),i._domNode.appendChild(i._horizontalScrollbar.domNode.domNode),i._domNode.appendChild(i._verticalScrollbar.domNode.domNode),i._options.useShadows?(i._leftShadowDomNode=bp(document.createElement("div")),i._leftShadowDomNode.setClassName("shadow"),i._domNode.appendChild(i._leftShadowDomNode.domNode),i._topShadowDomNode=bp(document.createElement("div")),i._topShadowDomNode.setClassName("shadow"),i._domNode.appendChild(i._topShadowDomNode.domNode),i._topLeftShadowDomNode=bp(document.createElement("div")),i._topLeftShadowDomNode.setClassName("shadow top-left-corner"),i._domNode.appendChild(i._topLeftShadowDomNode.domNode)):(i._leftShadowDomNode=null,i._topShadowDomNode=null,i._topLeftShadowDomNode=null),i._listenOnDomNode=i._options.listenOnDomNode||i._domNode,i._mouseWheelToDispose=[],i._setListeningToMouseWheel(i._options.handleMouseWheel),i.onmouseover(i._listenOnDomNode,(function(e){return i._onMouseOver(e)})),i.onnonbubblingmouseout(i._listenOnDomNode,(function(e){return i._onMouseOut(e)})),i._hideTimeout=i._register(new Ss),i._isDragging=!1,i._mouseIsOver=!1,i._shouldRender=!0,i._revealOnScroll=!0,i}return Hp(t,e),t.prototype.dispose=function(){this._mouseWheelToDispose=kt(this._mouseWheelToDispose),e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this._domNode},t.prototype.getOverviewRulerLayoutInfo=function(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this._verticalScrollbar.delegateMouseDown(e)},t.prototype.getScrollDimensions=function(){return this._scrollable.getScrollDimensions()},t.prototype.setScrollDimensions=function(e){this._scrollable.setScrollDimensions(e)},t.prototype.updateClassName=function(e){this._options.className=e,Ge.d&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className},t.prototype.updateOptions=function(e){var t=Gp(e);this._options.handleMouseWheel=t.handleMouseWheel,this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity,this._options.fastScrollSensitivity=t.fastScrollSensitivity,this._setListeningToMouseWheel(this._options.handleMouseWheel),this._options.lazyRender||this._render()},t.prototype._setListeningToMouseWheel=function(e){var t=this;if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=kt(this._mouseWheelToDispose),e)){this._mouseWheelToDispose.push(Bh(this._listenOnDomNode,nh?"mousewheel":"wheel",(function(e){t._onMouseWheel(new xh(e))})))}},t.prototype._onMouseWheel=function(e){var t,n=Vp.INSTANCE;if(n.accept(Date.now(),e.deltaX,e.deltaY),e.deltaY||e.deltaX){var r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.flipAxes&&(r=(t=[i,r])[0],i=t[1]);var o=!Ge.d&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!o||i||(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);var s=this._scrollable.getFutureScrollPosition(),a={};if(r){var u=s.scrollTop-50*r;this._verticalScrollbar.writeScrollPosition(a,u)}if(i){var c=s.scrollLeft-50*i;this._horizontalScrollbar.writeScrollPosition(a,c)}if(a=this._scrollable.validateScrollPosition(a),s.scrollLeft!==a.scrollLeft||s.scrollTop!==a.scrollTop)this._options.mouseWheelSmoothScroll&&n.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),this._shouldRender=!0}(this._options.alwaysConsumeMouseWheel||this._shouldRender)&&(e.preventDefault(),e.stopPropagation())},t.prototype._onDidScroll=function(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()},t.prototype.renderNow=function(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()},t.prototype._render=function(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){var e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0;this._leftShadowDomNode.setClassName("shadow"+(n?" left":"")),this._topShadowDomNode.setClassName("shadow"+(t?" top":"")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"+(t?" top":"")+(n?" left":""))}},t.prototype._onDragStart=function(){this._isDragging=!0,this._reveal()},t.prototype._onDragEnd=function(){this._isDragging=!1,this._hide()},t.prototype._onMouseOut=function(e){this._mouseIsOver=!1,this._hide()},t.prototype._onMouseOver=function(e){this._mouseIsOver=!0,this._reveal()},t.prototype._reveal=function(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()},t.prototype._hide=function(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())},t.prototype._scheduleHide=function(){var e=this;this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((function(){return e._hide()}),500)},t}(Nf),Up=function(e){function t(t,n){var r=this;(n=n||{}).mouseWheelSmoothScroll=!1;var i=new Fp(0,(function(e){return zh(e)}));return(r=e.call(this,t,n,i)||this)._register(i),r}return Hp(t,e),t.prototype.setScrollPosition=function(e){this._scrollable.setScrollPositionNow(e)},t.prototype.getScrollPosition=function(){return this._scrollable.getCurrentScrollPosition()},t}(zp),qp=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return Hp(t,e),t}(zp),Kp=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._element=t,r.onScroll((function(e){e.scrollTopChanged&&(r._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(r._element.scrollLeft=e.scrollLeft)})),r.scanDomNode(),r}return Hp(t,e),t.prototype.scanDomNode=function(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})},t}(Up);function Gp(e){var t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,Ge.d&&(t.className+=" mac"),t}var $p=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zp=Sf,Jp={inputBackground:xu.fromHex("#3C3C3C"),inputForeground:xu.fromHex("#CCCCCC"),inputValidationInfoBorder:xu.fromHex("#55AAFF"),inputValidationInfoBackground:xu.fromHex("#063B49"),inputValidationWarningBorder:xu.fromHex("#B89500"),inputValidationWarningBackground:xu.fromHex("#352A05"),inputValidationErrorBorder:xu.fromHex("#BE1100"),inputValidationErrorBackground:xu.fromHex("#5A1D1D")},Xp=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.history=new yp(r.history,100),i}return $p(t,e),t.prototype.addToHistory=function(){this.value&&this.value!==this.getCurrentValue()&&this.history.add(this.value)},t.prototype.showNextValue=function(){this.history.has(this.value)||this.addToHistory();var e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,Zf(this.value))},t.prototype.showPreviousValue=function(){this.history.has(this.value)||this.addToHistory();var e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Zf(this.value))},t.prototype.getCurrentValue=function(){var e=this.history.current();return e||(e=this.history.last(),this.history.next()),e},t.prototype.getPreviousValue=function(){return this.history.previous()||this.history.first()},t.prototype.getNextValue=function(){return this.history.next()||this.history.last()},t}(function(e){function t(t,n,r){var i=e.call(this)||this;i.state="idle",i.maxHeight=Number.POSITIVE_INFINITY,i._onDidChange=i._register(new Ht),i.onDidChange=i._onDidChange.event,i._onDidHeightChange=i._register(new Ht),i.onDidHeightChange=i._onDidHeightChange.event,i.contextViewProvider=n,i.options=r||Object.create(null),zr(i.options,Jp,!1),i.message=null,i.placeholder=i.options.placeholder||"",i.ariaLabel=i.options.ariaLabel||"",i.inputBackground=i.options.inputBackground,i.inputForeground=i.options.inputForeground,i.inputBorder=i.options.inputBorder,i.inputValidationInfoBorder=i.options.inputValidationInfoBorder,i.inputValidationInfoBackground=i.options.inputValidationInfoBackground,i.inputValidationInfoForeground=i.options.inputValidationInfoForeground,i.inputValidationWarningBorder=i.options.inputValidationWarningBorder,i.inputValidationWarningBackground=i.options.inputValidationWarningBackground,i.inputValidationWarningForeground=i.options.inputValidationWarningForeground,i.inputValidationErrorBorder=i.options.inputValidationErrorBorder,i.inputValidationErrorBackground=i.options.inputValidationErrorBackground,i.inputValidationErrorForeground=i.options.inputValidationErrorForeground,i.options.validationOptions&&(i.validation=i.options.validationOptions.validation),i.element=vf(t,Zp(".monaco-inputbox.idle"));var o=i.options.flexibleHeight?"textarea":"input",s=vf(i.element,Zp(".wrapper"));if(i.input=vf(s,Zp(o+".input")),i.input.setAttribute("autocorrect","off"),i.input.setAttribute("autocapitalize","off"),i.input.setAttribute("spellcheck","false"),i.onfocus(i.input,(function(){return Ih(i.element,"synthetic-focus")})),i.onblur(i.input,(function(){return Rh(i.element,"synthetic-focus")})),i.options.flexibleHeight){i.maxHeight="number"==typeof i.options.flexibleMaxHeight?i.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,i.mirror=vf(s,Zp("div.mirror")),i.mirror.innerHTML=" ",i.scrollableElement=new Up(i.element,{vertical:1}),i.options.flexibleWidth&&(i.input.setAttribute("wrap","off"),i.mirror.style.whiteSpace="pre",i.mirror.style.wordWrap="initial"),vf(t,i.scrollableElement.getDomNode()),i._register(i.scrollableElement),i._register(i.scrollableElement.onScroll((function(e){return i.input.scrollTop=e.scrollTop})));var a=It.filter(lh(document,"selectionchange"),(function(){var e=document.getSelection();return!!e&&e.anchorNode===s}));i._register(a(i.updateScrollDimensions,i)),i._register(i.onDidHeightChange(i.updateScrollDimensions,i))}else i.input.type=i.options.type||"text",i.input.setAttribute("wrap","off");return i.ariaLabel&&i.input.setAttribute("aria-label",i.ariaLabel),i.placeholder&&i.setPlaceHolder(i.placeholder),i.oninput(i.input,(function(){return i.onValueChange()})),i.onblur(i.input,(function(){return i.onBlur()})),i.onfocus(i.input,(function(){return i.onFocus()})),i.placeholder&&eh&&i.onclick(i.input,(function(e){mf.stop(e,!0),i.input.focus()})),setTimeout((function(){i.input&&i.updateMirror()}),0),i.options.actions&&(i.actionbar=i._register(new _p(i.element)),i.actionbar.push(i.options.actions,{icon:!0,label:!1})),i.applyStyles(),i}return $p(t,e),t.prototype.onBlur=function(){this._hideMessage()},t.prototype.onFocus=function(){this._showMessage()},t.prototype.setPlaceHolder=function(e){this.input&&(this.input.setAttribute("placeholder",e),this.input.title=e)},t.prototype.setAriaLabel=function(e){this.ariaLabel=e,this.input&&(e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label"))},Object.defineProperty(t.prototype,"inputElement",{get:function(){return this.input},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.input.value},set:function(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return"number"==typeof this.cachedHeight?this.cachedHeight:lf(this.element)},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this.input.focus()},t.prototype.blur=function(){this.input.blur()},t.prototype.hasFocus=function(){return document.activeElement===this.input},t.prototype.select=function(e){void 0===e&&(e=null),this.input.select(),e&&this.input.setSelectionRange(e.start,e.end)},t.prototype.enable=function(){this.input.removeAttribute("disabled")},t.prototype.disable=function(){this.input.disabled=!0,this._hideMessage()},Object.defineProperty(t.prototype,"width",{get:function(){return uf(this.input)},set:function(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){var t=0;if(this.mirror)t=(parseFloat(this.mirror.style.paddingLeft||"")||0)+(parseFloat(this.mirror.style.paddingRight||"")||0);this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paddingRight",{set:function(e){this.options.flexibleHeight&&this.options.flexibleWidth?this.input.style.width="calc(100% - "+e+"px)":this.input.style.paddingRight=e+"px",this.mirror&&(this.mirror.style.paddingRight=e+"px")},enumerable:!0,configurable:!0}),t.prototype.updateScrollDimensions=function(){if("number"==typeof this.cachedContentHeight&&"number"==typeof this.cachedHeight){var e=this.cachedContentHeight,t=this.cachedHeight,n=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:n})}},t.prototype.showMessage=function(e,t){this.message=e,Rh(this.element,"idle"),Rh(this.element,"info"),Rh(this.element,"warning"),Rh(this.element,"error"),Ih(this.element,this.classForType(e.type));var n=this.stylesForType(this.message.type);this.element.style.border=n.border?"1px solid "+n.border:null,$f(3===e.type?we("alertErrorMessage","Error: {0}",e.content):2===e.type?we("alertWarningMessage","Warning: {0}",e.content):we("alertInfoMessage","Info: {0}",e.content)),(this.hasFocus()||t)&&this._showMessage()},t.prototype.hideMessage=function(){this.message=null,Rh(this.element,"info"),Rh(this.element,"warning"),Rh(this.element,"error"),Ih(this.element,"idle"),this._hideMessage(),this.applyStyles()},t.prototype.validate=function(){var e=null;return this.validation&&((e=this.validation(this.value))?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),!e},t.prototype.stylesForType=function(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.inputValidationErrorForeground}}},t.prototype.classForType=function(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}},t.prototype._showMessage=function(){var e=this;if(this.contextViewProvider&&this.message){var t,n=function(){return t.style.width=uf(e.element)+"px"};this.contextViewProvider.showContextView({getAnchor:function(){return e.element},anchorAlignment:1,render:function(r){if(!e.message)return null;t=vf(r,Zp(".monaco-inputbox-container")),n();var i={inline:!0,className:"monaco-inputbox-message"},o=e.message.formatContent?up(e.message.content,i):function(e,t){void 0===t&&(t={});var n=cp(t);return n.textContent=e,n}(e.message.content,i);Ih(o,e.classForType(e.message.type));var s=e.stylesForType(e.message.type);return o.style.backgroundColor=s.background?s.background.toString():null,o.style.color=s.foreground?s.foreground.toString():null,o.style.border=s.border?"1px solid "+s.border:null,vf(t,o),null},onHide:function(){e.state="closed"},layout:n}),this.state="open"}},t.prototype._hideMessage=function(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")},t.prototype.onValueChange=function(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()},t.prototype.updateMirror=function(){if(this.mirror){var e=this.value||this.placeholder,t=10===e.charCodeAt(e.length-1)?" ":"";e+t?this.mirror.textContent=e+t:this.mirror.innerHTML=" ",this.layout()}},t.prototype.style=function(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.element){var e=this.inputBackground?this.inputBackground.toString():null,t=this.inputForeground?this.inputForeground.toString():null,n=this.inputBorder?this.inputBorder.toString():null;this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor=e,this.input.style.color=t,this.element.style.borderWidth=n?"1px":null,this.element.style.borderStyle=n?"solid":null,this.element.style.borderColor=n}},t.prototype.layout=function(){if(this.mirror){var e=this.cachedContentHeight;this.cachedContentHeight=lf(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}},t.prototype.dispose=function(){this._hideMessage(),this.element=null,this.input=null,this.contextViewProvider=void 0,this.message=null,this.validation=void 0,this.state=null,this.actionbar=void 0,e.prototype.dispose.call(this)},t}(Nf)),Qp=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),eg=we("defaultLabel","input"),tg=function(e){function t(t,n,r,i){var o=e.call(this)||this;o._showOptionButtons=r,o.fixFocusOnOptionClickEnabled=!0,o._onDidOptionChange=o._register(new Ht),o.onDidOptionChange=o._onDidOptionChange.event,o._onKeyDown=o._register(new Ht),o.onKeyDown=o._onKeyDown.event,o._onMouseDown=o._register(new Ht),o.onMouseDown=o._onMouseDown.event,o._onInput=o._register(new Ht),o._onKeyUp=o._register(new Ht),o._onCaseSensitiveKeyDown=o._register(new Ht),o.onCaseSensitiveKeyDown=o._onCaseSensitiveKeyDown.event,o._onRegexKeyDown=o._register(new Ht),o.onRegexKeyDown=o._onRegexKeyDown.event,o._lastHighlightFindOptions=0,o.contextViewProvider=n,o.placeholder=i.placeholder||"",o.validation=i.validation,o.label=i.label||eg,o.inputActiveOptionBorder=i.inputActiveOptionBorder,o.inputActiveOptionBackground=i.inputActiveOptionBackground,o.inputBackground=i.inputBackground,o.inputForeground=i.inputForeground,o.inputBorder=i.inputBorder,o.inputValidationInfoBorder=i.inputValidationInfoBorder,o.inputValidationInfoBackground=i.inputValidationInfoBackground,o.inputValidationInfoForeground=i.inputValidationInfoForeground,o.inputValidationWarningBorder=i.inputValidationWarningBorder,o.inputValidationWarningBackground=i.inputValidationWarningBackground,o.inputValidationWarningForeground=i.inputValidationWarningForeground,o.inputValidationErrorBorder=i.inputValidationErrorBorder,o.inputValidationErrorBackground=i.inputValidationErrorBackground,o.inputValidationErrorForeground=i.inputValidationErrorForeground;var s=i.appendCaseSensitiveLabel||"",a=i.appendWholeWordsLabel||"",u=i.appendRegexLabel||"",c=i.history||[],l=!!i.flexibleHeight,d=!!i.flexibleWidth,h=i.flexibleMaxHeight;o.domNode=document.createElement("div"),Ih(o.domNode,"monaco-findInput"),o.inputBox=o._register(new Xp(o.domNode,o.contextViewProvider,{placeholder:o.placeholder||"",ariaLabel:o.label||"",validationOptions:{validation:o.validation},inputBackground:o.inputBackground,inputForeground:o.inputForeground,inputBorder:o.inputBorder,inputValidationInfoBackground:o.inputValidationInfoBackground,inputValidationInfoForeground:o.inputValidationInfoForeground,inputValidationInfoBorder:o.inputValidationInfoBorder,inputValidationWarningBackground:o.inputValidationWarningBackground,inputValidationWarningForeground:o.inputValidationWarningForeground,inputValidationWarningBorder:o.inputValidationWarningBorder,inputValidationErrorBackground:o.inputValidationErrorBackground,inputValidationErrorForeground:o.inputValidationErrorForeground,inputValidationErrorBorder:o.inputValidationErrorBorder,history:c,flexibleHeight:l,flexibleWidth:d,flexibleMaxHeight:h})),o.regex=o._register(new Hf({appendTitle:u,isChecked:!1,inputActiveOptionBorder:o.inputActiveOptionBorder,inputActiveOptionBackground:o.inputActiveOptionBackground})),o._register(o.regex.onChange((function(e){o._onDidOptionChange.fire(e),!e&&o.fixFocusOnOptionClickEnabled&&o.inputBox.focus(),o.validate()}))),o._register(o.regex.onKeyDown((function(e){o._onRegexKeyDown.fire(e)}))),o.wholeWords=o._register(new Bf({appendTitle:a,isChecked:!1,inputActiveOptionBorder:o.inputActiveOptionBorder,inputActiveOptionBackground:o.inputActiveOptionBackground})),o._register(o.wholeWords.onChange((function(e){o._onDidOptionChange.fire(e),!e&&o.fixFocusOnOptionClickEnabled&&o.inputBox.focus(),o.validate()}))),o.caseSensitive=o._register(new jf({appendTitle:s,isChecked:!1,inputActiveOptionBorder:o.inputActiveOptionBorder,inputActiveOptionBackground:o.inputActiveOptionBackground})),o._register(o.caseSensitive.onChange((function(e){o._onDidOptionChange.fire(e),!e&&o.fixFocusOnOptionClickEnabled&&o.inputBox.focus(),o.validate()}))),o._register(o.caseSensitive.onKeyDown((function(e){o._onCaseSensitiveKeyDown.fire(e)}))),o._showOptionButtons&&(o.inputBox.paddingRight=o.caseSensitive.width()+o.wholeWords.width()+o.regex.width());var f=[o.caseSensitive.domNode,o.wholeWords.domNode,o.regex.domNode];o.onkeydown(o.domNode,(function(e){if(e.equals(15)||e.equals(17)||e.equals(9)){var t=f.indexOf(document.activeElement);if(t>=0){var n=-1;e.equals(17)?n=(t+1)%f.length:e.equals(15)&&(n=0===t?f.length-1:t-1),e.equals(9)?f[t].blur():n>=0&&f[n].focus(),mf.stop(e,!0)}}}));var p=document.createElement("div");return p.className="controls",p.style.display=o._showOptionButtons?"block":"none",p.appendChild(o.caseSensitive.domNode),p.appendChild(o.wholeWords.domNode),p.appendChild(o.regex.domNode),o.domNode.appendChild(p),t&&t.appendChild(o.domNode),o.onkeydown(o.inputBox.inputElement,(function(e){return o._onKeyDown.fire(e)})),o.onkeyup(o.inputBox.inputElement,(function(e){return o._onKeyUp.fire(e)})),o.oninput(o.inputBox.inputElement,(function(e){return o._onInput.fire()})),o.onmousedown(o.inputBox.inputElement,(function(e){return o._onMouseDown.fire(e)})),o}return Qp(t,e),t.prototype.enable=function(){Rh(this.domNode,"disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()},t.prototype.disable=function(){Ih(this.domNode,"disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()},t.prototype.setFocusInputOnOptionClick=function(e){this.fixFocusOnOptionClickEnabled=e},t.prototype.setEnabled=function(e){e?this.enable():this.disable()},t.prototype.getValue=function(){return this.inputBox.value},t.prototype.setValue=function(e){this.inputBox.value!==e&&(this.inputBox.value=e)},t.prototype.style=function(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.domNode){var e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);var t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}},t.prototype.select=function(){this.inputBox.select()},t.prototype.focus=function(){this.inputBox.focus()},t.prototype.getCaseSensitive=function(){return this.caseSensitive.checked},t.prototype.setCaseSensitive=function(e){this.caseSensitive.checked=e},t.prototype.getWholeWords=function(){return this.wholeWords.checked},t.prototype.setWholeWords=function(e){this.wholeWords.checked=e},t.prototype.getRegex=function(){return this.regex.checked},t.prototype.setRegex=function(e){this.regex.checked=e,this.validate()},t.prototype.focusOnCaseSensitive=function(){this.caseSensitive.focus()},t.prototype.highlightFindOptions=function(){Rh(this.domNode,"highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,Ih(this.domNode,"highlight-"+this._lastHighlightFindOptions)},t.prototype.validate=function(){this.inputBox&&this.inputBox.validate()},t.prototype.clearMessage=function(){this.inputBox&&this.inputBox.hideMessage()},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t}(Nf),ng=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rg=we("defaultLabel","input"),ig=we("label.preserveCaseCheckbox","Preserve Case"),og=function(e){function t(t){return e.call(this,{actionClassName:"monaco-case-sensitive",title:ig+t.appendTitle,isChecked:t.isChecked,inputActiveOptionBorder:t.inputActiveOptionBorder})||this}return ng(t,e),t}(If),sg=function(e){function t(t,n,r,i){var o=e.call(this)||this;o._showOptionButtons=r,o.fixFocusOnOptionClickEnabled=!0,o.cachedOptionsWidth=0,o._onDidOptionChange=o._register(new Ht),o.onDidOptionChange=o._onDidOptionChange.event,o._onKeyDown=o._register(new Ht),o.onKeyDown=o._onKeyDown.event,o._onMouseDown=o._register(new Ht),o._onInput=o._register(new Ht),o._onKeyUp=o._register(new Ht),o._onPreserveCaseKeyDown=o._register(new Ht),o.onPreserveCaseKeyDown=o._onPreserveCaseKeyDown.event,o.contextViewProvider=n,o.placeholder=i.placeholder||"",o.validation=i.validation,o.label=i.label||rg,o.inputActiveOptionBorder=i.inputActiveOptionBorder,o.inputBackground=i.inputBackground,o.inputForeground=i.inputForeground,o.inputBorder=i.inputBorder,o.inputValidationInfoBorder=i.inputValidationInfoBorder,o.inputValidationInfoBackground=i.inputValidationInfoBackground,o.inputValidationInfoForeground=i.inputValidationInfoForeground,o.inputValidationWarningBorder=i.inputValidationWarningBorder,o.inputValidationWarningBackground=i.inputValidationWarningBackground,o.inputValidationWarningForeground=i.inputValidationWarningForeground,o.inputValidationErrorBorder=i.inputValidationErrorBorder,o.inputValidationErrorBackground=i.inputValidationErrorBackground,o.inputValidationErrorForeground=i.inputValidationErrorForeground;var s=!!i.flexibleHeight,a=!!i.flexibleWidth,u=i.flexibleMaxHeight;return o.buildDomNode(i.history||[],s,a,u),t&&t.appendChild(o.domNode),o.onkeydown(o.inputBox.inputElement,(function(e){return o._onKeyDown.fire(e)})),o.onkeyup(o.inputBox.inputElement,(function(e){return o._onKeyUp.fire(e)})),o.oninput(o.inputBox.inputElement,(function(e){return o._onInput.fire()})),o.onmousedown(o.inputBox.inputElement,(function(e){return o._onMouseDown.fire(e)})),o}return ng(t,e),t.prototype.enable=function(){Rh(this.domNode,"disabled"),this.inputBox.enable(),this.preserveCase.enable()},t.prototype.disable=function(){Ih(this.domNode,"disabled"),this.inputBox.disable(),this.preserveCase.disable()},t.prototype.setEnabled=function(e){e?this.enable():this.disable()},t.prototype.style=function(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.domNode){var e={inputActiveOptionBorder:this.inputActiveOptionBorder};this.preserveCase.style(e);var t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}},t.prototype.select=function(){this.inputBox.select()},t.prototype.focus=function(){this.inputBox.focus()},t.prototype.getPreserveCase=function(){return this.preserveCase.checked},t.prototype.setPreserveCase=function(e){this.preserveCase.checked=e},t.prototype.focusOnPreserve=function(){this.preserveCase.focus()},t.prototype.buildDomNode=function(e,t,n,r){var i=this;this.domNode=document.createElement("div"),Ih(this.domNode,"monaco-findInput"),this.inputBox=this._register(new Xp(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:e,flexibleHeight:t,flexibleWidth:n,flexibleMaxHeight:r})),this.preserveCase=this._register(new og({appendTitle:"",isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder})),this._register(this.preserveCase.onChange((function(e){i._onDidOptionChange.fire(e),!e&&i.fixFocusOnOptionClickEnabled&&i.inputBox.focus(),i.validate()}))),this._register(this.preserveCase.onKeyDown((function(e){i._onPreserveCaseKeyDown.fire(e)}))),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;var o=[this.preserveCase.domNode];this.onkeydown(this.domNode,(function(e){if(e.equals(15)||e.equals(17)||e.equals(9)){var t=o.indexOf(document.activeElement);if(t>=0){var n=-1;e.equals(17)?n=(t+1)%o.length:e.equals(15)&&(n=0===t?o.length-1:t-1),e.equals(9)?o[t].blur():n>=0&&o[n].focus(),mf.stop(e,!0)}}}));var s=document.createElement("div");s.className="controls",s.style.display=this._showOptionButtons?"block":"none",s.appendChild(this.preserveCase.domNode),this.domNode.appendChild(s)},t.prototype.validate=function(){this.inputBox&&this.inputBox.validate()},Object.defineProperty(t.prototype,"width",{set:function(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t}(Nf),ag=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ug=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},cg=function(e,t){return function(n,r){t(n,r,e)}},lg="historyNavigationWidget",dg="historyNavigationEnabled";function hg(e,t){return e.getContext(document.activeElement).getValue(t)}function fg(e,t){var n=function(e,t){return e.createScoped(t.target)}(e,t);return function(e,t,n){new Yn(n,t).bindTo(e)}(n,t,lg),{scopedContextKeyService:n,historyNavigationEnablement:new Yn(dg,!0).bindTo(n)}}var pg=function(e){function t(t,n,r,i,o){void 0===o&&(o=!1);var s=e.call(this,t,n,o,r)||this;return s._register(fg(i,{target:s.inputBox.element,historyNavigator:s.inputBox}).scopedContextKeyService),s}return ag(t,e),t=ug([cg(3,jn)],t)}(tg),gg=function(e){function t(t,n,r,i,o){void 0===o&&(o=!1);var s=e.call(this,t,n,o,r)||this;return s._register(fg(i,{target:s.inputBox.element,historyNavigator:s.inputBox}).scopedContextKeyService),s}return ag(t,e),t=ug([cg(3,jn)],t)}(sg);vr.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:En.and(En.has(lg),En.equals(dg,!0)),primary:16,secondary:[528],handler:function(e,t){var n=hg(e.get(jn),lg);n&&n.historyNavigator.showPreviousValue()}}),vr.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:En.and(En.has(lg),En.equals(dg,!0)),primary:18,secondary:[530],handler:function(e,t){var n=hg(e.get(jn),lg);n&&n.historyNavigator.showNextValue()}});var mg=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_g=we("label.find","Find"),yg=we("placeholder.find","Find"),vg=we("label.previousMatchButton","Previous match"),bg=we("label.nextMatchButton","Next match"),wg=we("label.toggleSelectionFind","Find in selection"),Cg=we("label.closeButton","Close"),Sg=we("label.replace","Replace"),xg=we("placeholder.replace","Replace"),kg=we("label.replaceButton","Replace"),Lg=we("label.replaceAllButton","Replace All"),Mg=we("label.toggleReplaceButton","Toggle Replace mode"),Eg=we("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",19999),Dg=we("label.matchesLocation","{0} of {1}"),Tg=we("label.noResults","No Results"),Ng=69,Og=17+(Ng+3+1)+92+2,Ag=33,Ig="ctrlEnterReplaceAll.windows.donotask",Pg=Ge.d?256:2048,Rg=function(e){this.afterLineNumber=e,this.heightInPx=Ag,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"};function Fg(e,t,n){var r=!!t.match(/\n/);n&&r&&n.selectionStart>0&&e.stopPropagation()}function Yg(e,t,n){var r=!!t.match(/\n/);n&&r&&n.selectionEnd=0?Ih(this._domNode,"multipleline"):Rh(this._domNode,"multipleline");try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?this._codeEditor.getConfiguration().readOnly||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=uf(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){var t=this._state.searchString.length>0&&0===this._state.matchesCount;Yh(this._domNode,"no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory()},t.prototype._delayedUpdateHistory=function(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this))},t.prototype._updateHistory=function(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()},t.prototype._updateMatchesCount=function(){var e;if(this._matchesCount.style.minWidth=Ng+"px",this._state.matchesCount>=19999?this._matchesCount.title=Eg:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild),this._state.matchesCount>0){var t=String(this._state.matchesCount);this._state.matchesCount>=19999&&(t+="+");var n=String(this._state.matchesPosition);"0"===n&&(n="?"),e=Xt(Dg,n,t)}else e=Tg;this._matchesCount.appendChild(document.createTextNode(e)),$f(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString),!0),Ng=Math.max(Ng,this._matchesCount.clientWidth)},t.prototype._getAriaLabel=function(e,t,n){return e===Tg?""===n?we("ariaSearchNoResultEmpty","{0} found",e):we("ariaSearchNoResult","{0} found for {1}",e,n):t?we("ariaSearchNoResultWithLineNum","{0} found for {1} at {2}",e,n,t.startLineNumber+":"+t.startColumn):we("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for {1}",e,n)},t.prototype._updateToggleSelectionFindButton=function(){var e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),n=this._toggleSelectionFind.checked;this._toggleSelectionFind.setEnabled(this._isVisible&&(n||t))},t.prototype._updateButtons=function(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);var e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t),this._nextBtn.setEnabled(this._isVisible&&e&&t),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),Yh(this._domNode,"replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("collapse",!this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("expand",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);var n=!this._codeEditor.getConfiguration().readOnly;this._toggleReplaceBtn.setEnabled(this._isVisible&&n)},t.prototype._reveal=function(){var e=this;if(!this._isVisible){this._isVisible=!0;var t=this._codeEditor.getSelection();!!t&&(t.startLineNumber!==t.endLineNumber||t.startColumn!==t.endColumn)&&this._codeEditor.getConfiguration().contribInfo.find.autoFindInSelection?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._tryUpdateWidgetWidth(),this._updateButtons(),setTimeout((function(){Ih(e._domNode,"visible"),e._domNode.setAttribute("aria-hidden","false")}),0),setTimeout((function(){e._findInput.validate()}),200),this._codeEditor.layoutOverlayWidget(this);var n=!0;if(this._codeEditor.getConfiguration().contribInfo.find.seedSearchStringFromSelection&&t){var r=this._codeEditor.getDomNode();if(r){var i=sf(r),o=this._codeEditor.getScrolledVisiblePosition(t.getStartPosition()),s=i.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&at.startLineNumber&&(n=!1);var u=of(this._domNode).left;s>u&&(n=!1);var c=this._codeEditor.getScrolledVisiblePosition(t.getEndPosition());i.left+(c?c.left:0)>u&&(n=!1)}}}this._showViewZone(n)}},t.prototype._hide=function(e){this._isVisible&&(this._isVisible=!1,this._updateButtons(),Rh(this._domNode,"visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())},t.prototype._layoutViewZone=function(){var e=this;if(this._codeEditor.getConfiguration().contribInfo.find.addExtraSpaceOnTop){if(this._isVisible){var t=this._viewZone;void 0===this._viewZoneId&&t&&this._codeEditor.changeViewZones((function(n){t.heightInPx=e._getHeight(),e._viewZoneId=n.addZone(t),e._codeEditor.setScrollTop(e._codeEditor.getScrollTop()+t.heightInPx)}))}}else this._removeViewZone()},t.prototype._showViewZone=function(e){var t=this;if((void 0===e&&(e=!0),this._isVisible)&&this._codeEditor.getConfiguration().contribInfo.find.addExtraSpaceOnTop){void 0===this._viewZone&&(this._viewZone=new Rg(0));var n=this._viewZone;this._codeEditor.changeViewZones((function(r){if(void 0!==t._viewZoneId){var i=t._getHeight();if(i===n.heightInPx)return;var o=i-n.heightInPx;return n.heightInPx=i,r.layoutZone(t._viewZoneId),void(e&&t._codeEditor.setScrollTop(t._codeEditor.getScrollTop()+o))}o=t._getHeight();n.heightInPx=o,t._viewZoneId=r.addZone(n),e&&t._codeEditor.setScrollTop(t._codeEditor.getScrollTop()+o)}))}},t.prototype._removeViewZone=function(){var e=this;this._codeEditor.changeViewZones((function(t){void 0!==e._viewZoneId&&(t.removeZone(e._viewZoneId),e._viewZoneId=void 0,e._viewZone&&(e._codeEditor.setScrollTop(e._codeEditor.getScrollTop()-e._viewZone.heightInPx),e._viewZone=void 0))}))},t.prototype._applyTheme=function(e){var t={inputActiveOptionBorder:e.getColor(nl),inputActiveOptionBackground:e.getColor(rl),inputBackground:e.getColor(Qc),inputForeground:e.getColor(el),inputBorder:e.getColor(tl),inputValidationInfoBackground:e.getColor(il),inputValidationInfoForeground:e.getColor(ol),inputValidationInfoBorder:e.getColor(sl),inputValidationWarningBackground:e.getColor(al),inputValidationWarningForeground:e.getColor(ul),inputValidationWarningBorder:e.getColor(cl),inputValidationErrorBackground:e.getColor(ll),inputValidationErrorForeground:e.getColor(dl),inputValidationErrorBorder:e.getColor(hl)};this._findInput.style(t),this._replaceInput.style(t)},t.prototype._tryUpdateWidgetWidth=function(){if(this._isVisible)if(this._codeEditor.getConfiguration().layoutInfo.contentWidth<=0)Ih(this._domNode,"hiddenEditor");else{Ah(this._domNode,"hiddenEditor")&&Rh(this._domNode,"hiddenEditor");var e=this._codeEditor.getConfiguration().layoutInfo.width,t=this._codeEditor.getConfiguration().layoutInfo.minimapWidth,n=!1,r=!1,i=!1;if(this._resized)if(uf(this._domNode)>419)return this._domNode.style.maxWidth=e-28-t-15+"px",void(this._replaceInput.width=uf(this._findInput.domNode));if(447+t>=e&&(r=!0),447+t-Ng>=e&&(i=!0),447+t-Ng>=e+50&&(n=!0),Yh(this._domNode,"collapsed-find-widget",n),Yh(this._domNode,"narrow-find-widget",i),Yh(this._domNode,"reduced-find-widget",r),i||n||(this._domNode.style.maxWidth=e-28-t-15+"px"),this._resized){this._findInput.inputBox.layout();var o=this._findInput.inputBox.width;o>0&&(this._replaceInput.width=o)}}},t.prototype._getHeight=function(){var e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4},t.prototype._tryUpdateHeight=function(){var e=this._getHeight();return(null===this._cachedHeight||this._cachedHeight!==e)&&(this._cachedHeight=e,this._domNode.style.height=e+"px",!0)},t.prototype.focusFindInput=function(){this._findInput.select(),this._findInput.focus()},t.prototype.focusReplaceInput=function(){this._replaceInput.select(),this._replaceInput.focus()},t.prototype.highlightFindOptions=function(){this._findInput.highlightFindOptions()},t.prototype._updateSearchScope=function(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){var e=this._codeEditor.getSelection();1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));var t=this._state.currentMatch;e.startLineNumber!==e.endLineNumber&&(Tr.equalsRange(e,t)||this._state.change({searchScope:e},!0))}},t.prototype._onFindInputMouseDown=function(e){e.middleButton&&e.stopPropagation()},t.prototype._onFindInputKeyDown=function(e){if(e.equals(3|Pg)){var t=this._findInput.inputBox.inputElement,n=t.selectionStart,r=t.selectionEnd,i=t.value;if(null!==n&&null!==r){var o=i.substr(0,n)+"\n"+i.substr(r);return this._findInput.inputBox.value=o,t.setSelectionRange(n+1,n+1),this._findInput.inputBox.layout(),void e.preventDefault()}}return e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?Fg(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?Yg(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0},t.prototype._onReplaceInputKeyDown=function(e){if(e.equals(3|Pg)){Ge.g&&Ge.e&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(we("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(Ig,!0,0));var t=this._replaceInput.inputBox.inputElement,n=t.selectionStart,r=t.selectionEnd,i=t.value;if(null!==n&&null!==r){var o=i.substr(0,n)+"\n"+i.substr(r);return this._replaceInput.inputBox.value=o,t.setSelectionRange(n+1,n+1),this._replaceInput.inputBox.layout(),void e.preventDefault()}}return e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?Fg(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?Yg(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0},t.prototype.getHorizontalSashTop=function(e){return 0},t.prototype.getHorizontalSashLeft=function(e){return 0},t.prototype.getHorizontalSashWidth=function(e){return 500},t.prototype._keybindingLabelFor=function(e){var t=this._keybindingService.lookupKeybinding(e);return t?" ("+t.getLabel()+")":""},t.prototype._buildDomNode=function(){var e=this;this._findInput=this._register(new pg(null,this._contextViewProvider,{width:221,label:_g,placeholder:yg,appendCaseSensitiveLabel:this._keybindingLabelFor($d.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor($d.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor($d.ToggleRegexCommand),validation:function(t){if(0===t.length||!e._findInput.getRegex())return null;try{return new RegExp(t),null}catch(e){return{content:e.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118},this._contextKeyService,!0)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown((function(t){return e._onFindInputKeyDown(t)}))),this._register(this._findInput.inputBox.onDidChange((function(){e._ignoreChangeEvent||e._state.change({searchString:e._findInput.getValue()},!0)}))),this._register(this._findInput.onDidOptionChange((function(){e._state.change({isRegex:e._findInput.getRegex(),wholeWord:e._findInput.getWholeWords(),matchCase:e._findInput.getCaseSensitive()},!0)}))),this._register(this._findInput.onCaseSensitiveKeyDown((function(t){t.equals(1026)&&e._isReplaceVisible&&(e._replaceInput.focus(),t.preventDefault())}))),this._register(this._findInput.onRegexKeyDown((function(t){t.equals(2)&&e._isReplaceVisible&&(e._replaceInput.focusOnPreserve(),t.preventDefault())}))),this._register(this._findInput.inputBox.onDidHeightChange((function(t){e._tryUpdateHeight()&&e._showViewZone()}))),Ge.c&&this._register(this._findInput.onMouseDown((function(t){return e._onFindInputMouseDown(t)}))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new Hg({label:vg+this._keybindingLabelFor($d.PreviousMatchFindAction),className:"previous",onTrigger:function(){e._codeEditor.getAction($d.PreviousMatchFindAction).run().then(void 0,je)}})),this._nextBtn=this._register(new Hg({label:bg+this._keybindingLabelFor($d.NextMatchFindAction),className:"next",onTrigger:function(){e._codeEditor.getAction($d.NextMatchFindAction).run().then(void 0,je)}}));var t=document.createElement("div");t.className="find-part",t.appendChild(this._findInput.domNode);var n=document.createElement("div");n.className="find-actions",t.appendChild(n),n.appendChild(this._matchesCount),n.appendChild(this._prevBtn.domNode),n.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Bg({parent:n,title:wg+this._keybindingLabelFor($d.ToggleSearchScopeCommand),onChange:function(){if(e._toggleSelectionFind.checked){if(e._codeEditor.hasModel()){var t=e._codeEditor.getSelection();1===t.endColumn&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,e._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()||e._state.change({searchScope:t},!0)}}else e._state.change({searchScope:null},!0)}})),this._closeBtn=this._register(new Hg({label:Cg+this._keybindingLabelFor($d.CloseFindWidgetCommand),className:"close-fw",onTrigger:function(){e._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:function(t){t.equals(2)&&e._isReplaceVisible&&(e._replaceBtn.isEnabled()?e._replaceBtn.focus():e._codeEditor.focus(),t.preventDefault())}})),n.appendChild(this._closeBtn.domNode),this._replaceInput=this._register(new gg(null,void 0,{label:Sg,placeholder:xg,history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown((function(t){return e._onReplaceInputKeyDown(t)}))),this._register(this._replaceInput.inputBox.onDidChange((function(){e._state.change({replaceString:e._replaceInput.inputBox.value},!1)}))),this._register(this._replaceInput.inputBox.onDidHeightChange((function(t){e._isReplaceVisible&&e._tryUpdateHeight()&&e._showViewZone()}))),this._register(this._replaceInput.onDidOptionChange((function(){e._state.change({preserveCase:e._replaceInput.getPreserveCase()},!0)}))),this._register(this._replaceInput.onPreserveCaseKeyDown((function(t){t.equals(2)&&(e._prevBtn.isEnabled()?e._prevBtn.focus():e._nextBtn.isEnabled()?e._nextBtn.focus():e._toggleSelectionFind.isEnabled()?e._toggleSelectionFind.focus():e._closeBtn.isEnabled()&&e._closeBtn.focus(),t.preventDefault())}))),this._replaceBtn=this._register(new Hg({label:kg+this._keybindingLabelFor($d.ReplaceOneAction),className:"replace",onTrigger:function(){e._controller.replace()},onKeyDown:function(t){t.equals(1026)&&(e._closeBtn.focus(),t.preventDefault())}})),this._replaceAllBtn=this._register(new Hg({label:Lg+this._keybindingLabelFor($d.ReplaceAllAction),className:"replace-all",onTrigger:function(){e._controller.replaceAll()}}));var r=document.createElement("div");r.className="replace-part",r.appendChild(this._replaceInput.domNode);var i=document.createElement("div");i.className="replace-actions",r.appendChild(i),i.appendChild(this._replaceBtn.domNode),i.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new Hg({label:Mg,className:"toggle left",onTrigger:function(){e._state.change({isReplaceRevealed:!e._isReplaceVisible},!1),e._isReplaceVisible&&(e._replaceInput.width=uf(e._findInput.domNode),e._replaceInput.inputBox.layout()),e._showViewZone()}})),this._toggleReplaceBtn.toggleClass("expand",this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("collapse",!this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.style.width="419px",this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(t),this._domNode.appendChild(r),this._resizeSash=new ap(this._domNode,this,{orientation:0}),this._resized=!1;var o=419;this._register(this._resizeSash.onDidStart((function(){o=uf(e._domNode)}))),this._register(this._resizeSash.onDidChange((function(t){e._resized=!0;var n=o+t.startX-t.currentX;if(!(n<419)){var r=n-Og;n>(parseFloat(nf(e._domNode).maxWidth)||0)||(e._domNode.style.width=n+"px",e._findInput.inputBox.width=r,e._isReplaceVisible&&(e._replaceInput.width=uf(e._findInput.domNode)),e._findInput.inputBox.layout(),e._tryUpdateHeight())}}))),this._register(this._resizeSash.onDidReset((function(){var t=uf(e._domNode);if(!(t<419)){var n=419;e._resized&&419!==t||(n=e._codeEditor.getConfiguration().layoutInfo.width-28-e._codeEditor.getConfiguration().layoutInfo.minimapWidth-15,e._resized=!0);var r=n-Og;e._domNode.style.width=n+"px",e._findInput.inputBox.width=r,e._isReplaceVisible&&(e._replaceInput.width=uf(e._findInput.domNode)),e._findInput.inputBox.layout()}})))},t.prototype.updateAccessibilitySupport=function(){var e=this._codeEditor.getConfiguration().accessibilitySupport;this._findInput.setFocusInputOnOptionClick(2!==e)},t.ID="editor.contrib.findWidget",t}(Nf),Bg=function(e){function t(n){var r=e.call(this)||this;return r._opts=n,r._domNode=document.createElement("div"),r._domNode.className="monaco-checkbox",r._domNode.title=r._opts.title,r._domNode.tabIndex=0,r._checkbox=document.createElement("input"),r._checkbox.type="checkbox",r._checkbox.className="checkbox",r._checkbox.id="checkbox-"+t._COUNTER++,r._checkbox.tabIndex=-1,r._label=document.createElement("label"),r._label.className="label",r._label.htmlFor=r._checkbox.id,r._label.tabIndex=-1,r._domNode.appendChild(r._checkbox),r._domNode.appendChild(r._label),r._opts.parent.appendChild(r._domNode),r.onchange(r._checkbox,(function(){r._opts.onChange()})),r}return mg(t,e),Object.defineProperty(t.prototype,"domNode",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),t.prototype.isEnabled=function(){return this._domNode.tabIndex>=0},Object.defineProperty(t.prototype,"checked",{get:function(){return this._checkbox.checked},set:function(e){this._checkbox.checked=e},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this._domNode.focus()},t.prototype.enable=function(){this._checkbox.removeAttribute("disabled")},t.prototype.disable=function(){this._checkbox.disabled=!0},t.prototype.setEnabled=function(e){e?(this.enable(),this.domNode.tabIndex=0):(this.disable(),this.domNode.tabIndex=-1)},t._COUNTER=0,t}(Nf),Hg=function(e){function t(t){var n=e.call(this)||this;return n._opts=t,n._domNode=document.createElement("div"),n._domNode.title=n._opts.label,n._domNode.tabIndex=0,n._domNode.className="button "+n._opts.className,n._domNode.setAttribute("role","button"),n._domNode.setAttribute("aria-label",n._opts.label),n.onclick(n._domNode,(function(e){n._opts.onTrigger(),e.preventDefault()})),n.onkeydown(n._domNode,(function(e){if(e.equals(10)||e.equals(3))return n._opts.onTrigger(),void e.preventDefault();n._opts.onKeyDown&&n._opts.onKeyDown(e)})),n}return mg(t,e),Object.defineProperty(t.prototype,"domNode",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),t.prototype.isEnabled=function(){return this._domNode.tabIndex>=0},t.prototype.focus=function(){this._domNode.focus()},t.prototype.setEnabled=function(e){Yh(this._domNode,"disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1},t.prototype.setExpanded=function(e){this._domNode.setAttribute("aria-expanded",String(!!e))},t.prototype.toggleClass=function(e,t){Yh(this._domNode,e,t)},t}(Nf);Ad((function(e,t){var n=function(e,n){n&&t.addRule(".monaco-editor "+e+" { background-color: "+n+"; }")};n(".findMatch",e.getColor(od)),n(".currentFindMatch",e.getColor(id)),n(".findScope",e.getColor(sd)),n(".find-widget",e.getColor(Zl));var r=e.getColor(Xc);r&&t.addRule(".monaco-editor .find-widget { box-shadow: 0 2px 8px "+r+"; }");var i=e.getColor(ud);i&&t.addRule(".monaco-editor .findMatch { border: 1px "+("hc"===e.type?"dotted":"solid")+" "+i+"; box-sizing: border-box; }");var o=e.getColor(ad);o&&t.addRule(".monaco-editor .currentFindMatch { border: 2px solid "+o+"; padding: 1px; box-sizing: border-box; }");var s=e.getColor(cd);s&&t.addRule(".monaco-editor .findScope { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+s+"; }");var a=e.getColor(Zc);a&&t.addRule(".monaco-editor .find-widget { border: 2px solid "+a+"; }");var u=e.getColor(Jl);u&&t.addRule(".monaco-editor .find-widget { color: "+u+"; }");var c=e.getColor(Gc);c&&t.addRule(".monaco-editor .find-widget.no-results .matchesCount { color: "+c+"; }");var l=e.getColor(Ql);if(l)t.addRule(".monaco-editor .find-widget .monaco-sash { background-color: "+l+"; width: 3px !important; margin-left: -4px;}");else{var d=e.getColor(Xl);d&&t.addRule(".monaco-editor .find-widget .monaco-sash { background-color: "+d+"; width: 3px !important; margin-left: -4px;}")}var h=e.getColor(nl);h&&t.addRule(".monaco-editor .find-widget .monaco-checkbox .checkbox:checked + .label { border: 1px solid "+h.toString()+"; }");var f=e.getColor(rl);f&&t.addRule(".monaco-editor .find-widget .monaco-checkbox .checkbox:checked + .label { background-color: "+f.toString()+"; }");var p=e.getColor($c);p&&t.addRule(".monaco-workbench .monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: "+p+"; }")}));var Wg,Vg=pt("clipboardService"),zg=pt("contextViewService"),Ug=pt("contextMenuService"),qg=pt("keybindingService"),Kg=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gg=pt("storageService");!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(Wg||(Wg={}));var $g,Zg,Jg=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._serviceBrand=null,t._onDidChangeStorage=t._register(new Ht),t.onDidChangeStorage=t._onDidChangeStorage.event,t.onWillSaveState=It.None,t.globalCache=new Map,t.workspaceCache=new Map,t}return Kg(t,e),t.prototype.getCache=function(e){return 0===e?this.globalCache:this.workspaceCache},t.prototype.get=function(e,t,n){var r=this.getCache(t).get(e);return Ee(r)?n:r},t.prototype.getBoolean=function(e,t,n){var r=this.getCache(t).get(e);return Ee(r)?n:"true"===r},t.prototype.store=function(e,t,n){if(Ee(t))return this.remove(e,n);var r=String(t);return this.getCache(n).get(e)===r?Promise.resolve():(this.getCache(n).set(e,r),this._onDidChangeStorage.fire({scope:n,key:e}),Promise.resolve())},t.prototype.remove=function(e,t){return this.getCache(t).delete(e)?(this._onDidChangeStorage.fire({scope:t,key:e}),Promise.resolve()):Promise.resolve()},t}(Dt);(Zg=$g||($g={}))[Zg.Ignore=0]="Ignore",Zg[Zg.Info=1]="Info",Zg[Zg.Warning=2]="Warning",Zg[Zg.Error=3]="Error",function(e){var t="error",n="warning",r="warn",i="info",o=Object.create(null);o[e.Error]=we("sev.error","Error"),o[e.Warning]=we("sev.warning","Warning"),o[e.Info]=we("sev.info","Info"),e.fromValue=function(o){return o?fn(t,o)?e.Error:fn(n,o)||fn(r,o)?e.Warning:fn(i,o)?e.Info:e.Ignore:e.Ignore}}($g||($g={}));var Xg=$g,Qg=pt("notificationService"),em=function(){},tm=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nm=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},rm=function(e,t){return function(n,r){t(n,r,e)}},im=524288;function om(e){if(!e.hasModel())return null;var t=e.getSelection();if(t.startLineNumber===t.endLineNumber)if(t.isEmpty()){var n=e.getModel().getWordAtPosition(t.getStartPosition());if(n)return n.word}else if(e.getModel().getValueLengthInRange(t)e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()||this._state.change({searchScope:e},!0)}},t.prototype.setSearchString=function(e){this._state.isRegex&&(e=en(e)),this._state.change({searchString:e},!1)},t.prototype.highlightFindOptions=function(){},t.prototype._start=function(e){if(this.disposeModel(),this._editor.hasModel()){var t,n={isRevealed:!0};if(e.seedSearchStringFromSelection)(t=om(this._editor))&&(this._state.isRegex?n.searchString=en(t):n.searchString=t);if(!n.searchString&&e.seedSearchStringFromGlobalClipboard)(t=this.getGlobalBufferTerm())&&(n.searchString=t);if(e.forceRevealReplace?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),e.updateSearchScope){var r=this._editor.getSelection();r.isEmpty()||(n.searchScope=r)}this._state.change(n,!1),this._model||(this._model=new Zd(this._editor,this._state))}},t.prototype.start=function(e){this._start(e)},t.prototype.moveToNextMatch=function(){return!!this._model&&(this._model.moveToNextMatch(),!0)},t.prototype.moveToPrevMatch=function(){return!!this._model&&(this._model.moveToPrevMatch(),!0)},t.prototype.replace=function(){return!!this._model&&(this._model.replace(),!0)},t.prototype.replaceAll=function(){return!!this._model&&(this._model.replaceAll(),!0)},t.prototype.selectAllMatches=function(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)},t.prototype.getGlobalBufferTerm=function(){return this._editor.getConfiguration().contribInfo.find.globalFindClipboard&&this._clipboardService&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""},t.prototype.setGlobalBufferTerm=function(e){this._editor.getConfiguration().contribInfo.find.globalFindClipboard&&this._clipboardService&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)},t.ID="editor.contrib.findController",t=nm([rm(1,jn),rm(2,Gg),rm(3,Vg)],t)}(Dt),um=function(e){function t(t,n,r,i,o,s,a,u){var c=e.call(this,t,r,a,u)||this;return c._contextViewService=n,c._keybindingService=i,c._themeService=o,c._notificationService=s,c._widget=null,c._findOptionsWidget=null,c}return tm(t,e),t.prototype._start=function(t){this._widget||this._createFindWidget(),!this._widget.getPosition()&&this._editor.getConfiguration().contribInfo.find.autoFindInSelection&&(t.updateSearchScope=!0),e.prototype._start.call(this,t),2===t.shouldFocus?this._widget.focusReplaceInput():1===t.shouldFocus&&this._widget.focusFindInput()},t.prototype.highlightFindOptions=function(){this._widget||this._createFindWidget(),this._state.isRevealed?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()},t.prototype._createFindWidget=function(){this._widget=this._register(new jg(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new Vf(this._editor,this._state,this._keybindingService,this._themeService))},t=nm([rm(1,zg),rm(2,jn),rm(3,qg),rm(4,Ld),rm(5,Qg),rm(6,Gg),rm(7,gt(Vg))],t)}(am),cm=function(e){function t(){return e.call(this,{id:$d.StartFindAction,label:we("startFindAction","Find"),alias:"Find",precondition:void 0,kbOpts:{kbExpr:null,primary:2084,weight:100},menubarOpts:{menuId:14,group:"3_find",title:we({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}})||this}return tm(t,e),t.prototype.run=function(e,t){var n=am.get(t);n&&n.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getConfiguration().contribInfo.find.globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1})},t}(Lr),lm=function(e){function t(){return e.call(this,{id:$d.StartFindWithSelection,label:we("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})||this}return tm(t,e),t.prototype.run=function(e,t){var n=am.get(t);n&&(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:!0,seedSearchStringFromGlobalClipboard:!1,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1}),n.setGlobalBufferTerm(n.getState().searchString))},t}(Lr),dm=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tm(t,e),t.prototype.run=function(e,t){var n=am.get(t);n&&!this._run(n)&&(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===n.getState().searchString.length&&t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1}),this._run(n))},t}(Lr),hm=function(e){function t(){return e.call(this,{id:$d.NextMatchFindAction,label:we("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:{kbExpr:wc.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(dm),fm=function(e){function t(){return e.call(this,{id:$d.NextMatchFindAction,label:we("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:{kbExpr:En.and(wc.focus,Vd),primary:3,weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(dm),pm=function(e){function t(){return e.call(this,{id:$d.PreviousMatchFindAction,label:we("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:{kbExpr:wc.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(dm),gm=function(e){function t(){return e.call(this,{id:$d.PreviousMatchFindAction,label:we("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:{kbExpr:En.and(wc.focus,Vd),primary:1027,weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(dm),mm=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tm(t,e),t.prototype.run=function(e,t){var n=am.get(t);if(n){var r=om(t);r&&n.setSearchString(r),this._run(n)||(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1}),this._run(n))}},t}(Lr),_m=function(e){function t(){return e.call(this,{id:$d.NextSelectionMatchFindAction,label:we("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:wc.focus,primary:2109,weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(mm),ym=function(e){function t(){return e.call(this,{id:$d.PreviousSelectionMatchFindAction,label:we("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:wc.focus,primary:3133,weight:100}})||this}return tm(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(mm),vm=function(e){function t(){return e.call(this,{id:$d.StartFindReplaceAction,label:we("startReplace","Replace"),alias:"Replace",precondition:void 0,kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menubarOpts:{menuId:14,group:"3_find",title:we({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}})||this}return tm(t,e),t.prototype.run=function(e,t){if(t.hasModel()&&!t.getConfiguration().readOnly){var n=am.get(t),r=t.getSelection(),i=n.isFindInputFocused(),o=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&t.getConfiguration().contribInfo.find.seedSearchStringFromSelection&&!i,s=i||o?2:1;n&&n.start({forceRevealReplace:!0,seedSearchStringFromSelection:o,seedSearchStringFromGlobalClipboard:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,shouldFocus:s,shouldAnimate:!0,updateSearchScope:!1})}},t}(Lr);sm=um,Dr.INSTANCE.registerEditorContribution(sm),Er(cm),Er(lm),Er(hm),Er(fm),Er(pm),Er(gm),Er(_m),Er(ym),Er(vm);var bm=kr.bindToContribution(am.get);Mr(new bm({id:$d.CloseFindWidgetCommand,precondition:Wd,handler:function(e){return e.closeFindWidget()},kbOpts:{weight:105,kbExpr:wc.focus,primary:9,secondary:[1033]}})),Mr(new bm({id:$d.ToggleCaseSensitiveCommand,precondition:void 0,handler:function(e){return e.toggleCaseSensitive()},kbOpts:{weight:105,kbExpr:wc.focus,primary:Ud.primary,mac:Ud.mac,win:Ud.win,linux:Ud.linux}})),Mr(new bm({id:$d.ToggleWholeWordCommand,precondition:void 0,handler:function(e){return e.toggleWholeWords()},kbOpts:{weight:105,kbExpr:wc.focus,primary:qd.primary,mac:qd.mac,win:qd.win,linux:qd.linux}})),Mr(new bm({id:$d.ToggleRegexCommand,precondition:void 0,handler:function(e){return e.toggleRegex()},kbOpts:{weight:105,kbExpr:wc.focus,primary:Kd.primary,mac:Kd.mac,win:Kd.win,linux:Kd.linux}})),Mr(new bm({id:$d.ToggleSearchScopeCommand,precondition:void 0,handler:function(e){return e.toggleSearchScope()},kbOpts:{weight:105,kbExpr:wc.focus,primary:Gd.primary,mac:Gd.mac,win:Gd.win,linux:Gd.linux}})),Mr(new bm({id:$d.ReplaceOneAction,precondition:Wd,handler:function(e){return e.replace()},kbOpts:{weight:105,kbExpr:wc.focus,primary:3094}})),Mr(new bm({id:$d.ReplaceOneAction,precondition:Wd,handler:function(e){return e.replace()},kbOpts:{weight:105,kbExpr:En.and(wc.focus,zd),primary:3}})),Mr(new bm({id:$d.ReplaceAllAction,precondition:Wd,handler:function(e){return e.replaceAll()},kbOpts:{weight:105,kbExpr:wc.focus,primary:2563}})),Mr(new bm({id:$d.ReplaceAllAction,precondition:Wd,handler:function(e){return e.replaceAll()},kbOpts:{weight:105,kbExpr:En.and(wc.focus,zd),primary:void 0,mac:{primary:2051}}})),Mr(new bm({id:$d.SelectAllMatchesAction,precondition:Wd,handler:function(e){return e.selectAllMatches()},kbOpts:{weight:105,kbExpr:wc.focus,primary:515}}));var wm,Cm,Sm,xm,km,Lm,Mm,Em,Dm,Tm,Nm,Om,Am,Im,Pm,Rm,Fm,Ym,jm,Bm,Hm,Wm,Vm,zm,Um,qm,Km,Gm,$m,Zm,Jm;n(386);!function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(wm||(wm={})),(Sm=Cm||(Cm={}))[Sm.Hint=1]="Hint",Sm[Sm.Info=2]="Info",Sm[Sm.Warning=4]="Warning",Sm[Sm.Error=8]="Error",function(e){e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.KEY_0=21]="KEY_0",e[e.KEY_1=22]="KEY_1",e[e.KEY_2=23]="KEY_2",e[e.KEY_3=24]="KEY_3",e[e.KEY_4=25]="KEY_4",e[e.KEY_5=26]="KEY_5",e[e.KEY_6=27]="KEY_6",e[e.KEY_7=28]="KEY_7",e[e.KEY_8=29]="KEY_8",e[e.KEY_9=30]="KEY_9",e[e.KEY_A=31]="KEY_A",e[e.KEY_B=32]="KEY_B",e[e.KEY_C=33]="KEY_C",e[e.KEY_D=34]="KEY_D",e[e.KEY_E=35]="KEY_E",e[e.KEY_F=36]="KEY_F",e[e.KEY_G=37]="KEY_G",e[e.KEY_H=38]="KEY_H",e[e.KEY_I=39]="KEY_I",e[e.KEY_J=40]="KEY_J",e[e.KEY_K=41]="KEY_K",e[e.KEY_L=42]="KEY_L",e[e.KEY_M=43]="KEY_M",e[e.KEY_N=44]="KEY_N",e[e.KEY_O=45]="KEY_O",e[e.KEY_P=46]="KEY_P",e[e.KEY_Q=47]="KEY_Q",e[e.KEY_R=48]="KEY_R",e[e.KEY_S=49]="KEY_S",e[e.KEY_T=50]="KEY_T",e[e.KEY_U=51]="KEY_U",e[e.KEY_V=52]="KEY_V",e[e.KEY_W=53]="KEY_W",e[e.KEY_X=54]="KEY_X",e[e.KEY_Y=55]="KEY_Y",e[e.KEY_Z=56]="KEY_Z",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.NumLock=78]="NumLock",e[e.ScrollLock=79]="ScrollLock",e[e.US_SEMICOLON=80]="US_SEMICOLON",e[e.US_EQUAL=81]="US_EQUAL",e[e.US_COMMA=82]="US_COMMA",e[e.US_MINUS=83]="US_MINUS",e[e.US_DOT=84]="US_DOT",e[e.US_SLASH=85]="US_SLASH",e[e.US_BACKTICK=86]="US_BACKTICK",e[e.US_OPEN_SQUARE_BRACKET=87]="US_OPEN_SQUARE_BRACKET",e[e.US_BACKSLASH=88]="US_BACKSLASH",e[e.US_CLOSE_SQUARE_BRACKET=89]="US_CLOSE_SQUARE_BRACKET",e[e.US_QUOTE=90]="US_QUOTE",e[e.OEM_8=91]="OEM_8",e[e.OEM_102=92]="OEM_102",e[e.NUMPAD_0=93]="NUMPAD_0",e[e.NUMPAD_1=94]="NUMPAD_1",e[e.NUMPAD_2=95]="NUMPAD_2",e[e.NUMPAD_3=96]="NUMPAD_3",e[e.NUMPAD_4=97]="NUMPAD_4",e[e.NUMPAD_5=98]="NUMPAD_5",e[e.NUMPAD_6=99]="NUMPAD_6",e[e.NUMPAD_7=100]="NUMPAD_7",e[e.NUMPAD_8=101]="NUMPAD_8",e[e.NUMPAD_9=102]="NUMPAD_9",e[e.NUMPAD_MULTIPLY=103]="NUMPAD_MULTIPLY",e[e.NUMPAD_ADD=104]="NUMPAD_ADD",e[e.NUMPAD_SEPARATOR=105]="NUMPAD_SEPARATOR",e[e.NUMPAD_SUBTRACT=106]="NUMPAD_SUBTRACT",e[e.NUMPAD_DECIMAL=107]="NUMPAD_DECIMAL",e[e.NUMPAD_DIVIDE=108]="NUMPAD_DIVIDE",e[e.KEY_IN_COMPOSITION=109]="KEY_IN_COMPOSITION",e[e.ABNT_C1=110]="ABNT_C1",e[e.ABNT_C2=111]="ABNT_C2",e[e.MAX_VALUE=112]="MAX_VALUE"}(xm||(xm={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(km||(km={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(Lm||(Lm={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(Mm||(Mm={})),function(e){e[e.Inline=1]="Inline"}(Em||(Em={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Dm||(Dm={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Tm||(Tm={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(Nm||(Nm={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(Om||(Om={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(Am||(Am={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(Im||(Im={})),function(e){e[e.None=0]="None",e[e.Small=1]="Small",e[e.Large=2]="Large",e[e.SmallBlocks=3]="SmallBlocks",e[e.LargeBlocks=4]="LargeBlocks"}(Pm||(Pm={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(Rm||(Rm={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(Fm||(Fm={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(Ym||(Ym={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(jm||(jm={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(Bm||(Bm={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(Hm||(Hm={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}(Wm||(Wm={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(Vm||(Vm={})),function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.Snippet=25]="Snippet"}(zm||(zm={})),function(e){e[e.Deprecated=1]="Deprecated"}(Um||(Um={})),function(e){e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(qm||(qm={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(Km||(Km={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(Gm||(Gm={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}($m||($m={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(Zm||(Zm={})),function(e){e[e.Deprecated=1]="Deprecated"}(Jm||(Jm={}));var Xm=function(){function e(){}return e.chord=function(e,t){return function(e,t){return(e|(65535&t)<<16>>>0)>>>0}(e,t)},e.CtrlCmd=2048,e.Shift=1024,e.Alt=512,e.WinCtrl=256,e}();function Qm(){return{editor:void 0,languages:void 0,CancellationTokenSource:ys,Emitter:Ht,KeyCode:xm,KeyMod:Xm,Position:_t,Range:Tr,Selection:Or,SelectionDirection:km,MarkerSeverity:Cm,MarkerTag:wm,Uri:it,Token:Ta}}var e_;n(388);function t_(e){var t=JSON.parse(e);return t=function e(t,n){if(!t||n>200)return t;if("object"==typeof t){switch(t.$mid){case 1:return it.revive(t);case 2:return new RegExp(t.source,t.flags)}for(var r in t)Object.hasOwnProperty.call(t,r)&&(t[r]=e(t[r],n+1))}return t}(t,0)}function n_(e){var t,n,r=e.path;return t=e.authority&&r.length>1&&e.scheme===bh.file?"//"+e.authority+r:Ge.g&&47===r.charCodeAt(0)&&((n=r.charCodeAt(1))>=65&&n<=90||n>=97&&n<=122)&&58===r.charCodeAt(2)?r.substr(1):r,Ge.g&&(t=t.replace(/\//g,"\\")),t}!function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){var n=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach((function(e){var t=e.split(":"),r=t[0],i=t[1];r&&i&&n.set(r,i)}));var r=t.path.substring(0,t.path.indexOf(";"));return r&&n.set(e.META_DATA_MIME,r),n}}(e_||(e_={}));var r_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i_=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o_=function(e,t){return function(n,r){t(n,r,e)}},s_=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(s,a)}u((r=r.apply(e,t||[])).next())}))},a_=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));var n=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{var r=n.range.getStartPosition();this._editor.setPosition(r),this._editor.revealPositionInCenter(r,t)}finally{this.ignoreSelectionChange=!1}}},t.prototype.canNavigate=function(){return this.ranges&&this.ranges.length>0},t.prototype.next=function(e){void 0===e&&(e=0),this._move(!0,e)},t.prototype.previous=function(e){void 0===e&&(e=0),this._move(!1,e)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.ranges=[],this.disposed=!0},t}(Dt),h_=new(function(){function e(){this._zoomLevel=0,this._onDidChangeZoomLevel=new Ht,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}return e.prototype.getZoomLevel=function(){return this._zoomLevel},e.prototype.setZoomLevel=function(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))},e}()),f_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),p_=Ge.d?1.5:1.35;function g_(e,t){if("number"==typeof e)return e;if(void 0===e)return t;var n=parseFloat(e);return isNaN(n)?t:n}function m_(e,t,n){return en?n:e}function __(e,t){return"string"!=typeof e?t:e}var y_=function(){function e(e){this.zoomLevel=e.zoomLevel,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}return e.createFromRawSettings=function(t,n,r){void 0===r&&(r=!1);var i=__(t.fontFamily,fi.fontFamily),o=__(t.fontWeight,fi.fontWeight),s=g_(t.fontSize,fi.fontSize);0===(s=m_(s,0,100))?s=fi.fontSize:s<8&&(s=8);var a=function(e,t){if("number"==typeof e)return Math.round(e);if(void 0===e)return t;var n=parseInt(e);return isNaN(n)?t:n}(t.lineHeight,0);0===(a=m_(a,0,150))?a=Math.round(p_*s):a<8&&(a=8);var u=g_(t.letterSpacing,0);u=m_(u,-5,20);var c=1+(r?0:.1*h_.getZoomLevel());return new e({zoomLevel:n,fontFamily:i,fontWeight:o,fontSize:s*=c,lineHeight:a*=c,letterSpacing:u})},e.prototype.getId=function(){return this.zoomLevel+"-"+this.fontFamily+"-"+this.fontWeight+"-"+this.fontSize+"-"+this.lineHeight+"-"+this.letterSpacing},e.prototype.getMassagedFontFamily=function(){return/[,"']/.test(this.fontFamily)?this.fontFamily:/[+ ]/.test(this.fontFamily)?'"'+this.fontFamily+'"':this.fontFamily},e}(),v_=function(e){function t(t,n){var r=e.call(this,t)||this;return r.isTrusted=n,r.isMonospace=t.isMonospace,r.typicalHalfwidthCharacterWidth=t.typicalHalfwidthCharacterWidth,r.typicalFullwidthCharacterWidth=t.typicalFullwidthCharacterWidth,r.canUseHalfwidthRightwardsArrow=t.canUseHalfwidthRightwardsArrow,r.spaceWidth=t.spaceWidth,r.maxDigitWidth=t.maxDigitWidth,r}return f_(t,e),t.prototype.equals=function(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.maxDigitWidth===e.maxDigitWidth},t}(y_),b_=pt("editorWorkerService"),w_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C_="$initialize",S_=!1;function x_(e){Ge.f&&(S_||(S_=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq")),console.warn(e.message))}var k_=function(){function e(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}return e.prototype.setWorkerId=function(e){this._workerId=e},e.prototype.sendMessage=function(e,t){var n=this,r=String(++this._lastSentReq);return new Promise((function(i,o){n._pendingReplies[r]={resolve:i,reject:o},n._send({vsWorker:n._workerId,req:r,method:e,args:t})}))},e.prototype.handleMessage=function(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))},e.prototype._handleMessage=function(e){var t=this;if(e.seq){var n=e;if(!this._pendingReplies[n.seq])return void console.warn("Got reply to unknown seq");var r=this._pendingReplies[n.seq];if(delete this._pendingReplies[n.seq],n.err){var i=n.err;return n.err.$isError&&((i=new Error).name=n.err.name,i.message=n.err.message,i.stack=n.err.stack),void r.reject(i)}r.resolve(n.res)}else{var o=e,s=o.req;this._handler.handleMessage(o.method,o.args).then((function(e){t._send({vsWorker:t._workerId,seq:s,res:e,err:void 0})}),(function(e){e.detail instanceof Error&&(e.detail=Be(e.detail)),t._send({vsWorker:t._workerId,seq:s,res:void 0,err:Be(e)})}))}},e.prototype._send=function(e){var t=[];if(e.req)for(var n=e,r=0;r0||this.m_modifiedCount>0)&&this.m_changes.push(new D_(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Number.MAX_VALUE,this.m_modifiedStart=Number.MAX_VALUE},e.prototype.AddOriginalElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++},e.prototype.AddModifiedElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++},e.prototype.getChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes},e.prototype.getReverseChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes},e}(),P_=function(){function e(e,t,n){void 0===n&&(n=null),this.OriginalSequence=e,this.ModifiedSequence=t,this.ContinueProcessingPredicate=n,this.m_forwardHistory=[],this.m_reverseHistory=[]}return e.prototype.ElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.OriginalElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.OriginalSequence.getElementAtIndex(t)},e.prototype.ModifiedElementsAreEqual=function(e,t){return this.ModifiedSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.ComputeDiff=function(e){return this._ComputeDiff(0,this.OriginalSequence.getLength()-1,0,this.ModifiedSequence.getLength()-1,e)},e.prototype._ComputeDiff=function(e,t,n,r,i){var o=this.ComputeDiffRecursive(e,t,n,r,[!1]);return i?this.PrettifyChanges(o):o},e.prototype.ComputeDiffRecursive=function(e,t,n,r,i){for(i[0]=!1;e<=t&&n<=r&&this.ElementsAreEqual(e,n);)e++,n++;for(;t>=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){var o=void 0;return n<=r?(O_.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new D_(e,0,n,r-n+1)]):e<=t?(O_.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[new D_(e,t-e+1,n,0)]):(O_.Assert(e===t+1,"originalStart should only be one more than originalEnd"),O_.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}var s=[0],a=[0],u=this.ComputeRecursionPoint(e,t,n,r,s,a,i),c=s[0],l=a[0];if(null!==u)return u;if(!i[0]){var d=this.ComputeDiffRecursive(e,c,n,l,i),h=[];return h=i[0]?[new D_(c+1,t-(c+1)+1,l+1,r-(l+1)+1)]:this.ComputeDiffRecursive(c+1,t,l+1,r,i),this.ConcatenateChanges(d,h)}return[new D_(e,t-e+1,n,r-n+1)]},e.prototype.WALKTRACE=function(e,t,n,r,i,o,s,a,u,c,l,d,h,f,p,g,m,_){var y,v,b=null,w=new I_,C=t,S=n,x=h[0]-g[0]-r,k=Number.MIN_VALUE,L=this.m_forwardHistory.length-1;do{(v=x+e)===C||v=0&&(e=(u=this.m_forwardHistory[L])[0],C=1,S=u.length-1)}while(--L>=-1);if(y=w.getReverseChanges(),_[0]){var M=h[0]+1,E=g[0]+1;if(null!==y&&y.length>0){var D=y[y.length-1];M=Math.max(M,D.getOriginalEnd()),E=Math.max(E,D.getModifiedEnd())}b=[new D_(M,d-M+1,E,p-E+1)]}else{w=new I_,C=o,S=s,x=h[0]-g[0]-a,k=Number.MAX_VALUE,L=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{(v=x+i)===C||v=c[v+1]?(f=(l=c[v+1]-1)-x-a,l>k&&w.MarkNextChange(),k=l+1,w.AddOriginalElement(l+1,f+1),x=v+1-i):(f=(l=c[v-1])-x-a,l>k&&w.MarkNextChange(),k=l,w.AddModifiedElement(l+1,f+1),x=v-1-i),L>=0&&(i=(c=this.m_reverseHistory[L])[0],C=1,S=c.length-1)}while(--L>=-1);b=w.getChanges()}return this.ConcatenateChanges(y,b)},e.prototype.ComputeRecursionPoint=function(e,t,n,r,i,o,s){var a,u=0,c=0,l=0,d=0,h=0,f=0;e--,n--,i[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];var p,g,m=t-e+(r-n),_=m+1,y=new Array(_),v=new Array(_),b=r-n,w=t-e,C=e-n,S=t-r,x=(w-b)%2==0;for(y[b]=e,v[w]=t,s[0]=!1,a=1;a<=m/2+1;a++){var k=0,L=0;for(l=this.ClipDiagonalBound(b-a,a,b,_),d=this.ClipDiagonalBound(b+a,a,b,_),p=l;p<=d;p+=2){for(c=(u=p===l||pk+L&&(k=u,L=c),!x&&Math.abs(p-w)<=a-1&&u>=v[p])return i[0]=u,o[0]=c,g<=v[p]&&a<=1448?this.WALKTRACE(b,l,d,C,w,h,f,S,y,v,u,t,i,c,r,o,x,s):null}var M=(k-e+(L-n)-a)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(k,this.OriginalSequence,M))return s[0]=!0,i[0]=k,o[0]=L,M>0&&a<=1448?this.WALKTRACE(b,l,d,C,w,h,f,S,y,v,u,t,i,c,r,o,x,s):(e++,n++,[new D_(e,t-e+1,n,r-n+1)]);for(h=this.ClipDiagonalBound(w-a,a,w,_),f=this.ClipDiagonalBound(w+a,a,w,_),p=h;p<=f;p+=2){for(c=(u=p===h||p=v[p+1]?v[p+1]-1:v[p-1])-(p-w)-S,g=u;u>e&&c>n&&this.ElementsAreEqual(u,c);)u--,c--;if(v[p]=u,x&&Math.abs(p-b)<=a&&u<=y[p])return i[0]=u,o[0]=c,g>=y[p]&&a<=1448?this.WALKTRACE(b,l,d,C,w,h,f,S,y,v,u,t,i,c,r,o,x,s):null}if(a<=1447){var E=new Array(d-l+2);E[0]=b-l+1,A_.Copy(y,l,E,1,d-l+1),this.m_forwardHistory.push(E),(E=new Array(f-h+2))[0]=w-h+1,A_.Copy(v,h,E,1,f-h+1),this.m_reverseHistory.push(E)}}return this.WALKTRACE(b,l,d,C,w,h,f,S,y,v,u,t,i,c,r,o,x,s)},e.prototype.PrettifyChanges=function(e){for(var t=0;t0,s=n.modifiedLength>0;n.originalStart+n.originalLength=0;t--){n=e[t],r=0,i=0;if(t>0){var u=e[t-1];u.originalLength>0&&(r=u.originalStart+u.originalLength),u.modifiedLength>0&&(i=u.modifiedStart+u.modifiedLength)}o=n.originalLength>0,s=n.modifiedLength>0;for(var c=0,l=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength),d=1;;d++){var h=n.originalStart-d,f=n.modifiedStart-d;if(hl&&(l=p,c=d)}n.originalStart-=c,n.modifiedStart-=c}return e},e.prototype._OriginalIsBoundary=function(e){if(e<=0||e>=this.OriginalSequence.getLength()-1)return!0;var t=this.OriginalSequence.getElementAtIndex(e);return"string"==typeof t&&/^\s*$/.test(t)},e.prototype._OriginalRegionIsBoundary=function(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1},e.prototype._ModifiedIsBoundary=function(e){if(e<=0||e>=this.ModifiedSequence.getLength()-1)return!0;var t=this.ModifiedSequence.getElementAtIndex(e);return"string"==typeof t&&/^\s*$/.test(t)},e.prototype._ModifiedRegionIsBoundary=function(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1},e.prototype._boundaryScore=function(e,t,n,r){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(n,r)?1:0)},e.prototype.ConcatenateChanges=function(e,t){var n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){var r=new Array(e.length+t.length-1);return A_.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],A_.Copy(t,1,r,e.length,t.length-1),r}r=new Array(e.length+t.length);return A_.Copy(e,0,r,0,e.length),A_.Copy(t,0,r,e.length,t.length),r},e.prototype.ChangesOverlap=function(e,t,n){if(O_.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),O_.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){var r=e.originalStart,i=e.originalLength,o=e.modifiedStart,s=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(i=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(s=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new D_(r,i,o,s),!0}return n[0]=null,!1},e.prototype.ClipDiagonalBound=function(e,t,n,r){if(e>=0&&e1&&p>1;){if(d.charCodeAt(f-2)!==h.charCodeAt(p-2))break;f--,p--}(f>1||p>1)&&this._pushTrimWhitespaceCharChange(i,o+1,1,f,s+1,1,p);for(var g=j_._getLastNonBlankColumn(d,1),m=j_._getLastNonBlankColumn(h,1),_=d.length+1,y=h.length+1;g<_&&m=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.changeValue=function(e,t){return e=ho(e),t=ho(t),this.values[e]!==t&&(this.values[e]=t,e-1=n.length)return!1;var i=n.length-e;return t>=i&&(t=i),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)},e.prototype.getTotalValue=function(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)},e.prototype.getAccumulatedValue=function(e){return e<0?0:(e=ho(e),this._getAccumulatedValue(e))},e.prototype._getAccumulatedValue=function(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];var t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(var n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]},e.prototype.getIndexOf=function(e){e=Math.floor(e),this.getTotalValue();for(var t=0,n=this.values.length-1,r=0,i=0,o=0;t<=n;)if(r=t+(n-t)/2|0,e<(o=(i=this.prefixSum[r])-this.values[r]))n=r-1;else{if(!(e>=i))break;t=r+1}return new z_(r,e-o)},e}(),q_=function(){function e(e){this._cacheAccumulatedValueStart=0,this._cache=null,this._actual=new U_(e),this._bustCache()}return e.prototype._bustCache=function(){this._cacheAccumulatedValueStart=0,this._cache=null},e.prototype.insertValues=function(e,t){this._actual.insertValues(e,t)&&this._bustCache()},e.prototype.changeValue=function(e,t){this._actual.changeValue(e,t)&&this._bustCache()},e.prototype.removeValues=function(e,t){this._actual.removeValues(e,t)&&this._bustCache()},e.prototype.getTotalValue=function(){return this._actual.getTotalValue()},e.prototype.getAccumulatedValue=function(e){return this._actual.getAccumulatedValue(e)},e.prototype.getIndexOf=function(e){if(e=Math.floor(e),null!==this._cache){var t=e-this._cacheAccumulatedValueStart;if(t>=0&&tt&&(t=c),s>n&&(n=s),(l=o[2])>n&&(n=l)}t++,n++;var a=new co(n,t,0);for(r=0,i=e.length;r=this._maxCharCode?0:this._states.get(e,t)},e}(),$_=null;var Z_=null;var J_=function(){function e(){}return e._createLink=function(e,t,n,r,i){var o=i-1;do{var s=t.charCodeAt(o);if(2!==e.get(s))break;o--}while(o>r);if(r>0){var a=t.charCodeAt(r-1),u=t.charCodeAt(o);(40===a&&41===u||91===a&&93===u||123===a&&125===u)&&o--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:o+2},url:t.substring(r,o+1)}},e.computeLinks=function(t,n){void 0===n&&(null===$_&&($_=new G_([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),n=$_);for(var r=function(){if(null===Z_){Z_=new fo(0);for(var e=0;e<" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…".length;e++)Z_.set(" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…".charCodeAt(e),1);for(e=0;e<".,;".length;e++)Z_.set(".,;".charCodeAt(e),2)}return Z_}(),i=[],o=1,s=t.getLineCount();o<=s;o++){for(var a=t.getLineContent(o),u=a.length,c=0,l=0,d=0,h=1,f=!1,p=!1,g=!1;c=0?((r+=n?1:-1)<0?r=e.length-1:r%=e.length,e[r]):null},e.INSTANCE=new e,e}(),Q_=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ey=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Q_(t,e),Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._versionId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eol",{get:function(){return this._eol},enumerable:!0,configurable:!0}),t.prototype.getValue=function(){return this.getText()},t.prototype.getLinesContent=function(){return this._lines.slice(0)},t.prototype.getLineCount=function(){return this._lines.length},t.prototype.getLineContent=function(e){return this._lines[e-1]},t.prototype.getWordAtPosition=function(e,t){var n=Zr(e.column,$r(t),this._lines[e.lineNumber-1],0);return n?new Tr(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn):null},t.prototype.getWordUntilPosition=function(e,t){var n=this.getWordAtPosition(e,t);return n?{word:this._lines[e.lineNumber-1].substring(n.startColumn-1,e.column-1),startColumn:n.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}},t.prototype.createWordIterator=function(e){var t,n,r=this,i=0,o=0,s=[],a=function(){if(o=r._lines.length?At:(n=r._lines[i],s=r._wordenize(n,e),o=0,i+=1,a())};return{next:a}},t.prototype.getLineWords=function(e,t){for(var n=this._lines[e-1],r=[],i=0,o=this._wordenize(n,t);ithis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{var i=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>i&&(n=i,r=!0)}return r?{lineNumber:t,column:n}:e},t}(K_),ty=function(){function e(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}return e.prototype.dispose=function(){this._models=Object.create(null)},e.prototype._getModel=function(e){return this._models[e]},e.prototype._getModels=function(){var e=this,t=[];return Object.keys(this._models).forEach((function(n){return t.push(e._models[n])})),t},e.prototype.acceptNewModel=function(e){this._models[e.url]=new ey(it.parse(e.url),e.lines,e.EOL,e.versionId)},e.prototype.acceptModelChanged=function(e,t){this._models[e]&&this._models[e].onEvents(t)},e.prototype.acceptRemovedModel=function(e){this._models[e]&&delete this._models[e]},e.prototype.computeDiff=function(e,t,n){var r=this._getModel(e),i=this._getModel(t);if(!r||!i)return Promise.resolve(null);var o=r.getLinesContent(),s=i.getLinesContent(),a=new V_(o,s,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0}).computeDiff(),u=!(a.length>0)&&this._modelsAreIdentical(r,i);return Promise.resolve({identical:u,changes:a})},e.prototype._modelsAreIdentical=function(e,t){var n=e.getLineCount();if(n!==t.getLineCount())return!1;for(var r=1;r<=n;r++){if(e.getLineContent(r)!==t.getLineContent(r))return!1}return!0},e.prototype.computeMoreMinimalEdits=function(t,n){var r=this._getModel(t);if(!r)return Promise.resolve(n);for(var i=[],o=void 0,s=0,a=n=Pr(n,(function(e,t){return e.range&&t.range?Tr.compareRangesUsingStarts(e.range,t.range):(e.range?0:1)-(t.range?0:1)}));se._diffLimit)i.push({range:c,text:l});else for(var f=N_(h,l,!1),p=r.offsetAt(Tr.lift(c).getStartPosition()),g=0,m=f;g=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},uy=function(e,t){return function(n,r){t(n,r,e)}},cy=6e4,ly=3e5;function dy(e,t){var n=e.getModel(t);return!!n&&!n.isTooLargeForSyncing()}var hy=function(e){function t(t,n,r){var i=e.call(this)||this;return i._modelService=t,i._workerManager=i._register(new py(i._modelService)),i._logService=r,i._register(Sa.register("*",{provideLinks:function(e,t){return dy(i._modelService,e.uri)?i._workerManager.withWorker().then((function(t){return t.computeLinks(e.uri)})).then((function(e){return e&&{links:e}})):Promise.resolve({links:[]})}})),i._register(ua.register("*",new fy(i._workerManager,n,i._modelService))),i}return sy(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.canComputeDiff=function(e,t){return dy(this._modelService,e)&&dy(this._modelService,t)},t.prototype.computeDiff=function(e,t,n){return this._workerManager.withWorker().then((function(r){return r.computeDiff(e,t,n)}))},t.prototype.computeMoreMinimalEdits=function(e,t){var n,r=this;if(n=t,Array.isArray(n)&&n.length>0){if(!dy(this._modelService,e))return Promise.resolve(t);var i=Fa.create(!0),o=this._workerManager.withWorker().then((function(n){return n.computeMoreMinimalEdits(e,t)}));return o.finally((function(){return r._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed())})),o}return Promise.resolve(void 0)},t.prototype.canNavigateValueSet=function(e){return dy(this._modelService,e)},t.prototype.navigateValueSet=function(e,t,n){return this._workerManager.withWorker().then((function(r){return r.navigateValueSet(e,t,n)}))},t.prototype.canComputeWordRanges=function(e){return dy(this._modelService,e)},t.prototype.computeWordRanges=function(e,t){return this._workerManager.withWorker().then((function(n){return n.computeWordRanges(e,t)}))},t=ay([uy(0,yt),uy(1,ny),uy(2,iy)],t)}(Dt),fy=function(){function e(e,t,n){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=n}return e.prototype.provideCompletionItems=function(e,t){if(this._configurationService.getValue(e.uri,t,"editor").wordBasedSuggestions&&dy(this._modelService,e.uri))return this._workerManager.withWorker().then((function(n){return n.textualSuggest(e.uri,t)}))},e}(),py=function(e){function t(t){var n=e.call(this)||this;return n._modelService=t,n._editorWorkerClient=null,n._lastWorkerUsedTime=(new Date).getTime(),n._register(new xs).cancelAndSet((function(){return n._checkStopIdleWorker()}),Math.round(ly/2)),n._register(n._modelService.onModelRemoved((function(e){return n._checkStopEmptyWorker()}))),n}return sy(t,e),t.prototype.dispose=function(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),e.prototype.dispose.call(this)},t.prototype._checkStopEmptyWorker=function(){this._editorWorkerClient&&(0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null))},t.prototype._checkStopIdleWorker=function(){this._editorWorkerClient&&((new Date).getTime()-this._lastWorkerUsedTime>ly&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null))},t.prototype.withWorker=function(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new yy(this._modelService,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)},t}(Dt),gy=function(e){function t(t,n,r){var i=e.call(this)||this;if(i._syncedModels=Object.create(null),i._syncedModelsLastUsedTime=Object.create(null),i._proxy=t,i._modelService=n,!r){var o=new xs;o.cancelAndSet((function(){return i._checkStopModelSync()}),Math.round(cy/2)),i._register(o)}return i}return sy(t,e),t.prototype.dispose=function(){for(var t in this._syncedModels)kt(this._syncedModels[t]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),e.prototype.dispose.call(this)},t.prototype.ensureSyncedResources=function(e){for(var t=0,n=e;tcy&&t.push(n)}for(var r=0,i=t;r=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(var n=0;nn)&&(!l.isEmpty()||0!==c.type&&3!==c.type)){var d=l.startLineNumber===n?l.startColumn:r,h=l.endLineNumber===n?l.endColumn:i;o[s++]=new e(d,h,c.inlineClassName,c.type)}}return o},e.compare=function(e,t){return e.startColumn===t.startColumn?e.endColumn===t.endColumn?e.classNamet.className?1:0:e.endColumn-t.endColumn:e.startColumn-t.startColumn},e}(),ky=function(e,t,n){this.startOffset=e,this.endOffset=t,this.className=n},Ly=function(){function e(){this.stopOffsets=[],this.classNames=[],this.count=0}return e.prototype.consumeLowerThan=function(e,t,n){for(;this.count>0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t);break}this.count++},e}(),My=function(){function e(){}return e.normalize=function(e,t){if(0===t.length)return[];for(var n=[],r=new Ly,i=0,o=0,s=t.length;o1)mn(e.charCodeAt(u-2))&&u--;if(c>1)mn(e.charCodeAt(c-2))&&c--;var d=u-1,h=c-2;i=r.consumeLowerThan(d,i,n),0===r.count&&(i=d),r.insert(h,l)}return r.consumeLowerThan(1073741824,i,n),n},e}(),Ey=function(e,t){this.endIndex=e,this.type=t},Dy=function(){function e(e,t){this.startOffset=e,this.endOffset=t}return e.prototype.equals=function(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset},e}(),Ty=function(){function e(e,t,n,r,i,o,s,a,u,c,l,d,h,f,p,g){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=n,this.continuesWithWrappedLine=r,this.isBasicASCII=i,this.containsRTL=o,this.fauxIndentLength=s,this.lineTokens=a,this.lineDecorations=u,this.tabSize=c,this.spaceWidth=l,this.stopRenderingLineAfter=d,this.renderWhitespace="all"===h?3:"boundary"===h?1:"selection"===h?2:0,this.renderControlCharacters=f,this.fontLigatures=p,this.selectionsOnLine=g&&g.sort((function(e,t){return e.startOffset>>16},e.getCharIndex=function(e){return(65535&e)>>>0},e.prototype.setPartData=function(e,t,n,r){var i=(t<<16|n<<0)>>>0;this._data[e]=i,this._absoluteOffsets[e]=r+n},e.prototype.getAbsoluteOffsets=function(){return this._absoluteOffsets},e.prototype.charOffsetToPartData=function(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]},e.prototype.partDataToCharOffset=function(t,n,r){if(0===this.length)return 0;for(var i=(t<<16|r<<0)>>>0,o=0,s=this.length-1;o+1>>1,u=this._data[a];if(u===i)return a;u>i?s=a:o=a}if(o===s)return o;var c=this._data[o],l=this._data[s];if(c===i)return o;if(l===i)return s;var d=e.getPartIndex(c);return r-e.getCharIndex(c)<=(d!==e.getPartIndex(l)?n:e.getCharIndex(l))-r?o:s},e}(),Oy=function(e,t,n){this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=n};function Ay(e,t){if(0===e.lineContent.length){var n=0,r=" ";if(e.lineDecorations.length>0){for(var i=[],o=0,s=e.lineDecorations.length;o')}return t.appendASCIIString(r),new Oy(new Ny(0,0),!1,n)}return function(e,t){var n=e.fontIsMonospace,r=e.canUseHalfwidthRightwardsArrow,i=e.containsForeignElements,o=e.lineContent,s=e.len,a=e.isOverflowing,u=e.parts,c=e.tabSize,l=e.containsRTL,d=e.spaceWidth,h=e.renderWhitespace,f=e.renderControlCharacters,p=new Ny(s+1,u.length),g=0,m=0,_=0,y=0,v=0;t.appendASCIIString("");for(var b=0,w=u.length;b=0;if(_=0,t.appendASCIIString('0&&(!r||T>1?t.write1(8594):t.write1(65515),T--);T>0;)t.write1(160),T--;else t.write1(183);_++}y=L}else{L=0;for(l&&t.appendASCIIString(' dir="ltr"'),t.appendASCII(62);g0;)t.write1(160),L++,T--;break;case 32:t.write1(160),L++;break;case 60:t.appendASCIIString("<"),L++;break;case 62:t.appendASCIIString(">"),L++;break;case 38:t.appendASCIIString("&"),L++;break;case 0:t.appendASCIIString("�"),L++;break;case 65279:case 8232:t.write1(65533),L++;break;default:Sn(D)&&m++,f&&D<32?(t.write1(9216+D),L++):(t.write1(D),L++)}_++}y=L}t.appendASCIIString("")}p.setPartData(s,u.length-1,_,v),a&&t.appendASCIIString("");return t.appendASCIIString(""),new Oy(p,l,i)}(function(e){var t,n,r=e.useMonospaceOptimizations,i=e.lineContent;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0&&(r[i++]=new Ey(t,""));for(var o=0,s=e.getCount();o=n){r[i++]=new Ey(n,u);break}r[i++]=new Ey(a,u)}}return r}(e.lineTokens,e.fauxIndentLength,n);(3===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine)&&(o=function(e,t,n,r,i,o,s,a,u){var c,l=[],d=0,h=0,f=r[h].type,p=r[h].endIndex,g=r.length,m=an(e);-1===m?(m=t,c=t):c=cn(e);for(var _=0,y=0;y=w.endOffset&&(b++,w=a&&a[b]);var S=void 0;if(yc)S=!0;else if(9===C)S=!0;else if(32===C)if(u)if(v)S=!0;else{var x=y+1y),v?(!S||!s&&_>=o)&&(l[d++]=new Ey(y,"vs-whitespace"),_%=o):(y===p||S&&y>i)&&(l[d++]=new Ey(y,f),_%=o),9===C?_=o:Sn(C)?_+=2:_++,v=S,y===p&&++h0?e.charCodeAt(t-1):0,M=t>1?e.charCodeAt(t-2):0;32===L&&32!==M&&9!==M||(k=!0)}else k=!0;return l[d++]=new Ey(t,k?"vs-whitespace":f),l}(i,n,e.continuesWithWrappedLine,o,e.fauxIndentLength,e.tabSize,r,e.selectionsOnLine,1===e.renderWhitespace));var s=0;if(e.lineDecorations.length>0){for(var a=0,u=e.lineDecorations.length;ac&&(c=g.startOffset,a[u++]=new Ey(c,p)),!(g.endOffset+1<=f)){c=f,a[u++]=new Ey(c,p+" "+g.className);break}c=g.endOffset+1,a[u++]=new Ey(c,p+" "+g.className),s++}f>c&&(c=f,a[u++]=new Ey(c,p))}var m=n[n.length-1].endIndex;if(s=50&&(i[o++]=new Ey(l+1,c),d=l+1,l=-1);d!==u&&(i[o++]=new Ey(u,c))}else i[o++]=f;r=u}else for(s=0,a=t.length;s50){c=f.type;var g=Math.ceil(p/50);for(h=1;h'"_]/g,"-")}function $y(e,t){return new Error(e.languageId+": "+t)}function Zy(e,t,n,r,i){var o=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,s,a,u,c,l,d,h,f){return qy(a)?qy(u)?!qy(c)&&c0;){var r=e.tokenizer[n];if(r)return r;var i=n.lastIndexOf(".");n=i<0?null:n.substr(0,i)}return null}var Xy=function(){function e(e){this._maxCacheDepth=e,this._entries=Object.create(null)}return e.create=function(e,t){return this._INSTANCE.create(e,t)},e.prototype.create=function(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new Qy(e,t);var n=Qy.getStackElementId(e);n.length>0&&(n+="|"),n+=t;var r=this._entries[n];return r||(r=new Qy(e,t),this._entries[n]=r,r)},e._INSTANCE=new e(5),e}(),Qy=function(){function e(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}return e.getStackElementId=function(e){for(var t="";null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t},e._equals=function(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t},e.prototype.equals=function(t){return e._equals(this,t)},e.prototype.push=function(e){return Xy.create(this,e)},e.prototype.pop=function(){return this.parent},e.prototype.popall=function(){for(var e=this;e.parent;)e=e.parent;return e},e.prototype.switchTo=function(e){return Xy.create(this.parent,e)},e}(),ev=function(){function e(e,t){this.modeId=e,this.state=t}return e.prototype.equals=function(e){return this.modeId===e.modeId&&this.state.equals(e.state)},e.prototype.clone=function(){return this.state.clone()===this.state?this:new e(this.modeId,this.state)},e}(),tv=function(){function e(e){this._maxCacheDepth=e,this._entries=Object.create(null)}return e.create=function(e,t){return this._INSTANCE.create(e,t)},e.prototype.create=function(e,t){if(null!==t)return new nv(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new nv(e,t);var n=Qy.getStackElementId(e),r=this._entries[n];return r||(r=new nv(e,null),this._entries[n]=r,r)},e._INSTANCE=new e(5),e}(),nv=function(){function e(e,t){this.stack=e,this.embeddedModeData=t}return e.prototype.clone=function(){return(this.embeddedModeData?this.embeddedModeData.clone():null)===this.embeddedModeData?this:tv.create(this.stack,this.embeddedModeData)},e.prototype.equals=function(t){return t instanceof e&&(!!this.stack.equals(t.stack)&&(null===this.embeddedModeData&&null===t.embeddedModeData||null!==this.embeddedModeData&&null!==t.embeddedModeData&&this.embeddedModeData.equals(t.embeddedModeData)))},e}(),rv=function(){function e(){this._tokens=[],this._language=null,this._lastTokenType=null,this._lastTokenLanguage=null}return e.prototype.enterMode=function(e,t){this._language=t},e.prototype.emit=function(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._language||(this._lastTokenType=t,this._lastTokenLanguage=this._language,this._tokens.push(new Ta(e,t,this._language)))},e.prototype.nestedModeTokenize=function(e,t,n){var r=t.modeId,i=t.state,o=Ma.get(r);if(!o)return this.enterMode(n,r),this.emit(n,""),i;var s=o.tokenize(e,i,n);return this._tokens=this._tokens.concat(s.tokens),this._lastTokenType=null,this._lastTokenLanguage=null,this._language=null,s.endState},e.prototype.finalize=function(e){return new Na(this._tokens,e)},e}(),iv=function(){function e(e,t){this._modeService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}return e.prototype.enterMode=function(e,t){this._currentLanguageId=this._modeService.getLanguageIdentifier(t).id},e.prototype.emit=function(e,t){var n=this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))},e._merge=function(e,t,n){var r=null!==e?e.length:0,i=t.length,o=null!==n?n.length:0;if(0===r&&0===i&&0===o)return new Uint32Array(0);if(0===r&&0===i)return n;if(0===i&&0===o)return e;var s=new Uint32Array(r+i+o);null!==e&&s.set(e);for(var a=0;a0&&r.nestedModeTokenize(s,t.embeddedModeData,n);var a=e.substring(i);return this._myTokenize(a,t,n+i,r)},e.prototype._safeRuleName=function(e){return e?e.name:"(unknown)"},e.prototype._myTokenize=function(e,t,n,r){r.enterMode(n,this._modeId);for(var i,o,s=e.length,a=t.embeddedModeData,u=t.stack,c=0,l=null,d=!0;d||c=s)break;d=!1;var C=this._lexer.tokenizer[g];if(!C&&!(C=Jy(this._lexer,g)))throw $y(this._lexer,"tokenizer state is not defined: "+g);for(var S=e.substr(c),x=0,k=C;x=this._lexer.maxStack)throw $y(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(g)}else if("@pop"===y.next){if(u.depth<=1)throw $y(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(v));u=u.pop()}else if("@popall"===y.next)u=u.popall();else{var E;if("@"===(E=Zy(this._lexer,y.next,_,m,g))[0]&&(E=E.substr(1)),!Jy(this._lexer,E))throw $y(this._lexer,"trying to set a next state '"+E+"' that is undefined in rule: "+this._safeRuleName(v));u=u.push(E)}}y.log&&"string"==typeof y.log&&(i=this._lexer,o=this._lexer.languageId+": "+Zy(this._lexer,y.log,_,m,g),console.log(i.languageId+": "+o))}if(null===M)throw $y(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(v));if(Array.isArray(M)){if(l&&l.groups.length>0)throw $y(this._lexer,"groups cannot be nested: "+this._safeRuleName(v));if(m.length!==M.length+1)throw $y(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(v));for(var D=0,T=1;T=0&&a()}))})},e.colorizeLine=function(e,t,n,r,i){void 0===i&&(i=4);var o=By.isBasicASCII(e,t),s=By.containsRTL(e,o,n);return Py(new Ty(!1,!0,e,!1,o,s,0,r,[],i,0,-1,"none",!1,!1,null)).html},e.colorizeModelLine=function(e,t,n){void 0===n&&(n=4);var r=e.getLineContent(t);e.forceTokenization(t);var i=e.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),i,n)},e}();function uv(e,t,n){return new Promise((function(r,i){var o=function(){var s=function(e,t,n){for(var r=[],i=n.getInitialState(),o=0,s=e.length;o"),i=u.endState}return r.join("")}(e,t,n);if(n instanceof ov){var a=n.getLoadStatus();if(!1===a.loaded)return void a.promise.then(o,i)}r(s)};o()}))}function cv(e,t){var n=[],r=new Uint32Array(2);r[0]=0,r[1]=16793600;for(var i=0,o=e.length;i")}return n.join("")}var lv={Configuration:"base.contributions.configuration"},dv={properties:{},patternProperties:{}},hv={properties:{},patternProperties:{}},fv={properties:{},patternProperties:{}},pv={properties:{},patternProperties:{}},gv={properties:{},patternProperties:{}},mv={properties:{},patternProperties:{}},_v="vscode://schemas/settings/editor",yv=yr.as(Bc),vv=function(){function e(){this.overrideIdentifiers=[],this._onDidSchemaChange=new Ht,this._onDidUpdateConfiguration=new Ht,this.defaultOverridesConfigurationNode={id:"defaultOverrides",title:we("defaultConfigurations.title","Default Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultOverridesConfigurationNode],this.editorConfigurationSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowsTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},this.computeOverridePropertyPattern(),yv.registerSchema(_v,this.editorConfigurationSchema)}return e.prototype.registerConfiguration=function(e,t){void 0===t&&(t=!0),this.registerConfigurations([e],t)},e.prototype.registerConfigurations=function(e,t){var n=this;void 0===t&&(t=!0);var r=[];e.forEach((function(e){r.push.apply(r,n.validateAndRegisterProperties(e,t)),n.configurationContributors.push(e),n.registerJSONConfiguration(e),n.updateSchemaForOverrideSettingsConfiguration(e)})),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(r)},e.prototype.registerOverrideIdentifiers=function(e){var t;(t=this.overrideIdentifiers).push.apply(t,e),this.updateOverridePropertyPatternKey()},e.prototype.validateAndRegisterProperties=function(e,t,n,r){void 0===t&&(t=!0),void 0===n&&(n=3),void 0===r&&(r=!1),n=Ee(e.scope)?n:e.scope,r=e.overridable||r;var i=[],o=e.properties;if(o)for(var s in o){var a=void 0;if(t&&(a=Lv(s)))console.warn(a),delete o[s];else{var u=o[s];Me(u.default)&&(u.default=xv(u.type)),r&&(u.overridable=!0),Sv.test(s)?u.scope=void 0:u.scope=Ee(u.scope)?n:u.scope,!o[s].hasOwnProperty("included")||o[s].included?(this.configurationProperties[s]=o[s],i.push(s)):(this.excludedConfigurationProperties[s]=o[s],delete o[s])}}var c=e.allOf;if(c)for(var l=0,d=c;l console.log` because `log` has been completed recently."),we("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],default:"recentlyUsed",description:we("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")},"editor.suggestFontSize":{type:"integer",default:0,minimum:0,markdownDescription:we("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")},"editor.suggestLineHeight":{type:"integer",default:0,minimum:0,markdownDescription:we("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.")},"editor.tabCompletion":{type:"string",default:"off",enum:["on","off","onlySnippets"],enumDescriptions:[we("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),we("tabCompletion.off","Disable tab completions."),we("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:we("tabCompletion","Enables tab completions.")},"editor.suggest.filterGraceful":{type:"boolean",default:!0,description:we("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:!1,description:we("suggest.localityBonus","Controls whether sorting favours words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:!1,markdownDescription:we("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:!0,description:we("suggest.snippetsPreventQuickSuggestions","Control whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:Ev.contribInfo.suggest.showIcons,description:we("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.maxVisibleSuggestions":{type:"number",default:Ev.contribInfo.suggest.maxVisibleSuggestions,minimum:1,maximum:15,description:we("suggest.maxVisibleSuggestions","Controls how many suggestions IntelliSense will show before showing a scrollbar (maximum 15).")},"editor.suggest.filteredTypes":{type:"object",default:{keyword:!0,snippet:!0},markdownDescription:we("suggest.filtered","Controls whether some suggestion types should be filtered from IntelliSense. A list of suggestion types can be found here: https://code.visualstudio.com/docs/editor/intellisense#_types-of-completions."),properties:{method:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.method","When set to `false` IntelliSense never shows `method` suggestions.")},function:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.function","When set to `false` IntelliSense never shows `function` suggestions.")},constructor:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.constructor","When set to `false` IntelliSense never shows `constructor` suggestions.")},field:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.field","When set to `false` IntelliSense never shows `field` suggestions.")},variable:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.variable","When set to `false` IntelliSense never shows `variable` suggestions.")},class:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.class","When set to `false` IntelliSense never shows `class` suggestions.")},struct:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.struct","When set to `false` IntelliSense never shows `struct` suggestions.")},interface:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.interface","When set to `false` IntelliSense never shows `interface` suggestions.")},module:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.module","When set to `false` IntelliSense never shows `module` suggestions.")},property:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.property","When set to `false` IntelliSense never shows `property` suggestions.")},event:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.event","When set to `false` IntelliSense never shows `event` suggestions.")},operator:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.operator","When set to `false` IntelliSense never shows `operator` suggestions.")},unit:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.unit","When set to `false` IntelliSense never shows `unit` suggestions.")},value:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.value","When set to `false` IntelliSense never shows `value` suggestions.")},constant:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.constant","When set to `false` IntelliSense never shows `constant` suggestions.")},enum:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.enum","When set to `false` IntelliSense never shows `enum` suggestions.")},enumMember:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.enumMember","When set to `false` IntelliSense never shows `enumMember` suggestions.")},keyword:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.keyword","When set to `false` IntelliSense never shows `keyword` suggestions.")},text:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.text","When set to `false` IntelliSense never shows `text` suggestions.")},color:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.color","When set to `false` IntelliSense never shows `color` suggestions.")},file:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.file","When set to `false` IntelliSense never shows `file` suggestions.")},reference:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.reference","When set to `false` IntelliSense never shows `reference` suggestions.")},customcolor:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.customcolor","When set to `false` IntelliSense never shows `customcolor` suggestions.")},folder:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.folder","When set to `false` IntelliSense never shows `folder` suggestions.")},typeParameter:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.typeParameter","When set to `false` IntelliSense never shows `typeParameter` suggestions.")},snippet:{type:"boolean",default:!0,markdownDescription:we("suggest.filtered.snippet","When set to `false` IntelliSense never shows `snippet` suggestions.")}}},"editor.gotoLocation.multiple":{description:we("editor.gotoLocation.multiple","Controls the behavior of 'Go To' commands, like Go To Definition, when multiple target locations exist."),type:"string",enum:["peek","gotoAndPeek","goto"],default:Ev.contribInfo.gotoLocation.multiple,enumDescriptions:[we("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),we("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),we("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},"editor.selectionHighlight":{type:"boolean",default:Ev.contribInfo.selectionHighlight,description:we("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")},"editor.occurrencesHighlight":{type:"boolean",default:Ev.contribInfo.occurrencesHighlight,description:we("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")},"editor.overviewRulerLanes":{type:"integer",default:3,description:we("overviewRulerLanes","Controls the number of decorations that can show up at the same position in the overview ruler.")},"editor.overviewRulerBorder":{type:"boolean",default:Ev.viewInfo.overviewRulerBorder,description:we("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")},"editor.cursorBlinking":{type:"string",enum:["blink","smooth","phase","expand","solid"],default:function(e){if(1===e)return"blink";if(4===e)return"expand";if(3===e)return"phase";if(2===e)return"smooth";if(5===e)return"solid";throw new Error("blinkingStyleToString: Unknown blinkingStyle")}(Ev.viewInfo.cursorBlinking),description:we("cursorBlinking","Control the cursor animation style.")},"editor.mouseWheelZoom":{type:"boolean",default:Ev.viewInfo.mouseWheelZoom,markdownDescription:we("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")},"editor.cursorSmoothCaretAnimation":{type:"boolean",default:Ev.viewInfo.cursorSmoothCaretAnimation,description:we("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")},"editor.cursorStyle":{type:"string",enum:["block","block-outline","line","line-thin","underline","underline-thin"],default:function(e){if(e===Jr.Line)return"line";if(e===Jr.Block)return"block";if(e===Jr.Underline)return"underline";if(e===Jr.LineThin)return"line-thin";if(e===Jr.BlockOutline)return"block-outline";if(e===Jr.UnderlineThin)return"underline-thin";throw new Error("cursorStyleToString: Unknown cursorStyle")}(Ev.viewInfo.cursorStyle),description:we("cursorStyle","Controls the cursor style.")},"editor.cursorWidth":{type:"integer",default:Ev.viewInfo.cursorWidth,markdownDescription:we("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")},"editor.fontLigatures":{type:"boolean",default:Ev.viewInfo.fontLigatures,description:we("fontLigatures","Enables/Disables font ligatures.")},"editor.hideCursorInOverviewRuler":{type:"boolean",default:Ev.viewInfo.hideCursorInOverviewRuler,description:we("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")},"editor.renderWhitespace":{type:"string",enum:["none","boundary","selection","all"],enumDescriptions:["",we("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),we("renderWhitespace.selection","Render whitespace characters only on selected text."),""],default:Ev.viewInfo.renderWhitespace,description:we("renderWhitespace","Controls how the editor should render whitespace characters.")},"editor.renderControlCharacters":{type:"boolean",default:Ev.viewInfo.renderControlCharacters,description:we("renderControlCharacters","Controls whether the editor should render control characters.")},"editor.renderIndentGuides":{type:"boolean",default:Ev.viewInfo.renderIndentGuides,description:we("renderIndentGuides","Controls whether the editor should render indent guides.")},"editor.highlightActiveIndentGuide":{type:"boolean",default:Ev.viewInfo.highlightActiveIndentGuide,description:we("highlightActiveIndentGuide","Controls whether the editor should highlight the active indent guide.")},"editor.renderLineHighlight":{type:"string",enum:["none","gutter","line","all"],enumDescriptions:["","","",we("renderLineHighlight.all","Highlights both the gutter and the current line.")],default:Ev.viewInfo.renderLineHighlight,description:we("renderLineHighlight","Controls how the editor should render the current line highlight.")},"editor.codeLens":{type:"boolean",default:Ev.contribInfo.codeLens,description:we("codeLens","Controls whether the editor shows CodeLens.")},"editor.folding":{type:"boolean",default:Ev.contribInfo.folding,description:we("folding","Controls whether the editor has code folding enabled.")},"editor.foldingStrategy":{type:"string",enum:["auto","indentation"],default:Ev.contribInfo.foldingStrategy,markdownDescription:we("foldingStrategy","Controls the strategy for computing folding ranges. `auto` uses a language specific folding strategy, if available. `indentation` uses the indentation based folding strategy.")},"editor.showFoldingControls":{type:"string",enum:["always","mouseover"],default:Ev.contribInfo.showFoldingControls,description:we("showFoldingControls","Controls whether the fold controls on the gutter are automatically hidden.")},"editor.matchBrackets":{type:"boolean",default:Ev.contribInfo.matchBrackets,description:we("matchBrackets","Highlight matching brackets when one of them is selected.")},"editor.glyphMargin":{type:"boolean",default:Ev.viewInfo.glyphMargin,description:we("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")},"editor.useTabStops":{type:"boolean",default:Ev.useTabStops,description:we("useTabStops","Inserting and deleting whitespace follows tab stops.")},"editor.trimAutoWhitespace":{type:"boolean",default:Tv.trimAutoWhitespace,description:we("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:we("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.dragAndDrop":{type:"boolean",default:Ev.dragAndDrop,description:we("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")},"editor.accessibilitySupport":{type:"string",enum:["auto","on","off"],enumDescriptions:[we("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),we("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader."),we("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:Ev.accessibilitySupport,description:we("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers.")},"editor.showUnused":{type:"boolean",default:Ev.showUnused,description:we("showUnused","Controls fading out of unused code.")},"editor.links":{type:"boolean",default:Ev.contribInfo.links,description:we("links","Controls whether the editor should detect links and make them clickable.")},"editor.colorDecorators":{type:"boolean",default:Ev.contribInfo.colorDecorators,description:we("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")},"editor.lightbulb.enabled":{type:"boolean",default:Ev.contribInfo.lightbulbEnabled,description:we("codeActions","Enables the code action lightbulb in the editor.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:we("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.codeActionsOnSave":{type:"object",properties:{"source.organizeImports":{type:"boolean",description:we("codeActionsOnSave.organizeImports","Controls whether organize imports action should be run on file save.")},"source.fixAll":{type:"boolean",description:we("codeActionsOnSave.fixAll","Controls whether auto fix action should be run on file save.")}},additionalProperties:{type:"boolean"},default:Ev.contribInfo.codeActionsOnSave,description:we("codeActionsOnSave","Code action kinds to be run on save.")},"editor.codeActionsOnSaveTimeout":{type:"number",default:Ev.contribInfo.codeActionsOnSaveTimeout,description:we("codeActionsOnSaveTimeout","Timeout in milliseconds after which the code actions that are run on save are cancelled.")},"editor.selectionClipboard":{type:"boolean",default:Ev.contribInfo.selectionClipboard,description:we("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Ge.c},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:we("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:we("ignoreTrimWhitespace","Controls whether the diff editor shows changes in leading or trailing whitespace as diffs.")},"editor.largeFileOptimizations":{type:"boolean",default:Tv.largeFileOptimizations,description:we("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:we("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")}}},Rv=null;function Fv(){return null===Rv&&(Rv=Object.create(null),Object.keys(Pv.properties).forEach((function(e){Rv[e]=!0}))),Rv}Iv.registerConfiguration(Pv);var Yv=function(){function e(){}return e.insert=function(e,t){return{range:new Tr(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}},e.delete=function(e){return{range:e,text:null}},e.replace=function(e,t){return{range:e,text:t}},e.replaceMove=function(e,t){return{range:e,text:t,forceMoveMarkers:!0}},e}(),jv=pt("configurationService");function Bv(e,t){var n=Object.create(null);for(var r in e)Hv(n,r,e[r],t);return n}function Hv(e,t,n,r){for(var i=t.split("."),o=i.pop(),s=e,a=0;a0;){var n=t.shift();for(var r in Object.freeze(n),n)if(Vr.call(n,r)){var i=n[r];"object"!=typeof i||Object.isFrozen(i)||t.push(i)}}return e}(e):e},e.prototype.getContentsForOverrideIdentifer=function(e){for(var t=0,n=this.overrides;t5e3&&n._leaveChordMode():n._leaveChordMode()}),500)},t.prototype._leaveChordMode=function(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null},t.prototype._dispatch=function(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t)},t.prototype._doDispatch=function(e,t){var n=this,r=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;var i=e.getDispatchParts()[0];if(null===i)return r;var o=this._contextKeyService.getContext(t),s=this._currentChord?this._currentChord.keypress:null,a=e.getLabel(),u=this._getResolver().resolve(o,s,i);return u&&u.enterChord?(r=!0,this._enterChordMode(i,a),r):(this._currentChord&&(u&&u.commandId||(this._notificationService.status(we("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),r=!0)),this._leaveChordMode(),u&&u.commandId&&(u.bubble||(r=!0),void 0===u.commandArgs?this._commandService.executeCommand(u.commandId).then(void 0,(function(e){return n._notificationService.warn(e)})):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,(function(e){return n._notificationService.warn(e)})),this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding"})),r)},t.prototype.mightProducePrintableCharacter=function(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)},t}(Dt),Zv=function(){function e(t,n){this._defaultKeybindings=t,this._defaultBoundCommands=new Map;for(var r=0,i=t.length;r=0;l--)this._isTargetedForRemoval(e[l],a,u,s,c)&&e.splice(l,1);else n.push(o)}return e.concat(n)},e.prototype._addKeyPress=function(t,n){var r=this._map.get(t);if(void 0===r)return this._map.set(t,[n]),void this._addToLookupMap(n);for(var i=r.length-1;i>=0;i--){var o=r[i];if(o.command!==n.command){var s=o.keypressParts.length>1,a=n.keypressParts.length>1;s&&a&&o.keypressParts[1]!==n.keypressParts[1]||e.whenIsEntirelyIncluded(o.when,n.when)&&this._removeFromLookupMap(o)}}r.push(n),this._addToLookupMap(n)},e.prototype._addToLookupMap=function(e){if(e.command){var t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}},e.prototype._removeFromLookupMap=function(e){if(e.command){var t=this._lookupMap.get(e.command);if(void 0!==t)for(var n=0,r=t.length;n1&&null!==u.keypressParts[1]?{enterChord:!0,commandId:null,commandArgs:null,bubble:!1}:{enterChord:!1,commandId:u.command,commandArgs:u.commandArgs,bubble:u.bubble}:null},e.prototype._findCommand=function(t,n){for(var r=n.length-1;r>=0;r--){var i=n[r];if(e.contextMatchesRules(t,i.when))return i}return null},e.contextMatchesRules=function(e,t){return!t||t.evaluate(e)},e}(),Jv=function(e,t,n,r,i){this.resolvedKeybinding=e,this.keypressParts=e?function(e){for(var t=[],n=0,r=e.length;n1},t.prototype.getParts=function(){var e=this;return this._parts.map((function(t){return e._getPart(t)}))},t.prototype._getPart=function(e){return new gr(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))},t.prototype.getDispatchParts=function(){var e=this;return this._parts.map((function(t){return e._getDispatchPart(t)}))},t}(mr),sb=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ab=function(e){function t(t,n){return e.call(this,n,t.parts)||this}return sb(t,e),t.prototype._keyCodeToUILabel=function(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return tr.toString(e)},t.prototype._getLabel=function(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)},t.prototype._getAriaLabel=function(e){return e.isDuplicateModifierCase()?"":tr.toString(e.keyCode)},t.prototype._getDispatchPart=function(e){return t.getDispatchStr(e)},t.getDispatchStr=function(e){if(e.isModifierKey())return null;var t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=tr.toString(e.keyCode)},t}(ob),ub=pt("contextService");!function(e){e.isIWorkspace=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&Array.isArray(e.folders)}}(nb||(nb={})),(rb||(rb={})).isIWorkspaceFolder=function(e){return e&&"object"==typeof e&&it.isUri(e.uri)&&"string"==typeof e.name&&"function"==typeof e.toResource};!function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=null),this._id=e,this._configuration=n,this._foldersMap=qn.forPaths(),this.folders=t}Object.defineProperty(e.prototype,"folders",{get:function(){return this._folders},set:function(e){this._folders=e,this.updateFoldersMap()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._configuration},set:function(e){this._configuration=e},enumerable:!0,configurable:!0}),e.prototype.getFolder=function(e){return e&&this._foldersMap.findSubstr(e.with({scheme:e.scheme,authority:e.authority,path:e.path}).toString())||null},e.prototype.updateFoldersMap=function(){this._foldersMap=qn.forPaths();for(var e=0,t=this.folders;e=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},kb=function(e,t){return function(n,r){t(n,r,e)}},Lb=function(){function e(e){this.model=e,this._onDispose=new Ht}return Object.defineProperty(e.prototype,"textEditorModel",{get:function(){return this.model},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._onDispose.fire()},e}();function Mb(e,t,n){return(r=e)&&"function"==typeof r.getEditorType&&r.getEditorType()===Sc.ICodeEditor?t(e):n(e);var r}var Eb=function(){function e(){}return e.prototype.setEditor=function(e){this.editor=e},e.prototype.createModelReference=function(e){var t=this,n=null;return this.editor&&(n=Mb(this.editor,(function(n){return t.findModel(n,e)}),(function(n){return t.findModel(n.getOriginalEditor(),e)||t.findModel(n.getModifiedEditor(),e)}))),n?Promise.resolve(new Tt(new Lb(n))):Promise.reject(new Error("Model not found"))},e.prototype.findModel=function(e,t){var n=e.getModel();return n&&n.uri.toString()!==t.toString()?null:n},e}(),Db=function(){function e(){}return e.prototype.showWhile=function(e,t){return Promise.resolve(void 0)},e}(),Tb=function(){},Nb=function(){function e(){}return e.prototype.info=function(e){return this.notify({severity:Xg.Info,message:e})},e.prototype.warn=function(e){return this.notify({severity:Xg.Warning,message:e})},e.prototype.error=function(e){return this.notify({severity:Xg.Error,message:e})},e.prototype.notify=function(t){switch(t.severity){case Xg.Error:console.error(t.message);break;case Xg.Warning:console.warn(t.message);break;default:console.log(t.message)}return e.NO_OP},e.prototype.status=function(e,t){return Dt.None},e.NO_OP=new em,e}(),Ob=function(){function e(e){this._onWillExecuteCommand=new Ht,this._onDidExecuteCommand=new Ht,this._instantiationService=e,this._dynamicCommands=Object.create(null)}return e.prototype.addCommand=function(e){var t=this,n=e.id;return this._dynamicCommands[n]=e,Mt((function(){delete t._dynamicCommands[n]}))},e.prototype.executeCommand=function(e){for(var t=[],n=1;n.001){v=!1;break}}var x=!0;v&&_.width!==b&&(x=!1),_.width>m.width&&(x=!1);var k=Jd.INSTANCE.getTimeSinceLastZoomLevelChanged()>2e3;return new v_({zoomLevel:Xd(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:v,typicalHalfwidthCharacterWidth:r.width,typicalFullwidthCharacterWidth:i.width,canUseHalfwidthRightwardsArrow:x,spaceWidth:o.width,maxDigitWidth:y},k)},t.INSTANCE=new t,t}(Dt),Jb=function(e){function t(t,n,r,i){void 0===r&&(r=null);var o,s=e.call(this,t,n)||this;return s.accessibilityService=i,s._elementSizeObserver=s._register(new Kb(r,(function(){return s._onReferenceDomElementSizeChanged()}))),s._register(Zb.INSTANCE.onDidChange((function(){return s._onCSSBasedConfigurationChanged()}))),s._validatedOptions.automaticLayout&&s._elementSizeObserver.startObserving(),s._register((o=function(e){return s._recomputeOptions()},Jd.INSTANCE.onDidChangeZoomLevel(o))),s._register(s.accessibilityService.onDidChangeAccessibilitySupport((function(){return s._recomputeOptions()}))),s._recomputeOptions(),s}return Gb(t,e),t.applyFontInfoSlow=function(e,t){e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"},t.applyFontInfo=function(e,t){e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)},t.prototype._onReferenceDomElementSizeChanged=function(){this._recomputeOptions()},t.prototype._onCSSBasedConfigurationChanged=function(){this._recomputeOptions()},t.prototype.observeReferenceElement=function(e){this._elementSizeObserver.observe(e)},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._getExtraEditorClassName=function(){var e="";return sh||ah||(e+="no-user-select "),Ge.d&&(e+="mac "),e},t.prototype._getEnvConfiguration=function(){return{extraEditorClassName:this._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:ih||rh,pixelRatio:Jd.INSTANCE.getPixelRatio(),zoomLevel:Xd(),accessibilitySupport:this.accessibilityService.getAccessibilitySupport()}},t.prototype.readConfiguration=function(e){return Zb.INSTANCE.readConfiguration(e)},t}(Av),Xb=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qb=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.toClientCoordinates=function(){return new ew(this.x-af.scrollX,this.y-af.scrollY)},e}(),ew=function(){function e(e,t){this.clientX=e,this.clientY=t}return e.prototype.toPageCoordinates=function(){return new Qb(this.clientX+af.scrollX,this.clientY+af.scrollY)},e}(),tw=function(e,t,n,r){this.x=e,this.y=t,this.width=n,this.height=r};function nw(e){var t=sf(e);return new tw(t.left,t.top,t.width,t.height)}var rw=function(e){function t(t,n){var r=e.call(this,t)||this;return r.pos=new Qb(r.posx,r.posy),r.editorPos=nw(n),r}return Xb(t,e),t}(Sh),iw=function(){function e(e){this._editorViewDomNode=e}return e.prototype._create=function(e){return new rw(e,this._editorViewDomNode)},e.prototype.onContextMenu=function(e,t){var n=this;return Bh(e,"contextmenu",(function(e){t(n._create(e))}))},e.prototype.onMouseUp=function(e,t){var n=this;return Bh(e,"mouseup",(function(e){t(n._create(e))}))},e.prototype.onMouseDown=function(e,t){var n=this;return Bh(e,"mousedown",(function(e){t(n._create(e))}))},e.prototype.onMouseLeave=function(e,t){var n=this;return Wh(e,(function(e){t(n._create(e))}))},e.prototype.onMouseMoveThrottled=function(e,t,n,r){var i=this;return tf(e,"mousemove",t,(function(e,t){return n(e,i._create(t))}),r)},e}(),ow=function(e){function t(t){var n=e.call(this)||this;return n._editorViewDomNode=t,n._globalMouseMoveMonitor=n._register(new Cp),n._keydownListener=null,n}return Xb(t,e),t.prototype.startMonitoring=function(e,t,n){var r=this;this._keydownListener=Hh(document,"keydown",(function(e){e.toKeybinding().isModifierKey()||r._globalMouseMoveMonitor.stopMonitoring(!0)}),!0);this._globalMouseMoveMonitor.startMonitoring((function(t,n){return e(t,new rw(n,r._editorViewDomNode))}),t,(function(){r._keydownListener.dispose(),n()}))},t}(Dt),sw=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),aw=function(e){function t(){var t=e.call(this)||this;return t._shouldRender=!0,t}return sw(t,e),t.prototype.shouldRender=function(){return this._shouldRender},t.prototype.forceShouldRender=function(){this._shouldRender=!0},t.prototype.setShouldRender=function(){this._shouldRender=!0},t.prototype.onDidRender=function(){this._shouldRender=!1},t.prototype.onConfigurationChanged=function(e){return!1},t.prototype.onCursorStateChanged=function(e){return!1},t.prototype.onDecorationsChanged=function(e){return!1},t.prototype.onFlushed=function(e){return!1},t.prototype.onFocusChanged=function(e){return!1},t.prototype.onLanguageConfigurationChanged=function(e){return!1},t.prototype.onLineMappingChanged=function(e){return!1},t.prototype.onLinesChanged=function(e){return!1},t.prototype.onLinesDeleted=function(e){return!1},t.prototype.onLinesInserted=function(e){return!1},t.prototype.onRevealRangeRequest=function(e){return!1},t.prototype.onScrollChanged=function(e){return!1},t.prototype.onTokensChanged=function(e){return!1},t.prototype.onTokensColorsChanged=function(e){return!1},t.prototype.onZonesChanged=function(e){return!1},t.prototype.onThemeChanged=function(e){return!1},t.prototype.handleEvents=function(e){for(var t=!1,n=0,r=e.length;n=u?i=Math.max(i,u+c-r):(t[n++]=new pw(r,i),r=u,i=c)}return t[n++]=new pw(r,i),t},e._createHorizontalRangesFromClientRects=function(e,t){if(!e||0===e.length)return null;for(var n=[],r=0,i=e.length;ra)return null;(t=Math.min(a,Math.max(0,t)))!==(r=Math.min(a,Math.max(0,r)))&&r>0&&0===i&&(r--,i=1073741824);var u=e.children[t].firstChild,c=e.children[r].firstChild;if(u&&c||(!u&&0===n&&t>0&&(u=e.children[t-1].firstChild,n=1073741824),!c&&0===i&&r>0&&(c=e.children[r-1].firstChild,i=1073741824)),!u||!c)return null;n=Math.min(u.textContent.length,Math.max(0,n)),i=Math.min(c.textContent.length,Math.max(0,i));var l=this._readClientRects(u,n,c,i,s);return this._createHorizontalRangesFromClientRects(l,o)},e}(),_w=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yw=!!Ge.e||!(Ge.c||rh||sh),vw=nh,bw=function(){function e(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}return Object.defineProperty(e.prototype,"clientRectDeltaLeft",{get:function(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft},enumerable:!0,configurable:!0}),e}(),ww=function(){function e(e,t){this.themeType=t,this.renderWhitespace=e.editor.viewInfo.renderWhitespace,this.renderControlCharacters=e.editor.viewInfo.renderControlCharacters,this.spaceWidth=e.editor.fontInfo.spaceWidth,this.useMonospaceOptimizations=e.editor.fontInfo.isMonospace&&!e.editor.viewInfo.disableMonospaceOptimizations,this.canUseHalfwidthRightwardsArrow=e.editor.fontInfo.canUseHalfwidthRightwardsArrow,this.lineHeight=e.editor.lineHeight,this.stopRenderingLineAfter=e.editor.viewInfo.stopRenderingLineAfter,this.fontLigatures=e.editor.viewInfo.fontLigatures}return e.prototype.equals=function(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures},e}(),Cw=function(){function e(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}return e.prototype.getDomNode=function(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null},e.prototype.setDomNode=function(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=bp(e)},e.prototype.onContentChanged=function(){this._isMaybeInvalid=!0},e.prototype.onTokensChanged=function(){this._isMaybeInvalid=!0},e.prototype.onDecorationsChanged=function(){this._isMaybeInvalid=!0},e.prototype.onOptionsChanged=function(e){this._isMaybeInvalid=!0,this._options=e},e.prototype.onSelectionChanged=function(){return!(!vw&&this._options.themeType!==Dd&&"selection"!==this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)},e.prototype.renderLine=function(t,n,r,i){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;var o=r.getViewLineRenderingData(t),s=this._options,a=xy.filter(o.inlineDecorations,t,o.minColumn,o.maxColumn),u=null;if(vw||s.themeType===Dd||"selection"===this._options.renderWhitespace)for(var c=0,l=r.selections;ct)){var h=d.startLineNumber===t?d.startColumn:o.minColumn,f=d.endLineNumber===t?d.endColumn:o.maxColumn;h');var g=Ay(p,i);i.appendASCIIString("");var m=null;return yw&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===g.containsForeignElements&&o.content.length<300&&p.lineTokens.getCount()<100&&(m=new Sw(this._renderedViewLine?this._renderedViewLine.domNode:null,p,g.characterMapping)),m||(m=Lw(this._renderedViewLine?this._renderedViewLine.domNode:null,p,g.characterMapping,g.containsRTL,g.containsForeignElements)),this._renderedViewLine=m,!0},e.prototype.layoutLine=function(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))},e.prototype.getWidth=function(){return this._renderedViewLine?this._renderedViewLine.getWidth():0},e.prototype.getWidthIsFast=function(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()},e.prototype.getVisibleRangesForRange=function(e,t,n){if(!this._renderedViewLine)return null;e|=0,t|=0,e=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,e)),t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t));var r=0|this._renderedViewLine.input.stopRenderingLineAfter;return-1!==r&&e>r&&t>r?null:(-1!==r&&e>r&&(e=r),-1!==r&&t>r&&(t=r),this._renderedViewLine.getVisibleRangesForRange(e,t,n))},e.prototype.getColumnOfNodeOffset=function(e,t,n){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,n):1},e.CLASS_NAME="view-line",e}(),Sw=function(){function e(e,t,n){this.domNode=e,this.input=t,this._characterMapping=n,this._charWidth=t.spaceWidth}return e.prototype.getWidth=function(){return this._getCharPosition(this._characterMapping.length)},e.prototype.getWidthIsFast=function(){return!0},e.prototype.getVisibleRangesForRange=function(e,t,n){var r=this._getCharPosition(e),i=this._getCharPosition(t);return[new pw(r,i-r)]},e.prototype._getCharPosition=function(e){var t=this._characterMapping.getAbsoluteOffsets();return 0===t.length?0:Math.round(this._charWidth*t[e-1])},e.prototype.getColumnOfNodeOffset=function(e,t,n){for(var r=t.textContent.length,i=-1;t;)t=t.previousSibling,i++;return this._characterMapping.partDataToCharOffset(i,r,n)+1},e}(),xw=function(){function e(e,t,n,r,i){if(this.domNode=e,this.input=t,this._characterMapping=n,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=i,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||0===this._characterMapping.length){this._pixelOffsetCache=new Int32Array(Math.max(2,this._characterMapping.length+1));for(var o=0,s=this._characterMapping.length;o<=s;o++)this._pixelOffsetCache[o]=-1}}return e.prototype._getReadingTarget=function(){return this.domNode.domNode.firstChild},e.prototype.getWidth=function(){return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget().offsetWidth),this._cachedWidth},e.prototype.getWidthIsFast=function(){return-1!==this._cachedWidth},e.prototype.getVisibleRangesForRange=function(e,t,n){if(null!==this._pixelOffsetCache){var r=this._readPixelOffset(e,n);if(-1===r)return null;var i=this._readPixelOffset(t,n);return-1===i?null:[new pw(r,i-r)]}return this._readVisibleRangesForRange(e,t,n)},e.prototype._readVisibleRangesForRange=function(e,t,n){if(e===t){var r=this._readPixelOffset(e,n);return-1===r?null:[new pw(r,0)]}return this._readRawVisibleRangesForRange(e,t,n)},e.prototype._readPixelOffset=function(e,t){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth()}if(null!==this._pixelOffsetCache){var n=this._pixelOffsetCache[e];if(-1!==n)return n;var r=this._actualReadPixelOffset(e,t);return this._pixelOffsetCache[e]=r,r}return this._actualReadPixelOffset(e,t)},e.prototype._actualReadPixelOffset=function(e,t){if(0===this._characterMapping.length){var n=mw.readHorizontalRanges(this._getReadingTarget(),0,0,0,0,t.clientRectDeltaLeft,t.endNode);return n&&0!==n.length?n[0].left:-1}if(e===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();var r=this._characterMapping.charOffsetToPartData(e-1),i=Ny.getPartIndex(r),o=Ny.getCharIndex(r),s=mw.readHorizontalRanges(this._getReadingTarget(),i,o,i,o,t.clientRectDeltaLeft,t.endNode);return s&&0!==s.length?s[0].left:-1},e.prototype._readRawVisibleRangesForRange=function(e,t,n){if(1===e&&t===this._characterMapping.length)return[new pw(0,this.getWidth())];var r=this._characterMapping.charOffsetToPartData(e-1),i=Ny.getPartIndex(r),o=Ny.getCharIndex(r),s=this._characterMapping.charOffsetToPartData(t-1),a=Ny.getPartIndex(s),u=Ny.getCharIndex(s);return mw.readHorizontalRanges(this._getReadingTarget(),i,o,a,u,n.clientRectDeltaLeft,n.endNode)},e.prototype.getColumnOfNodeOffset=function(e,t,n){for(var r=t.textContent.length,i=-1;t;)t=t.previousSibling,i++;return this._characterMapping.partDataToCharOffset(i,r,n)+1},e}(),kw=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _w(t,e),t.prototype._readVisibleRangesForRange=function(t,n,r){var i=e.prototype._readVisibleRangesForRange.call(this,t,n,r);if(!i||0===i.length||t===n||1===t&&n===this._characterMapping.length)return i;if(!this.input.containsRTL){var o=this._readPixelOffset(n,r);if(-1!==o){var s=i[i.length-1];s.left=4&&3===e[0]&&7===e[3]},e.isStrictChildOfViewLines=function(e){return e.length>4&&3===e[0]&&7===e[3]},e.isChildOfScrollableElement=function(e){return e.length>=2&&3===e[0]&&5===e[1]},e.isChildOfMinimap=function(e){return e.length>=2&&3===e[0]&&8===e[1]},e.isChildOfContentWidgets=function(e){return e.length>=4&&3===e[0]&&1===e[3]},e.isChildOfOverflowingContentWidgets=function(e){return e.length>=1&&2===e[0]},e.isChildOfOverlayWidgets=function(e){return e.length>=2&&3===e[0]&&4===e[1]},e}(),Ow=function(){function e(e,t,n){this.model=e.model,this.layoutInfo=e.configuration.editor.layoutInfo,this.viewDomNode=t.viewDomNode,this.lineHeight=e.configuration.editor.lineHeight,this.typicalHalfwidthCharacterWidth=e.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,this.lastViewCursorsRenderData=n,this._context=e,this._viewHelper=t}return e.prototype.getZoneAtCoord=function(t){return e.getZoneAtCoord(this._context,t)},e.getZoneAtCoord=function(e,t){var n=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(n){var r=n.verticalOffset+n.height/2,i=e.model.getLineCount(),o=null,s=void 0,a=null;return n.afterLineNumber!==i&&(a=new _t(n.afterLineNumber+1,1)),n.afterLineNumber>0&&(o=new _t(n.afterLineNumber,e.model.getLineMaxColumn(n.afterLineNumber))),s=null===a?o:null===o?a:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Rw._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))})),Iw={isAfterLines:!0};function Pw(e){return{isAfterLines:!1,horizontalDistanceToText:e}}var Rw=function(){function e(e,t){this._context=e,this._viewHelper=t}return e.prototype.mouseTargetIsWidget=function(e){var t=e.target,n=lw.collect(t,this._viewHelper.viewDomNode);return!(!Nw.isChildOfContentWidgets(n)&&!Nw.isChildOfOverflowingContentWidgets(n))||!!Nw.isChildOfOverlayWidgets(n)},e.prototype.createMouseTarget=function(t,n,r,i){var o=new Ow(this._context,this._viewHelper,t),s=new Aw(o,n,r,i);try{return e._createMouseTarget(o,s,!1)}catch(e){return s.fulfill(0)}},e._createMouseTarget=function(t,n,r){if(null===n.target){if(r)return n.fulfill(0);var i=e._doHitTest(t,n);return i.position?e.createMouseTargetFromHitTestPosition(t,n,i.position.lineNumber,i.position.column):this._createMouseTarget(t,n.withTarget(i.hitTarget),!0)}var o=n,s=null;return(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=s||e._hitTestContentWidget(t,o))||e._hitTestOverlayWidget(t,o))||e._hitTestMinimap(t,o))||e._hitTestScrollbarSlider(t,o))||e._hitTestViewZone(t,o))||e._hitTestMargin(t,o))||e._hitTestViewCursor(t,o))||e._hitTestTextArea(t,o))||e._hitTestViewLines(t,o,r))||e._hitTestScrollbar(t,o))||n.fulfill(0)},e._hitTestContentWidget=function(e,t){if(Nw.isChildOfContentWidgets(t.targetPath)||Nw.isChildOfOverflowingContentWidgets(t.targetPath)){var n=e.findAttribute(t.target,"widgetId");return n?t.fulfill(9,null,null,n):t.fulfill(0)}return null},e._hitTestOverlayWidget=function(e,t){if(Nw.isChildOfOverlayWidgets(t.targetPath)){var n=e.findAttribute(t.target,"widgetId");return n?t.fulfill(12,null,null,n):t.fulfill(0)}return null},e._hitTestViewCursor=function(e,t){if(t.target)for(var n=0,r=o=e.lastViewCursorsRenderData;ni.contentLeft+i.width)){var l=e.getVerticalOffsetForLineNumber(i.position.lineNumber);if(l<=a&&a<=l+i.height)return t.fulfill(6,i.position)}}return null},e._hitTestViewZone=function(e,t){var n=e.getZoneAtCoord(t.mouseVerticalOffset);if(n){var r=t.isInContentArea?8:5;return t.fulfill(r,n.position,null,n)}return null},e._hitTestTextArea=function(e,t){return Nw.isTextArea(t.targetPath)?t.fulfill(1):null},e._hitTestMargin=function(e,t){if(t.isInMarginArea){var n=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=n.range.getStartPosition(),i=Math.abs(t.pos.x-t.editorPos.x),o={isAfterLines:n.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:i};return(i-=e.layoutInfo.glyphMarginLeft)<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,r,n.range,o):(i-=e.layoutInfo.glyphMarginWidth)<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,r,n.range,o):(i-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,r,n.range,o))}return null},e._hitTestViewLines=function(t,n,r){if(!Nw.isChildOfViewLines(n.targetPath))return null;if(t.isAfterLines(n.mouseVerticalOffset)){var i=t.model.getLineCount(),o=t.model.getLineMaxColumn(i);return n.fulfill(7,new _t(i,o),void 0,Iw)}if(r){if(Nw.isStrictChildOfViewLines(n.targetPath)){var s=t.getLineNumberAtVerticalOffset(n.mouseVerticalOffset);if(0===t.model.getLineLength(s)){var a=t.getLineWidth(s),u=Pw(n.mouseContentHorizontalOffset-a);return n.fulfill(7,new _t(s,1),void 0,u)}}return n.fulfill(0)}var c=e._doHitTest(t,n);return c.position?e.createMouseTargetFromHitTestPosition(t,n,c.position.lineNumber,c.position.column):this._createMouseTarget(t,n.withTarget(c.hitTarget),!0)},e._hitTestMinimap=function(e,t){if(Nw.isChildOfMinimap(t.targetPath)){var n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.model.getLineMaxColumn(n);return t.fulfill(11,new _t(n,r))}return null},e._hitTestScrollbarSlider=function(e,t){if(Nw.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){var n=t.target.className;if(n&&/\b(slider|scrollbar)\b/.test(n)){var r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),i=e.model.getLineMaxColumn(r);return t.fulfill(11,new _t(r,i))}}return null},e._hitTestScrollbar=function(e,t){if(Nw.isChildOfScrollableElement(t.targetPath)){var n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.model.getLineMaxColumn(n);return t.fulfill(11,new _t(n,r))}return null},e.prototype.getMouseColumn=function(t,n){var r=this._context.configuration.editor.layoutInfo,i=this._context.viewLayout.getCurrentScrollLeft()+n.x-t.x-r.contentLeft;return e._getMouseColumn(i,this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth)},e._getMouseColumn=function(e,t){return e<0?1:Math.round(e/t)+1},e.createMouseTargetFromHitTestPosition=function(e,t,n,r){var i=new _t(n,r),o=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>o){if(th&&1===i.column){var s=Pw(t.mouseContentHorizontalOffset-o);return t.fulfill(7,new _t(n,e.model.getLineMaxColumn(n)),void 0,s)}var a=Pw(t.mouseContentHorizontalOffset-o);return t.fulfill(7,i,void 0,a)}var u=e.visibleRangeForPosition2(n,r);if(!u)return t.fulfill(0,i);var c=u.left;if(t.mouseContentHorizontalOffset===c)return t.fulfill(6,i);var l=[];if(l.push({offset:u.left,column:r}),r>1){var d=e.visibleRangeForPosition2(n,r-1);d&&l.push({offset:d.left,column:r-1})}if(r=t.editorPos.y+e.layoutInfo.height&&(i=t.editorPos.y+e.layoutInfo.height-1);var o=new Qb(t.pos.x,i),s=this._actualDoHitTestWithCaretRangeFromPoint(e,o.toClientCoordinates());return s.position?s:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())},e._actualDoHitTestWithCaretRangeFromPoint=function(e,t){var n=document.caretRangeFromPoint(t.clientX,t.clientY);if(!n||!n.startContainer)return{position:null,hitTarget:null};var r=n.startContainer,i=null;if(r.nodeType===r.TEXT_NODE){var o=(a=(s=r.parentNode)?s.parentNode:null)?a.parentNode:null;if((o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===Cw.CLASS_NAME)return{position:e.getPositionFromDOMInfo(s,n.startOffset),hitTarget:null};i=r.parentNode}else if(r.nodeType===r.ELEMENT_NODE){var s,a;if(((a=(s=r.parentNode)?s.parentNode:null)&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Cw.CLASS_NAME)return{position:e.getPositionFromDOMInfo(r,r.textContent.length),hitTarget:null};i=r}return{position:null,hitTarget:i}},e._doHitTestWithCaretPositionFromPoint=function(e,t){var n=document.caretPositionFromPoint(t.clientX,t.clientY);if(n.offsetNode.nodeType===n.offsetNode.TEXT_NODE){var r=n.offsetNode.parentNode,i=r?r.parentNode:null,o=i?i.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===Cw.CLASS_NAME?{position:e.getPositionFromDOMInfo(n.offsetNode.parentNode,n.offset),hitTarget:null}:{position:null,hitTarget:n.offsetNode.parentNode}}return{position:null,hitTarget:n.offsetNode}},e._doHitTestWithMoveToPoint=function(e,t){var n=null,r=null,i=document.body.createTextRange();try{i.moveToPoint(t.clientX,t.clientY)}catch(e){return{position:null,hitTarget:null}}i.collapse(!0);var o=i?i.parentElement():null,s=o?o.parentNode:null,a=s?s.parentNode:null;if((a&&a.nodeType===a.ELEMENT_NODE?a.className:"")===Cw.CLASS_NAME){var u=i.duplicate();u.moveToElementText(o),u.setEndPoint("EndToStart",i),n=e.getPositionFromDOMInfo(o,u.text.length),u.moveToElementText(e.viewDomNode)}else r=o;return i.moveToElementText(e.viewDomNode),{position:n,hitTarget:r}},e._doHitTest=function(e,t){return document.caretRangeFromPoint?this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint?this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates()):document.body.createTextRange?this._doHitTestWithMoveToPoint(e,t.pos.toClientCoordinates()):{position:null,hitTarget:null}},e}(),Fw=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Yw(e){return function(t,n){var r=!1;return e&&(r=e.mouseTargetIsWidget(n)),r||n.preventDefault(),n}}var jw=function(e){function t(n,r,i){var o=e.call(this)||this;o._isFocused=!1,o._context=n,o.viewController=r,o.viewHelper=i,o.mouseTargetFactory=new Rw(o._context,i),o._mouseDownOperation=o._register(new Bw(o._context,o.viewController,o.viewHelper,(function(e,t){return o._createMouseTarget(e,t)}),(function(e){return o._getMouseColumn(e)}))),o._asyncFocus=o._register(new ks((function(){return o.viewHelper.focusTextArea()}),0)),o.lastMouseLeaveTime=-1;var s=new iw(o.viewHelper.viewDomNode);o._register(s.onContextMenu(o.viewHelper.viewDomNode,(function(e){return o._onContextMenu(e,!0)}))),o._register(s.onMouseMoveThrottled(o.viewHelper.viewDomNode,(function(e){return o._onMouseMove(e)}),Yw(o.mouseTargetFactory),t.MOUSE_MOVE_MINIMUM_TIME)),o._register(s.onMouseUp(o.viewHelper.viewDomNode,(function(e){return o._onMouseUp(e)}))),o._register(s.onMouseLeave(o.viewHelper.viewDomNode,(function(e){return o._onMouseLeave(e)}))),o._register(s.onMouseDown(o.viewHelper.viewDomNode,(function(e){return o._onMouseDown(e)})));return o._register(Bh(o.viewHelper.viewDomNode,nh?"mousewheel":"wheel",(function(e){if(o.viewController.emitMouseWheel(e),o._context.configuration.editor.viewInfo.mouseWheelZoom){var t=new xh(e);if(t.browserEvent.ctrlKey||t.browserEvent.metaKey){var n=h_.getZoomLevel(),r=t.deltaY>0?1:-1;h_.setZoomLevel(n+r),t.preventDefault(),t.stopPropagation()}}}),!0)),o._context.addEventHandler(o),o}return Fw(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onCursorStateChanged=function(e){return this._mouseDownOperation.onCursorStateChanged(e),!1},t.prototype.onFocusChanged=function(e){return this._isFocused=e.isFocused,!1},t.prototype.onScrollChanged=function(e){return this._mouseDownOperation.onScrollChanged(),!1},t.prototype.getTargetAtClientPoint=function(e,t){var n=new ew(e,t).toPageCoordinates(),r=nw(this.viewHelper.viewDomNode);if(n.yr.y+r.height||n.xr.x+r.width)return null;var i=this.viewHelper.getLastViewCursorsRenderData();return this.mouseTargetFactory.createMouseTarget(i,r,n,null)},t.prototype._createMouseTarget=function(e,t){var n=this.viewHelper.getLastViewCursorsRenderData();return this.mouseTargetFactory.createMouseTarget(n,e.editorPos,e.pos,t?e.target:null)},t.prototype._getMouseColumn=function(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)},t.prototype._onContextMenu=function(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})},t.prototype._onMouseMove=function(e){this._mouseDownOperation.isActive()||(e.timestampt.y+t.height){var a,u;o=r.getCurrentScrollTop()+(e.posy-t.y);if(a=Ow.getZoneAtCoord(this._context,o))if(u=this._helpPositionJumpOverViewZone(a))return new Tw(null,13,i,u);var c=r.getLineNumberAtVerticalOffset(o);return new Tw(null,13,i,new _t(c,n.getLineMaxColumn(c)))}var l=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+(e.posy-t.y));return e.posxt.x+t.width?new Tw(null,13,i,new _t(l,n.getLineMaxColumn(l))):null},t.prototype._findMousePosition=function(e,t){var n=this._getPositionOutsideEditor(e);if(n)return n;var r=this._createMouseTarget(e,t);if(!r.position)return null;if(8===r.type||5===r.type){var i=this._helpPositionJumpOverViewZone(r.detail);if(i)return new Tw(r.element,r.type,r.mouseColumn,i,null,r.detail)}return r},t.prototype._helpPositionJumpOverViewZone=function(e){var t=new _t(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),n=e.positionBefore,r=e.positionAfter;return n&&r?n.isBefore(t)?n:r:null},t.prototype._dispatchMouse=function(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton})},t}(Dt),Hw=function(){function e(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}return Object.defineProperty(e.prototype,"altKey",{get:function(){return this._altKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ctrlKey",{get:function(){return this._ctrlKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metaKey",{get:function(){return this._metaKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shiftKey",{get:function(){return this._shiftKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftButton",{get:function(){return this._leftButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"middleButton",{get:function(){return this._middleButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startedOnLineNumbers",{get:function(){return this._startedOnLineNumbers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._lastMouseDownCount},enumerable:!0,configurable:!0}),e.prototype.setModifiers=function(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey},e.prototype.setStartButtons=function(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton},e.prototype.setStartedOnLineNumbers=function(e){this._startedOnLineNumbers=e},e.prototype.trySetCount=function(t,n){var r=(new Date).getTime();r-this._lastSetMouseDownCountTime>e.CLEAR_MOUSE_DOWN_COUNT_TIME&&(t=1),this._lastSetMouseDownCountTime=r,t>this._lastMouseDownCount+1&&(t=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(n)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=n,this._lastMouseDownCount=Math.min(t,this._lastMouseDownPositionEqualCount)},e.CLEAR_MOUSE_DOWN_COUNT_TIME=400,e}(),Ww=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Vw(e,t){var n={translationY:t.translationY,translationX:t.translationX};return e&&(n.translationY+=e.translationY,n.translationX+=e.translationX),n}var zw=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.viewHelper.linesContentDomNode.style.msTouchAction="none",i.viewHelper.linesContentDomNode.style.msContentZooming="none",i._installGestureHandlerTimeout=window.setTimeout((function(){if(i._installGestureHandlerTimeout=-1,window.MSGesture){var e=new MSGesture,t=new MSGesture;e.target=i.viewHelper.linesContentDomNode,t.target=i.viewHelper.linesContentDomNode,i.viewHelper.linesContentDomNode.addEventListener("MSPointerDown",(function(n){var r=n.pointerType;r!==(n.MSPOINTER_TYPE_MOUSE||"mouse")?r===(n.MSPOINTER_TYPE_TOUCH||"touch")?(i._lastPointerType="touch",e.addPointer(n.pointerId)):(i._lastPointerType="pen",t.addPointer(n.pointerId)):i._lastPointerType="mouse"})),i._register(tf(i.viewHelper.linesContentDomNode,"MSGestureChange",(function(e){return i._onGestureChange(e)}),Vw)),i._register(Bh(i.viewHelper.linesContentDomNode,"MSGestureTap",(function(e){return i._onCaptureGestureTap(e)}),!0))}}),100),i._lastPointerType="mouse",i}return Ww(t,e),t.prototype._onMouseDown=function(t){"mouse"===this._lastPointerType&&e.prototype._onMouseDown.call(this,t)},t.prototype._onCaptureGestureTap=function(e){var t=this,n=new rw(e,this.viewHelper.viewDomNode),r=this._createMouseTarget(n,!1);r.position&&this.viewController.moveTo(r.position),n.browserEvent.fromElement?(n.preventDefault(),this.viewHelper.focusTextArea()):setTimeout((function(){t.viewHelper.focusTextArea()}))},t.prototype._onGestureChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t.prototype.dispose=function(){window.clearTimeout(this._installGestureHandlerTimeout),e.prototype.dispose.call(this)},t}(jw),Uw=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.viewHelper.linesContentDomNode.style.touchAction="none",i._installGestureHandlerTimeout=window.setTimeout((function(){if(i._installGestureHandlerTimeout=-1,window.MSGesture){var e=new MSGesture,t=new MSGesture;e.target=i.viewHelper.linesContentDomNode,t.target=i.viewHelper.linesContentDomNode,i.viewHelper.linesContentDomNode.addEventListener("pointerdown",(function(n){var r=n.pointerType;"mouse"!==r?"touch"===r?(i._lastPointerType="touch",e.addPointer(n.pointerId)):(i._lastPointerType="pen",t.addPointer(n.pointerId)):i._lastPointerType="mouse"})),i._register(tf(i.viewHelper.linesContentDomNode,"MSGestureChange",(function(e){return i._onGestureChange(e)}),Vw)),i._register(Bh(i.viewHelper.linesContentDomNode,"MSGestureTap",(function(e){return i._onCaptureGestureTap(e)}),!0))}}),100),i._lastPointerType="mouse",i}return Ww(t,e),t.prototype._onMouseDown=function(t){"mouse"===this._lastPointerType&&e.prototype._onMouseDown.call(this,t)},t.prototype._onCaptureGestureTap=function(e){var t=this,n=new rw(e,this.viewHelper.viewDomNode),r=this._createMouseTarget(n,!1);r.position&&this.viewController.moveTo(r.position),n.browserEvent.fromElement?(n.preventDefault(),this.viewHelper.focusTextArea()):setTimeout((function(){t.viewHelper.focusTextArea()}))},t.prototype._onGestureChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t.prototype.dispose=function(){window.clearTimeout(this._installGestureHandlerTimeout),e.prototype.dispose.call(this)},t}(jw),qw=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return ip.addTarget(i.viewHelper.linesContentDomNode),i._register(Bh(i.viewHelper.linesContentDomNode,tp.Tap,(function(e){return i.onTap(e)}))),i._register(Bh(i.viewHelper.linesContentDomNode,tp.Change,(function(e){return i.onChange(e)}))),i._register(Bh(i.viewHelper.linesContentDomNode,tp.Contextmenu,(function(e){return i._onContextMenu(new rw(e,i.viewHelper.viewDomNode),!1)}))),i}return Ww(t,e),t.prototype.onTap=function(e){e.preventDefault(),this.viewHelper.focusTextArea();var t=this._createMouseTarget(new rw(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.moveTo(t.position)},t.prototype.onChange=function(e){this._context.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)},t}(jw),Kw=function(e){function t(t,n,r){var i=e.call(this)||this;return window.navigator.msPointerEnabled?i.handler=i._register(new zw(t,n,r)):window.TouchEvent?i.handler=i._register(new qw(t,n,r)):window.navigator.pointerEnabled||window.PointerEvent?i.handler=i._register(new Uw(t,n,r)):i.handler=i._register(new jw(t,n,r)),i}return Ww(t,e),t.prototype.getTargetAtClientPoint=function(e,t){return this.handler.getTargetAtClientPoint(e,t)},t}(Dt),Gw=(n(391),function(){function e(e,t,n,r,i){this.value=e,this.selectionStart=t,this.selectionEnd=n,this.selectionStartPosition=r,this.selectionEndPosition=i}return e.prototype.toString=function(){return"[ <"+this.value+">, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"},e.readFromTextArea=function(t){return new e(t.getValue(),t.getSelectionStart(),t.getSelectionEnd(),null,null)},e.prototype.collapseSelection=function(){return new e(this.value,this.value.length,this.value.length,null,null)},e.prototype.writeToTextArea=function(e,t,n){t.setValue(e,this.value),n&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)},e.prototype.deduceEditorPosition=function(e){if(e<=this.selectionStart){var t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}var n=this.value.substring(this.selectionStart,e);if(-1===n.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,n,1);var r=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,r,-1)},e.prototype._finishDeduceEditorPosition=function(e,t,n){for(var r=0,i=-1;-1!==(i=t.indexOf("\n",i+1));)r++;return[e,n*t.length,r]},e.selectedText=function(t){return new e(t,0,t.length,null,null)},e.deduceInput=function(e,t,n,r){if(!e)return{text:"",replaceCharCnt:0};var i=e.value,o=e.selectionStart,s=e.selectionEnd,a=t.value,u=t.selectionStart,c=t.selectionEnd;r&&i.length>0&&o===s&&u===c&&!nn(a,i)&&rn(a,i)&&(o=0,s=0);var l=function(e,t){var n,r=Math.min(e.length,t.length),i=e.length-1,o=t.length-1;for(n=0;n0){var p=null;if(u===a.length?nn(a,i)&&(p=a.substring(i.length)):rn(a,i)&&(p=a.substring(0,a.length-i.length)),null!==p&&p.length>0&&(/\uFE0F/.test(p)||(d=p,bn.test(d))))return{text:p,replaceCharCnt:0}}return u===c?i===a&&0===o&&s===i.length&&u===a.length&&-1===a.indexOf("\n")&&function(e){for(var t=0,n=e.length;t500&&(d=d.substring(d.length-500,d.length)),g.length>500&&(g=g.substring(0,500)),o.length>1e3&&(o=o.substring(0,500)+String.fromCharCode(8230)+o.substring(o.length-500,o.length))}return new Gw(d+o+g,d.length,d.length+o.length,new _t(r.startLineNumber,r.startColumn),new _t(r.endLineNumber,r.endColumn))},e._LINES_PER_PAGE=10,e}(),Zw=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jw={forceCopyWithSyntaxHighlighting:!1},Xw=function(e){function t(t,n){var r=e.call(this)||this;r._onFocus=r._register(new Ht),r.onFocus=r._onFocus.event,r._onBlur=r._register(new Ht),r.onBlur=r._onBlur.event,r._onKeyDown=r._register(new Ht),r.onKeyDown=r._onKeyDown.event,r._onKeyUp=r._register(new Ht),r.onKeyUp=r._onKeyUp.event,r._onCut=r._register(new Ht),r.onCut=r._onCut.event,r._onPaste=r._register(new Ht),r.onPaste=r._onPaste.event,r._onType=r._register(new Ht),r.onType=r._onType.event,r._onCompositionStart=r._register(new Ht),r.onCompositionStart=r._onCompositionStart.event,r._onCompositionUpdate=r._register(new Ht),r.onCompositionUpdate=r._onCompositionUpdate.event,r._onCompositionEnd=r._register(new Ht),r.onCompositionEnd=r._onCompositionEnd.event,r._onSelectionChangeRequest=r._register(new Ht),r.onSelectionChangeRequest=r._onSelectionChangeRequest.event,r._host=t,r._textArea=r._register(new eC(n)),r._lastTextAreaEvent=0,r._asyncTriggerCut=r._register(new ks((function(){return r._onCut.fire()}),0)),r._textAreaState=Gw.EMPTY,r._selectionChangeListener=null,r.writeScreenReaderContent("ctor"),r._hasFocus=!1,r._isDoingComposition=!1,r._nextCommand=0,r._register(Hh(n.domNode,"keydown",(function(e){!r._isDoingComposition||109!==e.keyCode&&1!==e.keyCode||e.stopPropagation(),e.equals(9)&&e.preventDefault(),r._onKeyDown.fire(e)}))),r._register(Hh(n.domNode,"keyup",(function(e){r._onKeyUp.fire(e)}))),r._register(Bh(n.domNode,"compositionstart",(function(e){r._lastTextAreaEvent=1,r._isDoingComposition||(r._isDoingComposition=!0,nh||r._setAndWriteTextAreaState("compositionstart",Gw.EMPTY),r._onCompositionStart.fire())})));var i=function(e,t){var n=r._textAreaState,i=Gw.readFromTextArea(r._textArea);return[i,Gw.deduceInput(n,i,e,t)]},o=function(e){var t=r._textAreaState,n=Gw.selectedText(e);return[n,{text:n.value,replaceCharCnt:t.selectionEnd-t.selectionStart}]},s=function(e){return!(!nh||"ja"!==e)||!(!eh||0!==e.indexOf("zh-Han"))};return r._register(Bh(n.domNode,"compositionupdate",(function(e){if(r._lastTextAreaEvent=2,s(e.locale)){var t=i(!1,!1),n=t[0],a=t[1];return r._textAreaState=n,r._onType.fire(a),void r._onCompositionUpdate.fire(e)}var u=o(e.data),c=u[0],l=u[1];r._textAreaState=c,r._onType.fire(l),r._onCompositionUpdate.fire(e)}))),r._register(Bh(n.domNode,"compositionend",(function(e){if(r._lastTextAreaEvent=3,s(e.locale)){var t=i(!1,!1),n=t[0],a=t[1];r._textAreaState=n,r._onType.fire(a)}else{var u=o(e.data);n=u[0],a=u[1];r._textAreaState=n,r._onType.fire(a)}(nh||oh)&&(r._textAreaState=Gw.readFromTextArea(r._textArea)),r._isDoingComposition&&(r._isDoingComposition=!1,r._onCompositionEnd.fire())}))),r._register(Bh(n.domNode,"input",(function(){var e=8===r._lastTextAreaEvent;if(r._lastTextAreaEvent=4,r._textArea.setIgnoreSelectionChangeTime("received input event"),!r._isDoingComposition){var t=i(Ge.d,e&&Ge.d),n=t[0],o=t[1];0===o.replaceCharCnt&&1===o.text.length&&mn(o.text.charCodeAt(0))||(r._textAreaState=n,0===r._nextCommand?""!==o.text&&r._onType.fire(o):(""!==o.text&&r._onPaste.fire({text:o.text}),r._nextCommand=0))}}))),r._register(Bh(n.domNode,"cut",(function(e){r._lastTextAreaEvent=5,r._textArea.setIgnoreSelectionChangeTime("received cut event"),r._ensureClipboardGetsEditorSelection(e),r._asyncTriggerCut.schedule()}))),r._register(Bh(n.domNode,"copy",(function(e){r._lastTextAreaEvent=6,r._ensureClipboardGetsEditorSelection(e)}))),r._register(Bh(n.domNode,"paste",(function(e){if(r._lastTextAreaEvent=7,r._textArea.setIgnoreSelectionChangeTime("received paste event"),Qw.canUseTextData(e)){var t=Qw.getTextData(e);""!==t&&r._onPaste.fire({text:t})}else r._textArea.getSelectionStart()!==r._textArea.getSelectionEnd()&&r._setAndWriteTextAreaState("paste",Gw.EMPTY),r._nextCommand=1}))),r._register(Bh(n.domNode,"focus",(function(){r._lastTextAreaEvent=8,r._setHasFocus(!0)}))),r._register(Bh(n.domNode,"blur",(function(){r._lastTextAreaEvent=9,r._setHasFocus(!1)}))),r}return Zw(t,e),t.prototype._installSelectionChangeListener=function(){var e=this,t=0;return Bh(document,"selectionchange",(function(n){if(e._hasFocus&&!e._isDoingComposition&&oh&&Ge.g){var r=Date.now(),i=r-t;if(t=r,!(i<5)){var o=r-e._textArea.getIgnoreSelectionChangeTime();if(e._textArea.resetSelectionChangeTime(),!(o<100)&&e._textAreaState.selectionStartPosition&&e._textAreaState.selectionEndPosition){var s=e._textArea.getValue();if(e._textAreaState.value===s){var a=e._textArea.getSelectionStart(),u=e._textArea.getSelectionEnd();if(e._textAreaState.selectionStart!==a||e._textAreaState.selectionEnd!==u){var c=e._textAreaState.deduceEditorPosition(a),l=e._host.deduceModelPosition(c[0],c[1],c[2]),d=e._textAreaState.deduceEditorPosition(u),h=e._host.deduceModelPosition(d[0],d[1],d[2]),f=new Or(l.lineNumber,l.column,h.lineNumber,h.column);e._onSelectionChangeRequest.fire(f)}}}}}}))},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)},t.prototype.focusTextArea=function(){this._setHasFocus(!0)},t.prototype.isFocused=function(){return this._hasFocus},t.prototype._setHasFocus=function(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&(th?this._setAndWriteTextAreaState("focusgain",Gw.EMPTY):this.writeScreenReaderContent("focusgain")),this._hasFocus?this._onFocus.fire():this._onBlur.fire())},t.prototype._setAndWriteTextAreaState=function(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t},t.prototype.writeScreenReaderContent=function(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))},t.prototype._ensureClipboardGetsEditorSelection=function(e){var t=this._host.getPlainTextToCopy();if(Qw.canUseTextData(e)){var n=null;(function(){if(eh)return!1;if(th){var e=Qd.indexOf("Edge/"),t=parseInt(Qd.substring(e+5,Qd.indexOf(".",e)),10);if(!t||t>=12&&t<=16)return!1}return!0})()&&(t.length<65536||Jw.forceCopyWithSyntaxHighlighting)&&(n=this._host.getHTMLToCopy()),Qw.setTextData(e,t,n)}else this._setAndWriteTextAreaState("copy or cut",Gw.selectedText(t))},t}(Dt),Qw=function(){function e(){}return e.canUseTextData=function(e){return!!e.clipboardData||!!window.clipboardData},e.getTextData=function(e){if(e.clipboardData)return e.preventDefault(),e.clipboardData.getData("text/plain");if(window.clipboardData)return e.preventDefault(),window.clipboardData.getData("Text");throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")},e.setTextData=function(e,t,n){if(e.clipboardData)return e.clipboardData.setData("text/plain",t),null!==n&&e.clipboardData.setData("text/html",n),void e.preventDefault();if(window.clipboardData)return window.clipboardData.setData("Text",t),void e.preventDefault();throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")},e}(),eC=function(e){function t(t){var n=e.call(this)||this;return n._actual=t,n._ignoreSelectionChangeTime=0,n}return Zw(t,e),t.prototype.setIgnoreSelectionChangeTime=function(e){this._ignoreSelectionChangeTime=Date.now()},t.prototype.getIgnoreSelectionChangeTime=function(){return this._ignoreSelectionChangeTime},t.prototype.resetSelectionChangeTime=function(){this._ignoreSelectionChangeTime=0},t.prototype.getValue=function(){return this._actual.domNode.value},t.prototype.setValue=function(e,t){var n=this._actual.domNode;n.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),n.value=t)},t.prototype.getSelectionStart=function(){return this._actual.domNode.selectionStart},t.prototype.getSelectionEnd=function(){return this._actual.domNode.selectionEnd},t.prototype.setSelectionRange=function(e,t,n){var r=this._actual.domNode,i=document.activeElement===r,o=r.selectionStart,s=r.selectionEnd;if(i&&o===t&&s===n)rh&&window.parent!==window&&r.focus();else{if(i)return this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,n),void(rh&&window.parent!==window&&r.focus());try{var a=function(e){for(var t=[],n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)t[n]=e.scrollTop,e=e.parentNode;return t}(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,n),function(e,t){for(var n=0;e&&e.nodeType===e.ELEMENT_NODE;n++)e.scrollTop!==t[n]&&(e.scrollTop=t[n]),e=e.parentNode}(r,a)}catch(e){}}},t}(Dt),tC=(n(392),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),nC=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tC(t,e),t}(aw),rC=zc("editor.lineHighlightBackground",{dark:null,light:null,hc:null},we("lineHighlight","Background color for the highlight of line at the cursor position.")),iC=zc("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},we("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),oC=zc("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},we("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),sC=zc("editor.rangeHighlightBorder",{dark:null,light:null,hc:Jc},we("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),aC=zc("editorCursor.foreground",{dark:"#AEAFAD",light:xu.black,hc:xu.white},we("caret","Color of the editor cursor.")),uC=zc("editorCursor.background",null,we("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),cC=zc("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},we("editorWhitespaces","Color of whitespace characters in the editor.")),lC=zc("editorIndentGuide.background",{dark:cC,light:cC,hc:cC},we("editorIndentGuides","Color of the editor indentation guides.")),dC=zc("editorIndentGuide.activeBackground",{dark:cC,light:cC,hc:cC},we("editorActiveIndentGuide","Color of the active editor indentation guides.")),hC=zc("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:xu.white},we("editorLineNumbers","Color of editor line numbers.")),fC=zc("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:Jc},we("editorActiveLineNumber","Color of editor active line number"),!1,we("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),pC=zc("editorLineNumber.activeForeground",{dark:fC,light:fC,hc:fC},we("editorActiveLineNumber","Color of editor active line number")),gC=zc("editorRuler.foreground",{dark:"#5A5A5A",light:xu.lightgrey,hc:xu.white},we("editorRuler","Color of the editor rulers.")),mC=(zc("editorCodeLens.foreground",{dark:"#999999",light:"#999999",hc:"#999999"},we("editorCodeLensForeground","Foreground color of editor code lenses")),zc("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},we("editorBracketMatchBackground","Background color behind matching brackets")),zc("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:Zc},we("editorBracketMatchBorder","Color for matching brackets boxes")),zc("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},we("editorOverviewRulerBorder","Color of the overview ruler border."))),_C=zc("editorGutter.background",{dark:Gl,light:Gl,hc:Gl},we("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),yC=zc("editorUnnecessaryCode.border",{dark:null,light:null,hc:xu.fromHex("#fff").transparent(.8)},we("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),vC=zc("editorUnnecessaryCode.opacity",{dark:xu.fromHex("#000a"),light:xu.fromHex("#0007"),hc:null},we("unnecessaryCodeOpacity","Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.")),bC=zc("editorOverviewRuler.errorForeground",{dark:new xu(new wu(255,18,18,.7)),light:new xu(new wu(255,18,18,.7)),hc:new xu(new wu(255,50,50,1))},we("overviewRuleError","Overview ruler marker color for errors.")),wC=zc("editorOverviewRuler.warningForeground",{dark:Wl,light:Wl,hc:Vl},we("overviewRuleWarning","Overview ruler marker color for warnings.")),CC=zc("editorOverviewRuler.infoForeground",{dark:zl,light:zl,hc:Ul},we("overviewRuleInfo","Overview ruler marker color for infos."));Ad((function(e,t){var n=e.getColor(Gl);n&&t.addRule(".monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: "+n+"; }");var r=e.getColor($l);r&&t.addRule(".monaco-editor, .monaco-editor .inputarea.ime-input { color: "+r+"; }");var i=e.getColor(_C);i&&t.addRule(".monaco-editor .margin { background-color: "+i+"; }");var o=e.getColor(oC);o&&t.addRule(".monaco-editor .rangeHighlight { background-color: "+o+"; }");var s=e.getColor(sC);s&&t.addRule(".monaco-editor .rangeHighlight { border: 1px "+("hc"===e.type?"dotted":"solid")+" "+s+"; }");var a=e.getColor(cC);a&&t.addRule(".vs-whitespace { color: "+a+" !important; }")}));var SC=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xC=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._readConfig(),n._lastCursorModelPosition=new _t(1,1),n._renderResult=null,n._context.addEventHandler(n),n}return SC(t,e),t.prototype._readConfig=function(){var e=this._context.configuration.editor;this._lineHeight=e.lineHeight,this._renderLineNumbers=e.viewInfo.renderLineNumbers,this._renderCustomLineNumbers=e.viewInfo.renderCustomLineNumbers,this._renderFinalNewline=e.viewInfo.renderFinalNewline,this._lineNumbersLeft=e.layoutInfo.lineNumbersLeft,this._lineNumbersWidth=e.layoutInfo.lineNumbersWidth},t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return this._readConfig(),!0},t.prototype.onCursorStateChanged=function(e){var t=e.selections[0].getPosition();return this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t),2===this._renderLineNumbers||3===this._renderLineNumbers},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._getLineRenderLineNumber=function(e){var t=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new _t(e,1));if(1!==t.column)return"";var n=t.lineNumber;if(!this._renderFinalNewline){var r=this._context.model.getLineCount(),i=this._context.model.getLineContent(n);if(n===r&&""===i)return""}if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(n);if(2===this._renderLineNumbers){var o=Math.abs(this._lastCursorModelPosition.lineNumber-n);return 0===o?''+n+"":String(o)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===n?String(n):n%10==0?String(n):"":String(n)},t.prototype.prepareRender=function(e){if(0!==this._renderLineNumbers){for(var n=Ge.c?this._lineHeight%2==0?" lh-even":" lh-odd":"",r=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,o='
    ',s=[],a=r;a<=i;a++){var u=a-r,c=this._getLineRenderLineNumber(a);s[u]=c?o+c+"
    ":""}this._renderResult=s}else this._renderResult=null},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t.CLASS_NAME="line-numbers",t}(nC);Ad((function(e,t){var n=e.getColor(hC);n&&t.addRule(".monaco-editor .line-numbers { color: "+n+"; }");var r=e.getColor(pC);r&&t.addRule(".monaco-editor .current-line ~ .line-numbers { color: "+r+"; }")}));var kC=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),LC=function(e){function t(n){var r=e.call(this,n)||this;return r._canUseLayerHinting=r._context.configuration.editor.canUseLayerHinting,r._contentLeft=r._context.configuration.editor.layoutInfo.contentLeft,r._glyphMarginLeft=r._context.configuration.editor.layoutInfo.glyphMarginLeft,r._glyphMarginWidth=r._context.configuration.editor.layoutInfo.glyphMarginWidth,r._domNode=bp(document.createElement("div")),r._domNode.setClassName(t.OUTER_CLASS_NAME),r._domNode.setPosition("absolute"),r._domNode.setAttribute("role","presentation"),r._domNode.setAttribute("aria-hidden","true"),r._glyphMarginBackgroundDomNode=bp(document.createElement("div")),r._glyphMarginBackgroundDomNode.setClassName(t.CLASS_NAME),r._domNode.appendChild(r._glyphMarginBackgroundDomNode),r}return kC(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){return e.canUseLayerHinting&&(this._canUseLayerHinting=this._context.configuration.editor.canUseLayerHinting),e.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft,this._glyphMarginLeft=this._context.configuration.editor.layoutInfo.glyphMarginLeft,this._glyphMarginWidth=this._context.configuration.editor.layoutInfo.glyphMarginWidth),!0},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollTopChanged},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setLayerHinting(this._canUseLayerHinting);var t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);var n=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(n),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(n)},t.CLASS_NAME="glyph-margin",t.OUTER_CLASS_NAME="margin",t}(cw),MC=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),EC=function(e){this.type=1,this.canUseLayerHinting=e.canUseLayerHinting,this.pixelRatio=e.pixelRatio,this.editorClassName=e.editorClassName,this.lineHeight=e.lineHeight,this.readOnly=e.readOnly,this.accessibilitySupport=e.accessibilitySupport,this.emptySelectionClipboard=e.emptySelectionClipboard,this.copyWithSyntaxHighlighting=e.copyWithSyntaxHighlighting,this.layoutInfo=e.layoutInfo,this.fontInfo=e.fontInfo,this.viewInfo=e.viewInfo,this.wrappingInfo=e.wrappingInfo},DC=function(e){this.type=2,this.selections=e},TC=function(){this.type=3},NC=function(){this.type=4},OC=function(e){this.type=5,this.isFocused=e},AC=function(){this.type=6},IC=function(e,t){this.type=7,this.fromLineNumber=e,this.toLineNumber=t},PC=function(e,t){this.type=8,this.fromLineNumber=e,this.toLineNumber=t},RC=function(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t},FC=function(e,t,n,r){this.type=10,this.range=e,this.verticalType=t,this.revealHorizontal=n,this.scrollType=r},YC=function(e){this.type=11,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged},jC=function(e){this.type=12,this.ranges=e},BC=function(){this.type=15},HC=function(){this.type=13},WC=function(){this.type=14},VC=function(){this.type=16},zC=function(e){function t(){var t=e.call(this)||this;return t._listeners=[],t._collector=null,t._collectorCnt=0,t}return MC(t,e),t.prototype.dispose=function(){this._listeners=[],e.prototype.dispose.call(this)},t.prototype._beginEmit=function(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new UC),this._collector},t.prototype._endEmit=function(){if(this._collectorCnt--,0===this._collectorCnt){var e=this._collector.finalize();this._collector=null,e.length>0&&this._emit(e)}},t.prototype._emit=function(e){for(var t=this._listeners.slice(0),n=0,r=t.length;n0)return new Gw(r,r.length,r.length,n,n)}}return Gw.EMPTY}return $w.fromEditorSelection(e,s,i._selections[0],0===i._accessibilitySupport)},deduceModelPosition:function(e,t,n){return i._context.model.deduceModelPositionRelativeToViewPosition(e,t,n)}};return i._textAreaInput=i._register(new Xw(a,i.textArea)),i._register(i._textAreaInput.onKeyDown((function(e){i._viewController.emitKeyDown(e)}))),i._register(i._textAreaInput.onKeyUp((function(e){i._viewController.emitKeyUp(e)}))),i._register(i._textAreaInput.onPaste((function(e){var t=ZC.INSTANCE.get(e.text),n=!1,r=null;t&&(n=i._emptySelectionClipboard&&t.isFromEmptySelection,r=t.multicursorText),i._viewController.paste("keyboard",e.text,n,r)}))),i._register(i._textAreaInput.onCut((function(){i._viewController.cut("keyboard")}))),i._register(i._textAreaInput.onType((function(e){e.replaceCharCnt?i._viewController.replacePreviousChar("keyboard",e.text,e.replaceCharCnt):i._viewController.type("keyboard",e.text)}))),i._register(i._textAreaInput.onSelectionChangeRequest((function(e){i._viewController.setSelection("keyboard",e)}))),i._register(i._textAreaInput.onCompositionStart((function(){var e=i._selections[0].startLineNumber,t=i._selections[0].startColumn;i._context.privateViewEventBus.emit(new FC(new Tr(e,t,e,t),0,!0,1));var n=i._viewHelper.visibleRangeForPositionRelativeToEditor(e,t);n&&(i._visibleTextArea=new GC(i._context.viewLayout.getVerticalOffsetForLineNumber(e),n.left,$C?0:1),i._render()),i.textArea.setClassName("inputarea ime-input"),i._viewController.compositionStart("keyboard")}))),i._register(i._textAreaInput.onCompositionUpdate((function(e){i._visibleTextArea=nh?i._visibleTextArea.setWidth(0):i._visibleTextArea.setWidth(function(e,t){var n=document.createElement("canvas").getContext("2d");n.font=(r=t,i="normal",o=r.fontWeight,s=r.fontSize,a=r.lineHeight,u=r.fontFamily,i+" normal "+o+" "+s+"px / "+a+"px "+u);var r,i,o,s,a,u;var c=n.measureText(e);return rh?c.width+2:c.width}(e.data,i._fontInfo)),i._render()}))),i._register(i._textAreaInput.onCompositionEnd((function(){i._visibleTextArea=null,i._render(),i.textArea.setClassName("inputarea"),i._viewController.compositionEnd("keyboard")}))),i._register(i._textAreaInput.onFocus((function(){i._context.privateViewEventBus.emit(new OC(!0))}))),i._register(i._textAreaInput.onBlur((function(){i._context.privateViewEventBus.emit(new OC(!1))}))),i}return KC(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._getWordBeforePosition=function(e){for(var t=this._context.model.getLineContent(e.lineNumber),n=yo(this._context.configuration.editor.wordSeparators),r=e.column,i=0;r>1;){var o=t.charCodeAt(r-2);if(0!==n.get(o)||i>50)return t.substring(r-1,e.column-1);i++,r--}return t.substring(0,e.column-1)},t.prototype._getCharacterBeforePosition=function(e){if(e.column>1){var t=this._context.model.getLineContent(e.lineNumber).charAt(e.column-2);if(!mn(t.charCodeAt(0)))return t}return""},t.prototype.onConfigurationChanged=function(e){var t=this._context.configuration.editor;return e.fontInfo&&(this._fontInfo=t.fontInfo),e.viewInfo&&this.textArea.setAttribute("aria-label",t.viewInfo.ariaLabel),e.layoutInfo&&(this._contentLeft=t.layoutInfo.contentLeft,this._contentWidth=t.layoutInfo.contentWidth,this._contentHeight=t.layoutInfo.contentHeight),e.lineHeight&&(this._lineHeight=t.lineHeight),e.accessibilitySupport&&(this._accessibilitySupport=t.accessibilitySupport,this._textAreaInput.writeScreenReaderContent("strategy changed")),e.emptySelectionClipboard&&(this._emptySelectionClipboard=t.emptySelectionClipboard),e.copyWithSyntaxHighlighting&&(this._copyWithSyntaxHighlighting=t.copyWithSyntaxHighlighting),!0},t.prototype.onCursorStateChanged=function(e){return this._selections=e.selections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0},t.prototype.onZonesChanged=function(e){return!0},t.prototype.isFocused=function(){return this._textAreaInput.isFocused()},t.prototype.focusTextArea=function(){this._textAreaInput.focusTextArea()},t.prototype.prepareRender=function(e){var t=new _t(this._selections[0].positionLineNumber,this._selections[0].positionColumn);this._primaryCursorVisibleRange=e.visibleRangeForPosition(t)},t.prototype.render=function(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()},t.prototype._render=function(){if(this._visibleTextArea)this._renderInsideEditor(this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight,!0);else if(this._primaryCursorVisibleRange){var e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth)this._renderAtTopLeft();else{var t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;t<0||t>this._contentHeight?this._renderAtTopLeft():this._renderInsideEditor(t,e,$C?0:1,$C?0:1,!1)}}else this._renderAtTopLeft()},t.prototype._renderInsideEditor=function(e,t,n,r,i){var o=this.textArea,s=this.textAreaCover;i?Jb.applyFontInfo(o,this._fontInfo):(o.setFontSize(1),o.setLineHeight(this._fontInfo.lineHeight)),o.setTop(e),o.setLeft(t),o.setWidth(n),o.setHeight(r),s.setTop(0),s.setLeft(0),s.setWidth(0),s.setHeight(0)},t.prototype._renderAtTopLeft=function(){var e=this.textArea,t=this.textAreaCover;if(Jb.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),$C)return e.setWidth(0),e.setHeight(0),t.setWidth(0),void t.setHeight(0);e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1),this._context.configuration.editor.viewInfo.glyphMargin?t.setClassName("monaco-editor-background textAreaCover "+LC.OUTER_CLASS_NAME):0!==this._context.configuration.editor.viewInfo.renderLineNumbers?t.setClassName("monaco-editor-background textAreaCover "+xC.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")},t}(cw);var XC=function(){function e(e,t,n,r){this.configuration=e,this.viewModel=t,this.outgoingEvents=n,this.commandDelegate=r}return e.prototype._execMouseCommand=function(e,t){t.source="mouse",this.commandDelegate.executeEditorCommand(e,t)},e.prototype.paste=function(e,t,n,r){this.commandDelegate.paste(e,t,n,r)},e.prototype.type=function(e,t){this.commandDelegate.type(e,t)},e.prototype.replacePreviousChar=function(e,t,n){this.commandDelegate.replacePreviousChar(e,t,n)},e.prototype.compositionStart=function(e){this.commandDelegate.compositionStart(e)},e.prototype.compositionEnd=function(e){this.commandDelegate.compositionEnd(e)},e.prototype.cut=function(e){this.commandDelegate.cut(e)},e.prototype.setSelection=function(e,t){this.commandDelegate.executeEditorCommand(Dc.SetSelection,{source:e,selection:t})},e.prototype._validateViewColumn=function(e){var t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):2===e.mouseDownCount?this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!1):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)},e.prototype._usualArgs=function(e){return e=this._validateViewColumn(e),{position:this._convertViewToModelPosition(e),viewPosition:e}},e.prototype.moveTo=function(e){this._execMouseCommand(Dc.MoveTo,this._usualArgs(e))},e.prototype._moveToSelect=function(e){this._execMouseCommand(Dc.MoveToSelect,this._usualArgs(e))},e.prototype._columnSelect=function(e,t,n){e=this._validateViewColumn(e),this._execMouseCommand(Dc.ColumnSelect,{position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,setAnchorIfNotSet:n})},e.prototype._createCursor=function(e,t){e=this._validateViewColumn(e),this._execMouseCommand(Dc.CreateCursor,{position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})},e.prototype._lastCursorMoveToSelect=function(e){this._execMouseCommand(Dc.LastCursorMoveToSelect,this._usualArgs(e))},e.prototype._wordSelect=function(e){this._execMouseCommand(Dc.WordSelect,this._usualArgs(e))},e.prototype._wordSelectDrag=function(e){this._execMouseCommand(Dc.WordSelectDrag,this._usualArgs(e))},e.prototype._lastCursorWordSelect=function(e){this._execMouseCommand(Dc.LastCursorWordSelect,this._usualArgs(e))},e.prototype._lineSelect=function(e){this._execMouseCommand(Dc.LineSelect,this._usualArgs(e))},e.prototype._lineSelectDrag=function(e){this._execMouseCommand(Dc.LineSelectDrag,this._usualArgs(e))},e.prototype._lastCursorLineSelect=function(e){this._execMouseCommand(Dc.LastCursorLineSelect,this._usualArgs(e))},e.prototype._lastCursorLineSelectDrag=function(e){this._execMouseCommand(Dc.LastCursorLineSelectDrag,this._usualArgs(e))},e.prototype._selectAll=function(){this._execMouseCommand(Dc.SelectAll,{})},e.prototype._convertViewToModelPosition=function(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)},e.prototype.emitKeyDown=function(e){this.outgoingEvents.emitKeyDown(e)},e.prototype.emitKeyUp=function(e){this.outgoingEvents.emitKeyUp(e)},e.prototype.emitContextMenu=function(e){this.outgoingEvents.emitContextMenu(e)},e.prototype.emitMouseMove=function(e){this.outgoingEvents.emitMouseMove(e)},e.prototype.emitMouseLeave=function(e){this.outgoingEvents.emitMouseLeave(e)},e.prototype.emitMouseUp=function(e){this.outgoingEvents.emitMouseUp(e)},e.prototype.emitMouseDown=function(e){this.outgoingEvents.emitMouseDown(e)},e.prototype.emitMouseDrag=function(e){this.outgoingEvents.emitMouseDrag(e)},e.prototype.emitMouseDrop=function(e){this.outgoingEvents.emitMouseDrop(e)},e.prototype.emitMouseWheel=function(e){this.outgoingEvents.emitMouseWheel(e)},e}(),QC=function(){function e(e){this._createLine=e,this._set(1,[])}return e.prototype.flush=function(){this._set(1,[])},e.prototype._set=function(e,t){this._lines=t,this._rendLineNumberStart=e},e.prototype._get=function(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}},e.prototype.getStartLineNumber=function(){return this._rendLineNumberStart},e.prototype.getEndLineNumber=function(){return this._rendLineNumberStart+this._lines.length-1},e.prototype.getCount=function(){return this._lines.length},e.prototype.getLine=function(e){var t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]},e.prototype.onLinesDeleted=function(e,t){if(0===this.getCount())return null;var n=this.getStartLineNumber(),r=this.getEndLineNumber();if(tr)return null;for(var o=0,s=0,a=n;a<=r;a++){var u=a-this._rendLineNumberStart;e<=a&&a<=t&&(0===s?(o=u,s=1):s++)}if(e=n&&o<=r&&(this._lines[o-this._rendLineNumberStart].onContentChanged(),i=!0);return i},e.prototype.onLinesInserted=function(e,t){if(0===this.getCount())return null;var n=t-e+1,r=this.getStartLineNumber(),i=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=n,null;if(e>i)return null;if(n+e>i)return this._lines.splice(e-this._rendLineNumberStart,i-e+1);for(var o=[],s=0;sn))for(var a=Math.max(t,s.fromLineNumber),u=Math.min(n,s.toLineNumber),c=a;c<=u;c++){var l=c-this._rendLineNumberStart;this._lines[l].onTokensChanged(),r=!0}}return r},e}(),eS=function(){function e(e){var t=this;this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new QC((function(){return t._host.createVisibleLine()}))}return e.prototype._createDomNode=function(){var e=bp(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e},e.prototype.onConfigurationChanged=function(e){return e.layoutInfo},e.prototype.onFlushed=function(e){return this._linesCollection.flush(),!0},e.prototype.onLinesChanged=function(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)},e.prototype.onLinesDeleted=function(e){var t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(var n=0,r=t.length;nt)(u=t)<=(s=Math.min(n,i.rendLineNumberStart-1))&&(this._insertLinesBefore(i,u,s,r,t),i.linesLength+=s-u+1);else if(i.rendLineNumberStart0&&(this._removeLinesBefore(i,a),i.linesLength-=a)}if(i.rendLineNumberStart=t,i.rendLineNumberStart+i.linesLength-1n){var s,a,u=Math.max(0,n-i.rendLineNumberStart+1);(a=(s=i.linesLength-1)-u+1)>0&&(this._removeLinesAfter(i,a),i.linesLength-=a)}return this._finishRendering(i,!1,r),i},e.prototype._renderUntouchedLines=function(e,t,n,r,i){for(var o=e.rendLineNumberStart,s=e.lines,a=t;a<=n;a++){var u=o+a;s[a].layoutLine(u,r[u-i])}},e.prototype._insertLinesBefore=function(e,t,n,r,i){for(var o=[],s=0,a=t;a<=n;a++)o[s++]=this.host.createVisibleLine();e.lines=o.concat(e.lines)},e.prototype._removeLinesBefore=function(e,t){for(var n=0;n=0;s--){var a=e.lines[s];r[s]&&(a.setDomNode(o),o=o.previousSibling)}},e.prototype._finishRenderingInvalidLines=function(e,t,n){var r=document.createElement("div");r.innerHTML=t;for(var i=0;i'),r.appendASCIIString(i),r.appendASCIIString(""),!0)},e.prototype.layoutLine=function(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))},e}(),oS=function(e){function t(t){var n=e.call(this,t)||this;return n._contentWidth=n._context.configuration.editor.layoutInfo.contentWidth,n.domNode.setHeight(0),n}return nS(t,e),t.prototype.onConfigurationChanged=function(t){return t.layoutInfo&&(this._contentWidth=this._context.configuration.editor.layoutInfo.contentWidth),e.prototype.onConfigurationChanged.call(this,t)},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollWidthChanged},t.prototype._viewOverlaysRender=function(t){e.prototype._viewOverlaysRender.call(this,t),this.domNode.setWidth(Math.max(t.scrollWidth,this._contentWidth))},t}(rS),sS=function(e){function t(t){var n=e.call(this,t)||this;return n._contentLeft=n._context.configuration.editor.layoutInfo.contentLeft,n.domNode.setClassName("margin-view-overlays"),n.domNode.setWidth(1),Jb.applyFontInfo(n.domNode,n._context.configuration.editor.fontInfo),n}return nS(t,e),t.prototype.onConfigurationChanged=function(t){var n=!1;return t.fontInfo&&(Jb.applyFontInfo(this.domNode,this._context.configuration.editor.fontInfo),n=!0),t.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft,n=!0),e.prototype.onConfigurationChanged.call(this,t)||n},t.prototype.onScrollChanged=function(t){return e.prototype.onScrollChanged.call(this,t)||t.scrollHeightChanged},t.prototype._viewOverlaysRender=function(t){e.prototype._viewOverlaysRender.call(this,t);var n=Math.min(t.scrollHeight,1e6);this.domNode.setHeight(n),this.domNode.setWidth(this._contentLeft)},t}(rS),aS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uS=function(e,t){this.top=e,this.left=t},cS=function(e){function t(t,n){var r=e.call(this,t)||this;return r._viewDomNode=n,r._widgets={},r.domNode=bp(document.createElement("div")),lw.write(r.domNode,1),r.domNode.setClassName("contentWidgets"),r.domNode.setPosition("absolute"),r.domNode.setTop(0),r.overflowingContentWidgetsDomNode=bp(document.createElement("div")),lw.write(r.overflowingContentWidgetsDomNode,2),r.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets"),r}return aS(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._widgets={}},t.prototype.onConfigurationChanged=function(e){for(var t=0,n=Object.keys(this._widgets);t=r,l=a,d=i.viewportHeight-a>=r,h=e.left,f=t.left;return h+n>i.scrollLeft+i.viewportWidth&&(h=i.scrollLeft+i.viewportWidth-n),f+n>i.scrollLeft+i.viewportWidth&&(f=i.scrollLeft+i.viewportWidth-n),h=22,v=p+r<=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-22;g+n+20>_&&(g-=o=g-(_-n-20),l-=o);m+n+20>_&&(m-=o=m-(_-n-20),d-=o);g<0&&(g-=o=g,l-=o);m<0&&(m-=o=m,d-=o);return this._fixedOverflowWidgets&&(u=f,c=p,l=g,d=m),{fitsAbove:y,aboveTop:u,aboveLeft:l,fitsBelow:v,belowTop:c,belowLeft:d}},e.prototype._prepareRenderWidgetAtExactPositionOverflowing=function(e){return new uS(e.top,e.left+this._contentLeft)},e.prototype._getTopAndBottomLeft=function(e){if(!this._viewPosition)return[null,null];var t=e.visibleRangeForPosition(this._viewPosition);if(!t)return[null,null];var n=e.getVerticalOffsetForLineNumber(this._viewPosition.lineNumber)-e.scrollTop,r=new uS(n,t.left),i=this._viewPosition.lineNumber,o=t.left;if(this._viewRange){var s=e.linesVisibleRangesForRange(this._viewRange,!1);if(s&&s.length>0)for(var a=s.length-1;a>=0;a--){var u=s[a];if(u.lineNumber>=i){u.lineNumber>i&&(i=u.lineNumber,o=1073741824);for(var c=0,l=u.ranges.length;ce.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))},e.prototype.prepareRender=function(e){this._renderData=this._prepareRenderWidget(e)},e.prototype.render=function(e){this._renderData?(this.allowEditorOverflow?(this.domNode.setTop(this._renderData.top),this.domNode.setLeft(this._renderData.left)):(this.domNode.setTop(this._renderData.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0)):this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden"))},e}(),dS=(n(393),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),hS=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._renderLineHighlight=n._context.configuration.editor.viewInfo.renderLineHighlight,n._selectionIsEmpty=!0,n._primaryCursorLineNumber=1,n._scrollWidth=0,n._contentWidth=n._context.configuration.editor.layoutInfo.contentWidth,n._context.addEventHandler(n),n}return dS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._renderLineHighlight=this._context.configuration.editor.viewInfo.renderLineHighlight),e.layoutInfo&&(this._contentWidth=this._context.configuration.editor.layoutInfo.contentWidth),!0},t.prototype.onCursorStateChanged=function(e){var t=!1,n=e.selections[0].positionLineNumber;this._primaryCursorLineNumber!==n&&(this._primaryCursorLineNumber=n,t=!0);var r=e.selections[0].isEmpty();return this._selectionIsEmpty!==r?(this._selectionIsEmpty=r,!0):t},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollWidthChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){this._scrollWidth=e.scrollWidth},t.prototype.render=function(e,t){return t===this._primaryCursorLineNumber&&this._shouldShowCurrentLine()?'
    ':""},t.prototype._shouldShowCurrentLine=function(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty},t.prototype._willRenderMarginCurrentLine=function(){return"gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight},t}(nC);Ad((function(e,t){var n=e.getColor(rC);if(n&&t.addRule(".monaco-editor .view-overlays .current-line { background-color: "+n+"; }"),!n||n.isTransparent()||e.defines(iC)){var r=e.getColor(iC);r&&(t.addRule(".monaco-editor .view-overlays .current-line { border: 2px solid "+r+"; }"),"hc"===e.type&&t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"))}}));n(394);var fS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pS=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._renderLineHighlight=n._context.configuration.editor.viewInfo.renderLineHighlight,n._selectionIsEmpty=!0,n._primaryCursorLineNumber=1,n._contentLeft=n._context.configuration.editor.layoutInfo.contentLeft,n._context.addEventHandler(n),n}return fS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._renderLineHighlight=this._context.configuration.editor.viewInfo.renderLineHighlight),e.layoutInfo&&(this._contentLeft=this._context.configuration.editor.layoutInfo.contentLeft),!0},t.prototype.onCursorStateChanged=function(e){var t=!1,n=e.selections[0].positionLineNumber;this._primaryCursorLineNumber!==n&&(this._primaryCursorLineNumber=n,t=!0);var r=e.selections[0].isEmpty();return this._selectionIsEmpty!==r?(this._selectionIsEmpty=r,!0):t},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){},t.prototype.render=function(e,t){if(t===this._primaryCursorLineNumber){var n="current-line";if(this._shouldShowCurrentLine())n="current-line current-line-margin"+(this._willRenderContentCurrentLine()?" current-line-margin-both":"");return'
    '}return""},t.prototype._shouldShowCurrentLine=function(){return"gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight},t.prototype._willRenderContentCurrentLine=function(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty},t}(nC);Ad((function(e,t){var n=e.getColor(rC);if(n)t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { background-color: "+n+"; border: none; }");else{var r=e.getColor(iC);r&&t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid "+r+"; }"),"hc"===e.type&&t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")}}));n(395);var gS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mS=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._renderResult=null,n._context.addEventHandler(n),n}return gS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged||e.scrollWidthChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.prepareRender=function(e){for(var t=e.getDecorationsInViewport(),n=[],r=0,i=0,o=t.length;it.options.zIndex)return 1;var n=e.options.className,r=t.options.className;return nr?1:Tr.compareRangesUsingStarts(e.range,t.range)}));for(var a=e.visibleRange.startLineNumber,u=e.visibleRange.endLineNumber,c=[],l=a;l<=u;l++){c[l-a]=""}this._renderWholeLineDecorations(e,n,c),this._renderNormalDecorations(e,n,c),this._renderResult=c},t.prototype._renderWholeLineDecorations=function(e,t,n){for(var r=String(this._lineHeight),i=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,s=0,a=t.length;s',l=Math.max(u.range.startLineNumber,i),d=Math.min(u.range.endLineNumber,o),h=l;h<=d;h++){n[h-i]+=c}}},t.prototype._renderNormalDecorations=function(e,t,n){for(var r=String(this._lineHeight),i=e.visibleRange.startLineNumber,o=null,s=!1,a=null,u=0,c=t.length;u';s[d]+=m}}},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t}(nC),_S=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yS=function(e){function t(t,n,r,i){var o=e.call(this,t)||this,s=o._context.configuration.editor.viewInfo.scrollbar,a={listenOnDomNode:r.domNode,className:"editor-scrollable "+Td(t.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity};o.scrollbar=o._register(new qp(n.domNode,a,o._context.viewLayout.scrollable)),lw.write(o.scrollbar.getDomNode(),5),o.scrollbarDomNode=bp(o.scrollbar.getDomNode()),o.scrollbarDomNode.setPosition("absolute"),o._setLayout();var u=function(e,t,n){var r={};if(t){var i=e.scrollTop;i&&(r.scrollTop=o._context.viewLayout.getCurrentScrollTop()+i,e.scrollTop=0)}if(n){var s=e.scrollLeft;s&&(r.scrollLeft=o._context.viewLayout.getCurrentScrollLeft()+s,e.scrollLeft=0)}o._context.viewLayout.setScrollPositionNow(r)};return o._register(Bh(r.domNode,"scroll",(function(e){return u(r.domNode,!0,!0)}))),o._register(Bh(n.domNode,"scroll",(function(e){return u(n.domNode,!0,!1)}))),o._register(Bh(i.domNode,"scroll",(function(e){return u(i.domNode,!0,!1)}))),o._register(Bh(o.scrollbarDomNode.domNode,"scroll",(function(e){return u(o.scrollbarDomNode.domNode,!0,!1)}))),o}return _S(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._setLayout=function(){var e=this._context.configuration.editor.layoutInfo;this.scrollbarDomNode.setLeft(e.contentLeft),"right"===this._context.configuration.editor.viewInfo.minimap.side?this.scrollbarDomNode.setWidth(e.contentWidth+e.minimapWidth):this.scrollbarDomNode.setWidth(e.contentWidth),this.scrollbarDomNode.setHeight(e.contentHeight)},t.prototype.getOverviewRulerLayoutInfo=function(){return this.scrollbar.getOverviewRulerLayoutInfo()},t.prototype.getDomNode=function(){return this.scrollbarDomNode},t.prototype.delegateVerticalScrollbarMouseDown=function(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)},t.prototype.onConfigurationChanged=function(e){if(e.viewInfo){var t=this._context.configuration.editor,n={handleMouseWheel:t.viewInfo.scrollbar.handleMouseWheel,mouseWheelScrollSensitivity:t.viewInfo.scrollbar.mouseWheelScrollSensitivity,fastScrollSensitivity:t.viewInfo.scrollbar.fastScrollSensitivity};this.scrollbar.updateOptions(n)}return e.layoutInfo&&this._setLayout(),!0},t.prototype.onScrollChanged=function(e){return!0},t.prototype.onThemeChanged=function(e){return this.scrollbar.updateClassName("editor-scrollable "+Td(this._context.theme.type)),!0},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this.scrollbar.renderNow()},t}(cw),vS=(n(396),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),bS=function(e,t,n){this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(n)},wS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vS(t,e),t.prototype._render=function(e,t,n){for(var r=[],i=e;i<=t;i++){r[i-e]=[]}if(0===n.length)return r;n.sort((function(e,t){return e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className',s=[],a=t;a<=n;a++){var u=a-t,c=r[u];0===c.length?s[u]="":s[u]='
    =this._renderResult.length?"":this._renderResult[n]},t}(wS),SS=(n(397),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),xS=function(e){function t(t){var n=e.call(this)||this;n._context=t,n._primaryLineNumber=0,n._lineHeight=n._context.configuration.editor.lineHeight,n._spaceWidth=n._context.configuration.editor.fontInfo.spaceWidth,n._enabled=n._context.configuration.editor.viewInfo.renderIndentGuides,n._activeIndentEnabled=n._context.configuration.editor.viewInfo.highlightActiveIndentGuide;var r=n._context.configuration.editor.wrappingInfo.wrappingColumn;return n._maxIndentLeft=-1===r?-1:r*n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._renderResult=null,n._context.addEventHandler(n),n}return SS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){if(e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(this._spaceWidth=this._context.configuration.editor.fontInfo.spaceWidth),e.viewInfo&&(this._enabled=this._context.configuration.editor.viewInfo.renderIndentGuides,this._activeIndentEnabled=this._context.configuration.editor.viewInfo.highlightActiveIndentGuide),e.wrappingInfo||e.fontInfo){var t=this._context.configuration.editor.wrappingInfo.wrappingColumn;this._maxIndentLeft=-1===t?-1:t*this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth}return!0},t.prototype.onCursorStateChanged=function(e){var t=e.selections[0],n=t.isEmpty()?t.positionLineNumber:0;return this._primaryLineNumber!==n&&(this._primaryLineNumber=n,!0)},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype.onLanguageConfigurationChanged=function(e){return!0},t.prototype.prepareRender=function(e){if(this._enabled){var t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,r=this._context.model.getOptions().indentSize*this._spaceWidth,i=e.scrollWidth,o=this._lineHeight,s=this._context.model.getLinesIndentGuides(t,n),a=0,u=0,c=0;if(this._activeIndentEnabled&&this._primaryLineNumber){var l=this._context.model.getActiveIndentGuide(this._primaryLineNumber,t,n);a=l.startLineNumber,u=l.endLineNumber,c=l.indent}for(var d=[],h=t;h<=n;h++){for(var f=a<=h&&h<=u,p=h-t,g=s[p],m="",_=e.visibleRangeForPosition(new _t(h,1)),y=_?_.left:0,v=1;v<=g;v++){if(m+='
    ',(y+=r)>i||this._maxIndentLeft>0&&y>this._maxIndentLeft)break}d[p]=m}this._renderResult=d}else this._renderResult=null},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t}(nC);Ad((function(e,t){var n=e.getColor(lC);n&&t.addRule(".monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 "+n+" inset; }");var r=e.getColor(dC)||n;r&&t.addRule(".monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 "+r+" inset; }")}));n(398);var kS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),LS=function(){function e(){this._currentVisibleRange=new Tr(1,1,1,1)}return e.prototype.getCurrentVisibleRange=function(){return this._currentVisibleRange},e.prototype.setCurrentVisibleRange=function(e){this._currentVisibleRange=e},e}(),MS=function(e,t,n,r,i,o){this.lineNumber=e,this.startColumn=t,this.endColumn=n,this.startScrollTop=r,this.stopScrollTop=i,this.scrollType=o},ES=function(e){function t(t,n){var r=e.call(this,t)||this;r._linesContent=n,r._textRangeRestingSpot=document.createElement("div"),r._visibleLines=new eS(r),r.domNode=r._visibleLines.domNode;var i=r._context.configuration;return r._lineHeight=i.editor.lineHeight,r._typicalHalfwidthCharacterWidth=i.editor.fontInfo.typicalHalfwidthCharacterWidth,r._isViewportWrapping=i.editor.wrappingInfo.isViewportWrapping,r._revealHorizontalRightPadding=i.editor.viewInfo.revealHorizontalRightPadding,r._scrollOff=i.editor.viewInfo.cursorSurroundingLines,r._canUseLayerHinting=i.editor.canUseLayerHinting,r._viewLineOptions=new ww(i,r._context.theme.type),lw.write(r.domNode,7),r.domNode.setClassName("view-lines"),Jb.applyFontInfo(r.domNode,i.editor.fontInfo),r._maxLineWidth=0,r._asyncUpdateLineWidths=new ks((function(){r._updateLineWidthsSlow()}),200),r._lastRenderedData=new LS,r._horizontalRevealRequest=null,r}return kS(t,e),t.prototype.dispose=function(){this._asyncUpdateLineWidths.dispose(),e.prototype.dispose.call(this)},t.prototype.getDomNode=function(){return this.domNode},t.prototype.createVisibleLine=function(){return new Cw(this._viewLineOptions)},t.prototype.onConfigurationChanged=function(e){this._visibleLines.onConfigurationChanged(e),e.wrappingInfo&&(this._maxLineWidth=0);var t=this._context.configuration;return e.lineHeight&&(this._lineHeight=t.editor.lineHeight),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=t.editor.fontInfo.typicalHalfwidthCharacterWidth),e.wrappingInfo&&(this._isViewportWrapping=t.editor.wrappingInfo.isViewportWrapping),e.viewInfo&&(this._revealHorizontalRightPadding=t.editor.viewInfo.revealHorizontalRightPadding,this._scrollOff=t.editor.viewInfo.cursorSurroundingLines),e.canUseLayerHinting&&(this._canUseLayerHinting=t.editor.canUseLayerHinting),e.fontInfo&&Jb.applyFontInfo(this.domNode,t.editor.fontInfo),this._onOptionsMaybeChanged(),e.layoutInfo&&(this._maxLineWidth=0),!0},t.prototype._onOptionsMaybeChanged=function(){var e=this._context.configuration,t=new ww(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;for(var n=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber(),i=n;i<=r;i++){this._visibleLines.getVisibleLine(i).onOptionsChanged(this._viewLineOptions)}return!0}return!1},t.prototype.onCursorStateChanged=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=!1,i=t;i<=n;i++)r=this._visibleLines.getVisibleLine(i).onSelectionChanged()||r;return r},t.prototype.onDecorationsChanged=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=t;r<=n;r++)this._visibleLines.getVisibleLine(r).onDecorationsChanged();return!0},t.prototype.onFlushed=function(e){var t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t},t.prototype.onLinesChanged=function(e){return this._visibleLines.onLinesChanged(e)},t.prototype.onLinesDeleted=function(e){return this._visibleLines.onLinesDeleted(e)},t.prototype.onLinesInserted=function(e){return this._visibleLines.onLinesInserted(e)},t.prototype.onRevealRangeRequest=function(e){var t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.range,e.verticalType),n=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range.startLineNumber!==e.range.endLineNumber?n={scrollTop:n.scrollTop,scrollLeft:0}:this._horizontalRevealRequest=new MS(e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),n.scrollTop,e.scrollType):this._horizontalRevealRequest=null;var r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-n.scrollTop);return 0===e.scrollType&&r>this._lineHeight?this._context.viewLayout.setScrollPositionSmooth(n):this._context.viewLayout.setScrollPositionNow(n),!0},t.prototype.onScrollChanged=function(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){var t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),n=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopn)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0},t.prototype.onTokensChanged=function(e){return this._visibleLines.onTokensChanged(e)},t.prototype.onZonesChanged=function(e){return this._context.viewLayout.onMaxLineWidthChanged(this._maxLineWidth),this._visibleLines.onZonesChanged(e)},t.prototype.onThemeChanged=function(e){return this._onOptionsMaybeChanged()},t.prototype.getPositionFromDOMInfo=function(e,t){var n=this._getViewLineDomNode(e);if(null===n)return null;var r=this._getLineNumberFor(n);if(-1===r)return null;if(r<1||r>this._context.model.getLineCount())return null;if(1===this._context.model.getLineMaxColumn(r))return new _t(r,1);var i=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(ro)return null;var s=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(r,e,t),a=this._context.model.getLineMinColumn(r);return sn?-1:this._visibleLines.getVisibleLine(e).getWidth()},t.prototype.linesVisibleRangesForRange=function(e,t){if(this.shouldRender())return null;var n=e.endLineNumber,r=Tr.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;var i=[],o=0,s=new bw(this.domNode.domNode,this._textRangeRestingSpot),a=0;t&&(a=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new _t(r.startLineNumber,1)).lineNumber);for(var u=this._visibleLines.getStartLineNumber(),c=this._visibleLines.getEndLineNumber(),l=r.startLineNumber;l<=r.endLineNumber;l++)if(!(lc)){var d=l===r.startLineNumber?r.startColumn:1,h=l===r.endLineNumber?r.endColumn:this._context.model.getLineMaxColumn(l),f=this._visibleLines.getVisibleLine(l).getVisibleRangesForRange(d,h,s);if(f&&0!==f.length){if(t&&lo)){var a=s===t.startLineNumber?t.startColumn:1,u=s===t.endLineNumber?t.endColumn:this._context.model.getLineMaxColumn(s),c=this._visibleLines.getVisibleLine(s).getVisibleRangesForRange(a,u,r);c&&0!==c.length&&(n=n.concat(c))}return 0===n.length?null:n},t.prototype.visibleRangeForPosition=function(e){var t=this.visibleRangesForRange2(new Tr(e.lineNumber,e.column,e.lineNumber,e.column));return t?t[0]:null},t.prototype.updateLineWidths=function(){this._updateLineWidths(!1)},t.prototype._updateLineWidthsFast=function(){return this._updateLineWidths(!0)},t.prototype._updateLineWidthsSlow=function(){this._updateLineWidths(!1)},t.prototype._updateLineWidths=function(e){for(var t=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber(),r=1,i=!0,o=t;o<=n;o++){var s=this._visibleLines.getVisibleLine(o);!e||s.getWidthIsFast()?r=Math.max(r,s.getWidth()):i=!1}return i&&1===t&&n===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),i},t.prototype.prepareRender=function(){throw new Error("Not supported")},t.prototype.render=function(){throw new Error("Not supported")},t.prototype.renderText=function(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){var t=this._horizontalRevealRequest.lineNumber,n=this._horizontalRevealRequest.startColumn,r=this._horizontalRevealRequest.endColumn,i=this._horizontalRevealRequest.scrollType;if(e.startLineNumber<=t&&t<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();var o=this._computeScrollLeftToRevealRange(t,n,r);this._isViewportWrapping||this._ensureMaxLineWidth(o.maxHorizontalOffset),0===i?this._context.viewLayout.setScrollPositionSmooth({scrollLeft:o.scrollLeft}):this._context.viewLayout.setScrollPositionNow({scrollLeft:o.scrollLeft})}}this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),this._linesContent.setLayerHinting(this._canUseLayerHinting);var s=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-s),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())},t.prototype._ensureMaxLineWidth=function(e){var t=Math.ceil(e);this._maxLineWidthl&&(l=f.left+f.width)}return i=l,c=Math.max(0,c-t.HORIZONTAL_EXTRA_PX),l+=this._revealHorizontalRightPadding,{scrollLeft:this._computeMinimumScrolling(s,a,c,l),maxHorizontalOffset:i}},t.prototype._computeMinimumScrolling=function(e,t,n,r,i,o){i=!!i,o=!!o;var s=(t|=0)-(e|=0);return(r|=0)-(n|=0)t?Math.max(0,r-s):e:n},t.HORIZONTAL_EXTRA_PX=30,t}(cw),DS=(n(399),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),TS=function(e){function t(t){var n=e.call(this)||this;return n._context=t,n._decorationsLeft=n._context.configuration.editor.layoutInfo.decorationsLeft,n._decorationsWidth=n._context.configuration.editor.layoutInfo.decorationsWidth,n._renderResult=null,n._context.addEventHandler(n),n}return DS(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.layoutInfo&&(this._decorationsLeft=this._context.configuration.editor.layoutInfo.decorationsLeft,this._decorationsWidth=this._context.configuration.editor.layoutInfo.decorationsWidth),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._getDecorations=function(e){for(var t=e.getDecorationsInViewport(),n=[],r=0,i=0,o=t.length;i
    ',o=[],s=t;s<=n;s++){for(var a=s-t,u=r[a],c="",l=0,d=u.length;l';i[s]=u}this._renderResult=i},t.prototype.render=function(e,t){return this._renderResult?this._renderResult[t-e]:""},t}(wS),AS=(n(401),function(){function e(t,n,r,i){this.r=e._clamp(t),this.g=e._clamp(n),this.b=e._clamp(r),this.a=e._clamp(i)}return e._clamp=function(e){return e<0?0:e>255?255:0|e},e.Empty=new e(0,0,0,0),e}()),IS=function(){function e(){var e=this;this._onDidChange=new Ht,this.onDidChange=this._onDidChange.event,this._updateColorMap(),Ma.onDidChange((function(t){t.changedColorMap&&e._updateColorMap()}))}return e.getInstance=function(){return this._INSTANCE||(this._INSTANCE=new e),this._INSTANCE},e.prototype._updateColorMap=function(){var e=Ma.getColorMap();if(!e)return this._colors=[AS.Empty],void(this._backgroundIsLight=!0);this._colors=[AS.Empty];for(var t=1;t=.5,this._onDidChange.fire(void 0)},e.prototype.getColor=function(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]},e.prototype.backgroundIsLight=function(){return this._backgroundIsLight},e._INSTANCE=null,e}(),PS=function(){function e(t,n){if(760!==t.length)throw new Error("Invalid x2CharData");if(190!==n.length)throw new Error("Invalid x1CharData");this.x2charData=t,this.x1charData=n,this.x2charDataLight=e.soften(t,.8),this.x1charDataLight=e.soften(n,50/60)}return e.soften=function(e,t){for(var n=new Uint8ClampedArray(e.length),r=0,i=e.length;rt.width||r+4>t.height)console.warn("bad render request outside image data");else{var u=a?this.x2charDataLight:this.x2charData,c=e._getChIndex(i),l=4*t.width,d=s.r,h=s.g,f=s.b,p=o.r-d,g=o.g-h,m=o.b-f,_=t.data,y=4*c*2,v=r*l+4*n,b=u[y]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b;b=u[y+1]/255;_[v+4]=d+p*b,_[v+5]=h+g*b,_[v+6]=f+m*b,v+=l;b=u[y+2]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b;b=u[y+3]/255;_[v+4]=d+p*b,_[v+5]=h+g*b,_[v+6]=f+m*b,v+=l;b=u[y+4]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b;b=u[y+5]/255;_[v+4]=d+p*b,_[v+5]=h+g*b,_[v+6]=f+m*b,v+=l;b=u[y+6]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b;b=u[y+7]/255;_[v+4]=d+p*b,_[v+5]=h+g*b,_[v+6]=f+m*b}},e.prototype.x1RenderChar=function(t,n,r,i,o,s,a){if(n+1>t.width||r+2>t.height)console.warn("bad render request outside image data");else{var u=a?this.x1charDataLight:this.x1charData,c=e._getChIndex(i),l=4*t.width,d=s.r,h=s.g,f=s.b,p=o.r-d,g=o.g-h,m=o.b-f,_=t.data,y=2*c*1,v=r*l+4*n,b=u[y]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b,v+=l;b=u[y+1]/255;_[v+0]=d+p*b,_[v+1]=h+g*b,_[v+2]=f+m*b}},e.prototype.x2BlockRenderChar=function(e,t,n,r,i,o){if(t+2>e.width||n+4>e.height)console.warn("bad render request outside image data");else{var s=4*e.width,a=i.r,u=i.g,c=i.b,l=a+.5*(r.r-a),d=u+.5*(r.g-u),h=c+.5*(r.b-c),f=e.data,p=n*s+4*t;f[p+0]=l,f[p+1]=d,f[p+2]=h,f[p+4]=l,f[p+5]=d,f[p+6]=h,f[(p+=s)+0]=l,f[p+1]=d,f[p+2]=h,f[p+4]=l,f[p+5]=d,f[p+6]=h,f[(p+=s)+0]=l,f[p+1]=d,f[p+2]=h,f[p+4]=l,f[p+5]=d,f[p+6]=h,f[(p+=s)+0]=l,f[p+1]=d,f[p+2]=h,f[p+4]=l,f[p+5]=d,f[p+6]=h}},e.prototype.x1BlockRenderChar=function(e,t,n,r,i,o){if(t+1>e.width||n+2>e.height)console.warn("bad render request outside image data");else{var s=4*e.width,a=i.r,u=i.g,c=i.b,l=a+.5*(r.r-a),d=u+.5*(r.g-u),h=c+.5*(r.b-c),f=e.data,p=n*s+4*t;f[p+0]=l,f[p+1]=d,f[p+2]=h,f[(p+=s)+0]=l,f[p+1]=d,f[p+2]=h}},e}();function RS(e){for(var t=new Uint8ClampedArray(e.length),n=0,r=e.length;n=s+b)return new e(a,u,y,v,l,w=1,s);var w=Math.max(1,Math.floor(n-v*h/f));return c&&c.scrollHeight===u&&(c.scrollTop>a&&(w=Math.min(w,c.startLineNumber)),c.scrollTopzS)n._context.viewLayout.setScrollPositionNow({scrollTop:i.scrollTop});else{var s=e.posy-t;n._context.viewLayout.setScrollPositionNow({scrollTop:i.getDesiredScrollTopFromDelta(s)})}}),(function(){n._slider.toggleClassName("active",!1)}))}})),n}return HS(t,e),t.prototype.dispose=function(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),e.prototype.dispose.call(this)},t.prototype._getMinimapDomNodeClassName=function(){return"always"===this._options.showSlider?"minimap slider-always":"minimap slider-mouseover"},t.prototype.getDomNode=function(){return this._domNode},t.prototype._applyLayout=function(){this._domNode.setLeft(this._options.minimapLeft),this._domNode.setWidth(this._options.minimapWidth),this._domNode.setHeight(this._options.minimapHeight),this._shadow.setHeight(this._options.minimapHeight),this._canvas.setWidth(this._options.canvasOuterWidth),this._canvas.setHeight(this._options.canvasOuterHeight),this._canvas.domNode.width=this._options.canvasInnerWidth,this._canvas.domNode.height=this._options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._options.canvasInnerHeight,this._slider.setWidth(this._options.minimapWidth)},t.prototype._getBuffer=function(){return this._buffers||(this._buffers=new $S(this._canvas.domNode.getContext("2d"),this._options.canvasInnerWidth,this._options.canvasInnerHeight,this._tokensColorTracker.getColor(2))),this._buffers.getBuffer()},t.prototype._onOptionsMaybeChanged=function(){var e=new US(this._context.configuration);return!this._options.equals(e)&&(this._options=e,this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName()),!0)},t.prototype.onConfigurationChanged=function(e){return this._onOptionsMaybeChanged()},t.prototype.onFlushed=function(e){return this._lastRenderData=null,!0},t.prototype.onLinesChanged=function(e){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e)},t.prototype.onLinesDeleted=function(e){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e),!0},t.prototype.onLinesInserted=function(e){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e),!0},t.prototype.onScrollChanged=function(e){return this._renderDecorations=!0,!0},t.prototype.onTokensChanged=function(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)},t.prototype.onTokensColorsChanged=function(e){return this._lastRenderData=null,this._buffers=null,!0},t.prototype.onZonesChanged=function(e){return this._lastRenderData=null,!0},t.prototype.onDecorationsChanged=function(e){return this._renderDecorations=!0,!0},t.prototype.onThemeChanged=function(e){return this._context.model.invalidateMinimapColorCache(),this._renderDecorations=!!this._lastDecorations,!!this._lastDecorations},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){if(0===this._options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");var t=qS.create(this._options,e.visibleRange.startLineNumber,e.visibleRange.endLineNumber,e.viewportHeight,e.viewportData.whitespaceViewportData.length>0,this._context.model.getLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight);var n=e.scrollLeft/this._options.typicalHalfwidthCharacterWidth,r=Math.min(this._options.minimapWidth,Math.round(n*VS(this._options.renderMinimap)/this._options.pixelRatio));this._sliderHorizontal.setLeft(r),this._sliderHorizontal.setWidth(this._options.minimapWidth-r),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)},t.prototype.renderDecorations=function(e){if(this._renderDecorations){this._renderDecorations=!1;var t=this._context.model.getDecorationsInViewport(new Tr(e.startLineNumber,1,e.endLineNumber,this._context.model.getLineMaxColumn(e.endLineNumber))),n=this._options,r=n.renderMinimap,i=n.canvasInnerWidth,o=n.canvasInnerHeight,s=WS(r),a=VS(r),u=this._context.model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,i,o);for(var l=new Map,d=0;di?l.length-1:y-1;if(C>0){var S=l[C]-w||2;this.renderDecoration(e,n.options.minimap,w,c,S,o)}d&&this.renderLineHighlight(e,n.options.minimap,c,o)},t.prototype.renderLineHighlight=function(e,t,n,r){var i=t.getColor(this._context.theme);e.fillStyle=i&&i.transparent(.5).toString()||"",e.fillRect(0,n,e.canvas.width,r)},t.prototype.renderDecoration=function(e,t,n,r,i,o){var s=t.getColor(this._context.theme);e.fillStyle=s&&s.toString()||"",e.fillRect(n,r,i,o)},t.prototype.renderLines=function(e){var n=this._options.renderMinimap,r=e.startLineNumber,i=e.endLineNumber,o=WS(n);if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){var s=this._lastRenderData._get();return new GS(e,s.imageData,s.lines)}for(var a=this._getBuffer(),u=t._renderUntouchedLines(a,r,i,o,this._lastRenderData),c=u[0],l=u[1],d=u[2],h=this._context.model.getMinimapLinesRenderingData(r,i,d),f=h.tabSize,p=this._tokensColorTracker.getColor(2),g=this._tokensColorTracker.backgroundIsLight(),m=0,_=[],y=0,v=i-r+1;y=0&&kh)return;var w=c.charCodeAt(p);if(9===w){var C=a-(p+g)%a;g+=C-1,f+=C*d}else if(32===w)f+=d;else for(var S=Sn(w)?2:1,x=0;xh)return}},t}(cw);Ad((function(e,t){var n=e.getColor(Tl);if(n){var r=n.transparent(.5);t.addRule(".monaco-editor .minimap-slider, .monaco-editor .minimap-slider .minimap-slider-horizontal { background: "+r+"; }")}var i=e.getColor(Nl);if(i){var o=i.transparent(.5);t.addRule(".monaco-editor .minimap-slider:hover, .monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: "+o+"; }")}var s=e.getColor(Ol);if(s){var a=s.transparent(.5);t.addRule(".monaco-editor .minimap-slider.active, .monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: "+a+"; }")}var u=e.getColor(Dl);u&&t.addRule(".monaco-editor .minimap-shadow-visible { box-shadow: "+u+" -6px 0 6px -6px inset; }")}));n(402);var JS=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),XS=function(e){function t(t){var n=e.call(this,t)||this;return n._widgets={},n._verticalScrollbarWidth=n._context.configuration.editor.layoutInfo.verticalScrollbarWidth,n._minimapWidth=n._context.configuration.editor.layoutInfo.minimapWidth,n._horizontalScrollbarHeight=n._context.configuration.editor.layoutInfo.horizontalScrollbarHeight,n._editorHeight=n._context.configuration.editor.layoutInfo.height,n._editorWidth=n._context.configuration.editor.layoutInfo.width,n._domNode=bp(document.createElement("div")),lw.write(n._domNode,4),n._domNode.setClassName("overlayWidgets"),n}return JS(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._widgets={}},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){return!!e.layoutInfo&&(this._verticalScrollbarWidth=this._context.configuration.editor.layoutInfo.verticalScrollbarWidth,this._minimapWidth=this._context.configuration.editor.layoutInfo.minimapWidth,this._horizontalScrollbarHeight=this._context.configuration.editor.layoutInfo.horizontalScrollbarHeight,this._editorHeight=this._context.configuration.editor.layoutInfo.height,this._editorWidth=this._context.configuration.editor.layoutInfo.width,!0)},t.prototype.addWidget=function(e){var t=bp(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()},t.prototype.setWidgetPosition=function(e,t){var n=this._widgets[e.getId()];return n.preference!==t&&(n.preference=t,this.setShouldRender(),!0)},t.prototype.removeWidget=function(e){var t=e.getId();if(this._widgets.hasOwnProperty(t)){var n=this._widgets[t].domNode.domNode;delete this._widgets[t],n.parentNode.removeChild(n),this.setShouldRender()}},t.prototype._renderWidget=function(e){var t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){var n=t.domNode.clientHeight;t.setTop(this._editorHeight-n-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setWidth(this._editorWidth);for(var t=Object.keys(this._widgets),n=0,r=t.length;n=3){var i,o,s,a=r-(i=Math.floor(r/3))-(o=Math.floor(r/3)),u=(s=e)+i;return[[0,s,u,s,s+i+a,s,u,s],[0,i,a,i+a,o,i+a+o,a+o,i+a+o]]}if(2===n)return[[0,s=e,s,s,s+(i=Math.floor(r/2)),s,s,s],[0,i,i,i,o=r-i,i+o,i+o,i+o]];return[[0,e,e,e,e,e,e,e],[0,r,r,r,r,r,r,r]]},e.prototype.equals=function(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight},e}(),tx=function(e){function t(t){var n=e.call(this,t)||this;return n._domNode=bp(document.createElement("canvas")),n._domNode.setClassName("decorationsOverviewRuler"),n._domNode.setPosition("absolute"),n._domNode.setLayerHinting(!0),n._domNode.setAttribute("aria-hidden","true"),n._updateSettings(!1),n._tokensColorTrackerListener=Ma.onDidChange((function(e){e.changedColorMap&&n._updateSettings(!0)})),n._cursorPositions=[],n}return QS(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._tokensColorTrackerListener.dispose()},t.prototype._updateSettings=function(e){var t=new ex(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)},t.prototype.onConfigurationChanged=function(e){return this._updateSettings(!1)},t.prototype.onCursorStateChanged=function(e){this._cursorPositions=[];for(var t=0,n=e.selections.length;tt&&(D=t-a),x=D-a,N=D+a;x>y+1||w!==m?(0!==v&&u.fillRect(c[m],_,l[m],y-_),m=w,_=x,y=N):N>y&&(y=N)}u.fillRect(c[m],_,l[m],y-_)}if(!this._settings.hideCursor&&this._settings.cursorColor){var k=2*this._settings.pixelRatio|0,L=k/2|0,M=this._settings.x[7],E=this._settings.w[7];u.fillStyle=this._settings.cursorColor;for(_=-100,y=-100,v=0,b=this._cursorPositions.length;vt&&(D=t-L);var N=(x=D-L)+k;x>y+1?(0!==v&&u.fillRect(M,_,E,y-_),_=x,y=N):N>y&&(y=N)}u.fillRect(M,_,E,y-_)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(u.beginPath(),u.lineWidth=1,u.strokeStyle=this._settings.borderColor,u.moveTo(0,0),u.lineTo(0,t),u.stroke(),u.moveTo(0,0),u.lineTo(e,0),u.stroke())},t}(cw),nx=function(){function e(e,t,n){this.from=0|e,this.to=0|t,this.colorId=0|n}return e.compare=function(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId},e}(),rx=function(){function e(e,t,n){this.startLineNumber=e,this.endLineNumber=t,this.color=n,this._colorZone=null}return e.compare=function(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.colorn&&(h=n-f);var p=u.color,g=this._color2Id[p];g||(g=++this._lastAssignedId,this._color2Id[p]=g,this._id2Color[g]=p);var m=new nx(h-f,h+f,g);u.setColorZone(m),o.push(m)}return this._colorZonesInvalid=!1,o.sort(nx.compare),o},e}(),ox=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sx=function(e){function t(t,n){var r=e.call(this)||this;return r._context=t,r._domNode=bp(document.createElement("canvas")),r._domNode.setClassName(n),r._domNode.setPosition("absolute"),r._domNode.setLayerHinting(!0),r._zoneManager=new ix((function(e){return r._context.viewLayout.getVerticalOffsetForLineNumber(e)})),r._zoneManager.setDOMWidth(0),r._zoneManager.setDOMHeight(0),r._zoneManager.setOuterHeight(r._context.viewLayout.getScrollHeight()),r._zoneManager.setLineHeight(r._context.configuration.editor.lineHeight),r._zoneManager.setPixelRatio(r._context.configuration.editor.pixelRatio),r._context.addEventHandler(r),r}return ox(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._zoneManager.setLineHeight(this._context.configuration.editor.lineHeight),this._render()),e.pixelRatio&&(this._zoneManager.setPixelRatio(this._context.configuration.editor.pixelRatio),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0},t.prototype.onFlushed=function(e){return this._render(),!0},t.prototype.onScrollChanged=function(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0},t.prototype.onZonesChanged=function(e){return this._render(),!0},t.prototype.getDomNode=function(){return this._domNode.domNode},t.prototype.setLayout=function(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);var t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,(t=this._zoneManager.setDOMHeight(e.height)||t)&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())},t.prototype.setZones=function(e){this._zoneManager.setZones(e),this._render()},t.prototype._render=function(){if(0===this._zoneManager.getOuterHeight())return!1;var e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),n=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),i=this._domNode.domNode.getContext("2d");return i.clearRect(0,0,e,t),n.length>0&&this._renderOneLane(i,n,r,e),!0},t.prototype._renderOneLane=function(e,t,n,r){for(var i=0,o=0,s=0,a=0,u=t;a=d?s=Math.max(s,h):(e.fillRect(0,o,r,s-o),o=d,s=h)}e.fillRect(0,o,r,s-o)},t}(aw),ax=(n(403),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ux=function(e){function t(t){var n=e.call(this,t)||this;return n.domNode=bp(document.createElement("div")),n.domNode.setAttribute("role","presentation"),n.domNode.setAttribute("aria-hidden","true"),n.domNode.setClassName("view-rulers"),n._renderedRulers=[],n._rulers=n._context.configuration.editor.viewInfo.rulers,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n}return ax(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return!!(e.viewInfo||e.layoutInfo||e.fontInfo)&&(this._rulers=this._context.configuration.editor.viewInfo.rulers,this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,!0)},t.prototype.onScrollChanged=function(e){return e.scrollHeightChanged},t.prototype.prepareRender=function(e){},t.prototype._ensureRulersCount=function(){var e=this._renderedRulers.length,t=this._rulers.length;if(e!==t)if(e0;){(o=bp(document.createElement("div"))).setClassName("view-ruler"),o.setWidth(n),this.domNode.appendChild(o),this._renderedRulers.push(o),r--}else for(var i=e-t;i>0;){var o=this._renderedRulers.pop();this.domNode.removeChild(o),i--}},t.prototype.render=function(e){this._ensureRulersCount();for(var t=0,n=this._rulers.length;t0;return this._shouldShow!==e&&(this._shouldShow=e,!0)},t.prototype.getDomNode=function(){return this._domNode},t.prototype._updateWidth=function(){var e=this._context.configuration.editor.layoutInfo,t=0;return t=0===e.renderMinimap||e.minimapWidth>0&&0===e.minimapLeft?e.width:e.width-e.minimapWidth-e.verticalScrollbarWidth,this._width!==t&&(this._width=t,!0)},t.prototype.onConfigurationChanged=function(e){var t=!1;return e.viewInfo&&(this._useShadows=this._context.configuration.editor.viewInfo.scrollbar.useShadows),e.layoutInfo&&(t=this._updateWidth()),this._updateShouldShow()||t},t.prototype.onScrollChanged=function(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()},t.prototype.prepareRender=function(e){},t.prototype.render=function(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")},t}(cw);Ad((function(e,t){var n=e.getColor(Dl);n&&t.addRule(".monaco-editor .scroll-decoration { box-shadow: "+n+" 0 6px 6px -6px inset; }")}));n(405);var dx=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hx=function(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null},fx=function(e,t){this.lineNumber=e,this.ranges=t};function px(e){return new hx(e)}function gx(e){return new fx(e.lineNumber,e.ranges.map(px))}var mx=nh,_x=function(e){function t(t){var n=e.call(this)||this;return n._previousFrameVisibleRangesWithStyle=[],n._context=t,n._lineHeight=n._context.configuration.editor.lineHeight,n._roundedSelection=n._context.configuration.editor.viewInfo.roundedSelection,n._typicalHalfwidthCharacterWidth=n._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,n._selections=[],n._renderResult=null,n._context.addEventHandler(n),n}return dx(t,e),t.prototype.dispose=function(){this._context.removeEventHandler(this),this._renderResult=null,e.prototype.dispose.call(this)},t.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.viewInfo&&(this._roundedSelection=this._context.configuration.editor.viewInfo.roundedSelection),e.fontInfo&&(this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),!0},t.prototype.onCursorStateChanged=function(e){return this._selections=e.selections.slice(0),!0},t.prototype.onDecorationsChanged=function(e){return!0},t.prototype.onFlushed=function(e){return!0},t.prototype.onLinesChanged=function(e){return!0},t.prototype.onLinesDeleted=function(e){return!0},t.prototype.onLinesInserted=function(e){return!0},t.prototype.onScrollChanged=function(e){return e.scrollTopChanged},t.prototype.onZonesChanged=function(e){return!0},t.prototype._visibleRangesHaveGaps=function(e){for(var t=0,n=e.length;t1)return!0}return!1},t.prototype._enrichVisibleRangesWithStyle=function(e,t,n){var r=this._typicalHalfwidthCharacterWidth/4,i=null,o=null;if(n&&n.length>0&&t.length>0){var s=t[0].lineNumber;if(s===e.startLineNumber)for(var a=0;!i&&a=0;a--)n[a].lineNumber===u&&(o=n[a].ranges[0]);i&&!i.startStyle&&(i=null),o&&!o.startStyle&&(o=null)}a=0;for(var c=t.length;a0){var g=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;yx(d-g)g&&(f.top=1),yx(h-m)'},t.prototype._actualRenderOneSelection=function(e,n,r,i){for(var o=i.length>0&&i[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),u=i.length>0?i[0].lineNumber:0,c=i.length>0?i[i.length-1].lineNumber:0,l=0,d=i.length;l1,c)}}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t},t.prototype.render=function(e,t){if(!this._renderResult)return"";var n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]},t.SELECTION_CLASS_NAME="selected-text",t.SELECTION_TOP_LEFT="top-left-radius",t.SELECTION_BOTTOM_LEFT="bottom-left-radius",t.SELECTION_TOP_RIGHT="top-right-radius",t.SELECTION_BOTTOM_RIGHT="bottom-right-radius",t.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",t.ROUNDED_PIECE_WIDTH=10,t}(nC);function yx(e){return e<0?-e:e}Ad((function(e,t){var n=e.getColor(ed);n&&t.addRule(".monaco-editor .focused .selected-text { background-color: "+n+"; }");var r=e.getColor(nd);r&&t.addRule(".monaco-editor .selected-text { background-color: "+r+"; }");var i=e.getColor(td);i&&t.addRule(".monaco-editor .view-line span.inline-selected-text { color: "+i+"; }")}));n(406);var vx=function(e,t,n,r,i,o){this.top=e,this.left=t,this.width=n,this.height=r,this.textContent=i,this.textContentClassName=o},bx=function(){function e(e){this._context=e,this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._lineHeight=this._context.configuration.editor.lineHeight,this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(this._context.configuration.editor.viewInfo.cursorWidth,this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=bp(document.createElement("div")),this._domNode.setClassName("cursor"),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Jb.applyFontInfo(this._domNode,this._context.configuration.editor.fontInfo),this._domNode.setDisplay("none"),this._position=new _t(1,1),this._lastRenderedContent="",this._renderData=null}return e.prototype.getDomNode=function(){return this._domNode},e.prototype.getPosition=function(){return this._position},e.prototype.show=function(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)},e.prototype.hide=function(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)},e.prototype.onConfigurationChanged=function(e){return e.lineHeight&&(this._lineHeight=this._context.configuration.editor.lineHeight),e.fontInfo&&(Jb.applyFontInfo(this._domNode,this._context.configuration.editor.fontInfo),this._typicalHalfwidthCharacterWidth=this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth),e.viewInfo&&(this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._lineCursorWidth=Math.min(this._context.configuration.editor.viewInfo.cursorWidth,this._typicalHalfwidthCharacterWidth)),!0},e.prototype.onCursorPositionChanged=function(e){return this._position=e,!0},e.prototype._prepareRender=function(e){var t="",n="";if(this._cursorStyle===Jr.Line||this._cursorStyle===Jr.LineThin){var r,i=e.visibleRangeForPosition(this._position);if(!i)return null;if(this._cursorStyle===Jr.Line){if((r=Mf(this._lineCursorWidth>0?this._lineCursorWidth:2))>2)t=this._context.model.getLineContent(this._position.lineNumber).charAt(this._position.column-1)}else r=Mf(1);var o=i.left;r>=2&&o>=1&&(o-=1);var s=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new vx(s,o,r,this._lineHeight,t,n)}var a=e.linesVisibleRangesForRange(new Tr(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+1),!1);if(!a||0===a.length||0===a[0].ranges.length)return null;var u=a[0].ranges[0],c=u.width<1?this._typicalHalfwidthCharacterWidth:u.width;if(this._cursorStyle===Jr.Block){var l=this._context.model.getViewLineData(this._position.lineNumber);t=l.content.charAt(this._position.column-1),mn(l.content.charCodeAt(this._position.column-1))&&(t+=l.content.charAt(this._position.column));var d=l.tokens.findTokenIndexAtOffset(this._position.column-1);n=l.tokens.getClassName(d)}var h=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,f=this._lineHeight;return this._cursorStyle!==Jr.Underline&&this._cursorStyle!==Jr.UnderlineThin||(h+=this._lineHeight-2,f=2),new vx(h,u.left,c,f,t,n)},e.prototype.prepareRender=function(e){this._renderData=this._prepareRender(e)},e.prototype.render=function(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName("cursor "+this._renderData.textContentClassName),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)},e}(),wx=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cx=function(e){function t(t){var n=e.call(this,t)||this;return n._readOnly=n._context.configuration.editor.readOnly,n._cursorBlinking=n._context.configuration.editor.viewInfo.cursorBlinking,n._cursorStyle=n._context.configuration.editor.viewInfo.cursorStyle,n._cursorSmoothCaretAnimation=n._context.configuration.editor.viewInfo.cursorSmoothCaretAnimation,n._selectionIsEmpty=!0,n._isVisible=!1,n._primaryCursor=new bx(n._context),n._secondaryCursors=[],n._renderData=[],n._domNode=bp(document.createElement("div")),n._domNode.setAttribute("role","presentation"),n._domNode.setAttribute("aria-hidden","true"),n._updateDomClassName(),n._domNode.appendChild(n._primaryCursor.getDomNode()),n._startCursorBlinkAnimation=new Ss,n._cursorFlatBlinkInterval=new xs,n._blinkingEnabled=!1,n._editorHasFocus=!1,n._updateBlinking(),n}return wx(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()},t.prototype.getDomNode=function(){return this._domNode},t.prototype.onConfigurationChanged=function(e){e.readOnly&&(this._readOnly=this._context.configuration.editor.readOnly),e.viewInfo&&(this._cursorBlinking=this._context.configuration.editor.viewInfo.cursorBlinking,this._cursorStyle=this._context.configuration.editor.viewInfo.cursorStyle,this._cursorSmoothCaretAnimation=this._context.configuration.editor.viewInfo.cursorSmoothCaretAnimation),this._primaryCursor.onConfigurationChanged(e),this._updateBlinking(),e.viewInfo&&this._updateDomClassName();for(var t=0,n=this._secondaryCursors.length;tt.length){var o=this._secondaryCursors.length-t.length;for(r=0;rn){var o=t-n;for(i=0;i=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)},e.prototype._getAll=function(){var e=[];e[0]=this.primaryCursor;for(var t=0,n=this.secondaryCursors.length;td&&S.index--}e.splice(d,1),t.splice(l,1),this._removeSecondaryCursor(d-1),i--}}}}},e}(),Fx=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var Yx=function(e,t,n){this.selections=e,this.source=t,this.reason=n},jx=function(){function e(e,t){this.modelVersionId=e.getVersionId(),this.cursorState=t.getAll()}return e.prototype.equals=function(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(var t=0,n=this.cursorState.length;t=t.length)return!1;if(!t[n].strictContainsRange(e[n]))return!1}return!0},e}(),Hx=function(e){function t(t,n,r){var i=e.call(this)||this;i._onDidReachMaxCursorCount=i._register(new Ht),i.onDidReachMaxCursorCount=i._onDidReachMaxCursorCount.event,i._onDidAttemptReadOnlyEdit=i._register(new Ht),i.onDidAttemptReadOnlyEdit=i._onDidAttemptReadOnlyEdit.event,i._onDidChange=i._register(new Ht),i.onDidChange=i._onDidChange.event,i._configuration=t,i._model=n,i._knownModelVersionId=i._model.getVersionId(),i._viewModel=r,i.context=new Ku(i._configuration,i._model,i._viewModel),i._cursors=new Rx(i.context),i._isHandling=!1,i._isDoingComposition=!1,i._columnSelectData=null,i._autoClosedActions=[],i._prevEditOperationType=0,i._register(i._model.onDidChangeRawContent((function(e){if(i._knownModelVersionId=e.versionId,!i._isHandling){var t=e.containsEvent(1);i._onModelContentChanged(t)}}))),i._register(r.addEventListener((function(e){(function(e){for(var t=0,n=e.length;t0)for(var e=this._cursors.getSelections(),t=0;tt.MAX_CURSOR_COUNT&&(r=r.slice(0,t.MAX_CURSOR_COUNT),this._onDidReachMaxCursorCount.fire(void 0));var i=new jx(this._model,this);this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,n,i)},t.prototype.setColumnSelectData=function(e){this._columnSelectData=e},t.prototype.reveal=function(e,t,n){this._revealRange(t,0,e,n)},t.prototype.revealRange=function(e,t,n,r){this.emitCursorRevealRange(t,n,e,r)},t.prototype.scrollTo=function(e){this._viewModel.viewLayout.setScrollPositionSmooth({scrollTop:e})},t.prototype.saveState=function(){for(var e=[],t=this._cursors.getSelections(),n=0,r=t.length;n0&&this._pushAutoClosedAction(n,r),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}},t.prototype._interpretCommandResult=function(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()},t.prototype._emitStateChangedIfNecessary=function(e,t,n){var r=new jx(this._model,this);if(r.equals(n))return!1;var i=this._cursors.getSelections(),o=this._cursors.getViewSelections();try{this._beginEmit().emit(new DC(o))}finally{this._endEmit()}return n&&n.cursorState.length===r.cursorState.length&&!r.cursorState.some((function(e,t){return!e.modelState.equals(n.cursorState[t].modelState)}))||this._onDidChange.fire(new Yx(i,e||"keyboard",t)),!0},t.prototype._revealRange=function(e,t,n,r){var i=this._cursors.getViewPositions(),o=i[0];if(1===e)for(var s=1;s1)return;var a=new Tr(o.lineNumber,o.column,o.lineNumber,o.column);this.emitCursorRevealRange(a,t,n,r)},t.prototype.emitCursorRevealRange=function(e,t,n,r){try{this._beginEmit().emit(new FC(e,t,n,r))}finally{this._endEmit()}},t.prototype._findAutoClosingPairs=function(e){if(!e.length)return null;for(var t=[],n=0,r=e.length;n=0)return null;var o=i.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;var s=o[1],a=this.context.config.autoClosingPairsClose2.get(s);if(!a||1!==a.length)return null;var u=a[0].open,c=i.text.length-o[2].length-1,l=i.text.lastIndexOf(u,c-1);if(-1===l)return null;t.push([l,c])}return t},t.prototype.executeEdits=function(e,t,n){var r=this,i=null;"snippet"===e&&(i=this._findAutoClosingPairs(t)),i&&(t[0]._isTracked=!0);var o=[],s=[],a=this._model.pushEditOperations(this.getSelections(),t,(function(e){if(i)for(var t=0,a=i.length;t0&&this._pushAutoClosedAction(o,s)},t.prototype.trigger=function(e,t,n){var r=xc;if(t!==r.CompositionStart)if(t===r.CompositionEnd&&(this._isDoingComposition=!1),this._configuration.editor.readOnly)this._onDidAttemptReadOnlyEdit.fire(void 0);else{var i=new jx(this._model,this),o=0;t!==r.Undo&&t!==r.Redo&&this._cursors.stopTrackingSelections(),this._cursors.ensureValidState(),this._isHandling=!0;try{switch(t){case r.Type:this._type(e,n.text);break;case r.ReplacePreviousChar:this._replacePreviousChar(n.text,n.replaceCharCnt);break;case r.Paste:o=4,this._paste(n.text,n.pasteOnNewLine,n.multicursorText);break;case r.Cut:this._cut();break;case r.Undo:o=5,this._interpretCommandResult(this._model.undo());break;case r.Redo:o=6,this._interpretCommandResult(this._model.redo());break;case r.ExecuteCommand:this._externalExecuteCommand(n);break;case r.ExecuteCommands:this._externalExecuteCommands(n);break;case r.CompositionEnd:this._interpretCompositionEnd(e)}}catch(e){je(e)}this._isHandling=!1,t!==r.Undo&&t!==r.Redo&&this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,o,i)&&this._revealRange(0,0,!0,0)}else this._isDoingComposition=!0},t.prototype._interpretCompositionEnd=function(e){if(!this._isDoingComposition&&"keyboard"===e){var t=Bx.getAllAutoClosedCharacters(this._autoClosedActions);this._executeEditOperation(vc.compositionEndWithInterceptors(this._prevEditOperationType,this.context.config,this.context.model,this.getSelections(),t))}},t.prototype._type=function(e,t){if(this._isDoingComposition||"keyboard"!==e)this._executeEditOperation(vc.typeWithoutInterceptors(this._prevEditOperationType,this.context.config,this.context.model,this.getSelections(),t));else for(var n=0,r=t.length;n0&&(o[0]._isTracked=!0);var u=e.model.pushEditOperations(e.selectionsBefore,o,(function(n){for(var r=[],i=0;i0?(r[n].sort(u),c[n]=t[n].computeCursorState(e.model,{getInverseEditOperations:function(){return r[n]},getTrackedSelection:function(t){var n=parseInt(t,10),r=e.model._getTrackedRange(e.trackedRanges[n]);return 0===e.trackedRangesDirection[n]?new Or(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn):new Or(r.endLineNumber,r.endColumn,r.startLineNumber,r.startColumn)}})):c[n]=e.selectionsBefore[n]};for(i=0;ii.identifier.major?r.identifier.major:i.identifier.major).toString()]=!0;for(var s=0;s0&&n--}}return t},e}(),Vx=function(){function e(e,t,n,r,i,o){this.id=e,this.label=t,this.alias=n,this._precondition=r,this._run=i,this._contextKeyService=o}return e.prototype.isSupported=function(){return this._contextKeyService.contextMatchesRules(this._precondition)},e.prototype.run=function(){if(!this.isSupported())return Promise.resolve(void 0);var e=this._run();return e||Promise.resolve(void 0)},e}();function zx(e,t,n,r,i,o){for(var s="
    ",a=r,u=0,c=0,l=t.getCount();c0;)h+=" ",p--;break;case 60:h+="<";break;case 62:h+=">";break;case 38:h+="&";break;case 0:h+="�";break;case 65279:case 8232:h+="�";break;case 13:h+="​";break;case 32:h+=" ";break;default:h+=String.fromCharCode(f)}}if(s+=''+h+"",d>i||a>=i)break}}return s+="
    "}var Ux=function(){function e(){this._instanceId=Ln(++e.INSTANCE_COUNT),this._heights=[],this._minWidths=[],this._ids=[],this._afterLineNumbers=[],this._ordinals=[],this._prefixSum=[],this._prefixSumValidIndex=-1,this._whitespaceId2Index={},this._lastWhitespaceId=0,this._minWidth=-1}return e.findInsertionIndex=function(e,t,n,r){for(var i=0,o=e.length;i>>1;t===e[s]?r=t&&(this._whitespaceId2Index[c]=l+1)}this._whitespaceId2Index[e]=t,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)},e.prototype.changeWhitespace=function(e,t,n){t|=0,n|=0;var r=!1;return r=this.changeWhitespaceHeight(e,n)||r,r=this.changeWhitespaceAfterLineNumber(e,t)||r},e.prototype.changeWhitespaceHeight=function(e,t){if(t|=0,this._whitespaceId2Index.hasOwnProperty(e)){var n=this._whitespaceId2Index[e];if(this._heights[n]!==t)return this._heights[n]=t,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1),!0}return!1},e.prototype.changeWhitespaceAfterLineNumber=function(t,n){if(n|=0,this._whitespaceId2Index.hasOwnProperty(t)){var r=this._whitespaceId2Index[t];if(this._afterLineNumbers[r]!==n){var i=this._ordinals[r],o=this._heights[r],s=this._minWidths[r];this.removeWhitespace(t);var a=e.findInsertionIndex(this._afterLineNumbers,n,this._ordinals,i);return this._insertWhitespaceAtIndex(t,a,n,i,o,s),!0}}return!1},e.prototype.removeWhitespace=function(e){if(this._whitespaceId2Index.hasOwnProperty(e)){var t=this._whitespaceId2Index[e];return delete this._whitespaceId2Index[e],this._removeWhitespaceAtIndex(t),this._minWidth=-1,!0}return!1},e.prototype._removeWhitespaceAtIndex=function(e){e|=0,this._heights.splice(e,1),this._minWidths.splice(e,1),this._ids.splice(e,1),this._afterLineNumbers.splice(e,1),this._ordinals.splice(e,1),this._prefixSum.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1);for(var t=Object.keys(this._whitespaceId2Index),n=0,r=t.length;n=e&&(this._whitespaceId2Index[i]=o-1)}},e.prototype.onLinesDeleted=function(e,t){e|=0,t|=0;for(var n=0,r=this._afterLineNumbers.length;nt&&(this._afterLineNumbers[n]-=t-e+1)}},e.prototype.onLinesInserted=function(e,t){e|=0,t|=0;for(var n=0,r=this._afterLineNumbers.length;n=t.length||t[i+1]>=e)return i;n=i+1|0}else r=i-1|0}return-1},e.prototype._findFirstWhitespaceAfterLineNumber=function(e){e|=0;var t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t1?this._lineHeight*(e-1):0)+this._whitespaces.getAccumulatedHeightBeforeLineNumber(e)},e.prototype.getWhitespaceAccumulatedHeightBeforeLineNumber=function(e){return this._whitespaces.getAccumulatedHeightBeforeLineNumber(e)},e.prototype.getWhitespaceMinWidth=function(){return this._whitespaces.getMinWidth()},e.prototype.isAfterLines=function(e){return e>this.getLinesTotalHeight()},e.prototype.getLineNumberAtOrAfterVerticalOffset=function(e){if((e|=0)<0)return 1;for(var t=0|this._lineCount,n=this._lineHeight,r=1,i=t;r=s+n)r=o+1;else{if(e>=s)return o;i=o}}return r>t?t:r},e.prototype.getLinesViewportData=function(e,t){e|=0,t|=0;var n,r,i=this._lineHeight,o=0|this.getLineNumberAtOrAfterVerticalOffset(e),s=0|this.getVerticalOffsetForLineNumber(o),a=0|this._lineCount,u=0|this._whitespaces.getFirstWhitespaceIndexAfterLineNumber(o),c=0|this._whitespaces.getCount();-1===u?(u=c,r=a+1,n=0):(r=0|this._whitespaces.getAfterLineNumberForWhitespaceIndex(u),n=0|this._whitespaces.getHeightForWhitespaceIndex(u));var l=s,d=l,h=0;s>=5e5&&(h=5e5*Math.floor(s/5e5),d-=h=Math.floor(h/i)*i);for(var f=[],p=e+(t-e)/2,g=-1,m=o;m<=a;m++){if(-1===g){(l<=p&&pp)&&(g=m)}for(l+=i,f[m-o]=d,d+=i;r===m;)d+=n,l+=n,++u>=c?r=a+1:(r=0|this._whitespaces.getAfterLineNumberForWhitespaceIndex(u),n=0|this._whitespaces.getHeightForWhitespaceIndex(u));if(l>=t){a=m;break}}-1===g&&(g=a);var _=0|this.getVerticalOffsetForLineNumber(a),y=o,v=a;return yt&&v--,{bigNumbersDelta:h,startLineNumber:o,endLineNumber:a,relativeVerticalOffset:f,centeredLineNumber:g,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:v}},e.prototype.getVerticalOffsetForWhitespaceIndex=function(e){e|=0;var t=this._whitespaces.getAfterLineNumberForWhitespaceIndex(e);return(t>=1?this._lineHeight*t:0)+(e>0?this._whitespaces.getAccumulatedHeight(e-1):0)},e.prototype.getWhitespaceIndexAtOrAfterVerticallOffset=function(e){e|=0;var t,n,r=0,i=this._whitespaces.getCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this._whitespaces.getHeightForWhitespaceIndex(i))return-1;for(;r=(n=this.getVerticalOffsetForWhitespaceIndex(t))+this._whitespaces.getHeightForWhitespaceIndex(t))r=t+1;else{if(e>=n)return t;i=t}return r},e.prototype.getWhitespaceAtVerticalOffset=function(e){e|=0;var t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this._whitespaces.getCount())return null;var n=this.getVerticalOffsetForWhitespaceIndex(t);if(n>e)return null;var r=this._whitespaces.getHeightForWhitespaceIndex(t);return{id:this._whitespaces.getIdForWhitespaceIndex(t),afterLineNumber:this._whitespaces.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:n,height:r}},e.prototype.getWhitespaceViewportData=function(e,t){e|=0,t|=0;var n=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),r=this._whitespaces.getCount()-1;if(n<0)return[];for(var i=[],o=n;o<=r;o++){var s=this.getVerticalOffsetForWhitespaceIndex(o),a=this._whitespaces.getHeightForWhitespaceIndex(o);if(s>=t)break;i.push({id:this._whitespaces.getIdForWhitespaceIndex(o),afterLineNumber:this._whitespaces.getAfterLineNumberForWhitespaceIndex(o),verticalOffset:s,height:a})}return i},e.prototype.getWhitespaces=function(){return this._whitespaces.getWhitespaces(this._lineHeight)},e}(),Kx=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gx=function(e){function t(t,n,r){var i=e.call(this)||this;return i._configuration=t,i._linesLayout=new qx(n,i._configuration.editor.lineHeight),i.scrollable=i._register(new Fp(0,r)),i._configureSmoothScrollDuration(),i.scrollable.setScrollDimensions({width:t.editor.layoutInfo.contentWidth,height:t.editor.layoutInfo.contentHeight}),i.onDidScroll=i.scrollable.onScroll,i._updateHeight(),i}return Kx(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onHeightMaybeChanged=function(){this._updateHeight()},t.prototype._configureSmoothScrollDuration=function(){this.scrollable.setSmoothScrollDuration(this._configuration.editor.viewInfo.smoothScrolling?125:0)},t.prototype.onConfigurationChanged=function(e){e.lineHeight&&this._linesLayout.setLineHeight(this._configuration.editor.lineHeight),e.layoutInfo&&this.scrollable.setScrollDimensions({width:this._configuration.editor.layoutInfo.contentWidth,height:this._configuration.editor.layoutInfo.contentHeight}),e.viewInfo&&this._configureSmoothScrollDuration(),this._updateHeight()},t.prototype.onFlushed=function(e){this._linesLayout.onFlushed(e)},t.prototype.onLinesDeleted=function(e,t){this._linesLayout.onLinesDeleted(e,t)},t.prototype.onLinesInserted=function(e,t){this._linesLayout.onLinesInserted(e,t)},t.prototype._getHorizontalScrollbarHeight=function(e){return 2===this._configuration.editor.viewInfo.scrollbar.horizontal?0:e.width>=e.scrollWidth?0:this._configuration.editor.viewInfo.scrollbar.horizontalScrollbarSize},t.prototype._getTotalHeight=function(){var e=this.scrollable.getScrollDimensions(),t=this._linesLayout.getLinesTotalHeight();return this._configuration.editor.viewInfo.scrollBeyondLastLine?t+=e.height-this._configuration.editor.lineHeight:t+=this._getHorizontalScrollbarHeight(e),Math.max(e.height,t)},t.prototype._updateHeight=function(){this.scrollable.setScrollDimensions({scrollHeight:this._getTotalHeight()})},t.prototype.getCurrentViewport=function(){var e=this.scrollable.getScrollDimensions(),t=this.scrollable.getCurrentScrollPosition();return new Fy(t.scrollTop,t.scrollLeft,e.width,e.height)},t.prototype.getFutureViewport=function(){var e=this.scrollable.getScrollDimensions(),t=this.scrollable.getFutureScrollPosition();return new Fy(t.scrollTop,t.scrollLeft,e.width,e.height)},t.prototype._computeScrollWidth=function(e,t){if(!this._configuration.editor.wrappingInfo.isViewportWrapping){var n=this._configuration.editor.viewInfo.scrollBeyondLastColumn*this._configuration.editor.fontInfo.typicalHalfwidthCharacterWidth,r=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+n,t,r)}return Math.max(e,t)},t.prototype.onMaxLineWidthChanged=function(e){var t=this._computeScrollWidth(e,this.getCurrentViewport().width);this.scrollable.setScrollDimensions({scrollWidth:t}),this._updateHeight()},t.prototype.saveState=function(){var e=this.scrollable.getFutureScrollPosition(),t=e.scrollTop,n=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n),scrollLeft:e.scrollLeft}},t.prototype.addWhitespace=function(e,t,n,r){return this._linesLayout.insertWhitespace(e,t,n,r)},t.prototype.changeWhitespace=function(e,t,n){return this._linesLayout.changeWhitespace(e,t,n)},t.prototype.removeWhitespace=function(e){return this._linesLayout.removeWhitespace(e)},t.prototype.getVerticalOffsetForLineNumber=function(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)},t.prototype.isAfterLines=function(e){return this._linesLayout.isAfterLines(e)},t.prototype.getLineNumberAtVerticalOffset=function(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)},t.prototype.getWhitespaceAtVerticalOffset=function(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)},t.prototype.getLinesViewportData=function(){var e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)},t.prototype.getLinesViewportDataAtScrollTop=function(e){var t=this.scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)},t.prototype.getWhitespaceViewportData=function(){var e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)},t.prototype.getWhitespaces=function(){return this._linesLayout.getWhitespaces()},t.prototype.getScrollWidth=function(){return this.scrollable.getScrollDimensions().scrollWidth},t.prototype.getScrollHeight=function(){return this.scrollable.getScrollDimensions().scrollHeight},t.prototype.getCurrentScrollLeft=function(){return this.scrollable.getCurrentScrollPosition().scrollLeft},t.prototype.getCurrentScrollTop=function(){return this.scrollable.getCurrentScrollPosition().scrollTop},t.prototype.validateScrollPosition=function(e){return this.scrollable.validateScrollPosition(e)},t.prototype.setScrollPositionNow=function(e){this.scrollable.setScrollPositionNow(e)},t.prototype.setScrollPositionSmooth=function(e){this.scrollable.setScrollPositionSmooth(e)},t.prototype.deltaScrollNow=function(e,t){var n=this.scrollable.getCurrentScrollPosition();this.scrollable.setScrollPositionNow({scrollLeft:n.scrollLeft+e,scrollTop:n.scrollTop+t})},t}(Dt),$x=function(e,t){this.outputLineIndex=e,this.outputOffset=t},Zx=function(){function e(e){this._lines=e}return e.prototype.convertViewPositionToModelPosition=function(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)},e.prototype.convertViewRangeToModelRange=function(e){var t=this._lines.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),n=this._lines.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new Tr(t.lineNumber,t.column,n.lineNumber,n.column)},e.prototype.validateViewPosition=function(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)},e.prototype.validateViewRange=function(e,t){var n=this._lines.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),r=this._lines.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new Tr(n.lineNumber,n.column,r.lineNumber,r.column)},e.prototype.convertModelPositionToViewPosition=function(e){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column)},e.prototype.convertModelRangeToViewRange=function(e){var t=this._lines.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn),n=this._lines.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn);return new Tr(t.lineNumber,t.column,n.lineNumber,n.column)},e.prototype.modelPositionIsVisible=function(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)},e}(),Jx=function(){function e(e,t,n,r,i,o){this.model=e,this._validModelVersionId=-1,this.tabSize=n,this.wrappingColumn=r,this.columnsForFullWidthChar=i,this.wrappingIndent=o,this.linePositionMapperFactory=t,this._constructLines(!0)}return e.prototype.dispose=function(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])},e.prototype.createCoordinatesConverter=function(){return new Zx(this)},e.prototype._ensureValidState=function(){if(this.model.getVersionId()!==this._validModelVersionId)throw new Error("ViewModel is out of sync with Model!");this.lines.length!==this.model.getLineCount()&&this._constructLines(!1)},e.prototype._constructLines=function(e){var t=this;this.lines=[],e&&(this.hiddenAreasIds=[]);for(var n=this.model.getLinesContent(),r=n.length,i=new Uint32Array(r),o=this.hiddenAreasIds.map((function(e){return t.model.getDecorationRange(e)})).sort(Tr.compareRangesUsingStarts),s=1,a=0,u=-1,c=u+1=s&&d<=a,f=tk(this.linePositionMapperFactory,n[l],this.tabSize,this.wrappingColumn,this.columnsForFullWidthChar,this.wrappingIndent,!h);i[l]=f.getViewLineCount(),this.lines[l]=f}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new q_(i)},e.prototype.getHiddenAreas=function(){var e=this;return this.hiddenAreasIds.map((function(t){return e.model.getDecorationRange(t)}))},e.prototype._reduceRanges=function(e){var t=this;if(0===e.length)return[];for(var n=e.map((function(e){return t.model.validateRange(e)})).sort(Tr.compareRangesUsingStarts),r=[],i=n[0].startLineNumber,o=n[0].endLineNumber,s=1,a=n.length;so+1?(r.push(new Tr(i,1,o,1)),i=u.startLineNumber,o=u.endLineNumber):u.endLineNumber>o&&(o=u.endLineNumber)}return r.push(new Tr(i,1,o,1)),r},e.prototype.setHiddenAreas=function(e){var t=this,n=this._reduceRanges(e),r=this.hiddenAreasIds.map((function(e){return t.model.getDecorationRange(e)})).sort(Tr.compareRangesUsingStarts);if(n.length===r.length){for(var i=!1,o=0;o=d&&m<=h?this.lines[o].isVisible()&&(this.lines[o]=this.lines[o].setVisible(!1),_=!0):(g=!0,this.lines[o].isVisible()||(this.lines[o]=this.lines[o].setVisible(!0),_=!0)),_){var y=this.lines[o].getViewLineCount();this.prefixSumComputer.changeValue(o,y)}}return g||this.setHiddenAreas([]),!0},e.prototype.modelPositionIsVisible=function(e,t){return!(e<1||e>this.lines.length)&&this.lines[e-1].isVisible()},e.prototype.setTabSize=function(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1),!0)},e.prototype.setWrappingSettings=function(e,t,n){return(this.wrappingIndent!==e||this.wrappingColumn!==t||this.columnsForFullWidthChar!==n)&&(this.wrappingIndent=e,this.wrappingColumn=t,this.columnsForFullWidthChar=n,this._constructLines(!1),!0)},e.prototype.onModelFlushed=function(){this._constructLines(!0)},e.prototype.onModelLinesDeleted=function(e,t,n){if(e<=this._validModelVersionId)return null;var r=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,i=this.prefixSumComputer.getAccumulatedValue(n-1);return this.lines.splice(t-1,n-t+1),this.prefixSumComputer.removeValues(t-1,n-t+1),new PC(r,i)},e.prototype.onModelLinesInserted=function(e,t,n,r){if(e<=this._validModelVersionId)return null;for(var i=this.getHiddenAreas(),o=!1,s=new _t(t,1),a=0,u=i;aa?(p=(f=(l=(c=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1)+a-1)+1)+(i-a)-1,u=!0):it?t:e},e.prototype.warmUpLookupCache=function(e,t){this.prefixSumComputer.warmUpCache(e-1,t-1)},e.prototype.getActiveIndentGuide=function(e,t,n){this._ensureValidState(),e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),n=this._toValidViewLineNumber(n);var r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),i=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),o=this.convertViewPositionToModelPosition(n,this.getViewLineMinColumn(n)),s=this.model.getActiveIndentGuide(r.lineNumber,i.lineNumber,o.lineNumber),a=this.convertModelPositionToViewPosition(s.startLineNumber,1),u=this.convertModelPositionToViewPosition(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:u.lineNumber,indent:s.indent}},e.prototype.getViewLinesIndentGuides=function(e,t){this._ensureValidState(),e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);for(var n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t)),i=[],o=[],s=[],a=n.lineNumber-1,u=r.lineNumber-1,c=null,l=a;l<=u;l++){var d=this.lines[l];if(d.isVisible()){var h=d.getViewLineNumberOfModelPosition(0,l===a?n.column:1),f=d.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(l+1)),p=0;(w=f-h+1)>1&&1===d.getViewLineMinColumn(this.model,l+1,f)&&(p=0===h?1:2),o.push(w),s.push(p),null===c&&(c=new _t(l+1,0))}else null!==c&&(i=i.concat(this.model.getLinesIndentGuides(c.lineNumber,l)),c=null)}null!==c&&(i=i.concat(this.model.getLinesIndentGuides(c.lineNumber,r.lineNumber)),c=null);for(var g=t-e+1,m=new Array(g),_=0,y=0,v=i.length;yt&&(f=!0,h=t-i+1);var p=d+h;if(l.getViewLinesData(this.model,u+1,d,p,i-e,n,a),i+=h,f)break}}return a},e.prototype.validateViewPosition=function(e,t,n){this._ensureValidState(),e=this._toValidViewLineNumber(e);var r=this.prefixSumComputer.getIndexOf(e-1),i=r.index,o=r.remainder,s=this.lines[i],a=s.getViewLineMinColumn(this.model,i+1,o),u=s.getViewLineMaxColumn(this.model,i+1,o);tu&&(t=u);var c=s.getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new _t(i+1,c)).equals(n)?new _t(e,t):this.convertModelPositionToViewPosition(n.lineNumber,n.column)},e.prototype.convertViewPositionToModelPosition=function(e,t){this._ensureValidState(),e=this._toValidViewLineNumber(e);var n=this.prefixSumComputer.getIndexOf(e-1),r=n.index,i=n.remainder,o=this.lines[r].getModelColumnOfViewPosition(i,t);return this.model.validatePosition(new _t(r+1,o))},e.prototype.convertModelPositionToViewPosition=function(e,t){this._ensureValidState();for(var n=this.model.validatePosition(new _t(e,t)),r=n.lineNumber,i=n.column,o=r-1,s=!1;o>0&&!this.lines[o].isVisible();)o--,s=!0;if(0===o&&!this.lines[o].isVisible())return new _t(1,1);var a=1+(0===o?0:this.prefixSumComputer.getAccumulatedValue(o-1));return s?this.lines[o].getViewPositionOfModelPosition(a,this.model.getLineMaxColumn(o+1)):this.lines[r-1].getViewPositionOfModelPosition(a,i)},e.prototype._getViewLineNumberForModelPosition=function(e,t){var n=e-1;if(this.lines[n].isVisible()){var r=1+(0===n?0:this.prefixSumComputer.getAccumulatedValue(n-1));return this.lines[n].getViewLineNumberOfModelPosition(r,t)}for(;n>0&&!this.lines[n].isVisible();)n--;if(0===n&&!this.lines[n].isVisible())return 1;var i=1+(0===n?0:this.prefixSumComputer.getAccumulatedValue(n-1));return this.lines[n].getViewLineNumberOfModelPosition(i,this.model.getLineMaxColumn(n+1))},e.prototype.getAllOverviewRulerDecorations=function(e,t,n){for(var r=this.model.getOverviewRulerDecorations(e,t),i=new ik,o=0,s=r;ot.id?1:0:n}));for(var d=[],h=0,f=null,p=0,g=o;p0&&(o=this.wrappedIndent+o),o},e.prototype.getViewLineLength=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");var r=this.getInputStartOffsetOfOutputLineIndex(n),i=this.getInputEndOffsetOfOutputLineIndex(e,t,n)-r;return n>0&&(i=this.wrappedIndent.length+i),i},e.prototype.getViewLineMinColumn=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");return n>0?this.wrappedIndentLength+1:1},e.prototype.getViewLineMaxColumn=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineContent(e,t,n).length+1},e.prototype.getViewLineData=function(e,t,n){if(!this._isVisible)throw new Error("Not supported");var r=this.getInputStartOffsetOfOutputLineIndex(n),i=this.getInputEndOffsetOfOutputLineIndex(e,t,n),o=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:i+1});n>0&&(o=this.wrappedIndent+o);var s=n>0?this.wrappedIndentLength+1:1,a=o.length+1,u=n+10&&(c=this.wrappedIndentLength);var l=e.getLineTokens(t);return new jy(o,u,s,a,l.sliceAndInflate(r,i,c))},e.prototype.getViewLinesData=function(e,t,n,r,i,o,s){if(!this._isVisible)throw new Error("Not supported");for(var a=n;a0&&(n0&&(i+=this.wrappedIndentLength),new _t(e+r,i)},e.prototype.getViewLineNumberOfModelPosition=function(e,t){if(!this._isVisible)throw new Error("Not supported");return e+this.positionMapper.getOutputPositionOfInputOffset(t-1).outputLineIndex},e}();function tk(e,t,n,r,i,o,s){var a=e.createLineMapping(t,n,r,i,o);return null===a?s?Xx.INSTANCE:Qx.INSTANCE:new ek(a,s)}var nk=function(){function e(e){this._lines=e}return e.prototype._validPosition=function(e){return this._lines.model.validatePosition(e)},e.prototype._validRange=function(e){return this._lines.model.validateRange(e)},e.prototype.convertViewPositionToModelPosition=function(e){return this._validPosition(e)},e.prototype.convertViewRangeToModelRange=function(e){return this._validRange(e)},e.prototype.validateViewPosition=function(e,t){return this._validPosition(t)},e.prototype.validateViewRange=function(e,t){return this._validRange(t)},e.prototype.convertModelPositionToViewPosition=function(e){return this._validPosition(e)},e.prototype.convertModelRangeToViewRange=function(e){return this._validRange(e)},e.prototype.modelPositionIsVisible=function(e){var t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)},e}(),rk=function(){function e(e){this.model=e}return e.prototype.dispose=function(){},e.prototype.createCoordinatesConverter=function(){return new nk(this)},e.prototype.getHiddenAreas=function(){return[]},e.prototype.setHiddenAreas=function(e){return!1},e.prototype.setTabSize=function(e){return!1},e.prototype.setWrappingSettings=function(e,t,n){return!1},e.prototype.onModelFlushed=function(){},e.prototype.onModelLinesDeleted=function(e,t,n){return new PC(t,n)},e.prototype.onModelLinesInserted=function(e,t,n,r){return new RC(t,n)},e.prototype.onModelLineChanged=function(e,t,n){return[!1,new IC(t,t),null,null]},e.prototype.acceptVersionId=function(e){},e.prototype.getViewLineCount=function(){return this.model.getLineCount()},e.prototype.warmUpLookupCache=function(e,t){},e.prototype.getActiveIndentGuide=function(e,t,n){return{startLineNumber:e,endLineNumber:e,indent:0}},e.prototype.getViewLinesIndentGuides=function(e,t){for(var n=t-e+1,r=new Array(n),i=0;i=t)return void(n>s&&(i[i.length-1]=n));i.push(r,t,n)}else this.result[e]=[r,t,n]},e}(),ok=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sk=function(e){function t(t,n,r){for(var i=e.call(this,0)||this,o=0;o=12352&&t<=12543||t>=13312&&t<=19903||t>=19968&&t<=40959?4:e.prototype.get.call(this,t)},t}(fo),ak=function(){function e(e,t,n){this.classifier=new sk(e,t,n)}return e.nextVisibleColumn=function(e,t,n,r){return e=+e,t=+t,r=+r,n?e+(t-e%t):e+r},e.prototype.createLineMapping=function(t,n,r,i,o){if(-1===r)return null;n=+n,r=+r,i=+i;var s=0,a="",u=-1;if(0!==(o=+o)&&-1!==(u=an(t))){a=t.substring(0,u);for(var c=0;cr&&(a="",s=0)}var d=this.classifier,h=0,f=[],p=0,g=0,m=-1,_=0,y=-1,v=0,b=t.length;for(c=0;c0){var x=t.charCodeAt(c-1);1!==d.get(x)&&(m=c,_=s)}var k=1;if(Sn(w)&&(k=i),(g=e.nextVisibleColumn(g,n,C,k))>r&&0!==c){var L=void 0,M=void 0;-1!==m&&_<=r?(L=m,M=_):-1!==y&&v<=r?(L=y,M=v):(L=c,M=s),f[p++]=L-h,h=L,g=e.nextVisibleColumn(M,n,C,k),m=-1,_=0,y=-1,v=0}if(-1!==m&&(_=e.nextVisibleColumn(_,n,C,k)),-1!==y&&(v=e.nextVisibleColumn(v,n,C,k)),2===S&&(0===o||c>=u)&&(m=c+1,_=s),4===S&&c=2&&e.viewportStartLineTrackedRange){var g=e.model._getTrackedRange(e.viewportStartLineTrackedRange);if(g){var m=e.coordinatesConverter.convertModelPositionToViewPosition(g.getStartPosition()),_=e.viewLayout.getVerticalOffsetForLineNumber(m.lineNumber);e.viewLayout.setScrollPositionNow({scrollTop:_+e.viewportStartLineDelta})}}}))),this._register(this.model.onDidChangeTokens((function(t){for(var n=[],r=0,i=t.ranges.length;ra||(o0&&s[u-1]===s[u]||(a+=this.model.getLineContent(s[u])+i);return a}for(var c=[],l=0,d=o;l'+this._getHTMLToCopy(n,o)+""},t.prototype._getHTMLToCopy=function(e,t){for(var n=e.startLineNumber,r=e.startColumn,i=e.endLineNumber,o=e.endColumn,s=this.getTabSize(),a="",u=n;u<=i;u++){var c=this.model.getLineTokens(u),l=c.getLineContent(),d=u===n?r-1:0,h=u===i?o-1:l.length;a+=""===l?"
    ":zx(l,c.inflate(),t,d,h,s)}return a},t.prototype._getColorMap=function(){var e=Ma.getColorMap(),t=["#000000"];if(e)for(var n=1,r=e.length;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},yk=function(e,t){return function(n,r){t(n,r,e)}},vk=0,bk="showUnused",wk=function(){function e(e,t,n,r,i,o){this.model=e,this.viewModel=t,this.cursor=n,this.view=r,this.hasRealView=i,this.listenersToRemove=o}return e.prototype.dispose=function(){kt(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.cursor.dispose(),this.viewModel.dispose()},e}(),Ck=function(e){function t(t,n,r,i,o,s,a,u,c,l){var d,h=e.call(this)||this;h._onDidDispose=h._register(new Ht),h.onDidDispose=h._onDidDispose.event,h._onDidChangeModelContent=h._register(new Ht),h.onDidChangeModelContent=h._onDidChangeModelContent.event,h._onDidChangeModelLanguage=h._register(new Ht),h.onDidChangeModelLanguage=h._onDidChangeModelLanguage.event,h._onDidChangeModelLanguageConfiguration=h._register(new Ht),h.onDidChangeModelLanguageConfiguration=h._onDidChangeModelLanguageConfiguration.event,h._onDidChangeModelOptions=h._register(new Ht),h.onDidChangeModelOptions=h._onDidChangeModelOptions.event,h._onDidChangeModelDecorations=h._register(new Ht),h.onDidChangeModelDecorations=h._onDidChangeModelDecorations.event,h._onDidChangeConfiguration=h._register(new Ht),h.onDidChangeConfiguration=h._onDidChangeConfiguration.event,h._onDidChangeModel=h._register(new Ht),h.onDidChangeModel=h._onDidChangeModel.event,h._onDidChangeCursorPosition=h._register(new Ht),h.onDidChangeCursorPosition=h._onDidChangeCursorPosition.event,h._onDidChangeCursorSelection=h._register(new Ht),h.onDidChangeCursorSelection=h._onDidChangeCursorSelection.event,h._onDidAttemptReadOnlyEdit=h._register(new Ht),h.onDidAttemptReadOnlyEdit=h._onDidAttemptReadOnlyEdit.event,h._onDidLayoutChange=h._register(new Ht),h.onDidLayoutChange=h._onDidLayoutChange.event,h._editorTextFocus=h._register(new Sk),h.onDidFocusEditorText=h._editorTextFocus.onDidChangeToTrue,h.onDidBlurEditorText=h._editorTextFocus.onDidChangeToFalse,h._editorWidgetFocus=h._register(new Sk),h.onDidFocusEditorWidget=h._editorWidgetFocus.onDidChangeToTrue,h.onDidBlurEditorWidget=h._editorWidgetFocus.onDidChangeToFalse,h._onWillType=h._register(new Ht),h.onWillType=h._onWillType.event,h._onDidType=h._register(new Ht),h.onDidType=h._onDidType.event,h._onCompositionStart=h._register(new Ht),h.onCompositionStart=h._onCompositionStart.event,h._onCompositionEnd=h._register(new Ht),h.onCompositionEnd=h._onCompositionEnd.event,h._onDidPaste=h._register(new Ht),h.onDidPaste=h._onDidPaste.event,h._onMouseUp=h._register(new Ht),h.onMouseUp=h._onMouseUp.event,h._onMouseDown=h._register(new Ht),h.onMouseDown=h._onMouseDown.event,h._onMouseDrag=h._register(new Ht),h.onMouseDrag=h._onMouseDrag.event,h._onMouseDrop=h._register(new Ht),h.onMouseDrop=h._onMouseDrop.event,h._onContextMenu=h._register(new Ht),h.onContextMenu=h._onContextMenu.event,h._onMouseMove=h._register(new Ht),h.onMouseMove=h._onMouseMove.event,h._onMouseLeave=h._register(new Ht),h.onMouseLeave=h._onMouseLeave.event,h._onMouseWheel=h._register(new Ht),h.onMouseWheel=h._onMouseWheel.event,h._onKeyUp=h._register(new Ht),h.onKeyUp=h._onKeyUp.event,h._onKeyDown=h._register(new Ht),h.onKeyDown=h._onKeyDown.event,h._onDidScrollChange=h._register(new Ht),h.onDidScrollChange=h._onDidScrollChange.event,h._onDidChangeViewZones=h._register(new Ht),h.onDidChangeViewZones=h._onDidChangeViewZones.event,h._domElement=t,h._id=++vk,h._decorationTypeKeysToIds={},h._decorationTypeSubtypes={},h.isSimpleWidget=r.isSimpleWidget||!1,h._telemetryData=r.telemetryData,n=n||{},h._configuration=h._register(h._createConfiguration(n,l)),h._register(h._configuration.onDidChange((function(e){h._onDidChangeConfiguration.fire(e),e.layoutInfo&&h._onDidLayoutChange.fire(h._configuration.editor.layoutInfo),h._configuration.editor.showUnused?h._domElement.classList.add(bk):h._domElement.classList.remove(bk)}))),h._contextKeyService=h._register(a.createScoped(h._domElement)),h._notificationService=c,h._codeEditorService=o,h._commandService=s,h._themeService=u,h._register(new xk(h,h._contextKeyService)),h._register(new kk(h,h._contextKeyService)),h._instantiationService=i.createChild(new fk([jn,h._contextKeyService])),h._modelData=null,h._contributions={},h._actions={},h._focusTracker=new Lk(t),h._focusTracker.onChange((function(){h._editorWidgetFocus.setValue(h._focusTracker.hasFocus())})),h._contentWidgets={},h._overlayWidgets={};for(var f=0,p=(d=Array.isArray(r.contributions)?r.contributions:wr.getEditorContributions()).length;f1),this._hasNonEmptySelection.set(e.some((function(e){return!e.isEmpty()})))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())},t.prototype._updateFromFocus=function(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())},t.prototype._updateFromModel=function(){var e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))},t}(Dt),kk=function(e){function t(t,n){var r=e.call(this)||this;r._editor=t,r._contextKeyService=n,r._langId=wc.languageId.bindTo(n),r._hasCompletionItemProvider=wc.hasCompletionItemProvider.bindTo(n),r._hasCodeActionsProvider=wc.hasCodeActionsProvider.bindTo(n),r._hasCodeLensProvider=wc.hasCodeLensProvider.bindTo(n),r._hasDefinitionProvider=wc.hasDefinitionProvider.bindTo(n),r._hasDeclarationProvider=wc.hasDeclarationProvider.bindTo(n),r._hasImplementationProvider=wc.hasImplementationProvider.bindTo(n),r._hasTypeDefinitionProvider=wc.hasTypeDefinitionProvider.bindTo(n),r._hasHoverProvider=wc.hasHoverProvider.bindTo(n),r._hasDocumentHighlightProvider=wc.hasDocumentHighlightProvider.bindTo(n),r._hasDocumentSymbolProvider=wc.hasDocumentSymbolProvider.bindTo(n),r._hasReferenceProvider=wc.hasReferenceProvider.bindTo(n),r._hasRenameProvider=wc.hasRenameProvider.bindTo(n),r._hasSignatureHelpProvider=wc.hasSignatureHelpProvider.bindTo(n),r._hasDocumentFormattingProvider=wc.hasDocumentFormattingProvider.bindTo(n),r._hasDocumentSelectionFormattingProvider=wc.hasDocumentSelectionFormattingProvider.bindTo(n),r._hasMultipleDocumentFormattingProvider=wc.hasMultipleDocumentFormattingProvider.bindTo(n),r._hasMultipleDocumentSelectionFormattingProvider=wc.hasMultipleDocumentSelectionFormattingProvider.bindTo(n),r._isInWalkThrough=wc.isInEmbeddedEditor.bindTo(n);var i=function(){return r._update()};return r._register(t.onDidChangeModel(i)),r._register(t.onDidChangeModelLanguage(i)),r._register(ua.onDidChange(i)),r._register(va.onDidChange(i)),r._register(ya.onDidChange(i)),r._register(fa.onDidChange(i)),r._register(pa.onDidChange(i)),r._register(ma.onDidChange(i)),r._register(_a.onDidChange(i)),r._register(la.onDidChange(i)),r._register(ha.onDidChange(i)),r._register(da.onDidChange(i)),r._register(sa.onDidChange(i)),r._register(aa.onDidChange(i)),r._register(ba.onDidChange(i)),r._register(wa.onDidChange(i)),r._register(ca.onDidChange(i)),i(),r}return mk(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.reset=function(){var e=this;this._contextKeyService.bufferChangeEvents((function(){e._langId.reset(),e._hasCompletionItemProvider.reset(),e._hasCodeActionsProvider.reset(),e._hasCodeLensProvider.reset(),e._hasDefinitionProvider.reset(),e._hasDeclarationProvider.reset(),e._hasImplementationProvider.reset(),e._hasTypeDefinitionProvider.reset(),e._hasHoverProvider.reset(),e._hasDocumentHighlightProvider.reset(),e._hasDocumentSymbolProvider.reset(),e._hasReferenceProvider.reset(),e._hasRenameProvider.reset(),e._hasDocumentFormattingProvider.reset(),e._hasDocumentSelectionFormattingProvider.reset(),e._hasSignatureHelpProvider.reset(),e._isInWalkThrough.reset()}))},t.prototype._update=function(){var e=this,t=this._editor.getModel();t?this._contextKeyService.bufferChangeEvents((function(){e._langId.set(t.getLanguageIdentifier().language),e._hasCompletionItemProvider.set(ua.has(t)),e._hasCodeActionsProvider.set(va.has(t)),e._hasCodeLensProvider.set(ya.has(t)),e._hasDefinitionProvider.set(fa.has(t)),e._hasDeclarationProvider.set(pa.has(t)),e._hasImplementationProvider.set(ma.has(t)),e._hasTypeDefinitionProvider.set(_a.has(t)),e._hasHoverProvider.set(la.has(t)),e._hasDocumentHighlightProvider.set(ha.has(t)),e._hasDocumentSymbolProvider.set(da.has(t)),e._hasReferenceProvider.set(sa.has(t)),e._hasRenameProvider.set(aa.has(t)),e._hasSignatureHelpProvider.set(ca.has(t)),e._hasDocumentFormattingProvider.set(ba.has(t)||wa.has(t)),e._hasDocumentSelectionFormattingProvider.set(wa.has(t)),e._hasMultipleDocumentFormattingProvider.set(ba.all(t).length+wa.all(t).length>1),e._hasMultipleDocumentSelectionFormattingProvider.set(wa.all(t).length>1),e._isInWalkThrough.set(t.uri.scheme===bh.walkThroughSnippet)})):this.reset()},t}(Dt),Lk=function(e){function t(t){var n=e.call(this)||this;return n._onChange=n._register(new Ht),n.onChange=n._onChange.event,n._hasFocus=!1,n._domFocusTracker=n._register(yf(t)),n._register(n._domFocusTracker.onDidFocus((function(){n._hasFocus=!0,n._onChange.fire(void 0)}))),n._register(n._domFocusTracker.onDidBlur((function(){n._hasFocus=!1,n._onChange.fire(void 0)}))),n}return mk(t,e),t.prototype.hasFocus=function(){return this._hasFocus},t}(Dt),Mk=encodeURIComponent("");function Dk(e){return Mk+encodeURIComponent(e.toString())+Ek}var Tk=encodeURIComponent('');Ad((function(e,t){var n=e.getColor(Hl);n&&t.addRule(".monaco-editor .squiggly-error { border-bottom: 4px double "+n+"; }");var r=e.getColor(Bl);r&&t.addRule('.monaco-editor .squiggly-error { background: url("data:image/svg+xml,'+Dk(r)+'") repeat-x bottom left; }');var i=e.getColor(Vl);i&&t.addRule(".monaco-editor .squiggly-warning { border-bottom: 4px double "+i+"; }");var o=e.getColor(Wl);o&&t.addRule('.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,'+Dk(o)+'") repeat-x bottom left; }');var s=e.getColor(Ul);s&&t.addRule(".monaco-editor .squiggly-info { border-bottom: 4px double "+s+"; }");var a=e.getColor(zl);a&&t.addRule('.monaco-editor .squiggly-info { background: url("data:image/svg+xml,'+Dk(a)+'") repeat-x bottom left; }');var u=e.getColor(Kl);u&&t.addRule(".monaco-editor .squiggly-hint { border-bottom: 2px dotted "+u+"; }");var c=e.getColor(ql);c&&t.addRule('.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,'+(Tk+encodeURIComponent(c.toString())+Nk)+'") no-repeat bottom left; }');var l=e.getColor(vC);l&&t.addRule("."+bk+" .monaco-editor .squiggly-inline-unnecessary { opacity: "+l.rgba.a+"; }");var d=e.getColor(yC);d&&t.addRule("."+bk+" .monaco-editor .squiggly-unnecessary { border-bottom: 2px dashed "+d+"; }");var h=e.getColor($l)||"inherit";t.addRule(".monaco-editor .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: "+h+"}")}));n(407);var Ok=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!1),this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n},Ak=[];var Ik=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pk=pt("IEditorCancelService"),Rk=new Yn("cancellableOperation",!1);!function(e,t,n){Ak.push([e,new Ok(t,[],n)])}(Pk,function(){function e(){this._tokens=new WeakMap}return e.prototype.add=function(e,t){var n,r=this._tokens.get(e);return r||(r=e.invokeWithinContext((function(e){return{key:Rk.bindTo(e.get(jn)),tokens:new Ft}})),this._tokens.set(e,r)),r.key.set(!0),n=r.tokens.push(t),function(){n&&(n(),r.key.set(!r.tokens.isEmpty()),n=void 0)}},e.prototype.cancel=function(e){var t=this._tokens.get(e);if(t){var n=t.tokens.pop();n&&(n.cancel(),t.key.set(!t.tokens.isEmpty()))}},e}(),!0);var Fk=function(e){function t(t,n){var r=e.call(this,n)||this;return r.editor=t,r._unregister=t.invokeWithinContext((function(e){return e.get(Pk).add(t,r)})),r}return Ik(t,e),t.prototype.dispose=function(){this._unregister(),e.prototype.dispose.call(this)},t}(ys);Mr(new(function(e){function t(){return e.call(this,{id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:Rk})||this}return Ik(t,e),t.prototype.runEditorCommand=function(e,t){e.get(Pk).cancel(t)},t}(kr)));var Yk=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jk=(function(){function e(e,t){if(this.flags=t,0!=(1&this.flags)){var n=e.getModel();this.modelVersionId=n?Xt("{0}#{1}",n.uri.toString(),n.getVersionId()):null}else this.modelVersionId=null;0!=(4&this.flags)?this.position=e.getPosition():this.position=null,0!=(2&this.flags)?this.selection=e.getSelection():this.selection=null,0!=(8&this.flags)?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}e.prototype._equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.modelVersionId===n.modelVersionId&&(this.scrollLeft===n.scrollLeft&&this.scrollTop===n.scrollTop&&(!(!this.position&&n.position||this.position&&!n.position||this.position&&n.position&&!this.position.equals(n.position))&&!(!this.selection&&n.selection||this.selection&&!n.selection||this.selection&&n.selection&&!this.selection.equalsRange(n.selection))))},e.prototype.validate=function(t){return this._equals(new e(t,this.flags))}}(),function(e){function t(t,n,r){var i=e.call(this,t,r)||this;return i.editor=t,i._listener=new Et,4&n&&i._listener.add(t.onDidChangeCursorPosition((function(e){return i.cancel()}))),2&n&&i._listener.add(t.onDidChangeCursorSelection((function(e){return i.cancel()}))),8&n&&i._listener.add(t.onDidScrollChange((function(e){return i.cancel()}))),1&n&&(i._listener.add(t.onDidChangeModel((function(e){return i.cancel()}))),i._listener.add(t.onDidChangeModelContent((function(e){return i.cancel()})))),i}Yk(t,e),t.prototype.dispose=function(){this._listener.dispose(),e.prototype.dispose.call(this)}}(Fk),function(e){function t(t,n){var r=e.call(this,n)||this;return r._listener=t.onDidChangeContent((function(){return r.cancel()})),r}Yk(t,e),t.prototype.dispose=function(){this._listener.dispose(),e.prototype.dispose.call(this)}}(ys),function(){function e(e,t){this._visiblePosition=e,this._visiblePositionScrollDelta=t}return e.capture=function(t){var n=null,r=0;if(0!==t.getScrollTop()){var i=t.getVisibleRanges();if(i.length>0){n=i[0].getStartPosition();var o=t.getTopForPosition(n.lineNumber,n.column);r=t.getScrollTop()-o}}return new e(n,r)},e.prototype.restore=function(e){if(this._visiblePosition){var t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}},e}()),Bk=(n(408),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Hk=function(){function e(e,t,n,r){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=n,this.modifiedLineEnd=r}return e.prototype.getType=function(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0},e}(),Wk=function(e){this.entries=e},Vk=function(e){function t(t){var n=e.call(this)||this;return n._width=0,n._diffEditor=t,n._isVisible=!1,n.shadow=bp(document.createElement("div")),n.shadow.setClassName("diff-review-shadow"),n.actionBarContainer=bp(document.createElement("div")),n.actionBarContainer.setClassName("diff-review-actions"),n._actionBar=n._register(new _p(n.actionBarContainer.domNode)),n._actionBar.push(new Gt("diffreview.close",we("label.close","Close"),"close-diff-review",!0,(function(){return n.hide(),Promise.resolve(null)})),{label:!1,icon:!0}),n.domNode=bp(document.createElement("div")),n.domNode.setClassName("diff-review monaco-editor-background"),n._content=bp(document.createElement("div")),n._content.setClassName("diff-review-content"),n.scrollbar=n._register(new Kp(n._content.domNode,{})),n.domNode.domNode.appendChild(n.scrollbar.getDomNode()),n._register(t.onDidUpdateDiff((function(){n._isVisible&&(n._diffs=n._compute(),n._render())}))),n._register(t.getModifiedEditor().onDidChangeCursorPosition((function(){n._isVisible&&n._render()}))),n._register(t.getOriginalEditor().onDidFocusEditorWidget((function(){n._isVisible&&n.hide()}))),n._register(t.getModifiedEditor().onDidFocusEditorWidget((function(){n._isVisible&&n.hide()}))),n._register(Hh(n.domNode.domNode,"click",(function(e){e.preventDefault();var t=function(e,t,n){for(;e;){if(Ah(e,t))return e;if(n)if("string"==typeof n){if(Ah(e,n))return null}else if(e===n)return null;e=e.parentNode}return null}(e.target,"diff-review-row");t&&n._goToRow(t)}))),n._register(Hh(n.domNode.domNode,"keydown",(function(e){(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),n._goToRow(n._getNextRow())),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),n._goToRow(n._getPrevRow())),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),n.hide()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),n.accept())}))),n._diffs=[],n._currentDiff=null,n}return Bk(t,e),t.prototype.prev=function(){var e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){for(var t=-1,n=0,r=this._diffs.length;n0){var y=e[o-1];m=0===y.originalEndLineNumber?y.originalStartLineNumber+1:y.originalEndLineNumber+1,_=0===y.modifiedEndLineNumber?y.modifiedStartLineNumber+1:y.modifiedEndLineNumber+1}var v=p-3+1,b=g-3+1;if(vS)M+=L=S-M,E+=L;if(E>x)M+=L=x-E,E+=L;h[f++]=new Hk(w,M,C,E),r[i++]=new Wk(h)}var D=r[0].entries,T=[],N=0;for(o=1,s=r.length;od)&&(d=_),0!==y&&(0===h||yf)&&(f=v)}var b=document.createElement("div");b.className="diff-review-row";var w=document.createElement("div");w.className="diff-review-cell diff-review-summary";var C=d-l+1,S=f-h+1;w.appendChild(document.createTextNode(a+1+"/"+this._diffs.length+": @@ -"+l+","+C+" +"+h+","+S+" @@")),b.setAttribute("data-line",String(h));var x=function(e){return 0===e?we("no_lines","no lines"):1===e?we("one_line","1 line"):we("more_lines","{0} lines",e)},k=x(C),L=x(S);b.setAttribute("aria-label",we({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines", "1 line" or "X lines", localized separately.']},"Difference {0} of {1}: original {2}, {3}, modified {4}, {5}",a+1,this._diffs.length,l,k,h,L)),b.appendChild(w),b.setAttribute("role","listitem"),c.appendChild(b);var M=h;for(p=0,g=u.length;p0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]i.modifiedStartLineNumber?we("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):we("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"),void 0,!0,(function(){return Gk(a,void 0,void 0,(function(){return $k(this,(function(e){switch(e.label){case 0:return[4,this._clipboardService.writeText(i.originalContent.join(c)+c)];case 1:return e.sent(),[2]}}))}))})));var d=0,h=void 0;return i.originalEndLineNumber>i.modifiedStartLineNumber&&(h=new Gt("diff.clipboard.copyDeletedLineContent",we("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",i.originalStartLineNumber),void 0,!0,(function(){return Gk(a,void 0,void 0,(function(){return $k(this,(function(e){switch(e.label){case 0:return[4,this._clipboardService.writeText(i.originalContent[d])];case 1:return e.sent(),[2]}}))}))})),l.push(h)),r.getConfiguration().readOnly||l.push(new Gt("diff.inline.revertChange",we("diff.inline.revertChange.label","Revert this change"),void 0,!0,(function(){return Gk(a,void 0,void 0,(function(){var e;return $k(this,(function(t){return 0===i.modifiedEndLineNumber?(e=r.getModel().getLineMaxColumn(i.modifiedStartLineNumber),r.executeEdits("diffEditor",[{range:new Tr(i.modifiedStartLineNumber,e,i.modifiedStartLineNumber,e),text:c+i.originalContent.join(c)}])):(e=r.getModel().getLineMaxColumn(i.modifiedEndLineNumber),r.executeEdits("diffEditor",[{range:new Tr(i.modifiedStartLineNumber,1,i.modifiedEndLineNumber,e),text:i.originalContent.join(c)}])),[2]}))}))}))),a._register(Hh(a._diffActions,"mousedown",(function(e){var t=sf(a._diffActions),n=t.top,r=t.height,o=Math.floor(u/3);e.preventDefault(),a._contextMenuService.showContextMenu({getAnchor:function(){return{x:e.posx,y:n+r+o}},getActions:function(){return h&&(h.label=we("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",i.originalStartLineNumber+d)),l},autoSelectFirstItem:!0})}))),a._register(r.onMouseMove((function(e){8===e.target.type||5===e.target.type?e.target.detail.viewZoneId===a._viewZoneId?(a.visibility=!0,d=a._updateLightBulbPosition(a._marginDomNode,e.event.browserEvent.y,u)):a.visibility=!1:a.visibility=!1}))),a}return Kk(t,e),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._visibility},set:function(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")},enumerable:!0,configurable:!0}),t.prototype._updateLightBulbPosition=function(e,t,n){var r=t-sf(e).top,i=Math.floor(r/n),o=i*n;return this._diffActions.style.top=o+"px",i},t}(Dt),Jk=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xk=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Qk=function(e,t){return function(n,r){t(n,r,e)}},eL=function(){function e(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this.inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}return e.prototype.getForeignViewZones=function(e){var t=this;return e.filter((function(e){return!t._zonesMap[String(e.id)]}))},e.prototype.clean=function(e){var t=this;this._zones.length>0&&e.changeViewZones((function(e){for(var n=0,r=t._zones.length;n0?i/n:0;return{height:Math.max(0,Math.floor(e.contentHeight*o)),top:Math.floor(t*o)}},t.prototype._createDataSource=function(){var e=this;return{getWidth:function(){return e._width},getHeight:function(){return e._height-e._reviewHeight},getContainerDomNode:function(){return e._containerDomElement},relayoutEditors:function(){e._doLayout()},getOriginalEditor:function(){return e.originalEditor},getModifiedEditor:function(){return e.modifiedEditor}}},t.prototype._setStrategy=function(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getTheme()),this._diffComputationResult&&this._updateDecorations(),this._measureDomElement(!0)},t.prototype._getLineChangeAtOrBeforeLineNumber=function(e,t){var n=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===n.length||e=a?r=o+1:(r=o,i=o)}return n[r]},t.prototype._getEquivalentLineForOriginalLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,(function(e){return e.originalStartLineNumber}));if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),r=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),i=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,o=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-n;return s<=i?r+Math.min(s,o):r+o-i+s},t.prototype._getEquivalentLineForModifiedLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,(function(e){return e.modifiedStartLineNumber}));if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),r=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),i=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,o=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-r;return s<=o?n+Math.min(s,i):n+i-o+s},t.prototype.getDiffLineInformationForOriginal=function(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null},t.prototype.getDiffLineInformationForModified=function(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null},t.ONE_OVERVIEW_WIDTH=15,t.ENTIRE_DIFF_OVERVIEW_WIDTH=30,t.UPDATE_DIFF_DECORATIONS_DELAY=200,t=Xk([Qk(3,b_),Qk(4,jn),Qk(5,ht),Qk(6,mt),Qk(7,Ld),Qk(8,Qg),Qk(9,Ug)],t)}(Dt),rL=function(e){function t(t){var n=e.call(this)||this;return n._dataSource=t,n._insertColor=null,n._removeColor=null,n}return Jk(t,e),t.prototype.applyColors=function(e){var t=(e.getColor(fd)||dd).transparent(2),n=(e.getColor(pd)||hd).transparent(2),r=!t.equals(this._insertColor)||!n.equals(this._removeColor);return this._insertColor=t,this._removeColor=n,r},t.prototype.getEditorsDiffDecorations=function(e,t,n,r,i,o,s){i=i.sort((function(e,t){return e.afterLineNumber-t.afterLineNumber})),r=r.sort((function(e,t){return e.afterLineNumber-t.afterLineNumber}));var a=this._getViewZones(e,r,i,o,s,n),u=this._getOriginalEditorDecorations(e,t,n,o,s),c=this._getModifiedEditorDecorations(e,t,n,o,s);return{original:{decorations:u.decorations,overviewZones:u.overviewZones,zones:a.original},modified:{decorations:c.decorations,overviewZones:c.overviewZones,zones:a.modified}}},t}(Dt),iL=function(){function e(e){this._source=e,this._index=-1,this.current=null,this.advance()}return e.prototype.advance=function(){this._index++,this._index0){var n=e[e.length-1];if(n.afterLineNumber===t.afterLineNumber&&null===n.domNode)return void(n.heightInLines+=t.heightInLines)}e.push(t)},d=new iL(this.modifiedForeignVZ),h=new iL(this.originalForeignVZ),f=0,p=this.lineChanges.length;f<=p;f++){var g=f0?-1:0),s=g.modifiedStartLineNumber+(g.modifiedEndLineNumber>0?-1:0),i=g.originalEndLineNumber>0?g.originalEndLineNumber-g.originalStartLineNumber+1:0,r=g.modifiedEndLineNumber>0?g.modifiedEndLineNumber-g.modifiedStartLineNumber+1:0,a=Math.max(g.originalStartLineNumber,g.originalEndLineNumber),u=Math.max(g.modifiedStartLineNumber,g.modifiedEndLineNumber)):(a=o+=1e7+i,u=s+=1e7+r);for(var m,_=[],y=[];d.current&&d.current.afterLineNumber<=u;){var v=void 0;v=d.current.afterLineNumber<=s?o-s+d.current.afterLineNumber:a;var b=null;g&&g.modifiedStartLineNumber<=d.current.afterLineNumber&&d.current.afterLineNumber<=g.modifiedEndLineNumber&&(b=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),_.push({afterLineNumber:v,heightInLines:d.current.heightInLines,domNode:null,marginDomNode:b}),d.advance()}for(;h.current&&h.current.afterLineNumber<=a;){v=void 0;v=h.current.afterLineNumber<=o?s-o+h.current.afterLineNumber:u,y.push({afterLineNumber:v,heightInLines:h.current.heightInLines,domNode:null}),h.advance()}if(null!==g&&hL(g))(m=this._produceOriginalFromDiff(g,i,r))&&_.push(m);if(null!==g&&fL(g))(m=this._produceModifiedFromDiff(g,i,r))&&y.push(m);var w=0,C=0;for(_=_.sort(c),y=y.sort(c);w<_.length&&C=x.heightInLines?(S.heightInLines-=x.heightInLines,C++):(x.heightInLines-=S.heightInLines,w++)}for(;w<_.length;)l(t,_[w]),w++;for(;C2*t.MINIMUM_EDITOR_WIDTH?(rn-t.MINIMUM_EDITOR_WIDTH&&(r=n-t.MINIMUM_EDITOR_WIDTH)):r=i,this._sashPosition!==r&&(this._sashPosition=r,this._sash.layout()),this._sashPosition},t.prototype.onSashDragStart=function(){this._startSashPosition=this._sashPosition},t.prototype.onSashDrag=function(e){var t=this._dataSource.getWidth()-nL.ENTIRE_DIFF_OVERVIEW_WIDTH,n=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=n/t,this._dataSource.relayoutEditors()},t.prototype.onSashDragEnd=function(){this._sash.layout()},t.prototype.onSashReset=function(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()},t.prototype.getVerticalSashTop=function(e){return 0},t.prototype.getVerticalSashLeft=function(e){return this._sashPosition},t.prototype.getVerticalSashHeight=function(e){return this._dataSource.getHeight()},t.prototype._getViewZones=function(e,t,n,r,i){return new cL(e,t,n).getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,r,i){for(var o=String(this._removeColor),s={decorations:[],overviewZones:[]},a=r.getModel(),u=0,c=e.length;ut?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:n-t,domNode:null}:null},t.prototype._produceModifiedFromDiff=function(e,t,n){return t>n?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-n,domNode:null}:null},t}(oL),lL=function(e){function t(t,n){var r=e.call(this,t)||this;return r.decorationsLeft=t.getOriginalEditor().getLayoutInfo().decorationsLeft,r._register(t.getOriginalEditor().onDidLayoutChange((function(e){r.decorationsLeft!==e.decorationsLeft&&(r.decorationsLeft=e.decorationsLeft,t.relayoutEditors())}))),r}return Jk(t,e),t.prototype.setEnableSplitViewResizing=function(e){},t.prototype._getViewZones=function(e,t,n,r,i,o){return new dL(e,t,n,r,i,o).getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,r,i){for(var o=String(this._removeColor),s={decorations:[],overviewZones:[]},a=0,u=e.length;a'])}h+=this.modifiedEditorConfiguration.viewInfo.scrollBeyondLastColumn;var m=document.createElement("div");m.className="view-lines line-delete",m.innerHTML=a.build(),Jb.applyFontInfoSlow(m,this.modifiedEditorConfiguration.fontInfo);var _=document.createElement("div");return _.className="inline-deleted-margin-view-zone",_.innerHTML=u.join(""),Jb.applyFontInfoSlow(_,this.modifiedEditorConfiguration.fontInfo),{shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:h*d,domNode:m,marginDomNode:_,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalContent:f}}},t.prototype._renderOriginalLine=function(e,t,n,r,i,o,s){var a=t.getLineTokens(i),u=a.getLineContent(),c=xy.filter(o,i,1,u.length+1);s.appendASCIIString('
    ');var l=By.isBasicASCII(u,t.mightContainNonBasicASCII()),d=By.containsRTL(u,l,t.mightContainRTL()),h=Ay(new Ty(n.fontInfo.isMonospace&&!n.viewInfo.disableMonospaceOptimizations,n.fontInfo.canUseHalfwidthRightwardsArrow,u,!1,l,d,0,a,c,r,n.fontInfo.spaceWidth,n.viewInfo.stopRenderingLineAfter,n.viewInfo.renderWhitespace,n.viewInfo.renderControlCharacters,n.viewInfo.fontLigatures,null),s);s.appendASCIIString("
    ");var f=h.characterMapping.getAbsoluteOffsets();return f.length>0?f[f.length-1]:0},t}(oL);function hL(e){return e.modifiedEndLineNumber>0}function fL(e){return e.originalEndLineNumber>0}Ad((function(e,t){var n=e.getColor(fd);n&&(t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-editor .inline-added-margin-view-zone { background-color: "+n+"; }"));var r=e.getColor(pd);r&&(t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { background-color: "+r+"; }"),t.addRule(".monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: "+r+"; }"),t.addRule(".monaco-editor .inline-deleted-margin-view-zone { background-color: "+r+"; }"));var i=e.getColor(gd);i&&t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+i+"; }");var o=e.getColor(md);o&&t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+o+"; }");var s=e.getColor(Dl);s&&t.addRule(".monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px "+s+"; }");var a=e.getColor(_d);a&&t.addRule(".monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid "+a+"; }")}));var pL=pt("themeService"),gL=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mL=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},_L=function(e,t){return function(n,r){t(n,r,e)}},yL=0,vL=!1;function bL(){var e;vL||(vL=!0,e=document.body,(Uf=document.createElement("div")).className="monaco-aria-container",(qf=document.createElement("div")).className="monaco-alert",qf.setAttribute("role","alert"),qf.setAttribute("aria-atomic","true"),Uf.appendChild(qf),(Kf=document.createElement("div")).className="monaco-status",Kf.setAttribute("role","status"),Kf.setAttribute("aria-atomic","true"),Uf.appendChild(Kf),e.appendChild(Uf))}var wL=function(e){function t(t,n,r,i,o,s,a,u,c,l){var d=this;return(n=n||{}).ariaLabel=n.ariaLabel||yb.editorViewAccessibleLabel,n.ariaLabel=n.ariaLabel+";"+(eh?yb.accessibilityHelpMessageIE:yb.accessibilityHelpMessage),(d=e.call(this,t,n,{},r,i,o,s,u,c,l)||this)._standaloneKeybindingService=a instanceof Ab?a:null,bL(),d}return gL(t,e),t.prototype.addCommand=function(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;var r="DYNAMIC_"+ ++yL,i=En.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,i),r},t.prototype.createContextKey=function(e,t){return this._contextKeyService.createKey(e,t)},t.prototype.addAction=function(e){var t=this;if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Dt.None;var n=e.id,r=e.label,i=En.and(En.equals("editorId",this.getId()),En.deserialize(e.precondition)),o=e.keybindings,s=En.and(i,En.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,u=e.contextMenuOrder||0,c=function(){return Promise.resolve(e.run(t))},l=new Et,d=this.getId()+":"+n;if(l.add(Zn.registerCommand(d,c)),a){var h={command:{id:d,title:r},when:i,group:a,order:u};l.add(rr.appendMenuItem(7,h))}if(Array.isArray(o))for(var f=0,p=o;f=0}}(e);DL.push(n),n.userConfigured?NL.push(n):TL.push(n),t&&!n.userConfigured&&DL.forEach((function(e){e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn("Overwriting extension <<"+n.extension+">> to now point to mime <<"+n.mime+">>"),n.filename&&e.filename===n.filename&&console.warn("Overwriting filename <<"+n.filename+">> to now point to mime <<"+n.mime+">>"),n.filepattern&&e.filepattern===n.filepattern&&console.warn("Overwriting filepattern <<"+n.filepattern+">> to now point to mime <<"+n.mime+">>"),n.firstline&&e.firstline===n.firstline&&console.warn("Overwriting firstline <<"+n.firstline+">> to now point to mime <<"+n.mime+">>"))}))}function AL(e,t){var n;if(e)switch(e.scheme){case bh.file:n=e.fsPath;break;case bh.data:n=e_.parseMetaData(e).get(e_.META_DATA_LABEL);break;default:n=e.path}if(!n)return[EL];n=n.toLowerCase();var r=ds(n),i=IL(n,r,NL);if(i)return[i,ML];var o=IL(n,r,TL);if(o)return[o,ML];if(t){var s=function(e){kn(e)&&(e=e.substr(1));if(e.length>0)for(var t=DL.length-1;t>=0;t--){var n=DL[t];if(n.firstline){var r=e.match(n.firstline);if(r&&r.length>0)return n.mime}}return null}(t);if(s)return[s,ML]}return[EL]}function IL(e,t,n){for(var r=null,i=null,o=null,s=n.length-1;s>=0;s--){var a=n[s];if(t===a.filenameLowercase){r=a;break}if(a.filepattern&&(!i||a.filepattern.length>i.filepattern.length)){var u=a.filepatternOnPath?e:t;Ks(a.filepatternLowercase,u)&&(i=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&rn(t,a.extensionLowercase)&&(o=a)}return r?r.mime:i?i.mime:o?o.mime:null}var PL=new(function(){function e(){this._onDidChangeLanguages=new Ht,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[],this._dynamicLanguages=[]}return e.prototype.registerLanguage=function(e){this._languages.push(e),this._onDidChangeLanguages.fire(void 0)},e.prototype.getLanguages=function(){return[].concat(this._languages).concat(this._dynamicLanguages)},e}());yr.add("editor.modesRegistry",PL);var RL=new na("plaintext",1);PL.registerLanguage({id:"plaintext",extensions:[".txt",".gitignore"],aliases:[we("plainText.alias","Plain Text"),"text"],mimetypes:["text/plain"]}),vu.register(RL,{brackets:[["(",")"],["[","]"],["{","}"]]});var FL=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),YL=Object.prototype.hasOwnProperty,jL=function(e){function t(t,n){void 0===t&&(t=!0),void 0===n&&(n=!1);var r=e.call(this)||this;return r._onDidChange=r._register(new Ht),r.onDidChange=r._onDidChange.event,r._warnOnOverwrite=n,r._nextLanguageId2=1,r._languageIdToLanguage=[],r._languageToLanguageId=Object.create(null),r._languages={},r._mimeTypesMap={},r._nameMap={},r._lowercaseNameMap={},t&&(r._initializeFromRegistry(),r._register(PL.onDidChangeLanguages((function(e){return r._initializeFromRegistry()})))),r}return FL(t,e),t.prototype._initializeFromRegistry=function(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={};var e=PL.getLanguages();this._registerLanguages(e)},t.prototype._registerLanguages=function(e){for(var t=this,n=0,r=e;n0&&((n=e.mimetypes).push.apply(n,t.mimetypes),o=t.mimetypes[0]),o||(o="text/x-"+i,e.mimetypes.push(o)),Array.isArray(t.extensions))for(var s=0,a=t.extensions;s0){var p=t.firstLine;"^"!==p.charAt(0)&&(p="^"+p);try{var g=new RegExp(p);"^"!==(r=g).source&&"^$"!==r.source&&"$"!==r.source&&"^\\s*$"!==r.source&&r.exec("")&&0===r.lastIndex||OL({id:i,mime:o,firstline:g},this._warnOnOverwrite)}catch(e){je(e)}}e.aliases.push(i);var m=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(m=0===t.aliases.length?[null]:t.aliases),null!==m)for(var _=0,y=m;_0;if(b&&null===m[0]);else{var w=(b?m[0]:null)||i;!b&&e.name||(e.name=w)}t.configuration&&e.configurationFiles.push(t.configuration)},t.prototype.isRegisteredMode=function(e){return!!YL.call(this._mimeTypesMap,e)||YL.call(this._languages,e)},t.prototype.getModeIdForLanguageNameLowercase=function(e){return YL.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null},t.prototype.extractModeIds=function(e){var t=this;return e?e.split(",").map((function(e){return e.trim()})).map((function(e){return YL.call(t._mimeTypesMap,e)?t._mimeTypesMap[e].language:e})).filter((function(e){return YL.call(t._languages,e)})):[]},t.prototype.getLanguageIdentifier=function(e){if("vs.editor.nullMode"===e||0===e)return Ia;var t;if("string"==typeof e)t=e;else if(!(t=this._languageIdToLanguage[e]))return null;return YL.call(this._languages,t)?this._languages[t].identifier:null},t.prototype.getModeIdsFromFilepathOrFirstLine=function(e,t){if(!e&&!t)return[];var n=AL(e,t);return this.extractModeIds(n.join(","))},t}(Dt),BL=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),HL=function(e){function t(t,n){var r=e.call(this)||this;return r._onDidChange=r._register(new Ht),r.onDidChange=r._onDidChange.event,r._selector=n,r.languageIdentifier=r._selector(),r._register(t((function(){return r._evaluate()}))),r}return BL(t,e),t.prototype._evaluate=function(){var e=this._selector();e.id!==this.languageIdentifier.id&&(this.languageIdentifier=e,this._onDidChange.fire(this.languageIdentifier))},t}(Dt),WL=function(){function e(e){var t=this;void 0===e&&(e=!1),this._onDidCreateMode=new Ht,this.onDidCreateMode=this._onDidCreateMode.event,this._onLanguagesMaybeChanged=new Ht,this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,this._instantiatedModes={},this._registry=new jL(!0,e),this._registry.onDidChange((function(){return t._onLanguagesMaybeChanged.fire()}))}return e.prototype.isRegisteredMode=function(e){return this._registry.isRegisteredMode(e)},e.prototype.getModeIdForLanguageName=function(e){return this._registry.getModeIdForLanguageNameLowercase(e)},e.prototype.getModeIdByFilepathOrFirstLine=function(e,t){var n=this._registry.getModeIdsFromFilepathOrFirstLine(e,t);return n.length>0?n[0]:null},e.prototype.getModeId=function(e){var t=this._registry.extractModeIds(e);return t.length>0?t[0]:null},e.prototype.getLanguageIdentifier=function(e){return this._registry.getLanguageIdentifier(e)},e.prototype.create=function(e){var t=this;return new HL(this.onLanguagesMaybeChanged,(function(){var n=t.getModeId(e);return t._createModeAndGetLanguageIdentifier(n)}))},e.prototype.createByFilepathOrFirstLine=function(e,t){var n=this;return new HL(this.onLanguagesMaybeChanged,(function(){var r=n.getModeIdByFilepathOrFirstLine(e,t);return n._createModeAndGetLanguageIdentifier(r)}))},e.prototype._createModeAndGetLanguageIdentifier=function(e){var t=this.getLanguageIdentifier(e||"plaintext")||Ia;return this._getOrCreateMode(t.language),t},e.prototype.triggerMode=function(e){var t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")},e.prototype._getOrCreateMode=function(e){if(!this._instantiatedModes.hasOwnProperty(e)){var t=this.getLanguageIdentifier(e)||Ia;this._instantiatedModes[e]=new LL(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]},e}(),VL=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zL=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},UL=function(e,t){return function(n,r){t(n,r,e)}};function qL(e){return e.toString()}var KL=function(){function e(e,t,n){this._modelEventListeners=new Et,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose((function(){return t(e)}))),this._modelEventListeners.add(e.onDidChangeLanguage((function(t){return n(e,t)})))}return e.prototype._disposeLanguageSelection=function(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null),this._languageSelection&&(this._languageSelection.dispose(),this._languageSelection=null)},e.prototype.dispose=function(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()},e.prototype.setLanguage=function(e){var t=this;this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange((function(){return t.model.setMode(e.languageIdentifier)})),this.model.setMode(e.languageIdentifier)},e}(),GL=Ge.c||Ge.d?1:2,$L=function(e){function t(t,n){var r=e.call(this)||this;return r._onModelAdded=r._register(new Ht),r.onModelAdded=r._onModelAdded.event,r._onModelRemoved=r._register(new Ht),r.onModelRemoved=r._onModelRemoved.event,r._onModelModeChanged=r._register(new Ht),r.onModelModeChanged=r._onModelModeChanged.event,r._configurationService=t,r._resourcePropertiesService=n,r._models={},r._modelCreationOptionsByLanguageAndResource=Object.create(null),r._configurationServiceSubscription=r._configurationService.onDidChangeConfiguration((function(e){return r._updateModelOptions()})),r._updateModelOptions(),r}return VL(t,e),t._readModelOptions=function(e,t){var n=pi.tabSize;if(e.editor&&void 0!==e.editor.tabSize){var r=parseInt(e.editor.tabSize,10);isNaN(r)||(n=r),n<1&&(n=1)}var i=n;if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){var o=parseInt(e.editor.indentSize,10);isNaN(o)||(i=o),i<1&&(i=1)}var s=pi.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(s="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));var a=GL,u=e.eol;"\r\n"===u?a=2:"\n"===u&&(a=1);var c=pi.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(c="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));var l=pi.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(l="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));var d=pi.largeFileOptimizations;return e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations)),{isForSimpleWidget:t,tabSize:n,indentSize:i,insertSpaces:s,detectIndentation:l,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:d}},t.prototype.getCreationOptions=function(e,n,r){var i=this._modelCreationOptionsByLanguageAndResource[e+n];if(!i){var o=this._configurationService.getValue("editor",{overrideIdentifier:e,resource:n}),s=this._resourcePropertiesService.getEOL(n,e);i=t._readModelOptions({editor:o,eol:s},r),this._modelCreationOptionsByLanguageAndResource[e+n]=i}return i},t.prototype._updateModelOptions=function(){var e=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);for(var n=Object.keys(this._models),r=0,i=n.length;r=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},eM=function(e,t){return function(n,r){t(n,r,e)}},tM=function(e){function t(t,n){void 0===n&&(n=hf());var r=e.call(this)||this;return r._decorationOptionProviders=new Map,r._styleSheet=n,r._themeService=t,r}return XL(t,e),t.prototype.registerDecorationType=function(e,t,n){var r=this._decorationOptionProviders.get(e);if(!r){var i={styleSheet:this._styleSheet,key:e,parentTypeKey:n,options:t||Object.create(null)};r=n?new nM(this._themeService,i):new rM(this._themeService,i),this._decorationOptionProviders.set(e,r)}r.refCount++},t.prototype.removeDecorationType=function(e){var t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((function(t){return t.removeDecorations(e)}))))},t.prototype.resolveDecorationOptions=function(e,t){var n=this._decorationOptionProviders.get(e);if(!n)throw new Error("Unknown decoration type key: "+e);return n.getOptions(this,t)},t=QL([eM(0,Ld)],t)}(JL),nM=function(){function e(e,t){this._parentTypeKey=t.parentTypeKey,this.refCount=0,this._beforeContentRules=new oM(3,t,e),this._afterContentRules=new oM(4,t,e)}return e.prototype.getOptions=function(e,t){var n=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(n.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(n.afterContentClassName=this._afterContentRules.className),n},e.prototype.dispose=function(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null)},e}(),rM=function(){function e(e,t){var n=this;this._disposables=new Et,this.refCount=0;var r=function(r){var i=new oM(r,t,e);if(n._disposables.add(i),i.hasContent)return i.className};this.className=r(0);var i,o=(i=new oM(1,t,e),n._disposables.add(i),i.hasContent?{className:i.className,hasLetterSpacing:i.hasLetterSpacing}:null);o&&(this.inlineClassName=o.className,this.inlineClassNameAffectsLetterSpacing=o.hasLetterSpacing),this.beforeContentClassName=r(3),this.afterContentClassName=r(4),this.glyphMarginClassName=r(2);var s=t.options;this.isWholeLine=Boolean(s.isWholeLine),this.stickiness=s.rangeBehavior;var a=s.light&&s.light.overviewRulerColor||s.overviewRulerColor,u=s.dark&&s.dark.overviewRulerColor||s.overviewRulerColor;void 0===a&&void 0===u||(this.overviewRuler={color:a||u,darkColor:u||a,position:s.overviewRulerLane||ui.Center})}return e.prototype.getOptions=function(e,t){return t?{inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness}:this},e.prototype.dispose=function(){this._disposables.dispose()},e}(),iM={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",width:"width:{0};",height:"height:{0};"},oM=function(){function e(e,t,n){var r=this;this._theme=n.getTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;var i=sM.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(i=i+" "+sM.getClassName(this._providerArgs.parentTypeKey,e)),this._className=i,this._unThemedSelector=sM.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=n.onThemeChange((function(e){r._theme=n.getTheme(),r._removeCSS(),r._buildCSS()})):this._themeListener=null}return e.prototype.dispose=function(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)},Object.defineProperty(e.prototype,"hasContent",{get:function(){return this._hasContent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasLetterSpacing",{get:function(){return this._hasLetterSpacing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._className},enumerable:!0,configurable:!0}),e.prototype._buildCSS=function(){var e,t,n,r=this._providerArgs.options;switch(this._ruleType){case 0:e=this.getCSSTextForModelDecorationClassName(r),t=this.getCSSTextForModelDecorationClassName(r.light),n=this.getCSSTextForModelDecorationClassName(r.dark);break;case 1:e=this.getCSSTextForModelDecorationInlineClassName(r),t=this.getCSSTextForModelDecorationInlineClassName(r.light),n=this.getCSSTextForModelDecorationInlineClassName(r.dark);break;case 2:e=this.getCSSTextForModelDecorationGlyphMarginClassName(r),t=this.getCSSTextForModelDecorationGlyphMarginClassName(r.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(r.dark);break;case 3:e=this.getCSSTextForModelDecorationContentClassName(r.before),t=this.getCSSTextForModelDecorationContentClassName(r.light&&r.light.before),n=this.getCSSTextForModelDecorationContentClassName(r.dark&&r.dark.before);break;case 4:e=this.getCSSTextForModelDecorationContentClassName(r.after),t=this.getCSSTextForModelDecorationContentClassName(r.light&&r.light.after),n=this.getCSSTextForModelDecorationContentClassName(r.dark&&r.dark.after);break;default:throw new Error("Unknown rule type: "+this._ruleType)}var i=this._providerArgs.styleSheet.sheet,o=!1;e.length>0&&(i.insertRule(this._unThemedSelector+" {"+e+"}",0),o=!0),t.length>0&&(i.insertRule(".vs"+this._unThemedSelector+" {"+t+"}",0),o=!0),n.length>0&&(i.insertRule(".vs-dark"+this._unThemedSelector+", .hc-black"+this._unThemedSelector+" {"+n+"}",0),o=!0),this._hasContent=o},e.prototype._removeCSS=function(){!function(e,t){if(void 0===t&&(t=pf()),t){for(var n=function(e){return e&&e.sheet&&e.sheet.rules?e.sheet.rules:e&&e.sheet&&e.sheet.cssRules?e.sheet.cssRules:[]}(t),r=[],i=0;i=0;i--)t.sheet.deleteRule(r[i])}}(this._unThemedSelector,this._providerArgs.styleSheet)},e.prototype.getCSSTextForModelDecorationClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")},e.prototype.getCSSTextForModelDecorationInlineClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")},e.prototype.getCSSTextForModelDecorationContentClassName=function(e){if(!e)return"";var t=[];if(void 0!==e){if(this.collectBorderSettingsCSSText(e,t),void 0!==e.contentIconPath&&t.push(Xt(iM.contentIconPath,Df(it.revive(e.contentIconPath)))),"string"==typeof e.contentText){var n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(Xt(iM.contentText,n))}this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","color","opacity","backgroundColor","margin"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")},e.prototype.getCSSTextForModelDecorationGlyphMarginClassName=function(e){if(!e)return"";var t=[];return void 0!==e.gutterIconPath&&(t.push(Xt(iM.gutterIconPath,Df(it.revive(e.gutterIconPath)))),void 0!==e.gutterIconSize&&t.push(Xt(iM.gutterIconSize,e.gutterIconSize))),t.join("")},e.prototype.collectBorderSettingsCSSText=function(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push(Xt("box-sizing: border-box;")),!0)},e.prototype.collectCSSText=function(e,t,n){for(var r=n.length,i=0,o=t;it)return 1;return 0}(e.token,t.token);return 0!==n?n:e.index-t.index}));for(var n=0,r="000000",i="ffffff";e.length>=1&&""===e[0].token;){var o=e.shift();-1!==o.fontStyle&&(n=o.fontStyle),null!==o.foreground&&(r=o.foreground),null!==o.background&&(i=o.background)}for(var s=new hM,a=0,u=t;a>>0,this._cache.set(t,n)}return(n|e<<0)>>>0},e}(),pM=/\b(comment|string|regex|regexp)\b/;var gM,mM,_M,yM=function(){function e(e,t,n){this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}return e.prototype.clone=function(){return new e(this._fontStyle,this._foreground,this._background)},e.prototype.acceptOverwrite=function(e,t,n){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==n&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0},e}(),vM=function(){function e(e){this._mainRule=e,this._children=new Map}return e.prototype.match=function(e){if(""===e)return this._mainRule;var t,n,r=e.indexOf(".");-1===r?(t=e,n=""):(t=e.substring(0,r),n=e.substring(r+1));var i=this._children.get(t);return void 0!==i?i.match(n):this._mainRule},e.prototype.insert=function(t,n,r,i){if(""!==t){var o,s,a=t.indexOf(".");-1===a?(o=t,s=""):(o=t.substring(0,a),s=t.substring(a+1));var u=this._children.get(o);void 0===u&&(u=new e(this._mainRule.clone()),this._children.set(o,u)),u.insert(s,n,r,i)}else this._mainRule.acceptOverwrite(n,r,i)},e}();var bM={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"09885A"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"09885A"},{token:"attribute.value.unit",foreground:"09885A"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"FF00FF"}],colors:(gM={},gM[Gl]="#FFFFFE",gM[$l]="#000000",gM[nd]="#E5EBF1",gM[lC]="#D3D3D3",gM[dC]="#939393",gM[rd]="#ADD6FF4D",gM)},wM={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:(mM={},mM[Gl]="#1E1E1E",mM[$l]="#D4D4D4",mM[nd]="#3A3D41",mM[lC]="#404040",mM[dC]="#707070",mM[rd]="#ADD6FF26",mM)},CM={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:(_M={},_M[Gl]="#000000",_M[$l]="#FFFFFF",_M[lC]="#FFFFFF",_M[dC]="#FFFFFF",_M)},SM="vs",xM="vs-dark",kM="hc-black",LM=yr.as(Wc),MM=yr.as(Nd),EM=function(){function e(e,t){this.themeData=t;var n=t.base;e.length>0?(this.id=n+" "+e,this.themeName=e):(this.id=n,this.themeName=n),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}return Object.defineProperty(e.prototype,"base",{get:function(){return this.themeData.base},enumerable:!0,configurable:!0}),e.prototype.notifyBaseUpdated=function(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)},e.prototype.getColors=function(){if(!this.colors){var e=new Map;for(var t in this.themeData.colors)e.set(t,xu.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){var n=TM(this.themeData.base);for(var t in n.colors)e.has(t)||e.set(t,xu.fromHex(n.colors[t]))}this.colors=e}return this.colors},e.prototype.getColor=function(e,t){var n=this.getColors().get(e);return n||(!1!==t?this.getDefault(e):void 0)},e.prototype.getDefault=function(e){var t=this.defaultColors[e];return t||(t=LM.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)},e.prototype.defines=function(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)},Object.defineProperty(e.prototype,"type",{get:function(){switch(this.base){case SM:return"light";case kM:return"hc";default:return"dark"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tokenTheme",{get:function(){if(!this._tokenTheme){var e=[],t=[];if(this.themeData.inherit){var n=TM(this.themeData.base);e=n.rules,n.encodedTokensColors&&(t=n.encodedTokensColors)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=fM.createFromRawTokenTheme(e,t)}return this._tokenTheme},enumerable:!0,configurable:!0}),e}();function DM(e){return e===SM||e===xM||e===kM}function TM(e){switch(e){case SM:return bM;case xM:return wM;case kM:return CM}}function NM(e){var t=TM(e);return new EM(e,t)}var OM=function(){function e(){this.environment=Object.create(null),this._onThemeChange=new Ht,this._onIconThemeChange=new Ht,this._knownThemes=new Map,this._knownThemes.set(SM,NM(SM)),this._knownThemes.set(xM,NM(xM)),this._knownThemes.set(kM,NM(kM)),this._styleElement=hf(),this._styleElement.className="monaco-colors",this.setTheme(SM)}return Object.defineProperty(e.prototype,"onThemeChange",{get:function(){return this._onThemeChange.event},enumerable:!0,configurable:!0}),e.prototype.defineTheme=function(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!DM(t.base)&&!DM(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new EM(e,t)),DM(e)&&this._knownThemes.forEach((function(t){t.base===e&&t.notifyBaseUpdated()})),this._theme&&this._theme.themeName===e&&this.setTheme(e)},e.prototype.getTheme=function(){return this._theme},e.prototype.setTheme=function(e){var t,n=this;if(t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(SM),this._theme===t)return t.id;this._theme=t;var r=[],i={},o={addRule:function(e){i[e]||(r.push(e),i[e]=!0)}};MM.getThemingParticipants().forEach((function(e){return e(t,o,n.environment)}));var s=t.tokenTheme.getColorMap();return o.addRule(function(e){for(var t=[],n=1,r=e.length;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},PM=function(e,t){return function(n,r){t(n,r,e)}},RM="data-keybinding-context",FM=function(){function e(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}return e.prototype.setValue=function(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)},e.prototype.removeValue=function(e){return e in this._value&&(delete this._value[e],!0)},e.prototype.getValue=function(e){var t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t},e}(),YM=function(e){function t(){return e.call(this,-1,null)||this}return AM(t,e),t.prototype.setValue=function(e,t){return!1},t.prototype.removeValue=function(e){return!1},t.prototype.getValue=function(e){},t.INSTANCE=new t,t}(FM),jM=function(e){function t(t,n,r){var i=e.call(this,t,null)||this;return i._configurationService=n,i._values=new Map,i._listener=i._configurationService.onDidChangeConfiguration((function(e){if(6===e.source){var t=Wn(i._values);i._values.clear(),r.fire(new WM(t))}else{for(var n=[],o=0,s=e.affectedKeys;o1){var r=n.shift();r&&(i.focusItemByElement(r.container),n.push(r)),i.mnemonics.set(t,n)}}}))),Ge.c&&i._register(Bh(o,gf.KEY_DOWN,(function(e){var t=new gh(e);t.equals(14)||t.equals(11)?(i.focusedItem=i.viewItems.length-1,i.focusNext(),mf.stop(e,!0)):(t.equals(13)||t.equals(12))&&(i.focusedItem=0,i.focusPrevious(),mf.stop(e,!0))}))),i._register(Bh(i.domNode,gf.MOUSE_OUT,(function(e){df(e.relatedTarget,i.domNode)||(i.focusedItem=void 0,i.scrollTopHold=i.menuElement.scrollTop,i.updateFocus(),e.stopPropagation())}))),i._register(Bh(i.domNode,gf.MOUSE_UP,(function(e){mf.stop(e,!0)}))),i._register(Bh(i.actionsList,gf.MOUSE_OVER,(function(e){var t=e.target;if(t&&df(t,i.actionsList)&&t!==i.actionsList){for(;t.parentElement!==i.actionsList&&null!==t.parentElement;)t=t.parentElement;if(Ah(t,"action-item")){var n=i.focusedItem;i.scrollTopHold=i.menuElement.scrollTop,i.setFocusedItem(t),n!==i.focusedItem&&i.updateFocus()}}})));var s={parent:i};return i.mnemonics=new Map,i.push(n,{icon:!0,label:!0,isMenu:!0}),i.scrollableElement=i._register(new Kp(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0})),i.scrollableElement.getDomNode().style.position=null,o.style.maxHeight=Math.max(10,window.innerHeight-t.getBoundingClientRect().top-30)+"px",i.menuDisposables.add(i.scrollableElement.onScroll((function(){i._onScroll.fire()}),i)),i._register(Bh(i.menuElement,gf.SCROLL,(function(e){void 0!==i.scrollTopHold&&(i.menuElement.scrollTop=i.scrollTopHold,i.scrollTopHold=void 0),i.scrollableElement.scanDomNode()}))),t.appendChild(i.scrollableElement.getDomNode()),i.scrollableElement.scanDomNode(),i.viewItems.filter((function(e){return!(e instanceof eE)})).forEach((function(e,t,n){e.updatePositionInSet(t+1,n.length)})),i}return KM(t,e),t.prototype.style=function(e){var t=this.getContainer(),n=e.foregroundColor?""+e.foregroundColor:null,r=e.backgroundColor?""+e.backgroundColor:null,i=e.borderColor?"2px solid "+e.borderColor:null,o=e.shadowColor?"0 2px 4px "+e.shadowColor:null;t.style.border=i,this.domNode.style.color=n,this.domNode.style.backgroundColor=r,t.style.boxShadow=o,this.viewItems&&this.viewItems.forEach((function(t){(t instanceof XM||t instanceof eE)&&t.style(e)}))},t.prototype.getContainer=function(){return this.scrollableElement.getDomNode()},Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollOffset",{get:function(){return this.menuElement.scrollTop},enumerable:!0,configurable:!0}),t.prototype.focusItemByElement=function(e){var t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()},t.prototype.setFocusedItem=function(e){for(var t=0;t
  • \n\t\t\t\t\t\t\tMermaid Documentation\n\t\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\tMermaid on GitHub\n\t\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\tLive Editor on GitHub\n\t\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\tMermaid CLI\n\t\t\t\t\t\t
  • ',S(t,"classname","marketing-links")},m(e,n){_(e,t,n)},d(e){e&&y(t)}}}function BA(e){let t;const n=new xA({});return{c(){K(n.$$.fragment)},m(e,r){G(n,e,r),t=!0},i(e){t||(z(n.$$.fragment,e),t=!0)},o(e){U(n.$$.fragment,e),t=!1},d(e){$(n,e)}}}function HA(e){let t;const n=new PA({});return{c(){K(n.$$.fragment)},m(e,r){G(n,e,r),t=!0},i(e){t||(z(n.$$.fragment,e),t=!0)},o(e){U(n.$$.fragment,e),t=!1},d(e){$(n,e)}}}function WA(e){let t;return{c(){t=b(e[0])},m(e,n){_(e,t,n)},p(e,n){1&n&&x(t,e[0])},d(e){e&&y(t)}}}function VA(e){let t,n,r,i,o,s,a,u,c,l,d,h,f,p;const g=new MA({props:{title:"Code",noPadding:"true",$$slots:{default:[FA]},$$scope:{ctx:e}}}),C=new MA({props:{title:"Mermaid Configuration",$$slots:{default:[YA]},$$scope:{ctx:e}}}),x=new MA({props:{title:"Links",$$slots:{default:[jA]},$$scope:{ctx:e}}}),k=new MA({props:{title:"Preview",$$slots:{default:[BA]},$$scope:{ctx:e}}}),L=new MA({props:{title:"Actions",$$slots:{default:[HA]},$$scope:{ctx:e}}}),M=new TA({props:{color:"green",$$slots:{default:[WA]},$$scope:{ctx:e}}});return{c(){t=v("div"),(n=v("h1")).textContent="Mermaid Live Editor",r=w(),i=v("div"),o=v("div"),K(g.$$.fragment),s=w(),K(C.$$.fragment),a=w(),K(x.$$.fragment),u=w(),c=v("div"),K(k.$$.fragment),l=w(),K(L.$$.fragment),d=w(),h=v("div"),f=b("Powered by mermaid "),K(M.$$.fragment),S(n,"id","app-title"),S(n,"class","svelte-1cfasmi"),S(o,"id","col1"),S(o,"class","svelte-1cfasmi"),S(h,"id","power"),S(h,"class","svelte-1cfasmi"),S(c,"id","col2"),S(c,"class","svelte-1cfasmi"),S(i,"id","editor-root"),S(i,"class","svelte-1cfasmi")},m(e,y){_(e,t,y),m(t,n),m(t,r),m(t,i),m(i,o),G(g,o,null),m(o,s),G(C,o,null),m(o,a),G(x,o,null),m(i,u),m(i,c),G(k,c,null),m(c,l),G(L,c,null),m(c,d),m(c,h),m(h,f),G(M,h,null),p=!0},p(e,[t]){const n={};6&t&&(n.$$scope={dirty:t,ctx:e}),g.$set(n);const r={};4&t&&(r.$$scope={dirty:t,ctx:e}),C.$set(r);const i={};4&t&&(i.$$scope={dirty:t,ctx:e}),x.$set(i);const o={};4&t&&(o.$$scope={dirty:t,ctx:e}),k.$set(o);const s={};4&t&&(s.$$scope={dirty:t,ctx:e}),L.$set(s);const a={};5&t&&(a.$$scope={dirty:t,ctx:e}),M.$set(a)},i(e){p||(z(g.$$.fragment,e),z(C.$$.fragment,e),z(x.$$.fragment,e),z(k.$$.fragment,e),z(L.$$.fragment,e),z(M.$$.fragment,e),p=!0)},o(e){U(g.$$.fragment,e),U(C.$$.fragment,e),U(x.$$.fragment,e),U(k.$$.fragment,e),U(L.$$.fragment,e),U(M.$$.fragment,e),p=!1},d(e){e&&y(t),$(g),$(C),$(x),$(k),$(L),$(M)}}}function zA(){JA("FlowChart")}function UA(){JA("SequenceDiagram")}function qA(){JA("ClassDiagram")}function KA(){JA("StateDiagram")}function GA(){JA("GanttChart")}function $A(){JA("PieChart")}function ZA(){JA("ERDiagram")}function JA(e){let t="";switch(e){case"FlowChart":t="graph TD\n\tA[Christmas] --\x3e|Get money| B(Go shopping)\n\tB --\x3e C{Let me think}\n\tC --\x3e|One| D[Laptop]\n\tC --\x3e|Two| E[iPhone]\n\tC --\x3e|Three| F[fa:fa-car Car]\n\t\t\t\t\t";break;case"SequenceDiagram":t="sequenceDiagram\n\tAlice->>+John: Hello John, how are you?\n\tAlice->>+John: John, can you hear me?\n\tJohn--\x3e>-Alice: Hi Alice, I can hear you!\n\tJohn--\x3e>-Alice: I feel great!\n\t\t\t\t\t";break;case"ClassDiagram":t="classDiagram\n\tAnimal <|-- Duck\n\tAnimal <|-- Fish\n\tAnimal <|-- Zebra\n\tAnimal : +int age\n\tAnimal : +String gender\n\tAnimal: +isMammal()\n\tAnimal: +mate()\n\tclass Duck{\n\t\t+String beakColor\n\t\t+swim()\n\t\t+quack()\n\t}\n\tclass Fish{\n\t\t-int sizeInFeet\n\t\t-canEat()\n\t}\n\tclass Zebra{\n\t\t+bool is_wild\n\t\t+run()\n\t}\n\t\t\t\t\t";break;case"StateDiagram":t="stateDiagram\n\t[*] --\x3e Still\n\tStill --\x3e [*]\n\n\tStill --\x3e Moving\n\tMoving --\x3e Still\n\tMoving --\x3e Crash\n\tCrash --\x3e [*]\n\t\t\t\t\t";break;case"GanttChart":t="gantt\n\ttitle A Gantt Diagram\n\tdateFormat YYYY-MM-DD\n\tsection Section\n\tA task :a1, 2014-01-01, 30d\n\tAnother task :after a1 , 20d\n\tsection Another\n\tTask in sec :2014-01-12 , 12d\n\tanother task : 24d\n\t\t\t\t\t";break;case"PieChart":t='pie title Pets adopted by volunteers\n\t"Dogs" : 386\n\t"Cats" : 85\n\t"Rats" : 15\n\t\t\t\t\t';break;case"ERDiagram":t='erDiagram\n CUSTOMER }|..|{ DELIVERY-ADDRESS : has\n CUSTOMER ||--o{ ORDER : places\n CUSTOMER ||--o{ INVOICE : "liable for"\n DELIVERY-ADDRESS ||--o{ ORDER : receives\n INVOICE ||--|{ ORDER : covers\n ORDER ||--|{ ORDER-ITEM : includes\n PRODUCT-CATEGORY ||--|{ PRODUCT : contains\n PRODUCT ||--o{ ORDER-ITEM : "ordered in"\n\t\t\t\t\t'}fe({code:t,mermaid:{theme:"default"},updateEditor:!0})}function XA(e,t,n){let{mermaidVersion:r=RA.version}=t;D(async()=>{ga("send","pageview"),ga("send","event","version",r,r),he(i.data)});let{params:i={}}=t;return e.$set=e=>{"mermaidVersion"in e&&n(0,r=e.mermaidVersion),"params"in e&&n(1,i=e.params)},[r,i]}var QA=class extends J{constructor(e){super(),Z(this,e,XA,VA,l,{mermaidVersion:0,params:1})}};n(716);function eI(e){let t,n;const r=new xA({});return{c(){t=v("div"),K(r.$$.fragment),S(t,"id","view-page"),S(t,"class","svelte-ylwsal")},m(e,i){_(e,t,i),G(r,t,null),n=!0},p:o,i(e){n||(z(r.$$.fragment,e),n=!0)},o(e){U(r.$$.fragment,e),n=!1},d(e){e&&y(t),$(r)}}}function tI(e,t,n){D(async()=>{he(r.data),ga("send","pageview")});let{params:r={}}=t;return e.$set=e=>{"params"in e&&n(0,r=e.params)},[r]}var nI=class extends J{constructor(e){super(),Z(this,e,tI,eI,l,{params:0})}};function rI(e){let t;const n=new ce({props:{routes:e[0]}});return{c(){K(n.$$.fragment)},m(e,r){G(n,e,r),t=!0},p:o,i(e){t||(z(n.$$.fragment,e),t=!0)},o(e){U(n.$$.fragment,e),t=!1},d(e){$(n,e)}}}function iI(e){return[{"/":QA,"/edit/:data":QA,"/view/:data":nI,"*":QA}]}const oI=new class extends J{constructor(e){super(),Z(this,e,iI,rI,l,{})}}({target:document.body,props:{name:"world"}});window.app=oI;t.default=oI}]); \ No newline at end of file diff --git a/src/components/View.svelte b/src/components/View.svelte index e604bcc3ea..b018914ba3 100644 --- a/src/components/View.svelte +++ b/src/components/View.svelte @@ -63,7 +63,7 @@ onMount(async () => { }); let insertSvg = function(svgCode, bindFunctions){ - // element.innerHTML = svgCode; + element.innerHTML = svgCode; }; export let code = '';