diff --git a/.gitignore b/.gitignore index a9a5440..31f0834 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ node_modules -dist +# dist .DS_Store yarn-error.log \ No newline at end of file diff --git a/docs/circom.26dc677c.wasm b/docs/circom.26dc677c.wasm new file mode 100644 index 0000000..b6efdd1 Binary files /dev/null and b/docs/circom.26dc677c.wasm differ diff --git a/docs/circomlib.acbc52cb.zip b/docs/circomlib.acbc52cb.zip new file mode 100644 index 0000000..64bc539 Binary files /dev/null and b/docs/circomlib.acbc52cb.zip differ diff --git a/docs/circomspect.516050fc.wasm b/docs/circomspect.516050fc.wasm new file mode 100644 index 0000000..9da777f Binary files /dev/null and b/docs/circomspect.516050fc.wasm differ diff --git a/docs/codicon.ff6b888d.ttf b/docs/codicon.ff6b888d.ttf new file mode 100644 index 0000000..2bca0f7 Binary files /dev/null and b/docs/codicon.ff6b888d.ttf differ diff --git a/docs/index.48183d15.js b/docs/index.48183d15.js new file mode 100644 index 0000000..ff71a27 --- /dev/null +++ b/docs/index.48183d15.js @@ -0,0 +1,823 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerpolicy&&(r.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?r.credentials="include":s.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();var ku=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function SQ(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ey={exports:{}},Pt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Y0=Symbol.for("react.element"),yQ=Symbol.for("react.portal"),LQ=Symbol.for("react.fragment"),DQ=Symbol.for("react.strict_mode"),xQ=Symbol.for("react.profiler"),kQ=Symbol.for("react.provider"),EQ=Symbol.for("react.context"),IQ=Symbol.for("react.forward_ref"),NQ=Symbol.for("react.suspense"),TQ=Symbol.for("react.memo"),AQ=Symbol.for("react.lazy"),g4=Symbol.iterator;function MQ(n){return n===null||typeof n!="object"?null:(n=g4&&n[g4]||n["@@iterator"],typeof n=="function"?n:null)}var n8={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},s8=Object.assign,r8={};function am(n,e,t){this.props=n,this.context=e,this.refs=r8,this.updater=t||n8}am.prototype.isReactComponent={};am.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};am.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function o8(){}o8.prototype=am.prototype;function EM(n,e,t){this.props=n,this.context=e,this.refs=r8,this.updater=t||n8}var IM=EM.prototype=new o8;IM.constructor=EM;s8(IM,am.prototype);IM.isPureReactComponent=!0;var p4=Array.isArray,a8=Object.prototype.hasOwnProperty,NM={current:null},l8={key:!0,ref:!0,__self:!0,__source:!0};function u8(n,e,t){var i,s={},r=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(r=""+e.key),e)a8.call(e,i)&&!l8.hasOwnProperty(i)&&(s[i]=e[i]);var a=arguments.length-2;if(a===1)s.children=t;else if(1>>1,Xe=oe[We];if(0>>1;Wes(Li,Me))zis(ps,Li)?(oe[We]=ps,oe[zi]=Me,We=zi):(oe[We]=Li,oe[ut]=Me,We=ut);else if(zis(ps,Me))oe[We]=ps,oe[zi]=Me,We=zi;else break e}}return fe}function s(oe,fe){var Me=oe.sortIndex-fe.sortIndex;return Me!==0?Me:oe.id-fe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,c=null,f=3,g=!1,m=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(oe){for(var fe=t(u);fe!==null;){if(fe.callback===null)i(u);else if(fe.startTime<=oe)i(u),fe.sortIndex=fe.expirationTime,e(l,fe);else break;fe=t(u)}}function L(oe){if(v=!1,y(oe),!m)if(t(l)!==null)m=!0,Ie(E);else{var fe=t(u);fe!==null&&Te(L,fe.startTime-oe)}}function E(oe,fe){m=!1,v&&(v=!1,w(k),k=-1),g=!0;var Me=f;try{for(y(fe),c=t(l);c!==null&&(!(c.expirationTime>fe)||oe&&!V());){var We=c.callback;if(typeof We=="function"){c.callback=null,f=c.priorityLevel;var Xe=We(c.expirationTime<=fe);fe=n.unstable_now(),typeof Xe=="function"?c.callback=Xe:c===t(l)&&i(l),y(fe)}else i(l);c=t(l)}if(c!==null)var Bt=!0;else{var ut=t(u);ut!==null&&Te(L,ut.startTime-fe),Bt=!1}return Bt}finally{c=null,f=Me,g=!1}}var I=!1,x=null,k=-1,A=5,z=-1;function V(){return!(n.unstable_now()-zoe||125We?(oe.sortIndex=Me,e(u,oe),t(l)===null&&oe===t(u)&&(v?(w(k),k=-1):v=!0,Te(L,Me-We))):(oe.sortIndex=Xe,e(l,oe),m||g||(m=!0,Ie(E))),oe},n.unstable_shouldYield=V,n.unstable_wrapCallback=function(oe){var fe=f;return function(){var Me=f;f=fe;try{return oe.apply(this,arguments)}finally{f=Me}}}})(d8);(function(n){n.exports=d8})(c8);/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var f8=Ey.exports,Xr=c8.exports;function be(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nI=Object.prototype.hasOwnProperty,BQ=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,_4={},v4={};function WQ(n){return nI.call(v4,n)?!0:nI.call(_4,n)?!1:BQ.test(n)?v4[n]=!0:(_4[n]=!0,!1)}function VQ(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function HQ(n,e,t,i){if(e===null||typeof e>"u"||VQ(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Js(n,e,t,i,s,r,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=r,this.removeEmptyString=o}var cs={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){cs[n]=new Js(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];cs[e]=new Js(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){cs[n]=new Js(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){cs[n]=new Js(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){cs[n]=new Js(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){cs[n]=new Js(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){cs[n]=new Js(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){cs[n]=new Js(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){cs[n]=new Js(n,5,!1,n.toLowerCase(),null,!1,!1)});var AM=/[\-:]([a-z])/g;function MM(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(AM,MM);cs[e]=new Js(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(AM,MM);cs[e]=new Js(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(AM,MM);cs[e]=new Js(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){cs[n]=new Js(n,1,!1,n.toLowerCase(),null,!1,!1)});cs.xlinkHref=new Js("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){cs[n]=new Js(n,1,!1,n.toLowerCase(),null,!0,!0)});function RM(n,e,t,i){var s=cs.hasOwnProperty(e)?cs[e]:null;(s!==null?s.type!==0:i||!(2a||s[o]!==r[a]){var l=` +`+s[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{Tx=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?S_(n):""}function zQ(n){switch(n.tag){case 5:return S_(n.type);case 16:return S_("Lazy");case 13:return S_("Suspense");case 19:return S_("SuspenseList");case 0:case 2:case 15:return n=Ax(n.type,!1),n;case 11:return n=Ax(n.type.render,!1),n;case 1:return n=Ax(n.type,!0),n;default:return""}}function aI(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Eg:return"Fragment";case kg:return"Portal";case sI:return"Profiler";case OM:return"StrictMode";case rI:return"Suspense";case oI:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case m8:return(n.displayName||"Context")+".Consumer";case p8:return(n._context.displayName||"Context")+".Provider";case PM:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case FM:return e=n.displayName||null,e!==null?e:aI(n.type)||"Memo";case yh:e=n._payload,n=n._init;try{return aI(n(e))}catch{}}return null}function UQ(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return aI(e);case 8:return e===OM?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ac(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function v8(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function $Q(n){var e=v8(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,r=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){i=""+o,r.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function _C(n){n._valueTracker||(n._valueTracker=$Q(n))}function b8(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=v8(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function N1(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function lI(n,e){var t=e.checked;return Zi({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function C4(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=ac(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function C8(n,e){e=e.checked,e!=null&&RM(n,"checked",e,!1)}function uI(n,e){C8(n,e);var t=ac(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?hI(n,e.type,t):e.hasOwnProperty("defaultValue")&&hI(n,e.type,ac(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function w4(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function hI(n,e,t){(e!=="number"||N1(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var y_=Array.isArray;function Xg(n,e,t,i){if(n=n.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=vC.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Ev(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var B_={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},KQ=["Webkit","ms","Moz","O"];Object.keys(B_).forEach(function(n){KQ.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),B_[e]=B_[n]})});function L8(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||B_.hasOwnProperty(n)&&B_[n]?(""+e).trim():e+"px"}function D8(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,s=L8(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,s):n[t]=s}}var jQ=Zi({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fI(n,e){if(e){if(jQ[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(be(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(be(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(be(61))}if(e.style!=null&&typeof e.style!="object")throw Error(be(62))}}function gI(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pI=null;function BM(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var mI=null,Qg=null,Jg=null;function L4(n){if(n=J0(n)){if(typeof mI!="function")throw Error(be(280));var e=n.stateNode;e&&(e=My(e),mI(n.stateNode,n.type,e))}}function x8(n){Qg?Jg?Jg.push(n):Jg=[n]:Qg=n}function k8(){if(Qg){var n=Qg,e=Jg;if(Jg=Qg=null,L4(n),e)for(n=0;n>>=0,n===0?32:31-(nJ(n)/sJ|0)|0}var bC=64,CC=4194304;function L_(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function R1(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,s=n.suspendedLanes,r=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~s;a!==0?i=L_(a):(r&=o,r!==0&&(i=L_(r)))}else o=t&~s,o!==0?i=L_(o):r!==0&&(i=L_(r));if(i===0)return 0;if(e!==0&&e!==i&&(e&s)===0&&(s=i&-i,r=e&-e,s>=r||s===16&&(r&4194240)!==0))return e;if((i&4)!==0&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function X0(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-ba(e),n[e]=t}function lJ(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=V_),M4=String.fromCharCode(32),R4=!1;function G8(n,e){switch(n){case"keyup":return PJ.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function q8(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ig=!1;function BJ(n,e){switch(n){case"compositionend":return q8(e);case"keypress":return e.which!==32?null:(R4=!0,M4);case"textInput":return n=e.data,n===M4&&R4?null:n;default:return null}}function WJ(n,e){if(Ig)return n==="compositionend"||!jM&&G8(n,e)?(n=K8(),Bw=UM=Oh=null,Ig=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=B4(t)}}function Q8(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?Q8(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function J8(){for(var n=window,e=N1();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=N1(n.document)}return e}function GM(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function qJ(n){var e=J8(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&Q8(t.ownerDocument.documentElement,t)){if(i!==null&&GM(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var s=t.textContent.length,r=Math.min(i.start,s);i=i.end===void 0?r:Math.min(i.end,s),!n.extend&&r>i&&(s=i,i=r,r=s),s=W4(t,r);var o=W4(t,i);s&&o&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),r>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Ng=null,SI=null,z_=null,yI=!1;function V4(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;yI||Ng==null||Ng!==N1(i)||(i=Ng,"selectionStart"in i&&GM(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),z_&&Rv(z_,i)||(z_=i,i=F1(SI,"onSelect"),0Mg||(n.current=II[Mg],II[Mg]=null,Mg--)}function Ei(n,e){Mg++,II[Mg]=n.current,n.current=e}var lc={},Is=Lc(lc),Cr=Lc(!1),Vd=lc;function yp(n,e){var t=n.type.contextTypes;if(!t)return lc;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var s={},r;for(r in t)s[r]=e[r];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function wr(n){return n=n.childContextTypes,n!=null}function W1(){Oi(Cr),Oi(Is)}function G4(n,e,t){if(Is.current!==lc)throw Error(be(168));Ei(Is,e),Ei(Cr,t)}function l7(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var s in i)if(!(s in e))throw Error(be(108,UQ(n)||"Unknown",s));return Zi({},t,i)}function V1(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||lc,Vd=Is.current,Ei(Is,n),Ei(Cr,Cr.current),!0}function q4(n,e,t){var i=n.stateNode;if(!i)throw Error(be(169));t?(n=l7(n,e,Vd),i.__reactInternalMemoizedMergedChildContext=n,Oi(Cr),Oi(Is),Ei(Is,n)):Oi(Cr),Ei(Cr,t)}var bu=null,Ry=!1,jx=!1;function u7(n){bu===null?bu=[n]:bu.push(n)}function oee(n){Ry=!0,u7(n)}function Dc(){if(!jx&&bu!==null){jx=!0;var n=0,e=di;try{var t=bu;for(di=1;n>=o,s-=o,Tu=1<<32-ba(e)+s|t<k?(A=x,x=null):A=x.sibling;var z=f(w,x,y[k],L);if(z===null){x===null&&(x=A);break}n&&x&&z.alternate===null&&e(w,x),b=r(z,b,k),I===null?E=z:I.sibling=z,I=z,x=A}if(k===y.length)return t(w,x),Vi&&Yc(w,k),E;if(x===null){for(;kk?(A=x,x=null):A=x.sibling;var V=f(w,x,z.value,L);if(V===null){x===null&&(x=A);break}n&&x&&V.alternate===null&&e(w,x),b=r(V,b,k),I===null?E=V:I.sibling=V,I=V,x=A}if(z.done)return t(w,x),Vi&&Yc(w,k),E;if(x===null){for(;!z.done;k++,z=y.next())z=c(w,z.value,L),z!==null&&(b=r(z,b,k),I===null?E=z:I.sibling=z,I=z);return Vi&&Yc(w,k),E}for(x=i(w,x);!z.done;k++,z=y.next())z=g(x,w,k,z.value,L),z!==null&&(n&&z.alternate!==null&&x.delete(z.key===null?k:z.key),b=r(z,b,k),I===null?E=z:I.sibling=z,I=z);return n&&x.forEach(function(Q){return e(w,Q)}),Vi&&Yc(w,k),E}function S(w,b,y,L){if(typeof y=="object"&&y!==null&&y.type===Eg&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case mC:e:{for(var E=y.key,I=b;I!==null;){if(I.key===E){if(E=y.type,E===Eg){if(I.tag===7){t(w,I.sibling),b=s(I,y.props.children),b.return=w,w=b;break e}}else if(I.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===yh&&t5(E)===I.type){t(w,I.sibling),b=s(I,y.props),b.ref=Jm(w,I,y),b.return=w,w=b;break e}t(w,I);break}else e(w,I);I=I.sibling}y.type===Eg?(b=xd(y.props.children,w.mode,L,y.key),b.return=w,w=b):(L=jw(y.type,y.key,y.props,null,w.mode,L),L.ref=Jm(w,b,y),L.return=w,w=L)}return o(w);case kg:e:{for(I=y.key;b!==null;){if(b.key===I)if(b.tag===4&&b.stateNode.containerInfo===y.containerInfo&&b.stateNode.implementation===y.implementation){t(w,b.sibling),b=s(b,y.children||[]),b.return=w,w=b;break e}else{t(w,b);break}else e(w,b);b=b.sibling}b=ek(y,w.mode,L),b.return=w,w=b}return o(w);case yh:return I=y._init,S(w,b,I(y._payload),L)}if(y_(y))return m(w,b,y,L);if(qm(y))return v(w,b,y,L);kC(w,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,b!==null&&b.tag===6?(t(w,b.sibling),b=s(b,y),b.return=w,w=b):(t(w,b),b=Jx(y,w.mode,L),b.return=w,w=b),o(w)):t(w,b)}return S}var Dp=_7(!0),v7=_7(!1),eb={},Sl=Lc(eb),Bv=Lc(eb),Wv=Lc(eb);function gd(n){if(n===eb)throw Error(be(174));return n}function iR(n,e){switch(Ei(Wv,e),Ei(Bv,n),Ei(Sl,eb),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:dI(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=dI(e,n)}Oi(Sl),Ei(Sl,e)}function xp(){Oi(Sl),Oi(Bv),Oi(Wv)}function b7(n){gd(Wv.current);var e=gd(Sl.current),t=dI(e,n.type);e!==t&&(Ei(Bv,n),Ei(Sl,t))}function nR(n){Bv.current===n&&(Oi(Sl),Oi(Bv))}var Ki=Lc(0);function j1(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Gx=[];function sR(){for(var n=0;nt?t:4,n(!0);var i=qx.transition;qx.transition={};try{n(!1),e()}finally{di=t,qx.transition=i}}function O7(){return Ko().memoizedState}function hee(n,e,t){var i=Zh(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},P7(n))F7(e,t);else if(t=f7(n,e,t,i),t!==null){var s=Gs();Ca(t,n,i,s),B7(t,e,i)}}function cee(n,e,t){var i=Zh(n),s={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(P7(n))F7(e,s);else{var r=n.alternate;if(n.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var o=e.lastRenderedState,a=r(o,t);if(s.hasEagerState=!0,s.eagerState=a,Ea(a,o)){var l=e.interleaved;l===null?(s.next=s,eR(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}t=f7(n,e,s,i),t!==null&&(s=Gs(),Ca(t,n,i,s),B7(t,e,i))}}function P7(n){var e=n.alternate;return n===Gi||e!==null&&e===Gi}function F7(n,e){U_=G1=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function B7(n,e,t){if((t&4194240)!==0){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,VM(n,t)}}var q1={readContext:$o,useCallback:bs,useContext:bs,useEffect:bs,useImperativeHandle:bs,useInsertionEffect:bs,useLayoutEffect:bs,useMemo:bs,useReducer:bs,useRef:bs,useState:bs,useDebugValue:bs,useDeferredValue:bs,useTransition:bs,useMutableSource:bs,useSyncExternalStore:bs,useId:bs,unstable_isNewReconciler:!1},dee={readContext:$o,useCallback:function(n,e){return ol().memoizedState=[n,e===void 0?null:e],n},useContext:$o,useEffect:n5,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,zw(4194308,4,N7.bind(null,e,n),t)},useLayoutEffect:function(n,e){return zw(4194308,4,n,e)},useInsertionEffect:function(n,e){return zw(4,2,n,e)},useMemo:function(n,e){var t=ol();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=ol();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=hee.bind(null,Gi,n),[i.memoizedState,n]},useRef:function(n){var e=ol();return n={current:n},e.memoizedState=n},useState:i5,useDebugValue:uR,useDeferredValue:function(n){return ol().memoizedState=n},useTransition:function(){var n=i5(!1),e=n[0];return n=uee.bind(null,n[1]),ol().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=Gi,s=ol();if(Vi){if(t===void 0)throw Error(be(407));t=t()}else{if(t=e(),Gn===null)throw Error(be(349));(zd&30)!==0||S7(i,e,t)}s.memoizedState=t;var r={value:t,getSnapshot:e};return s.queue=r,n5(L7.bind(null,i,r,n),[n]),i.flags|=2048,zv(9,y7.bind(null,i,r,t,e),void 0,null),t},useId:function(){var n=ol(),e=Gn.identifierPrefix;if(Vi){var t=Au,i=Tu;t=(i&~(1<<32-ba(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Vv++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[fl]=e,n[Fv]=i,G7(n,e,!1,!1),e.stateNode=n;e:{switch(o=gI(t,i),t){case"dialog":Ai("cancel",n),Ai("close",n),s=i;break;case"iframe":case"object":case"embed":Ai("load",n),s=i;break;case"video":case"audio":for(s=0;sEp&&(e.flags|=128,i=!0,e_(r,!1),e.lanes=4194304)}else{if(!i)if(n=j1(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),e_(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!Vi)return Cs(e),null}else 2*dn()-r.renderingStartTime>Ep&&t!==1073741824&&(e.flags|=128,i=!0,e_(r,!1),e.lanes=4194304);r.isBackwards?(o.sibling=e.child,e.child=o):(t=r.last,t!==null?t.sibling=o:e.child=o,r.last=o)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=dn(),e.sibling=null,t=Ki.current,Ei(Ki,i?t&1|2:t&1),e):(Cs(e),null);case 22:case 23:return pR(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&(e.mode&1)!==0?(Fr&1073741824)!==0&&(Cs(e),e.subtreeFlags&6&&(e.flags|=8192)):Cs(e),null;case 24:return null;case 25:return null}throw Error(be(156,e.tag))}function Cee(n,e){switch(ZM(e),e.tag){case 1:return wr(e.type)&&W1(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return xp(),Oi(Cr),Oi(Is),sR(),n=e.flags,(n&65536)!==0&&(n&128)===0?(e.flags=n&-65537|128,e):null;case 5:return nR(e),null;case 13:if(Oi(Ki),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(be(340));Lp()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Oi(Ki),null;case 4:return xp(),null;case 10:return JM(e.type._context),null;case 22:case 23:return pR(),null;case 24:return null;default:return null}}var IC=!1,Ls=!1,wee=typeof WeakSet=="function"?WeakSet:Set,He=null;function Fg(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){nn(n,e,i)}else t.current=null}function HI(n,e,t){try{t()}catch(i){nn(n,e,i)}}var d5=!1;function See(n,e){if(LI=O1,n=J8(),GM(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var s=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{t.nodeType,r.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,u=0,h=0,c=n,f=null;t:for(;;){for(var g;c!==t||s!==0&&c.nodeType!==3||(a=o+s),c!==r||i!==0&&c.nodeType!==3||(l=o+i),c.nodeType===3&&(o+=c.nodeValue.length),(g=c.firstChild)!==null;)f=c,c=g;for(;;){if(c===n)break t;if(f===t&&++u===s&&(a=o),f===r&&++h===i&&(l=o),(g=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=g}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(DI={focusedElem:n,selectionRange:t},O1=!1,He=e;He!==null;)if(e=He,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,He=n;else for(;He!==null;){e=He;try{var m=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,S=m.memoizedState,w=e.stateNode,b=w.getSnapshotBeforeUpdate(e.elementType===e.type?v:sa(e.type,v),S);w.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(be(163))}}catch(L){nn(e,e.return,L)}if(n=e.sibling,n!==null){n.return=e.return,He=n;break}He=e.return}return m=d5,d5=!1,m}function $_(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&n)===n){var r=s.destroy;s.destroy=void 0,r!==void 0&&HI(e,t,r)}s=s.next}while(s!==i)}}function Fy(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function zI(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function Y7(n){var e=n.alternate;e!==null&&(n.alternate=null,Y7(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[fl],delete e[Fv],delete e[EI],delete e[see],delete e[ree])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function X7(n){return n.tag===5||n.tag===3||n.tag===4}function f5(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||X7(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function UI(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=B1));else if(i!==4&&(n=n.child,n!==null))for(UI(n,e,t),n=n.sibling;n!==null;)UI(n,e,t),n=n.sibling}function $I(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for($I(n,e,t),n=n.sibling;n!==null;)$I(n,e,t),n=n.sibling}var ns=null,la=!1;function ch(n,e,t){for(t=t.child;t!==null;)Q7(n,e,t),t=t.sibling}function Q7(n,e,t){if(wl&&typeof wl.onCommitFiberUnmount=="function")try{wl.onCommitFiberUnmount(Iy,t)}catch{}switch(t.tag){case 5:Ls||Fg(t,e);case 6:var i=ns,s=la;ns=null,ch(n,e,t),ns=i,la=s,ns!==null&&(la?(n=ns,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):ns.removeChild(t.stateNode));break;case 18:ns!==null&&(la?(n=ns,t=t.stateNode,n.nodeType===8?Kx(n.parentNode,t):n.nodeType===1&&Kx(n,t),Av(n)):Kx(ns,t.stateNode));break;case 4:i=ns,s=la,ns=t.stateNode.containerInfo,la=!0,ch(n,e,t),ns=i,la=s;break;case 0:case 11:case 14:case 15:if(!Ls&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var r=s,o=r.destroy;r=r.tag,o!==void 0&&((r&2)!==0||(r&4)!==0)&&HI(t,e,o),s=s.next}while(s!==i)}ch(n,e,t);break;case 1:if(!Ls&&(Fg(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){nn(t,e,a)}ch(n,e,t);break;case 21:ch(n,e,t);break;case 22:t.mode&1?(Ls=(i=Ls)||t.memoizedState!==null,ch(n,e,t),Ls=i):ch(n,e,t);break;default:ch(n,e,t)}}function g5(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new wee),e.forEach(function(i){var s=Tee.bind(null,n,i);t.has(i)||(t.add(i),i.then(s,s))})}}function na(n,e){var t=e.deletions;if(t!==null)for(var i=0;is&&(s=o),i&=~r}if(i=s,i=dn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Lee(i/1960))-i,10n?16:n,Ph===null)var i=!1;else{if(n=Ph,Ph=null,X1=0,(Zt&6)!==0)throw Error(be(331));var s=Zt;for(Zt|=4,He=n.current;He!==null;){var r=He,o=r.child;if((He.flags&16)!==0){var a=r.deletions;if(a!==null){for(var l=0;ldn()-fR?Dd(n,0):dR|=t),Sr(n,e)}function o6(n,e){e===0&&((n.mode&1)===0?e=1:(e=CC,CC<<=1,(CC&130023424)===0&&(CC=4194304)));var t=Gs();n=$u(n,e),n!==null&&(X0(n,e,t),Sr(n,t))}function Nee(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),o6(n,t)}function Tee(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(be(314))}i!==null&&i.delete(e),o6(n,t)}var a6;a6=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Cr.current)mr=!0;else{if((n.lanes&t)===0&&(e.flags&128)===0)return mr=!1,vee(n,e,t);mr=(n.flags&131072)!==0}else mr=!1,Vi&&(e.flags&1048576)!==0&&h7(e,z1,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Uw(n,e),n=e.pendingProps;var s=yp(e,Is.current);tp(e,t),s=oR(null,e,i,n,s,t);var r=aR();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,wr(i)?(r=!0,V1(e)):r=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,tR(e),s.updater=Oy,e.stateNode=s,s._reactInternals=e,RI(e,i,n,t),e=FI(null,e,i,!0,r,t)):(e.tag=0,Vi&&r&&qM(e),zs(null,e,s,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Uw(n,e),n=e.pendingProps,s=i._init,i=s(i._payload),e.type=i,s=e.tag=Mee(i),n=sa(i,n),s){case 0:e=PI(null,e,i,n,t);break e;case 1:e=u5(null,e,i,n,t);break e;case 11:e=a5(null,e,i,n,t);break e;case 14:e=l5(null,e,i,sa(i.type,n),t);break e}throw Error(be(306,i,""))}return e;case 0:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:sa(i,s),PI(n,e,i,s,t);case 1:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:sa(i,s),u5(n,e,i,s,t);case 3:e:{if($7(e),n===null)throw Error(be(387));i=e.pendingProps,r=e.memoizedState,s=r.element,g7(n,e),K1(e,i,null,t);var o=e.memoizedState;if(i=o.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=r,e.memoizedState=r,e.flags&256){s=kp(Error(be(423)),e),e=h5(n,e,i,t,s);break e}else if(i!==s){s=kp(Error(be(424)),e),e=h5(n,e,i,t,s);break e}else for($r=jh(e.stateNode.containerInfo.firstChild),Gr=e,Vi=!0,da=null,t=v7(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Lp(),i===s){e=Ku(n,e,t);break e}zs(n,e,i,t)}e=e.child}return e;case 5:return b7(e),n===null&&TI(e),i=e.type,s=e.pendingProps,r=n!==null?n.memoizedProps:null,o=s.children,xI(i,s)?o=null:r!==null&&xI(i,r)&&(e.flags|=32),U7(n,e),zs(n,e,o,t),e.child;case 6:return n===null&&TI(e),null;case 13:return K7(n,e,t);case 4:return iR(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Dp(e,null,i,t):zs(n,e,i,t),e.child;case 11:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:sa(i,s),a5(n,e,i,s,t);case 7:return zs(n,e,e.pendingProps,t),e.child;case 8:return zs(n,e,e.pendingProps.children,t),e.child;case 12:return zs(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,s=e.pendingProps,r=e.memoizedProps,o=s.value,Ei(U1,i._currentValue),i._currentValue=o,r!==null)if(Ea(r.value,o)){if(r.children===s.children&&!Cr.current){e=Ku(n,e,t);break e}}else for(r=e.child,r!==null&&(r.return=e);r!==null;){var a=r.dependencies;if(a!==null){o=r.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(r.tag===1){l=Fu(-1,t&-t),l.tag=2;var u=r.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?l.next=l:(l.next=h.next,h.next=l),u.pending=l}}r.lanes|=t,l=r.alternate,l!==null&&(l.lanes|=t),AI(r.return,t,e),a.lanes|=t;break}l=l.next}}else if(r.tag===10)o=r.type===e.type?null:r.child;else if(r.tag===18){if(o=r.return,o===null)throw Error(be(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),AI(o,t,e),o=r.sibling}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}zs(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,i=e.pendingProps.children,tp(e,t),s=$o(s),i=i(s),e.flags|=1,zs(n,e,i,t),e.child;case 14:return i=e.type,s=sa(i,e.pendingProps),s=sa(i.type,s),l5(n,e,i,s,t);case 15:return H7(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:sa(i,s),Uw(n,e),e.tag=1,wr(i)?(n=!0,V1(e)):n=!1,tp(e,t),m7(e,i,s),RI(e,i,s,t),FI(null,e,i,!0,n,t);case 19:return j7(n,e,t);case 22:return z7(n,e,t)}throw Error(be(156,e.tag))};function l6(n,e){return R8(n,e)}function Aee(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Po(n,e,t,i){return new Aee(n,e,t,i)}function _R(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Mee(n){if(typeof n=="function")return _R(n)?1:0;if(n!=null){if(n=n.$$typeof,n===PM)return 11;if(n===FM)return 14}return 2}function Yh(n,e){var t=n.alternate;return t===null?(t=Po(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function jw(n,e,t,i,s,r){var o=2;if(i=n,typeof n=="function")_R(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Eg:return xd(t.children,s,r,e);case OM:o=8,s|=8;break;case sI:return n=Po(12,t,e,s|2),n.elementType=sI,n.lanes=r,n;case rI:return n=Po(13,t,e,s),n.elementType=rI,n.lanes=r,n;case oI:return n=Po(19,t,e,s),n.elementType=oI,n.lanes=r,n;case _8:return Wy(t,s,r,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case p8:o=10;break e;case m8:o=9;break e;case PM:o=11;break e;case FM:o=14;break e;case yh:o=16,i=null;break e}throw Error(be(130,n==null?n:typeof n,""))}return e=Po(o,t,e,s),e.elementType=n,e.type=i,e.lanes=r,e}function xd(n,e,t,i){return n=Po(7,n,i,e),n.lanes=t,n}function Wy(n,e,t,i){return n=Po(22,n,i,e),n.elementType=_8,n.lanes=t,n.stateNode={isHidden:!1},n}function Jx(n,e,t){return n=Po(6,n,null,e),n.lanes=t,n}function ek(n,e,t){return e=Po(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function Ree(n,e,t,i,s){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rx(0),this.expirationTimes=Rx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rx(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function vR(n,e,t,i,s,r,o,a,l){return n=new Ree(n,e,t,a,l),e===1?(e=1,r===!0&&(e|=8)):e=0,r=Po(3,null,null,e),n.current=r,r.stateNode=n,r.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},tR(r),n}function Oee(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}e(),n.exports=eo})(h8);var S5=h8.exports;iI.createRoot=S5.createRoot,iI.hydrateRoot=S5.hydrateRoot;function Vee(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,function(i,s){const r=s[0];return typeof e[r]<"u"?e[r]:i}),t}function _(n,e,...t){return Vee(e,t)}class Hee{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?new Error(e.message+` + +`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const d6=new Hee;function Qe(n){xc(n)||d6.onUnexpectedError(n)}function Go(n){xc(n)||d6.onUnexpectedExternalError(n)}function y5(n){if(n instanceof Error){let{name:e,message:t}=n;const i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i}}return n}const ZI="Canceled";function xc(n){return n instanceof Error&&n.name===ZI&&n.message===ZI}function hm(){const n=new Error(ZI);return n.name=n.message,n}function yl(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function zee(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class Uee extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}function Kd(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}var gt;(function(n){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(b){yield b}n.single=s;function r(b){return b||t}n.from=r;function o(b){return!b||b[Symbol.iterator]().next().done===!0}n.isEmpty=o;function a(b){return b[Symbol.iterator]().next().value}n.first=a;function l(b,y){for(const L of b)if(y(L))return!0;return!1}n.some=l;function u(b,y){for(const L of b)if(y(L))return L}n.find=u;function*h(b,y){for(const L of b)y(L)&&(yield L)}n.filter=h;function*c(b,y){let L=0;for(const E of b)yield y(E,L++)}n.map=c;function*f(...b){for(const y of b)for(const L of y)yield L}n.concat=f;function*g(b){for(const y of b)for(const L of y)yield L}n.concatNested=g;function m(b,y,L){let E=L;for(const I of b)E=y(E,I);return E}n.reduce=m;function*v(b,y,L=b.length){for(y<0&&(y+=b.length),L<0?L+=b.length:L>b.length&&(L=b.length);yE===I){const E=b[Symbol.iterator](),I=y[Symbol.iterator]();for(;;){const x=E.next(),k=I.next();if(x.done!==k.done)return!1;if(x.done)return!0;if(!L(x.value,k.value))return!1}}n.equals=w})(gt||(gt={}));class $ee extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function f6(n){return typeof n.dispose=="function"&&n.dispose.length===0}function ct(n){if(gt.is(n)){let e=[];for(const t of n)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new $ee(e);return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function Xh(...n){return Ct(()=>ct(n))}function Ct(n){return{dispose:Kd(()=>{n()})}}class pe{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}clear(){try{ct(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?pe.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}pe.DISABLE_DISPOSED_WARNING=!1;class ie{constructor(){this._store=new pe,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}ie.None=Object.freeze({dispose(){}});class xr{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e}}class Kee{constructor(e){this.object=e}dispose(){}}class fi{constructor(e){this.element=e,this.next=fi.Undefined,this.prev=fi.Undefined}}fi.Undefined=new fi(void 0);class _r{constructor(){this._first=fi.Undefined,this._last=fi.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===fi.Undefined}clear(){let e=this._first;for(;e!==fi.Undefined;){const t=e.next;e.prev=fi.Undefined,e.next=fi.Undefined,e=t}this._first=fi.Undefined,this._last=fi.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new fi(e);if(this._first===fi.Undefined)this._first=i,this._last=i;else if(t){const r=this._last;this._last=i,i.prev=r,r.next=i}else{const r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==fi.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==fi.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==fi.Undefined&&e.next!==fi.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===fi.Undefined&&e.next===fi.Undefined?(this._first=fi.Undefined,this._last=fi.Undefined):e.next===fi.Undefined?(this._last=this._last.prev,this._last.next=fi.Undefined):e.prev===fi.Undefined&&(this._first=this._first.next,this._first.prev=fi.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==fi.Undefined;)yield e.element,e=e.next}}var tk;const Gw="en";let eS=!1,tS=!1,qw=!1,g6=!1,p6=!1,SR=!1,AC,ik=Gw,jee,vh;const oi=typeof self=="object"?self:typeof global=="object"?global:{};let Kn;typeof oi.vscode<"u"&&typeof oi.vscode.process<"u"?Kn=oi.vscode.process:typeof process<"u"&&(Kn=process);const Gee=typeof((tk=Kn?.versions)===null||tk===void 0?void 0:tk.electron)=="string"&&Kn.type==="renderer";if(typeof navigator=="object"&&!Gee)vh=navigator.userAgent,eS=vh.indexOf("Windows")>=0,tS=vh.indexOf("Macintosh")>=0,SR=(vh.indexOf("Macintosh")>=0||vh.indexOf("iPad")>=0||vh.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,qw=vh.indexOf("Linux")>=0,p6=!0,AC=navigator.language,ik=AC;else if(typeof Kn=="object"){eS=Kn.platform==="win32",tS=Kn.platform==="darwin",qw=Kn.platform==="linux",qw&&!!Kn.env.SNAP&&Kn.env.SNAP_REVISION,AC=Gw,ik=Gw;const n=Kn.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];AC=e.locale,ik=t||Gw,jee=e._translationsConfigFile}catch{}g6=!0}else console.error("Unable to resolve platform.");const Pn=eS,pt=tS,Ns=qw,wa=g6,cm=p6,Nl=SR,qee=vh,YI=function(){if(oi.setImmediate)return oi.setImmediate.bind(oi);if(typeof oi.postMessage=="function"&&!oi.importScripts){let t=[];oi.addEventListener("message",s=>{if(s.data&&s.data.vscodeSetImmediateId)for(let r=0,o=t.length;r{const r=++i;t.push({id:r,callback:s}),oi.postMessage({vscodeSetImmediateId:r},"*")}}if(typeof Kn?.nextTick=="function")return Kn.nextTick.bind(Kn);const e=Promise.resolve();return t=>e.then(t)}(),No=tS||SR?2:eS?1:3;let L5=!0,D5=!1;function m6(){if(!D5){D5=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,L5=new Uint16Array(n.buffer)[0]===(2<<8)+1}return L5}const Zee=oi.performance&&typeof oi.performance.now=="function";class ju{constructor(e){this._highResolution=Zee&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new ju(e)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?oi.performance.now():Date.now()}}var De;(function(n){n.None=()=>ie.None;function e(b){return(y,L=null,E)=>{let I=!1,x;return x=b(k=>{if(!I)return x?x.dispose():I=!0,y.call(L,k)},null,E),I&&x.dispose(),x}}n.once=e;function t(b,y){return l((L,E=null,I)=>b(x=>L.call(E,y(x)),null,I))}n.map=t;function i(b,y){return l((L,E=null,I)=>b(x=>{y(x),L.call(E,x)},null,I))}n.forEach=i;function s(b,y){return l((L,E=null,I)=>b(x=>y(x)&&L.call(E,x),null,I))}n.filter=s;function r(b){return b}n.signal=r;function o(...b){return(y,L=null,E)=>Xh(...b.map(I=>I(x=>y.call(L,x),null,E)))}n.any=o;function a(b,y,L){let E=L;return t(b,I=>(E=y(E,I),E))}n.reduce=a;function l(b){let y;const L=new H({onFirstListenerAdd(){y=b(L.fire,L)},onLastListenerRemove(){y.dispose()}});return L.event}function u(b,y,L=100,E=!1,I){let x,k,A,z=0;const V=new H({leakWarningThreshold:I,onFirstListenerAdd(){x=b(Q=>{z++,k=y(k,Q),E&&!A&&(V.fire(k),k=void 0),clearTimeout(A),A=setTimeout(()=>{const ee=k;k=void 0,A=void 0,(!E||z>1)&&V.fire(ee),z=0},L)})},onLastListenerRemove(){x.dispose()}});return V.event}n.debounce=u;function h(b,y=(L,E)=>L===E){let L=!0,E;return s(b,I=>{const x=L||!y(I,E);return L=!1,E=I,x})}n.latch=h;function c(b,y){return[n.filter(b,y),n.filter(b,L=>!y(L))]}n.split=c;function f(b,y=!1,L=[]){let E=L.slice(),I=b(A=>{E?E.push(A):k.fire(A)});const x=()=>{E&&E.forEach(A=>k.fire(A)),E=null},k=new H({onFirstListenerAdd(){I||(I=b(A=>k.fire(A)))},onFirstListenerDidAdd(){E&&(y?setTimeout(x):x())},onLastListenerRemove(){I&&I.dispose(),I=null}});return k.event}n.buffer=f;class g{constructor(y){this.event=y}map(y){return new g(t(this.event,y))}forEach(y){return new g(i(this.event,y))}filter(y){return new g(s(this.event,y))}reduce(y,L){return new g(a(this.event,y,L))}latch(){return new g(h(this.event))}debounce(y,L=100,E=!1,I){return new g(u(this.event,y,L,E,I))}on(y,L,E){return this.event(y,L,E)}once(y,L,E){return e(this.event)(y,L,E)}}function m(b){return new g(b)}n.chain=m;function v(b,y,L=E=>E){const E=(...A)=>k.fire(L(...A)),I=()=>b.on(y,E),x=()=>b.removeListener(y,E),k=new H({onFirstListenerAdd:I,onLastListenerRemove:x});return k.event}n.fromNodeEventEmitter=v;function S(b,y,L=E=>E){const E=(...A)=>k.fire(L(...A)),I=()=>b.addEventListener(y,E),x=()=>b.removeEventListener(y,E),k=new H({onFirstListenerAdd:I,onLastListenerRemove:x});return k.event}n.fromDOMEventEmitter=S;function w(b){return new Promise(y=>e(b)(y))}n.toPromise=w})(De||(De={}));class $y{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${$y._idPool++}`}start(e){this._stopWatch=new ju(!0),this._listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this._elapsedOverall+=e,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${e.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}$y._idPool=0;class H{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=void 0,this._perfMon=!((t=this._options)===null||t===void 0)&&t._profName?new $y(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,i)=>{var s;this._listeners||(this._listeners=new _r);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const o=this._listeners.push(t?[e,t]:e);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);const a=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),l=Ct(()=>{a&&a(),this._disposed||(o(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return i instanceof pe?i.add(l):Array.isArray(i)&&i.push(l),l}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new _r);for(let s of this._listeners)this._deliveryQueue.push([s,e]);for((t=this._perfMon)===null||t===void 0||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,r]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,r):s[0].call(s[1],r)}catch(o){Qe(o)}}(i=this._perfMon)===null||i===void 0||i.stop()}}dispose(){var e,t,i,s,r;this._disposed||(this._disposed=!0,(e=this._listeners)===null||e===void 0||e.clear(),(t=this._deliveryQueue)===null||t===void 0||t.clear(),(s=(i=this._options)===null||i===void 0?void 0:i.onLastListenerRemove)===null||s===void 0||s.call(i),(r=this._leakageMon)===null||r===void 0||r.dispose())}}class iS extends H{constructor(e){super(e),this._isPaused=0,this._eventQueue=new _r,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class Yee extends iS{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class yR{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,s)=>e(r=>{const o=this.buffers[this.buffers.length-1];o?o.push(()=>t.call(i,r)):t.call(i,r)},void 0,s)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(s=>s()),i}}class x5{constructor(){this.listening=!1,this.inputEvent=De.None,this.inputEventListener=ie.None,this.emitter=new H({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}class jd{constructor(){this._zoomLevel=0,this._lastZoomLevelChangeTime=0,this._onDidChangeZoomLevel=new H,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this._zoomFactor=1}getZoomLevel(){return this._zoomLevel}getTimeSinceLastZoomLevelChanged(){return Date.now()-this._lastZoomLevelChangeTime}getZoomFactor(){return this._zoomFactor}getPixelRatio(){let e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}jd.INSTANCE=new jd;function XI(){return jd.INSTANCE.getZoomLevel()}function Xee(){return jd.INSTANCE.getTimeSinceLastZoomLevelChanged()}function _6(n){return jd.INSTANCE.onDidChangeZoomLevel(n)}function Qee(){return jd.INSTANCE.getZoomFactor()}function nS(){return jd.INSTANCE.getPixelRatio()}const tb=navigator.userAgent,ls=tb.indexOf("Firefox")>=0,kd=tb.indexOf("AppleWebKit")>=0,sS=tb.indexOf("Chrome")>=0,Fo=!sS&&tb.indexOf("Safari")>=0,Jee=!sS&&!Fo&&kd,x_=tb.indexOf("Android")>=0,v6=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches;function b6(n){return Array.isArray(n)}function Ia(n){return typeof n=="string"}function Es(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function Gd(n){return typeof n=="number"&&!isNaN(n)}function C6(n){return n===!0||n===!1}function os(n){return typeof n>"u"}function ete(n){return!Wr(n)}function Wr(n){return os(n)||n===null}function Ri(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function G_(n){return typeof n=="function"}function tte(n,e){const t=Math.min(n.length,e.length);for(let i=0;ifunction(){const r=Array.prototype.slice.call(arguments,0);return e(s,r)};let i={};for(const s of n)i[s]=t(s);return i}function pd(n){return n===null?void 0:n}function rte(n,e="Unreachable"){throw new Error(e)}const Ky={clipboard:{writeText:wa||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:wa||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>wa||v6?0:navigator.keyboard||Fo?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};class DR{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const Zw=new DR,QI=new DR,JI=new DR,w6=new Array(230),ote=Object.create(null),ate=Object.create(null),xR=[];for(let n=0;n<=193;n++)xR[n]=-1;(function(){const n="",e=[[0,1,0,"None",0,"unknown",0,"VK_UNKNOWN",n,n],[0,1,1,"Hyper",0,n,0,n,n,n],[0,1,2,"Super",0,n,0,n,n,n],[0,1,3,"Fn",0,n,0,n,n,n],[0,1,4,"FnLock",0,n,0,n,n,n],[0,1,5,"Suspend",0,n,0,n,n,n],[0,1,6,"Resume",0,n,0,n,n,n],[0,1,7,"Turbo",0,n,0,n,n,n],[0,1,8,"Sleep",0,n,0,"VK_SLEEP",n,n],[0,1,9,"WakeUp",0,n,0,n,n,n],[31,0,10,"KeyA",31,"A",65,"VK_A",n,n],[32,0,11,"KeyB",32,"B",66,"VK_B",n,n],[33,0,12,"KeyC",33,"C",67,"VK_C",n,n],[34,0,13,"KeyD",34,"D",68,"VK_D",n,n],[35,0,14,"KeyE",35,"E",69,"VK_E",n,n],[36,0,15,"KeyF",36,"F",70,"VK_F",n,n],[37,0,16,"KeyG",37,"G",71,"VK_G",n,n],[38,0,17,"KeyH",38,"H",72,"VK_H",n,n],[39,0,18,"KeyI",39,"I",73,"VK_I",n,n],[40,0,19,"KeyJ",40,"J",74,"VK_J",n,n],[41,0,20,"KeyK",41,"K",75,"VK_K",n,n],[42,0,21,"KeyL",42,"L",76,"VK_L",n,n],[43,0,22,"KeyM",43,"M",77,"VK_M",n,n],[44,0,23,"KeyN",44,"N",78,"VK_N",n,n],[45,0,24,"KeyO",45,"O",79,"VK_O",n,n],[46,0,25,"KeyP",46,"P",80,"VK_P",n,n],[47,0,26,"KeyQ",47,"Q",81,"VK_Q",n,n],[48,0,27,"KeyR",48,"R",82,"VK_R",n,n],[49,0,28,"KeyS",49,"S",83,"VK_S",n,n],[50,0,29,"KeyT",50,"T",84,"VK_T",n,n],[51,0,30,"KeyU",51,"U",85,"VK_U",n,n],[52,0,31,"KeyV",52,"V",86,"VK_V",n,n],[53,0,32,"KeyW",53,"W",87,"VK_W",n,n],[54,0,33,"KeyX",54,"X",88,"VK_X",n,n],[55,0,34,"KeyY",55,"Y",89,"VK_Y",n,n],[56,0,35,"KeyZ",56,"Z",90,"VK_Z",n,n],[22,0,36,"Digit1",22,"1",49,"VK_1",n,n],[23,0,37,"Digit2",23,"2",50,"VK_2",n,n],[24,0,38,"Digit3",24,"3",51,"VK_3",n,n],[25,0,39,"Digit4",25,"4",52,"VK_4",n,n],[26,0,40,"Digit5",26,"5",53,"VK_5",n,n],[27,0,41,"Digit6",27,"6",54,"VK_6",n,n],[28,0,42,"Digit7",28,"7",55,"VK_7",n,n],[29,0,43,"Digit8",29,"8",56,"VK_8",n,n],[30,0,44,"Digit9",30,"9",57,"VK_9",n,n],[21,0,45,"Digit0",21,"0",48,"VK_0",n,n],[3,1,46,"Enter",3,"Enter",13,"VK_RETURN",n,n],[9,1,47,"Escape",9,"Escape",27,"VK_ESCAPE",n,n],[1,1,48,"Backspace",1,"Backspace",8,"VK_BACK",n,n],[2,1,49,"Tab",2,"Tab",9,"VK_TAB",n,n],[10,1,50,"Space",10,"Space",32,"VK_SPACE",n,n],[83,0,51,"Minus",83,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[81,0,52,"Equal",81,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[87,0,53,"BracketLeft",87,"[",219,"VK_OEM_4","[","OEM_4"],[89,0,54,"BracketRight",89,"]",221,"VK_OEM_6","]","OEM_6"],[88,0,55,"Backslash",88,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,0,56,"IntlHash",0,n,0,n,n,n],[80,0,57,"Semicolon",80,";",186,"VK_OEM_1",";","OEM_1"],[90,0,58,"Quote",90,"'",222,"VK_OEM_7","'","OEM_7"],[86,0,59,"Backquote",86,"`",192,"VK_OEM_3","`","OEM_3"],[82,0,60,"Comma",82,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[84,0,61,"Period",84,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[85,0,62,"Slash",85,"/",191,"VK_OEM_2","/","OEM_2"],[8,1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",n,n],[59,1,64,"F1",59,"F1",112,"VK_F1",n,n],[60,1,65,"F2",60,"F2",113,"VK_F2",n,n],[61,1,66,"F3",61,"F3",114,"VK_F3",n,n],[62,1,67,"F4",62,"F4",115,"VK_F4",n,n],[63,1,68,"F5",63,"F5",116,"VK_F5",n,n],[64,1,69,"F6",64,"F6",117,"VK_F6",n,n],[65,1,70,"F7",65,"F7",118,"VK_F7",n,n],[66,1,71,"F8",66,"F8",119,"VK_F8",n,n],[67,1,72,"F9",67,"F9",120,"VK_F9",n,n],[68,1,73,"F10",68,"F10",121,"VK_F10",n,n],[69,1,74,"F11",69,"F11",122,"VK_F11",n,n],[70,1,75,"F12",70,"F12",123,"VK_F12",n,n],[0,1,76,"PrintScreen",0,n,0,n,n,n],[79,1,77,"ScrollLock",79,"ScrollLock",145,"VK_SCROLL",n,n],[7,1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",n,n],[19,1,79,"Insert",19,"Insert",45,"VK_INSERT",n,n],[14,1,80,"Home",14,"Home",36,"VK_HOME",n,n],[11,1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",n,n],[20,1,82,"Delete",20,"Delete",46,"VK_DELETE",n,n],[13,1,83,"End",13,"End",35,"VK_END",n,n],[12,1,84,"PageDown",12,"PageDown",34,"VK_NEXT",n,n],[17,1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",n],[15,1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",n],[18,1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",n],[16,1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",n],[78,1,89,"NumLock",78,"NumLock",144,"VK_NUMLOCK",n,n],[108,1,90,"NumpadDivide",108,"NumPad_Divide",111,"VK_DIVIDE",n,n],[103,1,91,"NumpadMultiply",103,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[106,1,92,"NumpadSubtract",106,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[104,1,93,"NumpadAdd",104,"NumPad_Add",107,"VK_ADD",n,n],[3,1,94,"NumpadEnter",3,n,0,n,n,n],[94,1,95,"Numpad1",94,"NumPad1",97,"VK_NUMPAD1",n,n],[95,1,96,"Numpad2",95,"NumPad2",98,"VK_NUMPAD2",n,n],[96,1,97,"Numpad3",96,"NumPad3",99,"VK_NUMPAD3",n,n],[97,1,98,"Numpad4",97,"NumPad4",100,"VK_NUMPAD4",n,n],[98,1,99,"Numpad5",98,"NumPad5",101,"VK_NUMPAD5",n,n],[99,1,100,"Numpad6",99,"NumPad6",102,"VK_NUMPAD6",n,n],[100,1,101,"Numpad7",100,"NumPad7",103,"VK_NUMPAD7",n,n],[101,1,102,"Numpad8",101,"NumPad8",104,"VK_NUMPAD8",n,n],[102,1,103,"Numpad9",102,"NumPad9",105,"VK_NUMPAD9",n,n],[93,1,104,"Numpad0",93,"NumPad0",96,"VK_NUMPAD0",n,n],[107,1,105,"NumpadDecimal",107,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[92,0,106,"IntlBackslash",92,"OEM_102",226,"VK_OEM_102",n,n],[58,1,107,"ContextMenu",58,"ContextMenu",93,n,n,n],[0,1,108,"Power",0,n,0,n,n,n],[0,1,109,"NumpadEqual",0,n,0,n,n,n],[71,1,110,"F13",71,"F13",124,"VK_F13",n,n],[72,1,111,"F14",72,"F14",125,"VK_F14",n,n],[73,1,112,"F15",73,"F15",126,"VK_F15",n,n],[74,1,113,"F16",74,"F16",127,"VK_F16",n,n],[75,1,114,"F17",75,"F17",128,"VK_F17",n,n],[76,1,115,"F18",76,"F18",129,"VK_F18",n,n],[77,1,116,"F19",77,"F19",130,"VK_F19",n,n],[0,1,117,"F20",0,n,0,"VK_F20",n,n],[0,1,118,"F21",0,n,0,"VK_F21",n,n],[0,1,119,"F22",0,n,0,"VK_F22",n,n],[0,1,120,"F23",0,n,0,"VK_F23",n,n],[0,1,121,"F24",0,n,0,"VK_F24",n,n],[0,1,122,"Open",0,n,0,n,n,n],[0,1,123,"Help",0,n,0,n,n,n],[0,1,124,"Select",0,n,0,n,n,n],[0,1,125,"Again",0,n,0,n,n,n],[0,1,126,"Undo",0,n,0,n,n,n],[0,1,127,"Cut",0,n,0,n,n,n],[0,1,128,"Copy",0,n,0,n,n,n],[0,1,129,"Paste",0,n,0,n,n,n],[0,1,130,"Find",0,n,0,n,n,n],[0,1,131,"AudioVolumeMute",112,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[0,1,132,"AudioVolumeUp",113,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[0,1,133,"AudioVolumeDown",114,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[105,1,134,"NumpadComma",105,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[110,0,135,"IntlRo",110,"ABNT_C1",193,"VK_ABNT_C1",n,n],[0,1,136,"KanaMode",0,n,0,n,n,n],[0,0,137,"IntlYen",0,n,0,n,n,n],[0,1,138,"Convert",0,n,0,n,n,n],[0,1,139,"NonConvert",0,n,0,n,n,n],[0,1,140,"Lang1",0,n,0,n,n,n],[0,1,141,"Lang2",0,n,0,n,n,n],[0,1,142,"Lang3",0,n,0,n,n,n],[0,1,143,"Lang4",0,n,0,n,n,n],[0,1,144,"Lang5",0,n,0,n,n,n],[0,1,145,"Abort",0,n,0,n,n,n],[0,1,146,"Props",0,n,0,n,n,n],[0,1,147,"NumpadParenLeft",0,n,0,n,n,n],[0,1,148,"NumpadParenRight",0,n,0,n,n,n],[0,1,149,"NumpadBackspace",0,n,0,n,n,n],[0,1,150,"NumpadMemoryStore",0,n,0,n,n,n],[0,1,151,"NumpadMemoryRecall",0,n,0,n,n,n],[0,1,152,"NumpadMemoryClear",0,n,0,n,n,n],[0,1,153,"NumpadMemoryAdd",0,n,0,n,n,n],[0,1,154,"NumpadMemorySubtract",0,n,0,n,n,n],[0,1,155,"NumpadClear",0,n,0,n,n,n],[0,1,156,"NumpadClearEntry",0,n,0,n,n,n],[5,1,0,n,5,"Ctrl",17,"VK_CONTROL",n,n],[4,1,0,n,4,"Shift",16,"VK_SHIFT",n,n],[6,1,0,n,6,"Alt",18,"VK_MENU",n,n],[57,1,0,n,57,"Meta",0,"VK_COMMAND",n,n],[5,1,157,"ControlLeft",5,n,0,"VK_LCONTROL",n,n],[4,1,158,"ShiftLeft",4,n,0,"VK_LSHIFT",n,n],[6,1,159,"AltLeft",6,n,0,"VK_LMENU",n,n],[57,1,160,"MetaLeft",57,n,0,"VK_LWIN",n,n],[5,1,161,"ControlRight",5,n,0,"VK_RCONTROL",n,n],[4,1,162,"ShiftRight",4,n,0,"VK_RSHIFT",n,n],[6,1,163,"AltRight",6,n,0,"VK_RMENU",n,n],[57,1,164,"MetaRight",57,n,0,"VK_RWIN",n,n],[0,1,165,"BrightnessUp",0,n,0,n,n,n],[0,1,166,"BrightnessDown",0,n,0,n,n,n],[0,1,167,"MediaPlay",0,n,0,n,n,n],[0,1,168,"MediaRecord",0,n,0,n,n,n],[0,1,169,"MediaFastForward",0,n,0,n,n,n],[0,1,170,"MediaRewind",0,n,0,n,n,n],[114,1,171,"MediaTrackNext",119,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[115,1,172,"MediaTrackPrevious",120,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[116,1,173,"MediaStop",121,"MediaStop",178,"VK_MEDIA_STOP",n,n],[0,1,174,"Eject",0,n,0,n,n,n],[117,1,175,"MediaPlayPause",122,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[0,1,176,"MediaSelect",123,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[0,1,177,"LaunchMail",124,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[0,1,178,"LaunchApp2",125,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[0,1,179,"LaunchApp1",0,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[0,1,180,"SelectTask",0,n,0,n,n,n],[0,1,181,"LaunchScreenSaver",0,n,0,n,n,n],[0,1,182,"BrowserSearch",115,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[0,1,183,"BrowserHome",116,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[112,1,184,"BrowserBack",117,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[113,1,185,"BrowserForward",118,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[0,1,186,"BrowserStop",0,n,0,"VK_BROWSER_STOP",n,n],[0,1,187,"BrowserRefresh",0,n,0,"VK_BROWSER_REFRESH",n,n],[0,1,188,"BrowserFavorites",0,n,0,"VK_BROWSER_FAVORITES",n,n],[0,1,189,"ZoomToggle",0,n,0,n,n,n],[0,1,190,"MailReply",0,n,0,n,n,n],[0,1,191,"MailForward",0,n,0,n,n,n],[0,1,192,"MailSend",0,n,0,n,n,n],[109,1,0,n,109,"KeyInComposition",229,n,n,n],[111,1,0,n,111,"ABNT_C2",194,"VK_ABNT_C2",n,n],[91,1,0,n,91,"OEM_8",223,"VK_OEM_8",n,n],[0,1,0,n,0,n,0,"VK_CLEAR",n,n],[0,1,0,n,0,n,0,"VK_KANA",n,n],[0,1,0,n,0,n,0,"VK_HANGUL",n,n],[0,1,0,n,0,n,0,"VK_JUNJA",n,n],[0,1,0,n,0,n,0,"VK_FINAL",n,n],[0,1,0,n,0,n,0,"VK_HANJA",n,n],[0,1,0,n,0,n,0,"VK_KANJI",n,n],[0,1,0,n,0,n,0,"VK_CONVERT",n,n],[0,1,0,n,0,n,0,"VK_NONCONVERT",n,n],[0,1,0,n,0,n,0,"VK_ACCEPT",n,n],[0,1,0,n,0,n,0,"VK_MODECHANGE",n,n],[0,1,0,n,0,n,0,"VK_SELECT",n,n],[0,1,0,n,0,n,0,"VK_PRINT",n,n],[0,1,0,n,0,n,0,"VK_EXECUTE",n,n],[0,1,0,n,0,n,0,"VK_SNAPSHOT",n,n],[0,1,0,n,0,n,0,"VK_HELP",n,n],[0,1,0,n,0,n,0,"VK_APPS",n,n],[0,1,0,n,0,n,0,"VK_PROCESSKEY",n,n],[0,1,0,n,0,n,0,"VK_PACKET",n,n],[0,1,0,n,0,n,0,"VK_DBE_SBCSCHAR",n,n],[0,1,0,n,0,n,0,"VK_DBE_DBCSCHAR",n,n],[0,1,0,n,0,n,0,"VK_ATTN",n,n],[0,1,0,n,0,n,0,"VK_CRSEL",n,n],[0,1,0,n,0,n,0,"VK_EXSEL",n,n],[0,1,0,n,0,n,0,"VK_EREOF",n,n],[0,1,0,n,0,n,0,"VK_PLAY",n,n],[0,1,0,n,0,n,0,"VK_ZOOM",n,n],[0,1,0,n,0,n,0,"VK_NONAME",n,n],[0,1,0,n,0,n,0,"VK_PA1",n,n],[0,1,0,n,0,n,0,"VK_OEM_CLEAR",n,n]];let t=[],i=[];for(const s of e){const[r,o,a,l,u,h,c,f,g,m]=s;if(i[a]||(i[a]=!0,ote[l]=a,ate[l.toLowerCase()]=a,o&&(xR[a]=u)),!t[u]){if(t[u]=!0,!h)throw new Error(`String representation missing for key code ${u} around scan code ${l}`);Zw.define(u,h),QI.define(u,g||h),JI.define(u,m||g||h)}c&&(w6[c]=u)}})();var md;(function(n){function e(a){return Zw.keyCodeToStr(a)}n.toString=e;function t(a){return Zw.strToKeyCode(a)}n.fromString=t;function i(a){return QI.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return JI.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function r(a){return QI.strToKeyCode(a)||JI.strToKeyCode(a)}n.fromUserSettings=r;function o(a){if(a>=93&&a<=108)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Zw.keyCodeToStr(a)}n.toElectronAccelerator=o})(md||(md={}));function qn(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}function eN(n,e){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new rS([nk(t,e),nk(i,e)]):new rS([nk(t,e)])}function nk(n,e){const t=!!(n&2048),i=!!(n&256),s=e===2?i:t,r=!!(n&1024),o=!!(n&512),a=e===2?t:i,l=n&255;return new qd(s,r,o,a,l)}class qd{constructor(e,t,i,s,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=s,this.keyCode=r}equals(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toChord(){return new rS([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}}class rS{constructor(e){if(e.length===0)throw yl("parts");this.parts=e}}class lte{constructor(e,t,i,s,r,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=s,this.keyLabel=r,this.keyAriaLabel=o}}class ute{}function hte(n){if(n.charCode){let t=String.fromCharCode(n.charCode).toUpperCase();return md.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(ls){if(e===59)return 80;if(e===107)return 81;if(e===109)return 83;if(pt&&e===224)return 57}else if(kd){if(e===91)return 57;if(pt&&e===93)return 57;if(!pt&&e===92)return 57}return w6[e]||0}const cte=pt?256:2048,dte=512,fte=1024,gte=pt?2048:256;class ci{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.keyCode=hte(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asRuntimeKeybinding=this._computeRuntimeKeybinding()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeybinding(){return this._asRuntimeKeybinding}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=cte),this.altKey&&(t|=dte),this.shiftKey&&(t|=fte),this.metaKey&&(t|=gte),t|=e,t}_computeRuntimeKeybinding(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new qd(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let tN=!1,ng=null;function pte(n){if(!n.parent||n.parent===n)return null;try{let e=n.location,t=n.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return tN=!0,null}catch{return tN=!0,null}return n.parent}class iN{static getSameOriginWindowChain(){if(!ng){ng=[];let e=window,t;do t=pte(e),t?ng.push({window:e,iframeElement:e.frameElement||null}):ng.push({window:e,iframeElement:null}),e=t;while(e)}return ng.slice(0)}static hasDifferentOriginAncestor(){return ng||this.getSameOriginWindowChain(),tN}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0,r=this.getSameOriginWindowChain();for(const o of r){if(i+=o.window.scrollY,s+=o.window.scrollX,o.window===t||!o.iframeElement)break;let a=o.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}}class Kr{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);let t=iN.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class Ip{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){let s=e,r=e;if(typeof s.wheelDeltaY<"u")this.deltaY=s.wheelDeltaY/120;else if(typeof r.VERTICAL_AXIS<"u"&&r.axis===r.VERTICAL_AXIS)this.deltaY=-r.detail/3;else if(e.type==="wheel"){const o=e;o.deltaMode===o.DOM_DELTA_LINE?ls&&!pt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")Fo&&Pn?this.deltaX=-(s.wheelDeltaX/120):this.deltaX=s.wheelDeltaX/120;else if(typeof r.HORIZONTAL_AXIS<"u"&&r.axis===r.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const o=e;o.deltaMode===o.DOM_DELTA_LINE?ls&&!pt?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation()}}const S6=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var ii;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof Yw?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:De.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:S6})})(ii||(ii={}));class Yw{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?S6:(this._emitter||(this._emitter=new H),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class Pa{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Yw),this._token}cancel(){this._token?this._token instanceof Yw&&this._token.cancel():this._token=ii.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof Yw&&this._token.dispose():this._token=ii.None}}var k5=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function mte(n){return!!n&&typeof n.then=="function"}function kr(n){const e=new Pa,t=n(e.token),i=new Promise((s,r)=>{const o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),r(hm())});Promise.resolve(t).then(a=>{o.dispose(),e.dispose(),s(a)},a=>{o.dispose(),e.dispose(),r(a)})});return new class{cancel(){e.cancel()}then(s,r){return i.then(s,r)}catch(s){return this.then(void 0,s)}finally(s){return i.finally(s)}}}function y6(n,e,t){return Promise.race([n,new Promise(i=>e.onCancellationRequested(()=>i(t)))])}class _te{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{this.queuedPromise=null;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(s=>{this.activePromise=null,t(s)},s=>{this.activePromise=null,i(s)})})}}class dm{constructor(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){return this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,s)=>{this.doResolve=i,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const i=this.task;return this.task=null,i()}})),this.timeout=setTimeout(()=>{this.timeout=null,this.doResolve&&this.doResolve(null)},t),this.completionPromise}isTriggered(){return this.timeout!==null}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject&&this.doReject(hm()),this.completionPromise=null)}cancelTimeout(){this.timeout!==null&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancel()}}class vte{constructor(e){this.delayer=new dm(e),this.throttler=new _te}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}dispose(){this.delayer.dispose()}}function $v(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{r.dispose(),t()},n),r=e.onCancellationRequested(()=>{clearTimeout(s),r.dispose(),i(hm())})}):kr(t=>$v(n,t))}function Np(n,e=0){const t=setTimeout(n,e);return Ct(()=>clearTimeout(t))}class Ms{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class ib{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class mi{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner&&this.runner()}}let nN;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?nN=n=>{const e=setTimeout(()=>{const i=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0,clearTimeout(e))}}}:nN=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class q_{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=nN(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}var sN;(function(n){function e(i){return k5(this,void 0,void 0,function*(){let s;const r=yield Promise.all(i.map(o=>o.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return r})}n.settled=e;function t(i){return new Promise((s,r)=>k5(this,void 0,void 0,function*(){try{yield i(s,r)}catch(o){r(o)}}))}n.withAsyncBody=t})(sN||(sN={}));let np;if(typeof oi.vscode<"u"&&typeof oi.vscode.process<"u"){const n=oi.vscode.process;np={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()},nextTick(e){return YI(e)}}}else typeof process<"u"?np={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()},nextTick(n){return process.nextTick(n)}}:np={get platform(){return Pn?"win32":pt?"darwin":"linux"},get arch(){},nextTick(n){return YI(n)},get env(){return{}},cwd(){return"/"}};const rN=np.cwd,bte=np.env,bf=np.platform,Cte=65,wte=97,Ste=90,yte=122,Qh=46,zn=47,cr=92,dh=58,Lte=63;class L6 extends Error{constructor(e,t,i){let s;typeof t=="string"&&t.indexOf("not ")===0?(s="must not be",t=t.replace(/^not /,"")):s="must be";const r=e.indexOf(".")!==-1?"property":"argument";let o=`The "${e}" ${r} ${s} of type ${t}`;o+=`. Received type ${typeof i}`,super(o),this.code="ERR_INVALID_ARG_TYPE"}}function en(n,e){if(typeof n!="string")throw new L6(e,"string",n)}function yt(n){return n===zn||n===cr}function oN(n){return n===zn}function fh(n){return n>=Cte&&n<=Ste||n>=wte&&n<=yte}function oS(n,e,t,i){let s="",r=0,o=-1,a=0,l=0;for(let u=0;u<=n.length;++u){if(u2){const h=s.lastIndexOf(t);h===-1?(s="",r=0):(s=s.slice(0,h),r=s.length-1-s.lastIndexOf(t)),o=u,a=0;continue}else if(s.length!==0){s="",r=0,o=u,a=0;continue}}e&&(s+=s.length>0?`${t}..`:"..",r=2)}else s.length>0?s+=`${t}${n.slice(o+1,u)}`:s=n.slice(o+1,u),r=u-o-1;o=u,a=0}else l===Qh&&a!==-1?++a:a=-1}return s}function D6(n,e){if(e===null||typeof e!="object")throw new L6("pathObject","Object",e);const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const js={resolve(...n){let e="",t="",i=!1;for(let s=n.length-1;s>=-1;s--){let r;if(s>=0){if(r=n[s],en(r,"path"),r.length===0)continue}else e.length===0?r=rN():(r=bte[`=${e}`]||rN(),(r===void 0||r.slice(0,2).toLowerCase()!==e.toLowerCase()&&r.charCodeAt(2)===cr)&&(r=`${e}\\`));const o=r.length;let a=0,l="",u=!1;const h=r.charCodeAt(0);if(o===1)yt(h)&&(a=1,u=!0);else if(yt(h))if(u=!0,yt(r.charCodeAt(1))){let c=2,f=c;for(;c2&&yt(r.charCodeAt(2))&&(u=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${r.slice(a)}\\${t}`,i=u,u&&e.length>0)break}return t=oS(t,!i,"\\",yt),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){en(n,"path");const e=n.length;if(e===0)return".";let t=0,i,s=!1;const r=n.charCodeAt(0);if(e===1)return oN(r)?"\\":n;if(yt(r))if(s=!0,yt(n.charCodeAt(1))){let a=2,l=a;for(;a2&&yt(n.charCodeAt(2))&&(s=!0,t=3));let o=t0&&yt(n.charCodeAt(e-1))&&(o+="\\"),i===void 0?s?`\\${o}`:o:s?`${i}\\${o}`:`${i}${o}`},isAbsolute(n){en(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return yt(t)||e>2&&fh(t)&&n.charCodeAt(1)===dh&&yt(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let r=0;r0&&(e===void 0?e=t=o:e+=`\\${o}`)}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&yt(t.charCodeAt(0))){++s;const r=t.length;r>1&&yt(t.charCodeAt(1))&&(++s,r>2&&(yt(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(e=`\\${e.slice(s)}`)}return js.normalize(e)},relative(n,e){if(en(n,"from"),en(e,"to"),n===e)return"";const t=js.resolve(n),i=js.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;ss&&n.charCodeAt(r-1)===cr;)r--;const o=r-s;let a=0;for(;aa&&e.charCodeAt(l-1)===cr;)l--;const u=l-a,h=oh){if(e.charCodeAt(a+f)===cr)return i.slice(a+f+1);if(f===2)return i.slice(a+f)}o>h&&(n.charCodeAt(s+f)===cr?c=f:f===2&&(c=3)),c===-1&&(c=0)}let g="";for(f=s+c+1;f<=r;++f)(f===r||n.charCodeAt(f)===cr)&&(g+=g.length===0?"..":"\\..");return a+=c,g.length>0?`${g}${i.slice(a,l)}`:(i.charCodeAt(a)===cr&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string")return n;if(n.length===0)return"";const e=js.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===cr){if(e.charCodeAt(1)===cr){const t=e.charCodeAt(2);if(t!==Lte&&t!==Qh)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(fh(e.charCodeAt(0))&&e.charCodeAt(1)===dh&&e.charCodeAt(2)===cr)return`\\\\?\\${e}`;return n},dirname(n){en(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return yt(s)?n:".";if(yt(s)){if(t=i=1,yt(n.charCodeAt(1))){let a=2,l=a;for(;a2&&yt(n.charCodeAt(2))?3:2,i=t);let r=-1,o=!0;for(let a=e-1;a>=i;--a)if(yt(n.charCodeAt(a))){if(!o){r=a;break}}else o=!1;if(r===-1){if(t===-1)return".";r=t}return n.slice(0,r)},basename(n,e){e!==void 0&&en(e,"ext"),en(n,"path");let t=0,i=-1,s=!0,r;if(n.length>=2&&fh(n.charCodeAt(0))&&n.charCodeAt(1)===dh&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let o=e.length-1,a=-1;for(r=n.length-1;r>=t;--r){const l=n.charCodeAt(r);if(yt(l)){if(!s){t=r+1;break}}else a===-1&&(s=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(r=n.length-1;r>=t;--r)if(yt(n.charCodeAt(r))){if(!s){t=r+1;break}}else i===-1&&(s=!1,i=r+1);return i===-1?"":n.slice(t,i)},extname(n){en(n,"path");let e=0,t=-1,i=0,s=-1,r=!0,o=0;n.length>=2&&n.charCodeAt(1)===dh&&fh(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(yt(l)){if(!r){i=a+1;break}continue}s===-1&&(r=!1,s=a+1),l===Qh?t===-1?t=a:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||s===-1||o===0||o===1&&t===s-1&&t===i+1?"":n.slice(t,s)},format:D6.bind(null,"\\"),parse(n){en(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,s=n.charCodeAt(0);if(t===1)return yt(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(yt(s)){if(i=1,yt(n.charCodeAt(1))){let c=2,f=c;for(;c0&&(e.root=n.slice(0,i));let r=-1,o=i,a=-1,l=!0,u=n.length-1,h=0;for(;u>=i;--u){if(s=n.charCodeAt(u),yt(s)){if(!l){o=u+1;break}continue}a===-1&&(l=!1,a=u+1),s===Qh?r===-1?r=u:h!==1&&(h=1):r!==-1&&(h=-1)}return a!==-1&&(r===-1||h===0||h===1&&r===a-1&&r===o+1?e.base=e.name=n.slice(o,a):(e.name=n.slice(o,r),e.base=n.slice(o,a),e.ext=n.slice(r,a))),o>0&&o!==i?e.dir=n.slice(0,o-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},ji={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:rN();en(s,"path"),s.length!==0&&(e=`${s}/${e}`,t=s.charCodeAt(0)===zn)}return e=oS(e,!t,"/",oN),t?`/${e}`:e.length>0?e:"."},normalize(n){if(en(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===zn,t=n.charCodeAt(n.length-1)===zn;return n=oS(n,!e,"/",oN),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return en(n,"path"),n.length>0&&n.charCodeAt(0)===zn},join(...n){if(n.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":ji.normalize(e)},relative(n,e){if(en(n,"from"),en(e,"to"),n===e||(n=ji.resolve(n),e=ji.resolve(e),n===e))return"";const t=1,i=n.length,s=i-t,r=1,o=e.length-r,a=sa){if(e.charCodeAt(r+u)===zn)return e.slice(r+u+1);if(u===0)return e.slice(r+u)}else s>a&&(n.charCodeAt(t+u)===zn?l=u:u===0&&(l=0));let h="";for(u=t+l+1;u<=i;++u)(u===i||n.charCodeAt(u)===zn)&&(h+=h.length===0?"..":"/..");return`${h}${e.slice(r+l)}`},toNamespacedPath(n){return n},dirname(n){if(en(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===zn;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===zn){if(!i){t=s;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&en(e,"ext"),en(n,"path");let t=0,i=-1,s=!0,r;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let o=e.length-1,a=-1;for(r=n.length-1;r>=0;--r){const l=n.charCodeAt(r);if(l===zn){if(!s){t=r+1;break}}else a===-1&&(s=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(r=n.length-1;r>=0;--r)if(n.charCodeAt(r)===zn){if(!s){t=r+1;break}}else i===-1&&(s=!1,i=r+1);return i===-1?"":n.slice(t,i)},extname(n){en(n,"path");let e=-1,t=0,i=-1,s=!0,r=0;for(let o=n.length-1;o>=0;--o){const a=n.charCodeAt(o);if(a===zn){if(!s){t=o+1;break}continue}i===-1&&(s=!1,i=o+1),a===Qh?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||i===-1||r===0||r===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:D6.bind(null,"/"),parse(n){en(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===zn;let i;t?(e.root="/",i=1):i=0;let s=-1,r=0,o=-1,a=!0,l=n.length-1,u=0;for(;l>=i;--l){const h=n.charCodeAt(l);if(h===zn){if(!a){r=l+1;break}continue}o===-1&&(a=!1,o=l+1),h===Qh?s===-1?s=l:u!==1&&(u=1):s!==-1&&(u=-1)}if(o!==-1){const h=r===0&&t?1:r;s===-1||u===0||u===1&&s===o-1&&s===r+1?e.base=e.name=n.slice(h,o):(e.name=n.slice(h,s),e.base=n.slice(h,o),e.ext=n.slice(s,o))}return r>0?e.dir=n.slice(0,r-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};ji.win32=js.win32=js;ji.posix=js.posix=ji;const kR=bf==="win32"?js.normalize:ji.normalize,Dte=bf==="win32"?js.resolve:ji.resolve,xte=bf==="win32"?js.relative:ji.relative,x6=bf==="win32"?js.dirname:ji.dirname,Ed=bf==="win32"?js.basename:ji.basename,kte=bf==="win32"?js.extname:ji.extname,Xw=bf==="win32"?js.sep:ji.sep,Ete=/^\w[\w\d+.-]*$/,Ite=/^\//,Nte=/^\/\//;function E5(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!Ete.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!Ite.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Nte.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function Tte(n,e){return!n&&!e?"file":n}function Ate(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==fa&&(e=fa+e):e=fa;break}return e}const vi="",fa="/",Mte=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class $e{constructor(e,t,i,s,r,o=!1){typeof e=="object"?(this.scheme=e.scheme||vi,this.authority=e.authority||vi,this.path=e.path||vi,this.query=e.query||vi,this.fragment=e.fragment||vi):(this.scheme=Tte(e,o),this.authority=t||vi,this.path=Ate(this.scheme,i||vi),this.query=s||vi,this.fragment=r||vi,E5(this,o))}static isUri(e){return e instanceof $e?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}get fsPath(){return aS(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:s,query:r,fragment:o}=e;return t===void 0?t=this.scheme:t===null&&(t=vi),i===void 0?i=this.authority:i===null&&(i=vi),s===void 0?s=this.path:s===null&&(s=vi),r===void 0?r=this.query:r===null&&(r=vi),o===void 0?o=this.fragment:o===null&&(o=vi),t===this.scheme&&i===this.authority&&s===this.path&&r===this.query&&o===this.fragment?this:new sg(t,i,s,r,o)}static parse(e,t=!1){const i=Mte.exec(e);return i?new sg(i[2]||vi,MC(i[4]||vi),MC(i[5]||vi),MC(i[7]||vi),MC(i[9]||vi),t):new sg(vi,vi,vi,vi,vi)}static file(e){let t=vi;if(Pn&&(e=e.replace(/\\/g,fa)),e[0]===fa&&e[1]===fa){const i=e.indexOf(fa,2);i===-1?(t=e.substring(2),e=fa):(t=e.substring(2,i),e=e.substring(i)||fa)}return new sg("file",t,e,vi,vi)}static from(e){const t=new sg(e.scheme,e.authority,e.path,e.query,e.fragment);return E5(t,!0),t}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Pn&&e.scheme==="file"?i=$e.file(js.join(aS(e,!0),...t)).path:i=ji.join(e.path,...t),e.with({path:i})}toString(e=!1){return aN(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof $e)return e;{const t=new sg(e);return t._formatted=e.external,t._fsPath=e._sep===k6?e.fsPath:null,t}}else return e}}const k6=Pn?1:void 0;class sg extends $e{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=aS(this,!1)),this._fsPath}toString(e=!1){return e?aN(this,!0):(this._formatted||(this._formatted=aN(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=k6),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const E6={[58]:"%3A",[47]:"%2F",[63]:"%3F",[35]:"%23",[91]:"%5B",[93]:"%5D",[64]:"%40",[33]:"%21",[36]:"%24",[38]:"%26",[39]:"%27",[40]:"%28",[41]:"%29",[42]:"%2A",[43]:"%2B",[44]:"%2C",[59]:"%3B",[61]:"%3D",[32]:"%20"};function I5(n,e){let t,i=-1;for(let s=0;s=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===46||r===95||r===126||e&&r===47)i!==-1&&(t+=encodeURIComponent(n.substring(i,s)),i=-1),t!==void 0&&(t+=n.charAt(s));else{t===void 0&&(t=n.substr(0,s));const o=E6[r];o!==void 0?(i!==-1&&(t+=encodeURIComponent(n.substring(i,s)),i=-1),t+=o):i===-1&&(i=s)}}return i!==-1&&(t+=encodeURIComponent(n.substring(i))),t!==void 0?t:n}function Rte(n){let e;for(let t=0;t1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,Pn&&(t=t.replace(/\//g,"\\")),t}function aN(n,e){const t=e?Rte:I5;let i="",{scheme:s,authority:r,path:o,query:a,fragment:l}=n;if(s&&(i+=s,i+=":"),(r||s==="file")&&(i+=fa,i+=fa),r){let u=r.indexOf("@");if(u!==-1){const h=r.substr(0,u);r=r.substr(u+1),u=h.indexOf(":"),u===-1?i+=t(h,!1):(i+=t(h.substr(0,u),!1),i+=":",i+=t(h.substr(u+1),!1)),i+="@"}r=r.toLowerCase(),u=r.indexOf(":"),u===-1?i+=t(r,!1):(i+=t(r.substr(0,u),!1),i+=r.substr(u))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){const u=o.charCodeAt(1);u>=65&&u<=90&&(o=`/${String.fromCharCode(u+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){const u=o.charCodeAt(0);u>=65&&u<=90&&(o=`${String.fromCharCode(u+32)}:${o.substr(2)}`)}i+=t(o,!0)}return a&&(i+="?",i+=t(a,!1)),l&&(i+="#",i+=e?l:I5(l,!1)),i}function I6(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+I6(n.substr(3)):n}}const N5=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function MC(n){return n.match(N5)?n.replace(N5,e=>I6(e)):n}var lt;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.userData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebook="vscode-notebook",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractive="vscode-interactive",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp"})(lt||(lt={}));class Ote{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)return this._delegate(e);const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&(i=`[${i}]`);const s=this._ports[t],r=this._connectionTokens[t];let o=`path=${encodeURIComponent(e.path)}`;return typeof r=="string"&&(o+=`&tkn=${encodeURIComponent(r)}`),$e.from({scheme:cm?this._preferredWebSchema:lt.vscodeRemoteResource,authority:`${i}:${s}`,path:"/vscode-remote-resource",query:o})}}const N6=new Ote;class Kv{asBrowserUri(e,t){const i=this.toUri(e,t);return i.scheme===lt.vscodeRemote?N6.rewrite(i):i.scheme===lt.file&&(wa||typeof oi.importScripts=="function"&&oi.origin===`${lt.vscodeFileResource}://${Kv.FALLBACK_AUTHORITY}`)?i.with({scheme:lt.vscodeFileResource,authority:i.authority||Kv.FALLBACK_AUTHORITY,query:null,fragment:null}):i}toUri(e,t){return $e.isUri(e)?e:$e.parse(t.toUrl(e))}}Kv.FALLBACK_AUTHORITY="vscode-app";const T6=new Kv;function On(n){for(;n.firstChild;)n.firstChild.remove()}function ER(n){var e;return(e=n?.isConnected)!==null&&e!==void 0?e:!1}class Pte{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){!this._handler||(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function ne(n,e,t,i){return new Pte(n,e,t,i)}function A6(n){return function(e){return n(new Kr(e))}}function Fte(n){return function(e){return n(new ci(e))}}let qi=function(e,t,i,s){let r=i;return t==="click"||t==="mousedown"?r=A6(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=Fte(i)),ne(e,t,r,s)},Bte=function(e,t,i){let s=A6(t);return IR(e,s,i)};function IR(n,e,t){return ne(n,Nl&&Ky.pointerEvents?xe.POINTER_DOWN:xe.MOUSE_DOWN,e,t)}function M6(n,e,t){return ne(n,Nl&&Ky.pointerEvents?xe.POINTER_UP:xe.MOUSE_UP,e,t)}function NR(n,e){return ne(n,"mouseout",t=>{let i=t.relatedTarget;for(;i&&i!==n;)i=i.parentNode;i!==n&&e(t)})}function Wte(n,e){return ne(n,"pointerout",t=>{let i=t.relatedTarget;for(;i&&i!==n;)i=i.parentNode;i!==n&&e(t)})}let sk=null;function Vte(n){if(!sk){const e=t=>setTimeout(()=>t(new Date().getTime()),0);sk=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}return sk.call(self,n)}let R6,Tl;class rk{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Qe(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let n=[],e=null,t=!1,i=!1,s=()=>{for(t=!1,e=n,n=[],i=!0;e.length>0;)e.sort(rk.sort),e.shift().execute();i=!1};Tl=(r,o=0)=>{let a=new rk(r,o);return n.push(a),t||(t=!0,Vte(s)),a},R6=(r,o)=>{if(i){let a=new rk(r,o);return e.push(a),a}else return Tl(r,o)}})();const Hte=8,zte=function(n,e){return e};class Ute extends ie{constructor(e,t,i,s=zte,r=Hte){super();let o=null,a=0,l=this._register(new Ms),u=()=>{a=new Date().getTime(),i(o),o=null};this._register(ne(e,t,h=>{o=s(o,h);let c=new Date().getTime()-a;c>=r?(l.cancel(),u()):l.setIfNotSet(u,r-c)}))}}function TR(n,e,t,i,s){return new Ute(n,e,t,i,s)}function AR(n){return document.defaultView.getComputedStyle(n,null)}function jy(n){if(n!==document.body)return new Kt(n.clientWidth,n.clientHeight);if(Nl&&window.visualViewport)return new Kt(window.visualViewport.width,window.visualViewport.height);if(window.innerWidth&&window.innerHeight)return new Kt(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new Kt(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new Kt(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class pi{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let s=AR(e),r="0";return s&&(s.getPropertyValue?r=s.getPropertyValue(t):r=s.getAttribute(i)),pi.convertToPixels(e,r)}static getBorderLeftWidth(e){return pi.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return pi.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return pi.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return pi.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return pi.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return pi.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return pi.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return pi.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return pi.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return pi.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return pi.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return pi.getDimension(e,"margin-bottom","marginBottom")}}class Kt{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Kt(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Kt?e:new Kt(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}function O6(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==document.body&&n!==document.documentElement;){t-=n.scrollTop;const s=F6(n)?null:AR(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=pi.getBorderLeftWidth(n),t+=pi.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function $te(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function bn(n){let e=n.getBoundingClientRect();return{left:e.left+Bu.scrollX,top:e.top+Bu.scrollY,width:e.width,height:e.height}}const Bu=new class{get scrollX(){return typeof window.scrollX=="number"?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft}get scrollY(){return typeof window.scrollY=="number"?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop}};function So(n){let e=pi.getMarginLeft(n)+pi.getMarginRight(n);return n.offsetWidth+e}function ok(n){let e=pi.getBorderLeftWidth(n)+pi.getBorderRightWidth(n),t=pi.getPaddingLeft(n)+pi.getPaddingRight(n);return n.offsetWidth-e-t}function Kte(n){let e=pi.getBorderTopWidth(n)+pi.getBorderBottomWidth(n),t=pi.getPaddingTop(n)+pi.getPaddingBottom(n);return n.offsetHeight-e-t}function lN(n){let e=pi.getMarginTop(n)+pi.getMarginBottom(n);return n.offsetHeight+e}function Ll(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function P6(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function T5(n,e,t){return!!P6(n,e,t)}function F6(n){return n&&!!n.host&&!!n.mode}function MR(n){return!!Cf(n)}function Cf(n){for(;n.parentNode;){if(n===document.body)return null;n=n.parentNode}return F6(n)?n:null}function sp(){let n=document.activeElement;for(;n?.shadowRoot;)n=n.shadowRoot.activeElement;return n}function Qr(n=document.getElementsByTagName("head")[0]){let e=document.createElement("style");return e.type="text/css",e.media="screen",n.appendChild(e),e}let ak=null;function B6(){return ak||(ak=Qr()),ak}function jte(n){var e,t;return!((e=n?.sheet)===null||e===void 0)&&e.rules?n.sheet.rules:!((t=n?.sheet)===null||t===void 0)&&t.cssRules?n.sheet.cssRules:[]}function uN(n,e,t=B6()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function lS(n,e=B6()){if(!e)return;let t=jte(e),i=[];for(let s=0;s=0;s--)e.sheet.deleteRule(i[s])}function W6(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const xe={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",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:kd?"webkitAnimationStart":"animationstart",ANIMATION_END:kd?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:kd?"webkitAnimationIteration":"animationiteration"},Rt={stop:function(n,e){n.preventDefault?n.preventDefault():n.returnValue=!1,e&&(n.stopPropagation?n.stopPropagation():n.cancelBubble=!0)}};function Gte(n){let e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function qte(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class Zte extends ie{constructor(e){super(),this._onDidFocus=this._register(new H),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new H),this.onDidBlur=this._onDidBlur.event;let t=Ll(document.activeElement,e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{Ll(document.activeElement,e)!==t&&(t?r():s())},this._register(ne(e,xe.FOCUS,s,!0)),this._register(ne(e,xe.BLUR,r,!0))}}function Tp(n){return new Zte(n)}function le(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function Yte(n,e){return n.insertBefore(e,n.firstChild),e}function nb(n,...e){n.innerText="",le(n,...e)}const Xte=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var jv;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(jv||(jv={}));function V6(n,e,t,...i){let s=Xte.exec(e);if(!s)throw new Error("Bad use of emmet");t=Object.assign({},t||{});let r=s[1]||"div",o;return n!==jv.HTML?o=document.createElementNS(n,r):o=document.createElement(r),s[3]&&(o.id=s[3]),s[4]&&(o.className=s[4].replace(/\./g," ").trim()),Object.keys(t).forEach(a=>{const l=t[a];typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...i),o}function ge(n,e,...t){return V6(jv.HTML,n,e,...t)}ge.SVG=function(n,e,...t){return V6(jv.SVG,n,e,...t)};function fr(...n){for(let e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Ds(...n){for(let e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function Qte(n){return Array.prototype.slice.call(document.getElementsByTagName(n),0)}function A5(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function H6(n){window.open(n,"_blank","noopener")}function Jte(n){const e=()=>{n(),t=Tl(e)};let t=Tl(e);return Ct(()=>t.dispose())}N6.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function Gu(n){return n?`url('${T6.asBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function M5(n){return`'${n.replace(/'/g,"%27")}'`}class _d extends H{constructor(){super(),this._subscriptions=new pe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(ne(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new ci(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(ne(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(ne(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ne(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(ne(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(ne(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return _d.instance||(_d.instance=new _d),_d.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}function eie(n,e){const t=window.matchMedia(n);typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)}const R5=2e4;let td,Qw,hN,Jw,cN;function tie(n){td=document.createElement("div"),td.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),td.appendChild(i),i};Qw=e(),hN=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("role","complementary"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),td.appendChild(i),i};Jw=t(),cN=t(),n.appendChild(td)}function wf(n){!td||(Qw.textContent!==n?(On(hN),hS(Qw,n)):(On(Qw),hS(hN,n)))}function uS(n){!td||(pt?wf(n):Jw.textContent!==n?(On(cN),hS(Jw,n)):(On(Jw),hS(cN,n)))}function hS(n,e){On(n),e.length>R5&&(e=e.substr(0,R5)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}var ma;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(ma||(ma={}));const jt=wt("instantiationService");function z6(n,e,t,i){e[ma.DI_TARGET]===e?e[ma.DI_DEPENDENCIES].push({id:n,index:t,optional:i}):(e[ma.DI_DEPENDENCIES]=[{id:n,index:t,optional:i}],e[ma.DI_TARGET]=e)}function wt(n){if(ma.serviceIds.has(n))return ma.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");z6(e,t,s,!1)};return e.toString=()=>n,ma.serviceIds.set(n,e),e}function iie(n){return function(e,t,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");z6(n,e,i,!0)}}const ei=wt("codeEditorService");class G{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new G(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return G.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return G.isBefore(this,e)}static isBefore(e,t){return e.lineNumber` ${t} `).trim():""}class ve{constructor(e,t,i){this.id=e,this.definition=t,this.description=i,U6.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var Ks;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(r){if(r instanceof ve)return["codicon","codicon-"+r.id];const o=e.exec(r.id);if(!o)return t(ve.error);let[,a,l]=o;const u=["codicon","codicon-"+a];return l&&u.push("codicon-modifier-"+l.substr(1)),u}n.asClassNameArray=t;function i(r){return t(r).join(" ")}n.asClassName=i;function s(r){return"."+t(r).join(".")}n.asCSSSelector=s})(Ks||(Ks={}));(function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})})(ve||(ve={}));const mn=wt("commandService"),Ft=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new H,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.description){const o=[];for(let l of n.description.args)o.push(l.constraint);const a=n.handler;n.handler=function(l,...u){return tte(u,o),a(l,...u)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new _r,this._commands.set(t,i));let s=i.unshift(n),r=Ct(()=>{s();const o=this._commands.get(t);o?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(n,e){return Ft.registerCommand(n,(t,...i)=>t.get(mn).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return gt.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};Ft.registerCommand("noop",()=>{});function $6(n){return!n||typeof n!="string"?!0:n.trim().length===0}const oie=/{(\d+)}/g;function Eo(n,...e){return e.length===0?n:n.replace(oie,function(t,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function RR(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Na(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function K6(n,e){if(!n||!e)return n;const t=e.length;if(t===0||n.length===0)return n;let i=0;for(;n.indexOf(e,i)===i;)i=i+t;return n.substring(i)}function aie(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let s=i,r=-1;for(;r=n.lastIndexOf(e,s-1),!(r===-1||r+t!==s);){if(r===0)return"";s=r}return n.substring(0,s)}function lie(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function j6(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=Na(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(n,i)}function uie(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function lk(n){return(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")}function Ml(n){return n.split(/\r\n|\r|\n/)}function us(n){for(let e=0,t=n.length;e=0;t--){const i=n.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function Gv(n,e){return ne?1:0}function OR(n,e,t=0,i=n.length,s=0,r=e.length){for(;tu)return 1}const o=i-t,a=r-s;return oa?1:0}function dN(n,e){return sb(n,e,0,n.length,0,e.length)}function sb(n,e,t=0,i=n.length,s=0,r=e.length){for(;t=128||u>=128)return OR(n.toLowerCase(),e.toLowerCase(),t,i,s,r);Wg(l)&&(l-=32),Wg(u)&&(u-=32);const h=l-u;if(h!==0)return h}const o=i-t,a=r-s;return oa?1:0}function Wg(n){return n>=97&&n<=122}function Dh(n){return n>=65&&n<=90}function k_(n,e){return n.length===e.length&&sb(n,e)===0}function PR(n,e){const t=e.length;return e.length>n.length?!1:sb(n,e,0,t)===0}function qv(n,e){let t,i=Math.min(n.length,e.length);for(t=0;t1){const i=n.charCodeAt(e-2);if(fn(i))return FR(i,t)}return t}function fS(n,e){const t=Mu.getInstance(),i=e,s=n.length,r=Cu(n,s,e);e+=r>=65536?2:1;let o=t.getGraphemeBreakType(r);for(;e=65536?2:1,o=l}return e-i}function hie(n,e){const t=Mu.getInstance(),i=e,s=rp(n,e);e-=s>=65536?2:1;let r=t.getGraphemeBreakType(s);for(;e>0;){const o=rp(n,e),a=t.getGraphemeBreakType(o);if(Y_(a,r))break;e-=o>=65536?2:1,r=a}return i-e}const cie=/(?:[\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 Zy(n){return cie.test(n)}const die=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function fie(n){return die.test(n)}const gie=/^[\t\n\r\x20-\x7E]*$/;function BR(n){return gie.test(n)}const G6=/[\u2028\u2029]/;function q6(n){return G6.test(n)}function pie(n){for(let e=0,t=n.length;e=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function Z_(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129003||n>=129280&&n<=129535||n>=129648&&n<=129750}const mie=String.fromCharCode(65279);function WR(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function _ie(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function Z6(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function rg(n){return Mu.getInstance().getGraphemeBreakType(n)}function Y_(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}class Mu{constructor(){this._data=vie()}static getInstance(){return Mu._INSTANCE||(Mu._INSTANCE=new Mu),Mu._INSTANCE}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let s=1;for(;s<=i;)if(et[3*s+1])s=2*s+1;else return t[3*s+2];return 0}}Mu._INSTANCE=null;function vie(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function bie(n,e){if(n===0)return 0;const t=Cie(n,e);if(t!==void 0)return t;const i=rp(e,n);return n-=e1(i),n}function Cie(n,e){let t=rp(e,n);for(n-=e1(t);wie(t)||t===65039||t===8419;){if(n===0)return;t=rp(e,n),n-=e1(t)}if(!!Z_(t)){if(n>=0){const i=rp(e,n);i===8205&&(n-=e1(i))}return n}}function e1(n){return n>=65536?2:1}function wie(n){return 127995<=n&&n<=127999}let Yy=qee||"";const Fn=new Map;Fn.set("false",!1);Fn.set("true",!0);Fn.set("isMac",pt);Fn.set("isLinux",Ns);Fn.set("isWindows",Pn);Fn.set("isWeb",cm);Fn.set("isMacNative",pt&&!cm);Fn.set("isEdge",Yy.indexOf("Edg/")>=0);Fn.set("isFirefox",Yy.indexOf("Firefox")>=0);Fn.set("isChrome",Yy.indexOf("Chrome")>=0);Fn.set("isSafari",Yy.indexOf("Safari")>=0);const Sie=Object.prototype.hasOwnProperty;class ye{static has(e){return uc.create(e)}static equals(e,t){return Rp.create(e,t)}static regex(e,t){return gS.create(e,t)}static not(e){return Zd.create(e)}static and(...e){return Fh.create(e,null)}static or(...e){return Ru.create(e,null,!0)}static deserialize(e,t=!1){if(!!e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return Ru.create(i.map(s=>this._deserializeAndExpression(s,t)),null,!0)}static _deserializeAndExpression(e,t){let i=e.split("&&");return Fh.create(i.map(s=>this._deserializeOne(s,t)),null)}static _deserializeOne(e,t){if(e=e.trim(),e.indexOf("!=")>=0){let i=e.split("!=");return Xy.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return Rp.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return gS.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let i=e.split(" in ");return VR.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const i=e.split(">=");return eL.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const i=e.split(">");return Jy.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const i=e.split("<=");return iL.create(i[0].trim(),i[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const i=e.split("<");return tL.create(i[0].trim(),i[1].trim())}return/^\!\s*/.test(e)?Zd.create(e.substr(1).trim()):uc.create(e)}static _deserializeValue(e,t){if(e=e.trim(),e==="true")return!0;if(e==="false")return!1;let i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if($6(e)){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let i=e.indexOf("/"),s=e.lastIndexOf("/");if(i===s||i<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let r=e.slice(i+1,s),o=e[s+1]==="i"?"i":"";try{return new RegExp(r,o)}catch(a){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${a}`);return console.warn(`bad regexp-value '${e}', parse error: ${a}`),null}}}function yie(n,e){const t=n?n.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function op(n,e){return n.cmp(e)}class yr{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Jr.INSTANCE}}yr.INSTANCE=new yr;class Jr{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return yr.INSTANCE}}Jr.INSTANCE=new Jr;class uc{constructor(e,t){this.key=e,this.negated=t,this.type=2}static create(e,t=null){const i=Fn.get(e);return typeof i=="boolean"?i?Jr.INSTANCE:yr.INSTANCE:new uc(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:X6(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Fn.get(this.key);return typeof e=="boolean"?e?Jr.INSTANCE:yr.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Zd.create(this.key,this)),this.negated}}class Rp{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}static create(e,t,i=null){if(typeof t=="boolean")return t?uc.create(e,i):Zd.create(e,i);const s=Fn.get(e);return typeof s=="boolean"?t===(s?"true":"false")?Jr.INSTANCE:yr.INSTANCE:new Rp(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Sf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Fn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Jr.INSTANCE:yr.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Xy.create(this.key,this.value,this)),this.negated}}class VR{constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}static create(e,t){return new VR(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:Sf(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.indexOf(i)>=0:typeof i=="string"&&typeof t=="object"&&t!==null?Sie.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=HR.create(this)),this.negated}}class HR{constructor(e){this._actual=e,this.type=11}static create(e){return new HR(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class Xy{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}static create(e,t,i=null){if(typeof t=="boolean")return t?Zd.create(e,i):uc.create(e,i);const s=Fn.get(e);return typeof s=="boolean"?t===(s?"true":"false")?yr.INSTANCE:Jr.INSTANCE:new Xy(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Sf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Fn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?yr.INSTANCE:Jr.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Rp.create(this.key,this.value,this)),this.negated}}class Zd{constructor(e,t){this.key=e,this.negated=t,this.type=3}static create(e,t=null){const i=Fn.get(e);return typeof i=="boolean"?i?yr.INSTANCE:Jr.INSTANCE:new Zd(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:X6(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Fn.get(this.key);return typeof e=="boolean"?e?yr.INSTANCE:Jr.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=uc.create(this.key,this)),this.negated}}function Qy(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):yr.INSTANCE}class Jy{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}static create(e,t,i=null){return Qy(t,s=>new Jy(e,s,i))}cmp(e){return e.type!==this.type?this.type-e.type:Sf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=iL.create(this.key,this.value,this)),this.negated}}class eL{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}static create(e,t,i=null){return Qy(t,s=>new eL(e,s,i))}cmp(e){return e.type!==this.type?this.type-e.type:Sf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=tL.create(this.key,this.value,this)),this.negated}}class tL{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}static create(e,t,i=null){return Qy(t,s=>new tL(e,s,i))}cmp(e){return e.type!==this.type?this.type-e.type:Sf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new iL(e,s,i))}cmp(e){return e.type!==this.type?this.type-e.type:Sf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Jy.create(this.key,this.value,this)),this.negated}}class gS{constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}static create(e,t){return new gS(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=zR.create(this)),this.negated}}class zR{constructor(e){this._actual=e,this.type=8}static create(e){return new zR(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function Y6(n){let e=null;for(let t=0,i=n.length;te.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const r=i[i.length-1];if(r.type!==9)break;i.pop();const o=i.pop(),a=i.length===0,l=Ru.create(r.expr.map(u=>Fh.create([u,o],null)),null,a);l&&(i.push(l),i.sort(op))}return i.length===1?i[0]:new Fh(i,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(let t of this.expr)e.push(t.negate());this.negated=Ru.create(e,this,!0)}return this.negated}}class Ru{constructor(e,t){this.expr=e,this.negated=t,this.type=9}static create(e,t,i){return Ru._normalizeArr(e,t,i)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),s=[];for(const o of pS(t))for(const a of pS(i))s.push(Fh.create([o,a],null));const r=e.length===0;e.unshift(Ru.create(s,null,r))}this.negated=e[0]}return this.negated}}class Le extends uc{constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?Le._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&Le._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}static all(){return Le._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Rp.create(this.key,e)}}Le._info=[];const je=wt("contextKeyService"),Lie="setContext";function X6(n,e){return ne?1:0}function Sf(n,e,t,i){return nt?1:ei?1:0}function Q6(n,e){if(e.type===6&&n.type!==9&&n.type!==6){for(const s of e.expr)if(n.equals(s))return!0}const t=n.negate(),i=pS(t).concat(pS(e));i.sort(op);for(let s=0;s"u"||gN.isThemeColor(a.color))}n.isThemeIcon=e;const t=new RegExp(`^\\$\\((${Ks.iconNameExpression}(?:${Ks.iconModifierExpression})?)\\)$`);function i(a){const l=t.exec(a);if(!l)return;let[,u]=l;return{id:u}}n.fromString=i;function s(a,l){let u=a.id;const h=u.lastIndexOf("~");return h!==-1&&(u=u.substring(0,h)),l&&(u=`${u}~${l}`),{id:u}}n.modify=s;function r(a,l){var u,h;return a.id===l.id&&((u=a.color)===null||u===void 0?void 0:u.id)===((h=l.color)===null||h===void 0?void 0:h.id)}n.isEqual=r;function o(a,l){return{id:a.id,color:l?gr(l):void 0}}n.asThemeIcon=o,n.asClassNameArray=Ks.asClassNameArray,n.asClassName=Ks.asClassName,n.asCSSSelector=Ks.asCSSSelector})(ui||(ui={}));function mS(n){switch(n){case ya.DARK:return"vs-dark";case ya.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const J6={ThemingContribution:"base.contributions.theming"};class xie{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new H}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ct(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let e9=new xie;yn.add(J6.ThemingContribution,e9);function ni(n){return e9.onColorThemeChange(n)}class kie extends ie{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}var Eie=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},O5=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function E_(n){return n.command!==void 0}class ke{constructor(e){this.id=ke._idPool++,this._debugName=e}}ke._idPool=0;ke.CommandPalette=new ke("CommandPalette");ke.EditorContext=new ke("EditorContext");ke.SimpleEditorContext=new ke("SimpleEditorContext");ke.EditorContextCopy=new ke("EditorContextCopy");ke.EditorContextPeek=new ke("EditorContextPeek");ke.MenubarEditMenu=new ke("MenubarEditMenu");ke.MenubarCopy=new ke("MenubarCopy");ke.MenubarGoMenu=new ke("MenubarGoMenu");ke.MenubarSelectionMenu=new ke("MenubarSelectionMenu");ke.InlineCompletionsActions=new ke("InlineCompletionsActions");const yf=wt("menuService"),qr=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new H,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:n=>n===ke.CommandPalette}}addCommand(n){return this.addCommands(gt.single(n))}addCommands(n){for(const e of n)this._commands.set(e.id,e);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Ct(()=>{let e=!1;for(const t of n)e=this._commands.delete(t.id)||e;e&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){return this.appendMenuItems(gt.single({id:n,item:e}))}appendMenuItems(n){const e=new Set,t=new _r;for(const{id:i,item:s}of n){let r=this._menuItems.get(i);r||(r=new _r,this._menuItems.set(i,r)),t.push(r.push(s)),e.add(i)}return this._onDidChangeMenu.fire(e),Ct(()=>{if(t.size>0){for(let i of t)i();this._onDidChangeMenu.fire(e),t.clear()}})}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===ke.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)E_(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class UR extends Gy{constructor(e,t,i,s){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,[],"submenu"),this.item=e,this._menuService=t,this._contextKeyService=i,this._options=s}get actions(){const e=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),i=t.getActions(this._options);t.dispose();for(const[,s]of i)s.length>0&&(e.push(...s),e.push(new Ho));return e.length&&e.pop(),e}}let hc=class t9{constructor(e,t,i,s,r){var o,a;if(this._commandService=r,this.id=e.id,this.label=i?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value,this.tooltip=(a=typeof e.tooltip=="string"?e.tooltip:(o=e.tooltip)===null||o===void 0?void 0:o.value)!==null&&a!==void 0?a:"",this.enabled=!e.precondition||s.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const l=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=s.contextMatchesRules(l.condition),this.checked&&l.tooltip&&(this.tooltip=typeof l.tooltip=="string"?l.tooltip:l.tooltip.value),l.title&&(this.label=typeof l.title=="string"?l.title:l.title.value)}this.item=e,this.alt=t?new t9(t,void 0,i,s,r):void 0,this._options=i,ui.isThemeIcon(e.icon)&&(this.class=Ks.asClassName(e.icon))}dispose(){}run(...e){var t,i;let s=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(s=[...s,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(s=[...s,...e]),this._commandService.executeCommand(this.id,...s)}};hc=Eie([O5(3,je),O5(4,mn)],hc);class _S{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(No===1){if(e&&e.win)return e.win}else if(No===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=_S.bindToCurrentPlatform(e);if(t&&t.primary){const i=eN(t.primary,No);i&&this._registerDefaultKeybinding(i,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let i=0,s=t.secondary.length;i=21&&e<=30||e>=31&&e<=56?!0:e===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}_assertNoCtrlAlt(e,t){e.ctrlKey&&e.altKey&&!e.metaKey&&_S._mightProduceChar(e.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",e," for ",t)}_registerDefaultKeybinding(e,t,i,s,r,o){No===1&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e.parts,command:t,commandArgs:i,when:o,weight1:s,weight2:r,extensionId:null,isBuiltinExtension:!1}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Nie)),this._cachedMergedKeybindings.slice(0)}}const ds=new _S,Iie={EditorModes:"platform.keybindingsRegistry"};yn.add(Iie.EditorModes,ds);function Nie(n,e){return n.weight1!==e.weight1?n.weight1-e.weight1:n.commande.command?1:n.weight2-e.weight2}const gm=wt("telemetryService"),Ju=wt("logService");var _a;(function(n){n[n.Trace=0]="Trace",n[n.Debug=1]="Debug",n[n.Info=2]="Info",n[n.Warning=3]="Warning",n[n.Error=4]="Error",n[n.Critical=5]="Critical",n[n.Off=6]="Off"})(_a||(_a={}));const i9=_a.Info;class Tie extends ie{constructor(){super(...arguments),this.level=i9,this._onDidChangeLogLevel=this._register(new H)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class Aie extends Tie{constructor(e=i9){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=_a.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=_a.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=_a.Info&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.getLevel()<=_a.Error&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}class Mie extends ie{constructor(e){super(),this.logger=e,this._register(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}error(e,...t){this.logger.error(e,...t)}}class nL{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=ye.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};ds.registerKeybindingRule(s)}}Ft.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){qr.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class pm extends nL{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),this._implementations.sort((s,r)=>r.priority-s.priority),{dispose:()=>{for(let s=0;s{if(!!r.get(je).contextMatchesRules(pd(this.precondition)))return this.runEditorCommand(r,s,t)})}}class mt extends io{constructor(e){super(mt.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=ke.EditorContext),s.title||(s.title=e.label),s.when=ye.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(gm).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class s9 extends mt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;inew Promise((l,u)=>{try{const h=e(a.object.textEditorModel,G.lift(r),i.slice(2));l(h)}catch(h){u(h)}}).finally(()=>{a.dispose()}))})}function _e(n){return Vr.INSTANCE.registerEditorCommand(n),n}function ze(n){const e=new n;return Vr.INSTANCE.registerEditorAction(e),e}function r9(n){return Vr.INSTANCE.registerEditorAction(n),n}function o9(n){Vr.INSTANCE.registerEditorAction(n)}function Ln(n,e){Vr.INSTANCE.registerEditorContribution(n,e)}var ap;(function(n){function e(o){return Vr.INSTANCE.getEditorCommand(o)}n.getEditorCommand=e;function t(){return Vr.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return Vr.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(o){return Vr.INSTANCE.getEditorContributions().filter(a=>o.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function r(){return Vr.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=r})(ap||(ap={}));const Rie={EditorCommonContributions:"editor.contributions"};class Vr{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}Vr.INSTANCE=new Vr;yn.add(Rie.EditorCommonContributions,Vr.INSTANCE);function rb(n){return n.register(),n}const $R=rb(new pm({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:ke.MenubarEditMenu,group:"1_do",title:_({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:ke.CommandPalette,group:"",title:_("undo","Undo"),order:1}]}));rb(new n9($R,{id:"default:undo",precondition:void 0}));const KR=rb(new pm({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:ke.MenubarEditMenu,group:"1_do",title:_({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:ke.CommandPalette,group:"",title:_("redo","Redo"),order:1}]}));rb(new n9(KR,{id:"default:redo",precondition:void 0}));const Oie=rb(new pm({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:ke.MenubarSelectionMenu,group:"1_basic",title:_({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:ke.CommandPalette,group:"",title:_("selectAll","Select All"),order:1}]}));class M{constructor(e,t,i,s){e>i||e===i&&t>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return M.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return M.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}containsRange(e){return M.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return M.strictContainsRange(this,e)}static strictContainsRange(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)}plusRange(e){return M.plusRange(this,e)}static plusRange(e,t){let i,s,r,o;return t.startLineNumbere.endLineNumber?(r=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,o=e.endColumn),new M(i,s,r,o)}intersectRanges(e){return M.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,s=e.startColumn,r=e.endLineNumber,o=e.endColumn,a=t.startLineNumber,l=t.startColumn,u=t.endLineNumber,h=t.endColumn;return iu?(r=u,o=h):r===u&&(o=Math.min(o,h)),i>r||i===r&&s>o?null:new M(i,s,r,o)}equalsRange(e){return M.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return M.getEndPosition(this)}static getEndPosition(e){return new G(e.endLineNumber,e.endColumn)}getStartPosition(){return M.getStartPosition(this)}static getStartPosition(e){return new G(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new M(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new M(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return M.collapseToStart(this)}static collapseToStart(e){return new M(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new M(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new M(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}}class Oe extends M{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Oe.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new Oe(this.startLineNumber,this.startColumn,e,t):new Oe(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new G(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return this.getDirection()===0?new Oe(e,t,this.endLineNumber,this.endColumn):new Oe(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Oe(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new Oe(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i/?";function Pie(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of a9)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const l9=Pie();function vS(n){let e=l9;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const Fie={maxLen:1e3,windowSize:15,timeBudget:150};function bS(n,e,t,i,s=Fie){if(t.length>s.maxLen){let u=n-s.maxLen/2;return u<0?u=0:i+=u,t=t.substring(u,n+s.maxLen/2),bS(n,e,t,i,s)}const r=Date.now(),o=n-1-i;let a=-1,l=null;for(let u=1;!(Date.now()-r>=s.timeBudget);u++){const h=o-s.windowSize*u;e.lastIndex=Math.max(0,h);const c=Bie(e,t,o,a);if(!c&&l||(l=c,h<=0))break;a=h}if(l){let u={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,u}return null}function Bie(n,e,t,i){let s;for(;s=n.exec(e);){const r=s.index||0;if(r<=t&&n.lastIndex>=t)return s;if(i>0&&r>i)return null}return null}const bh=8;class u9{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Wie{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class h9{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class on{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}compute(e,t,i){return i}}class _m{constructor(e,t=null){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0,this.deps=t}validate(e){return this.defaultValue}}class Lf{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function Ae(n,e){return typeof n>"u"?e:n==="false"?!1:Boolean(n)}class at extends Lf{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return Ae(e,this.defaultValue)}}function pN(n,e,t,i){if(typeof n>"u")return e;let s=parseInt(n,10);return isNaN(s)?e:(s=Math.max(t,s),s=Math.min(i,s),s|0)}class Xt extends Lf{constructor(e,t,i,s,r,o=void 0){typeof o<"u"&&(o.type="integer",o.default=i,o.minimum=s,o.maximum=r),super(e,t,i,o),this.minimum=s,this.maximum=r}static clampedInt(e,t,i,s){return pN(e,t,i,s)}validate(e){return Xt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class vl extends Lf{constructor(e,t,i,s,r){typeof r<"u"&&(r.type="number",r.default=i),super(e,t,i,r),this.validationFn=s}static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){return this.validationFn(vl.float(e,this.defaultValue))}}class Us extends Lf{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return Us.string(e,this.defaultValue)}}function xs(n,e,t){return typeof n!="string"||t.indexOf(n)===-1?e:n}class Wi extends Lf{constructor(e,t,i,s,r=void 0){typeof r<"u"&&(r.type="string",r.enum=s,r.default=i),super(e,t,i,r),this._allowedValues=s}validate(e){return xs(e,this.defaultValue,this._allowedValues)}}class i_ extends on{constructor(e,t,i,s,r,o,a=void 0){typeof a<"u"&&(a.type="string",a.enum=r,a.default=s),super(e,t,i,a),this._allowedValues=r,this._convert=o}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Vie(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Hie extends on{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[_("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),_("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."),_("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:"auto",description:_("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class zie extends on{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(19,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:_("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:_("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Ae(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Ae(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Uie(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var gn;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(gn||(gn={}));function $ie(n){switch(n){case"line":return gn.Line;case"block":return gn.Block;case"underline":return gn.Underline;case"line-thin":return gn.LineThin;case"block-outline":return gn.BlockOutline;case"underline-thin":return gn.UnderlineThin}}class Kie extends _m{constructor(){super(126,[65,33])}compute(e,t,i){const s=["monaco-editor"];return t.get(33)&&s.push(t.get(33)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(65)==="default"?s.push("mouse-default"):t.get(65)==="copy"&&s.push("mouse-copy"),t.get(99)&&s.push("showUnused"),t.get(124)&&s.push("showDeprecated"),s.join(" ")}}class jie extends at{constructor(){super(32,"emptySelectionClipboard",!0,{description:_("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class Gie extends on{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(35,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:_("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[_("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),_("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),_("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:_("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[_("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),_("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),_("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:_("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:_("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:pt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:_("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:_("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Ae(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":xs(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":xs(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Ae(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Ae(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Ae(t.loop,this.defaultValue.loop)}}}class pr extends on{constructor(){super(44,"fontLigatures",pr.OFF,{anyOf:[{type:"boolean",description:_("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:_("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:_("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?pr.OFF:e==="true"?pr.ON:e:Boolean(e)?pr.ON:pr.OFF}}pr.OFF='"liga" off, "calt" off';pr.ON='"liga" on, "calt" on';class qie extends _m{constructor(){super(43)}compute(e,t,i){return e.fontInfo}}class Zie extends Lf{constructor(){super(45,"fontSize",hs.fontSize,{type:"number",minimum:6,maximum:100,default:hs.fontSize,description:_("fontSize","Controls the font size in pixels.")})}validate(e){let t=vl.float(e,this.defaultValue);return t===0?hs.fontSize:vl.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class gl extends on{constructor(){super(46,"fontWeight",hs.fontWeight,{anyOf:[{type:"number",minimum:gl.MINIMUM_VALUE,maximum:gl.MAXIMUM_VALUE,errorMessage:_("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:gl.SUGGESTION_VALUES}],default:hs.fontWeight,description:_("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(Xt.clampedInt(e,hs.fontWeight,gl.MINIMUM_VALUE,gl.MAXIMUM_VALUE))}}gl.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];gl.MINIMUM_VALUE=1;gl.MAXIMUM_VALUE=1e3;class Yie extends on{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[_("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),_("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),_("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(50,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:_("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:_("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:_("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:_("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:_("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:_("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:_("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:_("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:_("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:_("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:_("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,s,r,o;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:xs(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:xs(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:xs(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=a.multipleDeclarations)!==null&&s!==void 0?s:xs(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(r=a.multipleImplementations)!==null&&r!==void 0?r:xs(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(o=a.multipleReferences)!==null&&o!==void 0?o:xs(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Us.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Us.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Us.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Us.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Us.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class Xie extends on{constructor(){const e={enabled:!0,delay:300,sticky:!0,above:!0};super(52,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:_("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,description:_("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:_("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.above":{type:"boolean",default:e.above,description:_("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Ae(t.enabled,this.defaultValue.enabled),delay:Xt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Ae(t.sticky,this.defaultValue.sticky),above:Ae(t.above,this.defaultValue.above)}}}class lp extends _m{constructor(){super(129,[49,57,37,64,91,59,60,93,116,119,120,121,2])}compute(e,t,i){return lp.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=e.scrollBeyondLastLine?t-1:0,s=(e.viewLineCount+i)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:s,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,r=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(r*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const o=t.stableMinimapLayoutInput,a=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,l=e.lineHeight,u=e.typicalHalfwidthCharacterWidth,h=e.scrollBeyondLastLine,c=e.minimap.renderCharacters;let f=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const g=e.minimap.maxColumn,m=e.minimap.size,v=e.minimap.side,S=e.verticalScrollbarWidth,w=e.viewLineCount,b=e.remainingWidth,y=e.isViewportWrapping,L=c?2:3;let E=Math.floor(r*s);const I=E/r;let x=!1,k=!1,A=L*f,z=f/r,V=1;if(m==="fill"||m==="fit"){const{typicalViewportLineCount:oe,extraLinesBeyondLastLine:fe,desiredRatio:Me,minimapLineCount:We}=lp.computeContainedMinimapLineCount({viewLineCount:w,scrollBeyondLastLine:h,height:s,lineHeight:l,pixelRatio:r});if(w/We>1)x=!0,k=!0,f=1,A=1,z=f/r;else{let Bt=!1,ut=f+1;if(m==="fit"){const Li=Math.ceil((w+fe)*A);y&&a&&b<=t.stableFitRemainingWidth?(Bt=!0,ut=t.stableFitMaxMinimapScale):Bt=Li>E}if(m==="fill"||Bt){x=!0;const Li=f;A=Math.min(l*r,Math.max(1,Math.floor(1/Me))),y&&a&&b<=t.stableFitRemainingWidth&&(ut=t.stableFitMaxMinimapScale),f=Math.min(ut,Math.max(1,Math.floor(A/L))),f>Li&&(V=Math.min(2,f/Li)),z=f/r/V,E=Math.ceil(Math.max(oe,w+fe)*A),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=f):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const Q=Math.floor(g*z),ee=Math.min(Q,Math.max(0,Math.floor((b-S-2)*z/(u+z)))+bh);let Ce=Math.floor(r*ee);const Se=Ce/r;Ce=Math.floor(Ce*V);const Ie=c?1:2,Te=v==="left"?0:i-ee-S;return{renderMinimap:Ie,minimapLeft:Te,minimapWidth:ee,minimapHeightIsEditorHeight:x,minimapIsSampling:k,minimapScale:f,minimapLineHeight:A,minimapCanvasInnerWidth:Ce,minimapCanvasInnerHeight:E,minimapCanvasOuterWidth:Se,minimapCanvasOuterHeight:I}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,r=t.lineHeight|0,o=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,u=t.pixelRatio,h=t.viewLineCount,c=e.get(121),f=c==="inherit"?e.get(120):c,g=f==="inherit"?e.get(116):f,m=e.get(119),v=e.get(2),S=t.isDominatedByLongLines,w=e.get(49),b=e.get(59).renderType!==0,y=e.get(60),L=e.get(93),E=e.get(64),I=e.get(91),x=I.verticalScrollbarSize,k=I.verticalHasArrows,A=I.arrowSize,z=I.horizontalScrollbarSize,V=e.get(57),Q=e.get(37);let ee;if(typeof V=="string"&&/^\d+(\.\d+)?ch$/.test(V)){const Xn=parseFloat(V.substr(0,V.length-2));ee=Xt.clampedInt(Xn*a,0,0,1e3)}else ee=Xt.clampedInt(V,0,0,1e3);Q&&(ee+=16);let Ce=0;if(b){const Xn=Math.max(o,y);Ce=Math.round(Xn*l)}let Se=0;w&&(Se=r);let Ie=0,Te=Ie+Se,oe=Te+Ce,fe=oe+ee;const Me=i-Se-Ce-ee;let We=!1,Xe=!1,Bt=-1;v!==2&&(f==="inherit"&&S?(We=!0,Xe=!0):g==="on"||g==="bounded"?Xe=!0:g==="wordWrapColumn"&&(Bt=m));const ut=lp._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:u,scrollBeyondLastLine:L,minimap:E,verticalScrollbarWidth:x,viewLineCount:h,remainingWidth:Me,isViewportWrapping:Xe},t.memory||new h9);ut.renderMinimap!==0&&ut.minimapLeft===0&&(Ie+=ut.minimapWidth,Te+=ut.minimapWidth,oe+=ut.minimapWidth,fe+=ut.minimapWidth);const Li=Me-ut.minimapWidth,zi=Math.max(1,Math.floor((Li-x-2)/a)),ps=k?A:0;return Xe&&(Bt=Math.max(1,zi),g==="bounded"&&(Bt=Math.min(Bt,m))),{width:i,height:s,glyphMarginLeft:Ie,glyphMarginWidth:Se,lineNumbersLeft:Te,lineNumbersWidth:Ce,decorationsLeft:oe,decorationsWidth:ee,contentLeft:fe,contentWidth:Li,minimap:ut,viewportColumn:zi,isWordWrapMinified:We,isViewportWrapping:Xe,wrappingColumn:Bt,verticalScrollbarWidth:x,horizontalScrollbarHeight:z,overviewRuler:{top:ps,width:x,height:s-2*ps,right:0}}}}class Qie extends on{constructor(){const e={enabled:!0};super(56,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:_("codeActions","Enables the code action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Ae(e.enabled,this.defaultValue.enabled)}}}class Jie extends on{constructor(){const e={enabled:!0,fontSize:0,fontFamily:""};super(125,"inlayHints",e,{"editor.inlayHints.enabled":{type:"boolean",default:e.enabled,description:_("inlayHints.enable","Enables the inlay hints in the editor.")},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:_("inlayHints.fontSize","Controls font size of inlay hints in the editor. A default of 90% of `#editor.fontSize#` is used when the configured value is less than `5` or greater than the editor font size.")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:_("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the `#editor.fontFamily#` is used.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Ae(t.enabled,this.defaultValue.enabled),fontSize:Xt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Us.string(t.fontFamily,this.defaultValue.fontFamily)}}}class ene extends vl{constructor(){super(58,"lineHeight",hs.lineHeight,e=>vl.clamp(e,0,150),{markdownDescription:_("lineHeight",`Controls the line height. + - Use 0 to automatically compute the line height from the font size. + - Values between 0 and 8 will be used as a multiplier with the font size. + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class tne extends on{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(64,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:_("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[_("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),_("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),_("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:_("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:_("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:_("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:_("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:_("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:_("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Ae(t.enabled,this.defaultValue.enabled),size:xs(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:xs(t.side,this.defaultValue.side,["right","left"]),showSlider:xs(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Ae(t.renderCharacters,this.defaultValue.renderCharacters),scale:Xt.clampedInt(t.scale,1,1,3),maxColumn:Xt.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function ine(n){return n==="ctrlCmd"?pt?"metaKey":"ctrlKey":"altKey"}class nne extends on{constructor(){super(74,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:_("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:_("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:Xt.clampedInt(t.top,0,0,1e3),bottom:Xt.clampedInt(t.bottom,0,0,1e3)}}}class sne extends on{constructor(){const e={enabled:!0,cycle:!1};super(75,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:_("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:_("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Ae(t.enabled,this.defaultValue.enabled),cycle:Ae(t.cycle,this.defaultValue.cycle)}}}class rne extends _m{constructor(){super(127)}compute(e,t,i){return e.pixelRatio}}class one extends on{constructor(){const e={other:!0,comments:!1,strings:!1};super(78,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:_("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:_("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:e.other,description:_("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}}}],default:e,description:_("quickSuggestions","Controls whether suggestions should automatically show up while typing.")}),this.defaultValue=e}validate(e){if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const t=e,i={other:Ae(t.other,this.defaultValue.other),comments:Ae(t.comments,this.defaultValue.comments),strings:Ae(t.strings,this.defaultValue.strings)};return i.other&&i.comments&&i.strings?!0:!i.other&&!i.comments&&!i.strings?!1:i}return this.defaultValue}}class ane extends on{constructor(){super(59,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[_("lineNumbers.off","Line numbers are not rendered."),_("lineNumbers.on","Line numbers are rendered as absolute number."),_("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),_("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:_("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function jR(n){const e=n.get(86);return e==="editable"?n.get(80):e!=="on"}class lne extends on{constructor(){const e=[],t={type:"number",description:_("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(90,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:_("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:_("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){let t=[];for(let i of e)if(typeof i=="number")t.push({column:Xt.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:Xt.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}function P5(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}class une extends on{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(91,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[_("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),_("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),_("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:_("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[_("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),_("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),_("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:_("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:_("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:_("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:_("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=Xt.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=Xt.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Xt.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:P5(t.vertical,this.defaultValue.vertical),horizontal:P5(t.horizontal,this.defaultValue.horizontal),useShadows:Ae(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Ae(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Ae(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Ae(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Ae(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Xt.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:Xt.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:Ae(t.scrollByPage,this.defaultValue.scrollByPage)}}}class hne extends on{constructor(){const e={enabled:!0,mode:"subwordSmart"};super(54,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:_("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Ae(t.enabled,this.defaultValue.enabled),mode:xs(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"])}}}class cne extends on{constructor(){const e={enabled:jn.bracketPairColorizationOptions.enabled};super(12,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,description:_("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use 'workbench.colorCustomizations' to override the bracket highlight colors.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Ae(e.enabled,this.defaultValue.enabled)}}}class dne extends on{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(13,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[_("editor.guides.bracketPairs.true","Enables bracket pair guides."),_("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),_("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:_("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[_("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),_("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),_("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:_("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:_("editor.guides.highlightActiveBracketPair","Controls whether bracket pair guides are enabled or not.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:_("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:"boolean",default:e.highlightActiveIndentation,description:_("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:F5(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:F5(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Ae(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Ae(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Ae(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation)}}}function F5(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class fne extends on{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(105,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[_("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),_("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:_("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:_("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:_("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:_("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:_("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:_("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:_("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:_("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:_("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:_("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:_("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:_("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:xs(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Ae(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Ae(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Ae(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Ae(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:Ae(t.showIcons,this.defaultValue.showIcons),showStatusBar:Ae(t.showStatusBar,this.defaultValue.showStatusBar),preview:Ae(t.preview,this.defaultValue.preview),previewMode:xs(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Ae(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Ae(t.showMethods,this.defaultValue.showMethods),showFunctions:Ae(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Ae(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Ae(t.showDeprecated,this.defaultValue.showDeprecated),showFields:Ae(t.showFields,this.defaultValue.showFields),showVariables:Ae(t.showVariables,this.defaultValue.showVariables),showClasses:Ae(t.showClasses,this.defaultValue.showClasses),showStructs:Ae(t.showStructs,this.defaultValue.showStructs),showInterfaces:Ae(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Ae(t.showModules,this.defaultValue.showModules),showProperties:Ae(t.showProperties,this.defaultValue.showProperties),showEvents:Ae(t.showEvents,this.defaultValue.showEvents),showOperators:Ae(t.showOperators,this.defaultValue.showOperators),showUnits:Ae(t.showUnits,this.defaultValue.showUnits),showValues:Ae(t.showValues,this.defaultValue.showValues),showConstants:Ae(t.showConstants,this.defaultValue.showConstants),showEnums:Ae(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Ae(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Ae(t.showKeywords,this.defaultValue.showKeywords),showWords:Ae(t.showWords,this.defaultValue.showWords),showColors:Ae(t.showColors,this.defaultValue.showColors),showFiles:Ae(t.showFiles,this.defaultValue.showFiles),showReferences:Ae(t.showReferences,this.defaultValue.showReferences),showFolders:Ae(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Ae(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Ae(t.showSnippets,this.defaultValue.showSnippets),showUsers:Ae(t.showUsers,this.defaultValue.showUsers),showIssues:Ae(t.showIssues,this.defaultValue.showIssues)}}}class gne extends on{constructor(){super(101,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:_("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:Ae(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}}}class pne extends _m{constructor(){super(128,[80])}compute(e,t,i){return t.get(80)?!0:e.tabFocusMode}}function mne(n){switch(n){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}class _ne extends _m{constructor(){super(130,[129])}compute(e,t,i){const s=t.get(129);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}const vne="Consolas, 'Courier New', monospace",bne="Menlo, Monaco, 'Courier New', monospace",Cne="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",hs={fontFamily:pt?bne:Ns?Cne:vne,fontWeight:"normal",fontSize:pt?12:14,lineHeight:0,letterSpacing:0},jn={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!1}},Vg=[];function ue(n){return Vg[n.id]=n,n}const Df={acceptSuggestionOnCommitCharacter:ue(new at(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:_("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:ue(new Wi(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",_("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:_("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:ue(new Hie),accessibilityPageSize:ue(new Xt(3,"accessibilityPageSize",10,1,1073741824,{description:_("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.")})),ariaLabel:ue(new Us(4,"ariaLabel",_("editorViewAccessibleLabel","Editor content"))),autoClosingBrackets:ue(new Wi(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",_("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),_("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:_("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingDelete:ue(new Wi(6,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",_("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:_("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:ue(new Wi(7,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",_("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:_("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:ue(new Wi(8,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",_("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),_("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:_("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:ue(new i_(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Vie,{enumDescriptions:[_("editor.autoIndent.none","The editor will not insert indentation automatically."),_("editor.autoIndent.keep","The editor will keep the current line's indentation."),_("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),_("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),_("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:_("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:ue(new at(10,"automaticLayout",!1)),autoSurround:ue(new Wi(11,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[_("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),_("editor.autoSurround.quotes","Surround with quotes but not brackets."),_("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:_("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:ue(new cne),bracketPairGuides:ue(new dne),stickyTabStops:ue(new at(103,"stickyTabStops",!1,{description:_("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:ue(new at(14,"codeLens",!0,{description:_("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:ue(new Us(15,"codeLensFontFamily","",{description:_("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:ue(new Xt(16,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:_("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.")})),colorDecorators:ue(new at(17,"colorDecorators",!0,{description:_("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:ue(new at(18,"columnSelection",!1,{description:_("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:ue(new zie),contextmenu:ue(new at(20,"contextmenu",!0)),copyWithSyntaxHighlighting:ue(new at(21,"copyWithSyntaxHighlighting",!0,{description:_("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:ue(new i_(22,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],Uie,{description:_("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:ue(new at(23,"cursorSmoothCaretAnimation",!1,{description:_("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:ue(new i_(24,"cursorStyle",gn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],$ie,{description:_("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:ue(new Xt(25,"cursorSurroundingLines",0,0,1073741824,{description:_("cursorSurroundingLines","Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:ue(new Wi(26,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[_("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),_("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],description:_("cursorSurroundingLinesStyle","Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:ue(new Xt(27,"cursorWidth",0,0,1073741824,{markdownDescription:_("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:ue(new at(28,"disableLayerHinting",!1)),disableMonospaceOptimizations:ue(new at(29,"disableMonospaceOptimizations",!1)),domReadOnly:ue(new at(30,"domReadOnly",!1)),dragAndDrop:ue(new at(31,"dragAndDrop",!0,{description:_("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:ue(new jie),extraEditorClassName:ue(new Us(33,"extraEditorClassName","")),fastScrollSensitivity:ue(new vl(34,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:_("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:ue(new Gie),fixedOverflowWidgets:ue(new at(36,"fixedOverflowWidgets",!1)),folding:ue(new at(37,"folding",!0,{description:_("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:ue(new Wi(38,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[_("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),_("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:_("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:ue(new at(39,"foldingHighlight",!0,{description:_("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:ue(new at(40,"foldingImportsByDefault",!1,{description:_("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),unfoldOnClickAfterEndOfLine:ue(new at(41,"unfoldOnClickAfterEndOfLine",!1,{description:_("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:ue(new Us(42,"fontFamily",hs.fontFamily,{description:_("fontFamily","Controls the font family.")})),fontInfo:ue(new qie),fontLigatures2:ue(new pr),fontSize:ue(new Zie),fontWeight:ue(new gl),formatOnPaste:ue(new at(47,"formatOnPaste",!1,{description:_("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:ue(new at(48,"formatOnType",!1,{description:_("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:ue(new at(49,"glyphMargin",!0,{description:_("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:ue(new Yie),hideCursorInOverviewRuler:ue(new at(51,"hideCursorInOverviewRuler",!1,{description:_("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:ue(new Xie),inDiffEditor:ue(new at(53,"inDiffEditor",!1)),letterSpacing:ue(new vl(55,"letterSpacing",hs.letterSpacing,n=>vl.clamp(n,-5,20),{description:_("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:ue(new Qie),lineDecorationsWidth:ue(new Lf(57,"lineDecorationsWidth",10)),lineHeight:ue(new ene),lineNumbers:ue(new ane),lineNumbersMinChars:ue(new Xt(60,"lineNumbersMinChars",5,1,300)),linkedEditing:ue(new at(61,"linkedEditing",!1,{description:_("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.")})),links:ue(new at(62,"links",!0,{description:_("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:ue(new Wi(63,"matchBrackets","always",["always","near","never"],{description:_("matchBrackets","Highlight matching brackets.")})),minimap:ue(new tne),mouseStyle:ue(new Wi(65,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:ue(new vl(66,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:_("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:ue(new at(67,"mouseWheelZoom",!1,{markdownDescription:_("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:ue(new at(68,"multiCursorMergeOverlapping",!0,{description:_("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:ue(new i_(69,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],ine,{markdownEnumDescriptions:[_("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),_("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:_({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:ue(new Wi(70,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[_("multiCursorPaste.spread","Each cursor pastes a single line of the text."),_("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:_("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),occurrencesHighlight:ue(new at(71,"occurrencesHighlight",!0,{description:_("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:ue(new at(72,"overviewRulerBorder",!0,{description:_("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:ue(new Xt(73,"overviewRulerLanes",3,0,3)),padding:ue(new nne),parameterHints:ue(new sne),peekWidgetDefaultFocus:ue(new Wi(76,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[_("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),_("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:_("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:ue(new at(77,"definitionLinkOpensInPeek",!1,{description:_("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:ue(new one),quickSuggestionsDelay:ue(new Xt(79,"quickSuggestionsDelay",10,0,1073741824,{description:_("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:ue(new at(80,"readOnly",!1)),renameOnType:ue(new at(81,"renameOnType",!1,{description:_("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:_("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:ue(new at(82,"renderControlCharacters",!0,{description:_("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:ue(new at(83,"renderFinalNewline",!0,{description:_("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:ue(new Wi(84,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",_("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:_("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:ue(new at(85,"renderLineHighlightOnlyWhenFocus",!1,{description:_("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:ue(new Wi(86,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:ue(new Wi(87,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",_("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),_("renderWhitespace.selection","Render whitespace characters only on selected text."),_("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:_("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:ue(new Xt(88,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:ue(new at(89,"roundedSelection",!0,{description:_("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:ue(new lne),scrollbar:ue(new une),scrollBeyondLastColumn:ue(new Xt(92,"scrollBeyondLastColumn",5,0,1073741824,{description:_("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:ue(new at(93,"scrollBeyondLastLine",!0,{description:_("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:ue(new at(94,"scrollPredominantAxis",!0,{description:_("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:ue(new at(95,"selectionClipboard",!0,{description:_("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Ns})),selectionHighlight:ue(new at(96,"selectionHighlight",!0,{description:_("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:ue(new at(97,"selectOnLineNumbers",!0)),showFoldingControls:ue(new Wi(98,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[_("showFoldingControls.always","Always show the folding controls."),_("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:_("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:ue(new at(99,"showUnused",!0,{description:_("showUnused","Controls fading out of unused code.")})),showDeprecated:ue(new at(124,"showDeprecated",!0,{description:_("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:ue(new Jie),snippetSuggestions:ue(new Wi(100,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[_("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),_("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),_("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),_("snippetSuggestions.none","Do not show snippet suggestions.")],description:_("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:ue(new gne),smoothScrolling:ue(new at(102,"smoothScrolling",!1,{description:_("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:ue(new Xt(104,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:ue(new fne),inlineSuggest:ue(new hne),suggestFontSize:ue(new Xt(106,"suggestFontSize",0,0,1e3,{markdownDescription:_("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")})),suggestLineHeight:ue(new Xt(107,"suggestLineHeight",0,0,1e3,{markdownDescription:_("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.")})),suggestOnTriggerCharacters:ue(new at(108,"suggestOnTriggerCharacters",!0,{description:_("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:ue(new Wi(109,"suggestSelection","recentlyUsed",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[_("suggestSelection.first","Always select the first suggestion."),_("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),_("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:_("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:ue(new Wi(110,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[_("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),_("tabCompletion.off","Disable tab completions."),_("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:_("tabCompletion","Enables tab completions.")})),tabIndex:ue(new Xt(111,"tabIndex",0,-1,1073741824)),unusualLineTerminators:ue(new Wi(112,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[_("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),_("unusualLineTerminators.off","Unusual line terminators are ignored."),_("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:_("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:ue(new at(113,"useShadowDOM",!0)),useTabStops:ue(new at(114,"useTabStops",!0,{description:_("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordSeparators:ue(new Us(115,"wordSeparators",a9,{description:_("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:ue(new Wi(116,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[_("wordWrap.off","Lines will never wrap."),_("wordWrap.on","Lines will wrap at the viewport width."),_({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),_({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:_({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:ue(new Us(117,"wordWrapBreakAfterCharacters"," })]?|/&.,;\xA2\xB0\u2032\u2033\u2030\u2103\u3001\u3002\uFF61\uFF64\uFFE0\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF01\uFF05\u30FB\uFF65\u309D\u309E\u30FD\u30FE\u30FC\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u3095\u3096\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3005\u303B\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70\u201D\u3009\u300B\u300D\u300F\u3011\u3015\uFF09\uFF3D\uFF5D\uFF63")),wordWrapBreakBeforeCharacters:ue(new Us(118,"wordWrapBreakBeforeCharacters","([{\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF08\uFF3B\uFF5B\uFF62\xA3\xA5\uFF04\uFFE1\uFFE5+\uFF0B")),wordWrapColumn:ue(new Xt(119,"wordWrapColumn",80,1,1073741824,{markdownDescription:_({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:ue(new Wi(120,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:ue(new Wi(121,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:ue(new i_(122,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],mne,{enumDescriptions:[_("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),_("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),_("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),_("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:_("wrappingIndent","Controls the indentation of wrapped lines.")})),wrappingStrategy:ue(new Wi(123,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[_("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),_("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],description:_("wrappingStrategy","Controls the algorithm that computes wrapping points.")})),editorClassName:ue(new Kie),pixelRatio:ue(new rne),tabFocusMode:ue(new pne),layoutInfo:ue(new lp),wrappingInfo:ue(new _ne)};function Ih(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;const e=Array.isArray(n)?[]:{};return Object.keys(n).forEach(t=>{n[t]&&typeof n[t]=="object"?e[t]=Ih(n[t]):e[t]=n[t]}),e}function wne(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(c9.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&e.push(s)}}return n}const c9=Object.prototype.hasOwnProperty;function Sne(n,e){return mN(n,e,new Set)}function mN(n,e,t){if(Wr(n))return n;const i=e(n);if(typeof i<"u")return i;if(b6(n)){const s=[];for(const r of n)s.push(mN(r,e,t));return s}if(Es(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(let r in n)c9.call(n,r)&&(s[r]=mN(n[r],e,t));return t.delete(n),s}return n}function Fa(n,e,t=!0){return Es(n)?(Es(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Es(n[i])&&Es(e[i])?Fa(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function La(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t"u"?t:i}var Rl;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Rl||(Rl={}));var Dl;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(Dl||(Dl={}));class i1{constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),this.indentSize=e.tabSize|0,this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&La(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class Zv{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}var Id;(function(n){n[n.Disabled=0]="Disabled",n[n.EnabledForActive=1]="EnabledForActive",n[n.Enabled=2]="Enabled"})(Id||(Id={}));class Hg{constructor(e,t,i){this.visibleColumn=e,this.className=t,this.horizontalLine=i}}class _N{constructor(e,t){this.top=e,this.endColumn=t}}class uk{constructor(e,t,i,s,r,o){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=s,this.isAutoWhitespaceEdit=r,this._isTracked=o}}class yne{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}const B5=typeof Buffer<"u";let hk;class sL{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(e){return B5&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new sL(e)}toString(){return B5?this.buffer.toString():(hk||(hk=new TextDecoder),hk.decode(this.buffer))}}function Lne(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function Dne(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function ra(n,e){return n[e]*Math.pow(2,24)+n[e+1]*Math.pow(2,16)+n[e+2]*Math.pow(2,8)+n[e+3]}function oa(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function W5(n,e){return n[e]}function V5(n,e,t){n[t]=e}let ck;function d9(){return ck||(ck=new TextDecoder("UTF-16LE")),ck}let dk;function xne(){return dk||(dk=new TextDecoder("UTF-16BE")),dk}let fk;function f9(){return fk||(fk=m6()?d9():xne()),fk}const g9=typeof TextDecoder<"u";let Yd,vN;g9?(Yd=n=>new Ene(n),vN=kne):(Yd=n=>new Ine,vN=p9);function kne(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?p9(n,e,t):d9().decode(i)}function p9(n,e,t){let i=[],s=0;for(let r=0;r=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;in.length)return!1;if(t){if(!PR(n,e))return!1;if(e.length===n.length)return!0;let r=e.length;return e.charAt(e.length-1)===i&&r--,n.charAt(r)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function Rne(n){return n>=65&&n<=90||n>=97&&n<=122}function One(n){const e=kR(n);return Pn?n.length>3?!1:m9(e)&&(n.length===2||e.charCodeAt(2)===92):e===ji.sep}function m9(n){return Pn?Rne(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}function gk(n){return aS(n,!0)}class Pne{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Gv(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}joinPath(e,...t){return $e.joinPath(e,...t)}basenameOrAuthority(e){return Ta(e)||e.authority}basename(e){return ji.basename(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===lt.file?t=$e.file(x6(gk(e))).path:(t=ji.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===lt.file?t=$e.file(kR(gk(e))).path:t=ji.normalize(e.path),e.with({path:t})}resolvePath(e,t){if(e.scheme===lt.file){const i=$e.file(Dte(gk(e),t));return e.with({authority:i.authority,path:i.path})}return t=Ane(t),e.with({path:ji.resolve(e.path,t)})}}const Ts=new Pne(()=>!1),_9=Ts.isEqual.bind(Ts),v9=Ts.basenameOrAuthority.bind(Ts),Ta=Ts.basename.bind(Ts),GR=Ts.dirname.bind(Ts);Ts.joinPath.bind(Ts);const Fne=Ts.normalizePath.bind(Ts),H5=Ts.resolvePath.bind(Ts);var cc;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(o=>{const[a,l]=o.split(":");a&&l&&i.set(a,l)});const r=t.path.substring(0,t.path.indexOf(";"));return r&&i.set(n.META_DATA_MIME,r),i}n.parseMetaData=e})(cc||(cc={}));function og(n){return n.toString()}class Qi{constructor(e,t,i,s,r,o,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=s,this.beforeCursorState=r,this.afterCursorState=o,this.changes=a}static create(e,t){const i=e.getAlternativeVersionId(),s=bN(e);return new Qi(i,i,s,s,t,t,[])}append(e,t,i,s,r){t.length>0&&(this.changes=Nne(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(oa(e,t?t.length:0,i),i+=4,t)for(const s of t)oa(e,s.selectionStartLineNumber,i),i+=4,oa(e,s.selectionStartColumn,i),i+=4,oa(e,s.positionLineNumber,i),i+=4,oa(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=ra(e,t);t+=4;for(let r=0;rt.toString()).join(", ")}matchesResource(e){return($e.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Qi}append(e,t,i,s,r){this._data instanceof Qi&&this._data.append(e,t,i,s,r)}close(){this._data instanceof Qi&&(this._data=this._data.serialize())}open(){this._data instanceof Qi||(this._data=Qi.deserialize(this._data))}undo(){if($e.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Qi&&(this._data=this._data.serialize());const e=Qi.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if($e.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Qi&&(this._data=this._data.serialize());const e=Qi.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Qi&&(this._data=this._data.serialize()),this._data.byteLength+168}}class Bne{constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const i of this._editStackElementsArr){const s=og(i.resource);this._editStackElementsMap.set(s,i)}this._delegate=null}get resources(){return this._editStackElementsArr.map(e=>e.resource)}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=og(e);return this._editStackElementsMap.has(t)}setModel(e){const t=og($e.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=og(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,r){const o=og(e.uri);this._editStackElementsMap.get(o).append(e,t,i,s,r)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=og(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){let e=[];for(const t of this._editStackElementsArr)e.push(`${Ta(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function bN(n){return n.getEOL()===` +`?0:1}function wu(n){return n?n instanceof b9||n instanceof Bne:!1}class qR{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);wu(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);wu(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(wu(t)&&t.canAppend(this._model))return t;const i=new b9(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],bN(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const s=this._getOrCreateEditStackElement(e),r=this._model.applyEdits(t,!0),o=qR._computeCursorState(i,r),a=r.map((l,u)=>({index:u,textChange:l.textChange}));return a.sort((l,u)=>l.textChange.oldPosition===u.textChange.oldPosition?l.index-u.index:l.textChange.oldPosition-u.textChange.oldPosition),s.append(this._model,a.map(l=>l.textChange),bN(this._model),this._model.getAlternativeVersionId(),o),o}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Qe(i),null}}}class Wne{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Vne(n,e,t,i,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let r;for(r=0;r0&&a>0||l>0&&u>0)return;let h=Math.abs(a-u),c=Math.abs(o-l);if(h===0){s.spacesDiff=c,c>0&&0<=l-1&&l-10?s++:L>1&&r++,Vne(o,a,S,y,c),c.looksLikeAlignment&&!(t&&e===c.spacesDiff)))continue;let I=c.spacesDiff;I<=u&&h[I]++,o=S,a=y}let f=t;s!==r&&(f=s{let S=h[v];S>m&&(m=S,g=v)}),g===4&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(g=2)}return{insertSpaces:f,tabSize:g}}function ws(n){return(n.metadata&1)>>>0}function zt(n,e){n.metadata=n.metadata&254|e<<0}function wn(n){return(n.metadata&2)>>>1===1}function Ht(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function C9(n){return(n.metadata&4)>>>2===1}function U5(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function Hne(n){return(n.metadata&24)>>>3}function $5(n,e){n.metadata=n.metadata&231|e<<3}function zne(n){return(n.metadata&32)>>>5===1}function K5(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class w9{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,zt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,U5(this,!1),$5(this,1),K5(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Ht(this,!1)}reset(e,t,i,s){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=s}setOptions(e){this.options=e;let t=this.options.className;U5(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),$5(this,this.options.stickiness),K5(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const qe=new w9(null,0,0);qe.parent=qe;qe.left=qe;qe.right=qe;zt(qe,0);class pk{constructor(){this.root=qe,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,s,r){return this.root===qe?[]:Yne(this,e,t,i,s,r)}search(e,t,i){return this.root===qe?[]:Zne(this,e,t,i)}collectNodesFromOwner(e){return Gne(this,e)}collectNodesPostOrder(){return qne(this)}insert(e){j5(this,e),this._normalizeDeltaIfNecessary()}delete(e){G5(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let s=0;for(;e!==this.root;)e===e.parent.right&&(s+=e.parent.delta),e=e.parent;const r=i.start+s,o=i.end+s;i.setCachedOffsets(r,o,t)}acceptReplace(e,t,i,s){const r=Kne(this,e,e+t);for(let o=0,a=r.length;ot||i===1?!1:i===2?!0:e}function $ne(n,e,t,i,s){const r=Hne(n),o=r===0||r===2,a=r===1||r===2,l=t-e,u=i,h=Math.min(l,u),c=n.start;let f=!1;const g=n.end;let m=!1;e<=c&&g<=t&&zne(n)&&(n.start=e,f=!0,n.end=e,m=!0);{const S=s?1:l>0?2:0;!f&&ag(c,o,e,S)&&(f=!0),!m&&ag(g,a,e,S)&&(m=!0)}if(h>0&&!s){const S=l>u?2:0;!f&&ag(c,o,e+h,S)&&(f=!0),!m&&ag(g,a,e+h,S)&&(m=!0)}{const S=s?1:0;!f&&ag(c,o,t,S)&&(n.start=e+u,f=!0),!m&&ag(g,a,t,S)&&(n.end=e+u,m=!0)}const v=u-l;f||(n.start=Math.max(0,c+v)),m||(n.end=Math.max(0,g+v)),n.start>n.end&&(n.end=n.start)}function Kne(n,e,t){let i=n.root,s=0,r=0,o=0,a=0,l=[],u=0;for(;i!==qe;){if(wn(i)){Ht(i.left,!1),Ht(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!wn(i.left)){if(r=s+i.maxEnd,rt){Ht(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(o,a,0),l[u++]=i),Ht(i,!0),i.right!==qe&&!wn(i.right)){s+=i.delta,i=i.right;continue}}return Ht(n.root,!1),l}function jne(n,e,t,i){let s=n.root,r=0,o=0,a=0;const l=i-(t-e);for(;s!==qe;){if(wn(s)){Ht(s.left,!1),Ht(s.right,!1),s===s.parent.right&&(r-=s.parent.delta),dc(s),s=s.parent;continue}if(!wn(s.left)){if(o=r+s.maxEnd,ot){s.start+=l,s.end+=l,s.delta+=l,(s.delta<-1073741824||s.delta>1073741824)&&(n.requestNormalizeDelta=!0),Ht(s,!0);continue}if(Ht(s,!0),s.right!==qe&&!wn(s.right)){r+=s.delta,s=s.right;continue}}Ht(n.root,!1)}function Gne(n,e){let t=n.root,i=[],s=0;for(;t!==qe;){if(wn(t)){Ht(t.left,!1),Ht(t.right,!1),t=t.parent;continue}if(t.left!==qe&&!wn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),Ht(t,!0),t.right!==qe&&!wn(t.right)){t=t.right;continue}}return Ht(n.root,!1),i}function qne(n){let e=n.root,t=[],i=0;for(;e!==qe;){if(wn(e)){Ht(e.left,!1),Ht(e.right,!1),e=e.parent;continue}if(e.left!==qe&&!wn(e.left)){e=e.left;continue}if(e.right!==qe&&!wn(e.right)){e=e.right;continue}t[i++]=e,Ht(e,!0)}return Ht(n.root,!1),t}function Zne(n,e,t,i){let s=n.root,r=0,o=0,a=0,l=[],u=0;for(;s!==qe;){if(wn(s)){Ht(s.left,!1),Ht(s.right,!1),s===s.parent.right&&(r-=s.parent.delta),s=s.parent;continue}if(s.left!==qe&&!wn(s.left)){s=s.left;continue}o=r+s.start,a=r+s.end,s.setCachedOffsets(o,a,i);let h=!0;if(e&&s.ownerId&&s.ownerId!==e&&(h=!1),t&&C9(s)&&(h=!1),h&&(l[u++]=s),Ht(s,!0),s.right!==qe&&!wn(s.right)){r+=s.delta,s=s.right;continue}}return Ht(n.root,!1),l}function Yne(n,e,t,i,s,r){let o=n.root,a=0,l=0,u=0,h=0,c=[],f=0;for(;o!==qe;){if(wn(o)){Ht(o.left,!1),Ht(o.right,!1),o===o.parent.right&&(a-=o.parent.delta),o=o.parent;continue}if(!wn(o.left)){if(l=a+o.maxEnd,lt){Ht(o,!0);continue}if(h=a+o.end,h>=e){o.setCachedOffsets(u,h,r);let g=!0;i&&o.ownerId&&o.ownerId!==i&&(g=!1),s&&C9(o)&&(g=!1),g&&(c[f++]=o)}if(Ht(o,!0),o.right!==qe&&!wn(o.right)){a+=o.delta,o=o.right;continue}}return Ht(n.root,!1),c}function j5(n,e){if(n.root===qe)return e.parent=qe,e.left=qe,e.right=qe,zt(e,0),n.root=e,n.root;Xne(n,e),Ch(e.parent);let t=e;for(;t!==n.root&&ws(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;ws(i)===1?(zt(t.parent,0),zt(i,0),zt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,X_(n,t)),zt(t.parent,0),zt(t.parent.parent,1),Q_(n,t.parent.parent))}else{const i=t.parent.parent.left;ws(i)===1?(zt(t.parent,0),zt(i,0),zt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,Q_(n,t)),zt(t.parent,0),zt(t.parent.parent,1),X_(n,t.parent.parent))}return zt(n.root,0),e}function Xne(n,e){let t=0,i=n.root;const s=e.start,r=e.end;for(;;)if(Jne(s,r,i.start+t,i.end+t)<0)if(i.left===qe){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===qe){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=qe,e.right=qe,zt(e,1)}function G5(n,e){let t,i;if(e.left===qe?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===qe?(t=e.left,i=e):(i=Qne(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,zt(t,0),e.detach(),mk(),dc(t),n.root.parent=qe;return}let s=ws(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,zt(i,ws(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==qe&&(i.left.parent=i),i.right!==qe&&(i.right.parent=i)),e.detach(),s){Ch(t.parent),i!==e&&(Ch(i),Ch(i.parent)),mk();return}Ch(t),Ch(t.parent),i!==e&&(Ch(i),Ch(i.parent));let r;for(;t!==n.root&&ws(t)===0;)t===t.parent.left?(r=t.parent.right,ws(r)===1&&(zt(r,0),zt(t.parent,1),X_(n,t.parent),r=t.parent.right),ws(r.left)===0&&ws(r.right)===0?(zt(r,1),t=t.parent):(ws(r.right)===0&&(zt(r.left,0),zt(r,1),Q_(n,r),r=t.parent.right),zt(r,ws(t.parent)),zt(t.parent,0),zt(r.right,0),X_(n,t.parent),t=n.root)):(r=t.parent.left,ws(r)===1&&(zt(r,0),zt(t.parent,1),Q_(n,t.parent),r=t.parent.left),ws(r.left)===0&&ws(r.right)===0?(zt(r,1),t=t.parent):(ws(r.left)===0&&(zt(r.right,0),zt(r,1),X_(n,r),r=t.parent.left),zt(r,ws(t.parent)),zt(t.parent,0),zt(r.left,0),Q_(n,t.parent),t=n.root));zt(t,0),mk()}function Qne(n){for(;n.left!==qe;)n=n.left;return n}function mk(){qe.parent=qe,qe.delta=0,qe.start=0,qe.end=0}function X_(n,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==qe&&(t.left.parent=e),t.parent=e.parent,e.parent===qe?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,dc(e),dc(t)}function Q_(n,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==qe&&(t.right.parent=e),t.parent=e.parent,e.parent===qe?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,dc(e),dc(t)}function S9(n){let e=n.end;if(n.left!==qe){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==qe){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function dc(n){n.maxEnd=S9(n)}function Ch(n){for(;n!==qe;){const e=S9(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function Jne(n,e,t,i){return n===t?e-i:n-t}class CN{constructor(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}next(){if(this.right!==Ve)return ZR(this.right);let e=this;for(;e.parent!==Ve&&e.parent.left!==e;)e=e.parent;return e.parent===Ve?Ve:e.parent}prev(){if(this.left!==Ve)return y9(this.left);let e=this;for(;e.parent!==Ve&&e.parent.right!==e;)e=e.parent;return e.parent===Ve?Ve:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Ve=new CN(null,0);Ve.parent=Ve;Ve.left=Ve;Ve.right=Ve;Ve.color=0;function ZR(n){for(;n.left!==Ve;)n=n.left;return n}function y9(n){for(;n.right!==Ve;)n=n.right;return n}function YR(n){return n===Ve?0:n.size_left+n.piece.length+YR(n.right)}function XR(n){return n===Ve?0:n.lf_left+n.piece.lineFeedCnt+XR(n.right)}function _k(){Ve.parent=Ve}function J_(n,e){let t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Ve&&(t.left.parent=e),t.parent=e.parent,e.parent===Ve?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function ev(n,e){let t=e.left;e.left=t.right,t.right!==Ve&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Ve?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function OC(n,e){let t,i;if(e.left===Ve?(i=e,t=i.right):e.right===Ve?(i=e,t=i.left):(i=ZR(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),_k(),n.root.parent=Ve;return}let s=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,I_(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,I_(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ve&&(i.left.parent=i),i.right!==Ve&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,I_(n,i)),e.detach(),t.parent.left===t){let o=YR(t),a=XR(t);if(o!==t.parent.size_left||a!==t.parent.lf_left){let l=o-t.parent.size_left,u=a-t.parent.lf_left;t.parent.size_left=o,t.parent.lf_left=a,du(n,t.parent,l,u)}}if(I_(n,t.parent),s){_k();return}let r;for(;t!==n.root&&t.color===0;)t===t.parent.left?(r=t.parent.right,r.color===1&&(r.color=0,t.parent.color=1,J_(n,t.parent),r=t.parent.right),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.right.color===0&&(r.left.color=0,r.color=1,ev(n,r),r=t.parent.right),r.color=t.parent.color,t.parent.color=0,r.right.color=0,J_(n,t.parent),t=n.root)):(r=t.parent.left,r.color===1&&(r.color=0,t.parent.color=1,ev(n,t.parent),r=t.parent.left),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.left.color===0&&(r.right.color=0,r.color=1,J_(n,r),r=t.parent.left),r.color=t.parent.color,t.parent.color=0,r.left.color=0,ev(n,t.parent),t=n.root));t.color=0,_k()}function q5(n,e){for(I_(n,e);e!==n.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,J_(n,e)),e.parent.color=0,e.parent.parent.color=1,ev(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,ev(n,e)),e.parent.color=0,e.parent.parent.color=1,J_(n,e.parent.parent))}n.root.color=0}function du(n,e,t,i){for(;e!==n.root&&e!==Ve;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function I_(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=YR(e.left)-e.size_left,i=XR(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}function CS(n){return n<0?0:n>255?255:n|0}function lg(n){return n<0?0:n>4294967295?4294967295:n|0}class vm{constructor(e){let t=CS(e);this._defaultValue=t,this._asciiMap=vm._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);for(let i=0;i<256;i++)t[i]=e;return t}set(e,t){let i=CS(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}}class ese{constructor(){this._actual=new vm(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}}class tse extends vm{constructor(e){super(0);for(let t=0,i=e.length;t(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const Op=ise(n=>new tse(n)),nse=999;class Qc{constructor(e,t,i,s){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=s}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=sse(this.searchString):e=this.searchString.indexOf(` +`)>=0;let t=null;try{t=j6(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new rse(t,this.wordSeparators?Op(this.wordSeparators):null,i?this.searchString:null)}}function sse(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;const s=n.charCodeAt(e);if(s===110||s===114||s===87)return!0}return!1}class rse{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}function id(n,e,t){if(!t)return new Zv(n,null);let i=[];for(let s=0,r=e.length;s>0);t[r]>=e?s=r-1:t[r+1]>=e?(i=r,s=r):i=r+1}return i+1}}class PC{static findMatches(e,t,i,s,r){const o=t.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(e,i,new N_(o.wordSeparators,o.regex),s,r):this._doFindMatchesLineByLine(e,i,o,s,r):[]}static _getMultilineMatchRange(e,t,i,s,r,o){let a,l=0;s?(l=s.findLineFeedCountBeforeOffset(r),a=t+r+l):a=t+r;let u;if(s){let g=s.findLineFeedCountBeforeOffset(r+o.length)-l;u=a+o.length+g}else u=a+o.length;const h=e.getPositionAt(a),c=e.getPositionAt(u);return new M(h.lineNumber,h.column,c.lineNumber,c.column)}static _doFindMatchesMultiline(e,t,i,s,r){const o=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new Z5(a):null,u=[];let h=0,c;for(i.reset(0);c=i.next(a);)if(u[h++]=id(this._getMultilineMatchRange(e,o,a,l,c.index,c[0]),c,s),h>=r)return u;return u}static _doFindMatchesLineByLine(e,t,i,s,r){const o=[];let a=0;if(t.startLineNumber===t.endLineNumber){const u=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,u,t.startLineNumber,t.startColumn-1,a,o,s,r),o}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,o,s,r);for(let u=t.startLineNumber+1;u=l))return r;return r}const h=new N_(e.wordSeparators,e.regex);let c;h.reset(0);do if(c=h.next(t),c&&(o[r++]=id(new M(i,c.index+1+s,i,c.index+1+c[0].length+s),c,a),r>=l))return r;while(c);return r}static findNextMatch(e,t,i,s){const r=t.parseSearchRequest();if(!r)return null;const o=new N_(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindNextMatchMultiline(e,i,o,s):this._doFindNextMatchLineByLine(e,i,o,s)}static _doFindNextMatchMultiline(e,t,i,s){const r=new G(t.lineNumber,1),o=e.getOffsetAt(r),a=e.getLineCount(),l=e.getValueInRange(new M(r.lineNumber,r.column,a,e.getLineMaxColumn(a)),1),u=e.getEOL()===`\r +`?new Z5(l):null;i.reset(t.column-1);let h=i.next(l);return h?id(this._getMultilineMatchRange(e,o,l,u,h.index,h[0]),h,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new G(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const r=e.getLineCount(),o=t.lineNumber,a=e.getLineContent(o),l=this._findFirstMatchInLine(i,a,o,t.column,s);if(l)return l;for(let u=1;u<=r;u++){const h=(o+u-1)%r,c=e.getLineContent(h+1),f=this._findFirstMatchInLine(i,c,h+1,1,s);if(f)return f}return null}static _findFirstMatchInLine(e,t,i,s,r){e.reset(s-1);const o=e.next(t);return o?id(new M(i,o.index+1,i,o.index+1+o[0].length),o,r):null}static findPreviousMatch(e,t,i,s){const r=t.parseSearchRequest();if(!r)return null;const o=new N_(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindPreviousMatchMultiline(e,i,o,s):this._doFindPreviousMatchLineByLine(e,i,o,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const r=this._doFindMatchesMultiline(e,new M(1,1,t.lineNumber,t.column),i,s,10*nse);if(r.length>0)return r[r.length-1];const o=e.getLineCount();return t.lineNumber!==o||t.column!==e.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(e,new G(o,e.getLineMaxColumn(o)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const r=e.getLineCount(),o=t.lineNumber,a=e.getLineContent(o).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,o,s);if(l)return l;for(let u=1;u<=r;u++){const h=(r+o-u-1)%r,c=e.getLineContent(h+1),f=this._findLastMatchInLine(i,c,h+1,s);if(f)return f}return null}static _findLastMatchInLine(e,t,i,s){let r=null,o;for(e.reset(0);o=e.next(t);)r=id(new M(i,o.index+1,i,o.index+1+o[0].length),o,s);return r}}function ose(n,e,t,i,s){if(i===0)return!0;const r=e.charCodeAt(i-1);if(n.get(r)!==0||r===13||r===10)return!0;if(s>0){const o=e.charCodeAt(i);if(n.get(o)!==0)return!0}return!1}function ase(n,e,t,i,s){if(i+s===t)return!0;const r=e.charCodeAt(i+s);if(n.get(r)!==0||r===13||r===10)return!0;if(s>0){const o=e.charCodeAt(i+s-1);if(n.get(o)!==0)return!0}return!1}function QR(n,e,t,i,s){return ose(n,e,t,i,s)&&ase(n,e,t,i,s)}class N_{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const s=i.index,r=i[0].length;if(s===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){Cu(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=r,!this._wordSeparators||QR(this._wordSeparators,e,t,s,r))return i}while(i);return null}}const ru=65535;function L9(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class lse{constructor(e,t,i,s,r){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=r}}function gu(n,e=!0){let t=[0],i=1;for(let s=0,r=n.length;s126)&&(o=!1)}const a=new lse(L9(n),i,s,r,o);return n.length=0,a}class Vs{constructor(e,t,i,s,r){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=r}}class nd{constructor(e,t){this.buffer=e,this.lineStarts=t}}class hse{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Ve&&e.iterate(e.root,i=>(i!==Ve&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class cse{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,i=this._cache;for(let s=0;s=e){i[s]=null,t=!0;continue}}if(t){let s=[];for(const r of i)r!==null&&s.push(r);this._cache=s}}}class dse{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new nd("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Ve,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let r=0,o=e.length;r0){e[r].lineStarts||(e[r].lineStarts=gu(e[r].buffer));let a=new Vs(r+1,{line:0,column:0},{line:e[r].lineStarts.length-1,column:e[r].buffer.length-e[r].lineStarts[e[r].lineStarts.length-1]},e[r].lineStarts.length-1,e[r].buffer.length);this._buffers.push(e[r]),s=this.rbInsertRight(s,a)}this._searchCache=new cse(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=ru,i=t-Math.floor(t/3),s=i*2,r="",o=0,a=[];if(this.iterate(this.root,l=>{let u=this.getNodeContent(l),h=u.length;if(o<=i||o+h0){let l=r.replace(/\r\n|\r|\n/g,e);a.push(new nd(l,gu(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new hse(this,e)}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==Ve;)if(s.left!==Ve&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;let r=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=r+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0,s=e;for(;t!==Ve;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){let r=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+r.index,r.index===0){let o=this.getOffsetAt(i+1,1),a=s-o;return new G(i+1,a+1)}return new G(i+1,r.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Ve){let r=this.getOffsetAt(i+1,1),o=s-e-r;return new G(i+1,o+1)}else t=t.right;return new G(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";let i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),r=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?r.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?r:r.replace(/\r\n|\r|\n/g,t):r}getValueInRange2(e,t){if(e.node===t.node){let a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,u=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(u+e.remainder,u+t.remainder)}let i=e.node,s=this._buffers[i.piece.bufferIndex].buffer,r=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start),o=s.substring(r+e.remainder,r+i.piece.length);for(i=i.next();i!==Ve;){let a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){o+=a.substring(l,l+t.remainder);break}else o+=a.substr(l,i.piece.length);i=i.next()}return o}getLinesContent(){let e=[],t=0,i="",s=!1;return this.iterate(this.root,r=>{if(r===Ve)return!0;const o=r.piece;let a=o.length;if(a===0)return!0;const l=this._buffers[o.bufferIndex].buffer,u=this._buffers[o.bufferIndex].lineStarts,h=o.start.line,c=o.end.line;let f=u[h]+o.start.column;if(s&&(l.charCodeAt(f)===10&&(f++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(h===c)return!this._EOLNormalized&&l.charCodeAt(f+a-1)===13?(s=!0,i+=l.substr(f,a-1)):i+=l.substr(f,a),!0;i+=this._EOLNormalized?l.substring(f,Math.max(f,u[h+1]-this._EOLLength)):l.substring(f,u[h+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let g=h+1;gL+m,t.reset(0)):(b=f.buffer,y=L=>L,t.reset(m));do if(S=t.next(b),S){if(y(S.index)>=v)return h;this.positionInBuffer(e,y(S.index)-g,w);let L=this.getLineFeedCnt(e.piece.bufferIndex,r,w),E=w.line===r.line?w.column-r.column+s:w.column+1,I=E+S[0].length;if(c[h++]=id(new M(i+L,E,i+L,I),S,l),y(S.index)+S[0].length>=v||h>=u)return h}while(S);return h}findMatchesLineByLine(e,t,i,s){const r=[];let o=0;const a=new N_(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];let u=this.nodeAt2(e.endLineNumber,e.endColumn);if(u===null)return[];let h=this.positionInBuffer(l.node,l.remainder),c=this.positionInBuffer(u.node,u.remainder);if(l.node===u.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,h,c,t,i,s,o,r),r;let f=e.startLineNumber,g=l.node;for(;g!==u.node;){let v=this.getLineFeedCnt(g.piece.bufferIndex,h,g.piece.end);if(v>=1){let w=this._buffers[g.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),y=w[h.line+v],L=f===e.startLineNumber?e.startColumn:1;if(o=this.findMatchesInNode(g,a,f,L,h,this.positionInBuffer(g,y-b),t,i,s,o,r),o>=s)return r;f+=v}let S=f===e.startLineNumber?e.startColumn-1:0;if(f===e.endLineNumber){const w=this.getLineContent(f).substring(S,e.endColumn-1);return o=this._findMatchesInLine(t,a,w,e.endLineNumber,S,o,r,i,s),r}if(o=this._findMatchesInLine(t,a,this.getLineContent(f).substr(S),f,S,o,r,i,s),o>=s)return r;f++,l=this.nodeAt2(f,1),g=l.node,h=this.positionInBuffer(l.node,l.remainder)}if(f===e.endLineNumber){let v=f===e.startLineNumber?e.startColumn-1:0;const S=this.getLineContent(f).substring(v,e.endColumn-1);return o=this._findMatchesInLine(t,a,S,e.endLineNumber,v,o,r,i,s),r}let m=f===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(u.node,a,f,m,h,c,t,i,s,o,r),r}_findMatchesInLine(e,t,i,s,r,o,a,l,u){const h=e.wordSeparators;if(!l&&e.simpleSearch){const f=e.simpleSearch,g=f.length,m=i.length;let v=-g;for(;(v=i.indexOf(f,v+g))!==-1;)if((!h||QR(h,i,m,v,g))&&(a[o++]=new Zv(new M(s,v+1+r,s,v+1+g+r),null),o>=u))return o;return o}let c;t.reset(0);do if(c=t.next(i),c&&(a[o++]=id(new M(s,c.index+1+r,s,c.index+1+c[0].length+r),c,l),o>=u))return o;while(c);return o}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Ve){let{node:s,remainder:r,nodeStartOffset:o}=this.nodeAt(e),a=s.piece,l=a.bufferIndex,u=this.positionInBuffer(s,r);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&o+a.length===e&&t.lengthe){let h=[],c=new Vs(a.bufferIndex,u,a.end,this.getLineFeedCnt(a.bufferIndex,u,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,u));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,r)===10){let v={line:c.start.line+1,column:0};c=new Vs(c.bufferIndex,v,c.end,this.getLineFeedCnt(c.bufferIndex,v,c.end),c.length-1),t+=` +`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(s,r-1)===13){let v=this.positionInBuffer(s,r-1);this.deleteNodeTail(s,v),t="\r"+t,s.piece.length===0&&h.push(s)}else this.deleteNodeTail(s,u);else this.deleteNodeTail(s,u);let f=this.createNewPieces(t);c.length>0&&this.rbInsertRight(s,c);let g=s;for(let m=0;m=0;o--)r=this.rbInsertLeft(r,s[o]);this.validateCRLFWithPrevNode(r),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` +`);let i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]),r=s;for(let o=1;o=f)u=c+1;else break;return i?(i.line=c,i.column=l-g,null):{line:c,column:l-g}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;let s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;let r=s[i.line+1],o=s[i.line]+i.column;if(r>o+1)return i.line-t.line;let a=o-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tru){let h=[];for(;e.length>ru;){const f=e.charCodeAt(ru-1);let g;f===13||f>=55296&&f<=56319?(g=e.substring(0,ru-1),e=e.substring(ru-1)):(g=e.substring(0,ru),e=e.substring(ru));let m=gu(g);h.push(new Vs(this._buffers.length,{line:0,column:0},{line:m.length-1,column:g.length-m[m.length-1]},m.length-1,g.length)),this._buffers.push(new nd(g,m))}let c=gu(e);return h.push(new Vs(this._buffers.length,{line:0,column:0},{line:c.length-1,column:e.length-c[c.length-1]},c.length-1,e.length)),this._buffers.push(new nd(e,c)),h}let t=this._buffers[0].buffer.length;const i=gu(e,!1);let s=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},s=this._lastChangeBufferPos;for(let h=0;h=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let l=this.getAccumulatedValue(i,e-i.lf_left-2),u=this.getAccumulatedValue(i,e-i.lf_left-1),h=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:a-(e-1-i.lf_left)}),h.substring(c+l,c+u-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let l=this.getAccumulatedValue(i,e-i.lf_left-2),u=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s=u.substring(h+l,h+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Ve;){let o=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){let a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=o.substring(l,l+a-t),s}else{let a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=o.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Ve;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){let i=e.piece,s=this.positionInBuffer(e,t),r=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){let o=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(o!==r)return{index:o,remainder:0}}return{index:r,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;let i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,r=i.start.line+t+1;return r>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[r]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,r=this.offsetInBuffer(i.bufferIndex,i.end),o=t,a=this.offsetInBuffer(i.bufferIndex,o),l=this.getLineFeedCnt(i.bufferIndex,i.start,o),u=l-s,h=a-r,c=i.length+h;e.piece=new Vs(i.bufferIndex,i.start,o,l,c),du(this,e,h,u)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,r=this.offsetInBuffer(i.bufferIndex,i.start),o=t,a=this.getLineFeedCnt(i.bufferIndex,o,i.end),l=this.offsetInBuffer(i.bufferIndex,o),u=a-s,h=r-l,c=i.length+h;e.piece=new Vs(i.bufferIndex,o,i.end,a,c),du(this,e,h,u)}shrinkNode(e,t,i){const s=e.piece,r=s.start,o=s.end,a=s.length,l=s.lineFeedCnt,u=t,h=this.getLineFeedCnt(s.bufferIndex,s.start,u),c=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,r);e.piece=new Vs(s.bufferIndex,s.start,u,h,c),du(this,e,c-a,h-l);let f=new Vs(s.bufferIndex,i,o,this.getLineFeedCnt(s.bufferIndex,i,o),this.offsetInBuffer(s.bufferIndex,o)-this.offsetInBuffer(s.bufferIndex,i)),g=this.rbInsertRight(e,f);this.validateCRLFWithPrevNode(g)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const r=gu(t,!1);for(let g=0;ge)t=t.left;else if(t.size_left+t.piece.length>=e){s+=t.size_left;let r={node:t,remainder:e-t.size_left,nodeStartOffset:s};return this._searchCache.set(r),r}else e-=t.size_left+t.piece.length,s+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,s=0;for(;i!==Ve;)if(i.left!==Ve&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let r=this.getAccumulatedValue(i,e-i.lf_left-2),o=this.getAccumulatedValue(i,e-i.lf_left-1);return s+=i.size_left,{node:i,remainder:Math.min(r+t-1,o),nodeStartOffset:s}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let r=this.getAccumulatedValue(i,e-i.lf_left-2);if(r+t-1<=i.piece.length)return{node:i,remainder:r+t-1,nodeStartOffset:s};t-=i.piece.length-r;break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Ve;){if(i.piece.lineFeedCnt>0){let r=this.getAccumulatedValue(i,0),o=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,r),nodeStartOffset:o}}else if(i.piece.length>=t-1){let r=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:r}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let i=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(s)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` +`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Ve||e.piece.lineFeedCnt===0)return!1;let t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,s=t.start.line,r=i[s]+t.start.column;return s===i.length-1||i[s+1]>r+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(r)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Ve||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let i=[],s=this._buffers[e.piece.bufferIndex].lineStarts,r;e.piece.end.column===0?r={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:r={line:e.piece.end.line,column:e.piece.end.column-1};const o=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Vs(e.piece.bufferIndex,e.piece.start,r,a,o),du(this,e,-1,-1),e.piece.length===0&&i.push(e);let l={line:t.piece.start.line+1,column:0};const u=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Vs(t.piece.bufferIndex,l,t.piece.end,h,u),du(this,t,-1,-1),t.piece.length===0&&i.push(t);let c=this.createNewPieces(`\r +`);this.rbInsertRight(e,c[0]);for(let f=0;fi===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;i0)s=r-1;else return r}return-(i+1)}function D9(n,e){let t=0,i=n.length;if(i===0)return 0;for(;t=e.length)throw new TypeError("invalid index");let i=e[Math.floor(e.length*Math.random())],s=[],r=[],o=[];for(let a of e){const l=t(a,i);l<0?s.push(a):l>0?r.push(a):o.push(a)}return n!!e)}function x9(n){return!Array.isArray(n)||n.length===0}function kl(n){return Array.isArray(n)&&n.length>0}function wS(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function gse(n,e){const t=pse(n,e);if(t!==-1)return n[t]}function pse(n,e){for(let t=n.length-1;t>=0;t--){const i=n[t];if(e(i))return t}return-1}function SN(n,e){return n.length>0?n[0]:e}function e2(n){return[].concat(...n)}function ss(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;se;s--)i.push(s);return i}function Yv(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function vk(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function FC(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function k9(n){return Array.isArray(n)?n:[n]}function mse(n,e,t){const i=E9(n,e),s=n.length,r=t.length;n.length=s+r;for(let o=s-1;o>=i;o--)n[o+r]=n[o];for(let o=0;o=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){return this.items[this.firstIdx]}}function _se(n){return t2(n,0)}function t2(n,e){switch(typeof n){case"object":return n===null?Ou(349,e):Array.isArray(n)?bse(n,e):Cse(n,e);case"string":return i2(n,e);case"boolean":return vse(n,e);case"number":return Ou(n,e);case"undefined":return Ou(937,e);default:return Ou(617,e)}}function Ou(n,e){return(e<<5)-e+n|0}function vse(n,e){return Ou(n?433:863,e)}function i2(n,e){e=Ou(149417,e);for(let t=0,i=n.length;tt2(i,t),e)}function Cse(n,e){return e=Ou(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=i2(i,t),t2(n[i],t)),e)}function bk(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function Q5(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):wse((n>>>0).toString(16),e/4)}class oL{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,r=this._leftoverHighSurrogate,o,a;for(r!==0?(o=r,a=-1,r=0):(o=e.charCodeAt(0),a=0);;){let l=o;if(fn(o))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),n_(this._h0)+n_(this._h1)+n_(this._h2)+n_(this._h3)+n_(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Q5(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Q5(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=oL._bigBlock32,t=this._buffDV;for(let c=0;c<64;c+=4)e.setUint32(c,t.getUint32(c,!1),!1);for(let c=64;c<320;c+=4)e.setUint32(c,bk(e.getUint32(c-12,!1)^e.getUint32(c-32,!1)^e.getUint32(c-56,!1)^e.getUint32(c-64,!1),1),!1);let i=this._h0,s=this._h1,r=this._h2,o=this._h3,a=this._h4,l,u,h;for(let c=0;c<80;c++)c<20?(l=s&r|~s&o,u=1518500249):c<40?(l=s^r^o,u=1859775393):c<60?(l=s&r|s&o|r&o,u=2400959708):(l=s^r^o,u=3395469782),h=bk(i,5)+l+a+u+e.getUint32(c*4,!1)&4294967295,a=o,o=r,r=bk(s,30),s=i,i=h;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}}oL._bigBlock32=new DataView(new ArrayBuffer(320));var J5,eB;class Sse{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos!1){return new up(new Dse(e))}static forStrings(){return new up(new Sse)}static forConfigKeys(){return new up(new yse)}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new BC,this._root.segment=i.value());const r=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new BC,s.left.segment=i.value()),r.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new BC,s.right.segment=i.value()),r.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new BC,s.mid.segment=i.value()),r.push([0,s]),s=s.mid;else break}const o=s.value;s.value=t,s.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const u=l.balanceFactor();if(u<-1||u>1){const h=r[a][0],c=r[a+1][0];if(h===1&&c===1)r[a][1]=l.rotateLeft();else if(h===-1&&c===-1)r[a][1]=l.rotateRight();else if(h===1&&c===-1)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(h===-1&&c===1)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return o}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const s=this._iter.reset(e),r=[];let o=this._root;for(;o;){const a=s.cmp(o.segment);if(a>0)r.push([-1,o]),o=o.left;else if(a<0)r.push([1,o]),o=o.right;else if(s.hasNext())s.next(),r.push([0,o]),o=o.mid;else break}if(!!o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const a=this._min(o.right),{key:l,value:u,segment:h}=a;this._delete(a.key,!1),o.key=l,o.value=u,o.segment=h}else{const a=(i=o.left)!==null&&i!==void 0?i:o.right;if(r.length>0){const[l,u]=r[r.length-1];switch(l){case-1:u.left=a;break;case 0:u.mid=a;break;case 1:u.right=a;break}}else this._root=a}for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const u=l.balanceFactor();if(u>1?(l.right.balanceFactor()>=0||(l.right=r[a+1][1]=r[a+1][1].rotateRight()),r[a][1]=l.rotateLeft()):u<-1&&(l.left.balanceFactor()<=0||(l.left=r[a+1][1]=r[a+1][1].rotateLeft()),r[a][1]=l.rotateRight()),a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const r=t.cmp(i.segment);if(r>0)i=i.left;else if(r<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else return i.mid?this._entries(i.mid):void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}*_entries(e){!e||(e.left&&(yield*this._entries(e.left)),e.value&&(yield[e.key,e.value]),e.mid&&(yield*this._entries(e.mid)),e.right&&(yield*this._entries(e.right)))}}class xse{constructor(e,t){this.uri=e,this.value=t}}class rs{constructor(e,t){this[J5]="ResourceMap",e instanceof rs?(this.map=new Map(e.map),this.toKey=t??rs.defaultToKey):(this.map=new Map,this.toKey=e??rs.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),new xse(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(let[i,s]of this.map)e(s.value,s.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(J5=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}}rs.defaultToKey=n=>n.toString();class kse{constructor(){this[eB]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(!!i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let s=this._map.get(e);if(s)s.value=t,i!==0&&this.touch(s,i);else{switch(s={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(!!t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.key,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}values(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.value,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}entries(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:[i.key,i.value],done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}[(eB=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(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{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,s=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class n2 extends kse{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}function Do(n,e,t){return Math.min(Math.max(n,e),t)}const Ck="**",tB="/",n1="[/\\\\]",s1="[^/\\\\]",Ese=/\//g;function iB(n){switch(n){case 0:return"";case 1:return`${s1}*?`;default:return`(?:${n1}|${s1}+${n1}|${n1}${s1}+)*?`}}function nB(n,e){if(!n)return[];const t=[];let i=!1,s=!1,r="";for(const o of n){switch(o){case e:if(!i&&!s){t.push(r),r="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}r+=o}return r&&t.push(r),t}function I9(n){if(!n)return"";let e="";const t=nB(n,tB);if(t.every(i=>i===Ck))e=".*";else{let i=!1;t.forEach((s,r)=>{if(s===Ck){i||(e+=iB(2),i=!0);return}let o=!1,a="",l=!1,u="";for(const h of s){if(h!=="}"&&o){a+=h;continue}if(l&&(h!=="]"||!u)){let c;h==="-"?c=h:(h==="^"||h==="!")&&!u?c="^":h===tB?c="":c=Na(h),u+=c;continue}switch(h){case"{":o=!0;continue;case"[":l=!0;continue;case"}":const f=`(?:${nB(a,",").map(g=>I9(g)).join("|")})`;e+=f,o=!1,a="";break;case"]":e+="["+u+"]",l=!1,u="";break;case"?":e+=s1;continue;case"*":e+=iB(1);continue;default:e+=Na(h)}}rs2(a,e)).filter(a=>a!==El),n),i=t.length;if(!i)return El;if(i===1)return t[0];const s=function(a,l){for(let u=0,h=t.length;u!!a.allBasenames);r&&(s.allBasenames=r.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(s.allPaths=o),s}function aB(n,e,t){const i=Xw===ji.sep,s=i?n:n.replace(Ese,Xw),r=Xw+s,o=ji.sep+n,a=t?function(l,u){return typeof l=="string"&&(l===s||l.endsWith(r)||!i&&(l===n||l.endsWith(o)))?e:null}:function(l,u){return typeof l=="string"&&(l===s||!i&&l===n)?e:null};return a.allPaths=[(t?"*/":"./")+n],a}function Fse(n){try{const e=new RegExp(`^${I9(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return El}}function Bse(n,e,t){return!n||typeof e!="string"?!1:N9(n)(e,void 0,t)}function N9(n,e={}){if(!n)return rB;if(typeof n=="string"||Wse(n)){const t=s2(n,e);if(t===El)return rB;const i=function(s,r){return!!t(s,r)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return Vse(n,e)}function Wse(n){const e=n;return e&&typeof e.base=="string"&&typeof e.pattern=="string"}function Vse(n,e){const t=T9(Object.getOwnPropertyNames(n).map(a=>Hse(a,n[a],e)).filter(a=>a!==El)),i=t.length;if(!i)return El;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(h,c){for(let f=0,g=t.length;f!!h.allBasenames);l&&(a.allBasenames=l.allBasenames);const u=t.reduce((h,c)=>c.allPaths?h.concat(c.allPaths):h,[]);return u.length&&(a.allPaths=u),a}const s=function(a,l,u){let h;for(let c=0,f=t.length;c!!a.allBasenames);r&&(s.allBasenames=r.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(s.allPaths=o),s}function Hse(n,e,t){if(e===!1)return El;const i=s2(n,t);if(i===El)return El;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const r=(o,a,l,u)=>{if(!u||!i(o,a))return null;const h=s.replace("$(basename)",l),c=u(h);return mte(c)?c.then(f=>f?n:null):c?n:null};return r.requiresSiblings=!0,r}}return i}function T9(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const u=l.basenames;return u?a.concat(u):a},[]);let s;if(e){s=[];for(let a=0,l=i.length;a{const u=l.patterns;return u?a.concat(u):a},[]);const r=function(a,l){if(typeof a!="string")return null;if(!l){let h;for(h=a.length;h>0;h--){const c=a.charCodeAt(h-1);if(c===47||c===92)break}l=a.substr(h)}const u=i.indexOf(l);return u!==-1?s[u]:null};r.basenames=i,r.patterns=s,r.allBasenames=i;const o=n.filter(a=>!a.basenames);return o.push(r),o}function A9(n,e,t,i){if(Array.isArray(n)){let s=0;for(const r of n){const o=A9(r,e,t,i);if(o===10)return o;o>s&&(s=o)}return s}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:s,pattern:r,scheme:o,hasAccessToAllModels:a}=n;if(!i&&!a)return 0;let l=0;if(o)if(o===e.scheme)l=10;else if(o==="*")l=5;else return 0;if(s)if(s===t)l=10;else if(s==="*")l=Math.max(l,5);else return 0;if(r){let u;if(typeof r=="string"?u=r:u=Object.assign(Object.assign({},r),{base:kR(r.base)}),u===e.fsPath||Bse(u,e.fsPath))l=10;else return 0}return l}else return 0}}function M9(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(M9):!!n.exclusive}class yi{constructor(){this._clock=0,this._entries=[],this._onDidChange=new H}get onDidChange(){return this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ct(()=>{if(i){let s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(let i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,r=>{i&&s===r._score?i.push(r.provider):(s=r._score,i=[r.provider],t.push(i))}),t}_orderedForEach(e,t){if(!!e){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}}_updateScores(e){let t={uri:e.uri.toString(),language:e.getLanguageId()};if(!(this._lastCandidate&&this._lastCandidate.language===t.language&&this._lastCandidate.uri===t.uri)){this._lastCandidate=t;for(let i of this._entries)if(i._score=A9(i.selector,e.uri,e.getLanguageId(),nie(e)),M9(i.selector)&&i._score>0){for(let s of this._entries)s._score=0;i._score=1e3;break}this._entries.sort(yi._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:e._timet._time?-1:0}}class zse{constructor(){this._map=new Map,this._promises=new Map,this._onDidChange=new H,this.onDidChange=this._onDidChange.event,this._colorMap=null}fire(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._map.set(e,t),this.fire([e]),Ct(()=>{this._map.get(e)===t&&(this._map.delete(e),this.fire([e]))})}registerPromise(e,t){let i=null,s=!1;return this._promises.set(e,t.then(r=>{this._promises.delete(e),!(s||!r)&&(i=this.register(e,r))})),Ct(()=>{s=!0,i&&i.dispose()})}getPromise(e){const t=this.get(e);if(t)return Promise.resolve(t);const i=this._promises.get(e);return i?i.then(s=>this.get(e)):null}get(e){return this._map.get(e)||null}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._map.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}class Hr{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&1792)>>>8}static getFontStyle(e){return(e&14336)>>>11}static getForeground(e){return(e&8372224)>>>14}static getBackground(e){return(e&4286578688)>>>23}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e),s=this.getFontStyle(e);return s&1&&(i+=" mtki"),s&2&&(i+=" mtkb"),s&4&&(i+=" mtku"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),s=this.getFontStyle(e);let r=`color: ${t[i]};`;return s&1&&(r+="font-style: italic;"),s&2&&(r+="font-weight: bold;"),s&4&&(r+="text-decoration: underline;"),r}}const Use=function(){let n=Object.create(null);return n[0]="symbol-method",n[1]="symbol-function",n[2]="symbol-constructor",n[3]="symbol-field",n[4]="symbol-variable",n[5]="symbol-class",n[6]="symbol-struct",n[7]="symbol-interface",n[8]="symbol-module",n[9]="symbol-property",n[10]="symbol-event",n[11]="symbol-operator",n[12]="symbol-unit",n[13]="symbol-value",n[14]="symbol-constant",n[15]="symbol-enum",n[16]="symbol-enum-member",n[17]="symbol-keyword",n[27]="symbol-snippet",n[18]="symbol-text",n[19]="symbol-color",n[20]="symbol-file",n[21]="symbol-reference",n[22]="symbol-customcolor",n[23]="symbol-folder",n[24]="symbol-type-parameter",n[25]="account",n[26]="issues",function(e){const t=n[e];let i=t&&dS.get(t);return i||(console.info("No codicon found for CompletionItemKind "+e),i=ve.symbolProperty),i.classNames}}();let R9=function(){let n=Object.create(null);return n.method=0,n.function=1,n.constructor=2,n.field=3,n.variable=4,n.class=5,n.struct=6,n.interface=7,n.module=8,n.property=9,n.event=10,n.operator=11,n.unit=12,n.value=13,n.constant=14,n.enum=15,n["enum-member"]=16,n.enumMember=16,n.keyword=17,n.snippet=27,n.text=18,n.color=19,n.file=20,n.reference=21,n.customcolor=22,n.folder=23,n["type-parameter"]=24,n.typeParameter=24,n.account=25,n.issue=26,function(e,t){let i=n[e];return typeof i>"u"&&!t&&(i=9),i}}();var zr;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(zr||(zr={}));var lB;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(lB||(lB={}));var uB;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(uB||(uB={}));function $se(n){return n&&$e.isUri(n.uri)&&M.isIRange(n.range)&&(M.isIRange(n.originSelectionRange)||M.isIRange(n.targetSelectionRange))}var hB;(function(n){const e=new Map;e.set("file",0),e.set("module",1),e.set("namespace",2),e.set("package",3),e.set("class",4),e.set("method",5),e.set("property",6),e.set("field",7),e.set("constructor",8),e.set("enum",9),e.set("interface",10),e.set("function",11),e.set("variable",12),e.set("constant",13),e.set("string",14),e.set("number",15),e.set("boolean",16),e.set("array",17),e.set("object",18),e.set("key",19),e.set("null",20),e.set("enum-member",21),e.set("struct",22),e.set("event",23),e.set("operator",24),e.set("type-parameter",25);const t=new Map;t.set(0,"file"),t.set(1,"module"),t.set(2,"namespace"),t.set(3,"package"),t.set(4,"class"),t.set(5,"method"),t.set(6,"property"),t.set(7,"field"),t.set(8,"constructor"),t.set(9,"enum"),t.set(10,"interface"),t.set(11,"function"),t.set(12,"variable"),t.set(13,"constant"),t.set(14,"string"),t.set(15,"number"),t.set(16,"boolean"),t.set(17,"array"),t.set(18,"object"),t.set(19,"key"),t.set(20,"null"),t.set(21,"enum-member"),t.set(22,"struct"),t.set(23,"event"),t.set(24,"operator"),t.set(25,"type-parameter");function i(o){return e.get(o)}n.fromString=i;function s(o){return t.get(o)}n.toString=s;function r(o,a){const l=t.get(o);let u=l&&dS.get("symbol-"+l);return u||(console.info("No codicon found for SymbolKind "+o),u=ve.symbolProperty),`${a?"inline":"block"} ${u.classNames}`}n.toCssClassName=r})(hB||(hB={}));class Aa{constructor(e){this.value=e}}Aa.Comment=new Aa("comment");Aa.Imports=new Aa("imports");Aa.Region=new Aa("region");var cB;(function(n){n[n.Other=0]="Other",n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(cB||(cB={}));const SS=new yi,yN=new yi,pa=new yi,r2=new yi,LN=new yi,Xv=new yi,DN=new yi,yS=new yi,Kse=new yi,Qv=new yi,LS=new yi,DS=new yi,xS=new yi,xN=new yi,kN=new yi,Il=new yi,iv=new yi,Nh=new yi,O9=new yi,P9=new yi,Pp=new yi,jse=new yi,EN=new yi,Fp=new yi,F9=new yi,Ii=new zse;class pn{constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}static createEmpty(e,t){const i=pn.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new pn(s,e,t)}equals(e){return e instanceof pn?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,r=s+(i<<1);for(let o=s;o0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Hr.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Hr.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Hr.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Hr.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Hr.getInlineStyleFromMetadata(i,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return pn.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new o2(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let r=0;r>>1)-1;for(;it&&(s=r)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const r=new Array;let o=0;for(;;){let a=to){s+=this._text.substring(o,l.offset);const u=this._tokens[(t<<1)+1];r.push(s.length,u),o=l.offset}s+=l.text,r.push(s.length,l.tokenMetadata),i++}else break}return new pn(new Uint32Array(r),s,this._languageIdCodec)}}pn.defaultTokenMetadata=(0<<11|1<<14|2<<23)>>>0;class o2{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let r=this._firstTokenIndex,o=e.getCount();r=i);r++)this._tokensCount++}equals(e){return e instanceof o2?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}function Bp(n){let e=0,t=0,i=0,s=0;for(let r=0,o=n.length;r>>0}const ou=new Uint32Array(0).buffer;class Sk{constructor(){this.tokens=[]}add(e,t){if(this.tokens.length>0){const i=this.tokens[this.tokens.length-1];if(i.startLineNumber+i.tokens.length-1+1===e){i.tokens.push(t);return}}this.tokens.push(new Gse(e,[t]))}}class kS{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;ie)i=s-1;else{let o=s;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let a=s;for(;ae||f===e&&m>=t)&&(fe||m===e&&S>=t){if(mr?v-=r-i:v=i;else if(g===t&&m===i)if(g===s&&v>r)v-=r-i;else{h=!0;continue}else if(gr)g===t?(m=i,v=m+(v-r)):(m=0,v=m+(v-r));else{h=!0;continue}else if(g>s){if(l===0&&!h){u=a;break}g-=l}else if(g===s&&m>=r)e&&g===0&&(m+=e,v+=e),g-=l,m-=r-i,v-=r-i;else throw new Error("Not possible!");const w=4*u;o[w]=g,o[w+1]=m,o[w+2]=v,o[w+3]=S,u++}this._tokenCount=u}acceptInsertText(e,t,i,s,r,o){const a=i===0&&s===1&&(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122),l=this._tokens,u=this._tokenCount;for(let h=0;h0?t.charCodeAt(0):0)}acceptEdit(e,t,i,s,r){this._acceptDeleteRange(e),this._acceptInsertText(new G(e.startLineNumber,e.startColumn),t,i,s,r),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;if(i<0){const r=i-t;this.startLineNumber-=r;return}const s=this.tokens.getMaxDeltaLine();if(!(t>=s+1)){if(t<0&&i>=s+1){this.startLineNumber=0,this.tokens.clear();return}if(t<0){const r=-t;this.startLineNumber-=r,this.tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this.tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,s,r){if(t===0&&i===0)return;const o=e.lineNumber-this.startLineNumber;if(o<0){this.startLineNumber+=t;return}const a=this.tokens.getMaxDeltaLine();o>=a+1||this.tokens.acceptInsertText(o,e.column-1,t,i,s,r)}}class Gse{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function au(n){return n instanceof Uint32Array?n:new Uint32Array(n)}class a2{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const r=t[0].getRange(),o=t[t.length-1].getRange();if(!r||!o)return e;i=e.plusRange(r).plusRange(o)}let s=null;for(let r=0,o=this._pieces.length;ri.endLineNumber){s=s||{index:r};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(r,1),r--,o--;continue}if(a.endLineNumberi.endLineNumber){s=s||{index:r};continue}const[l,u]=a.split(i);if(l.isEmpty()){s=s||{index:r};continue}u.isEmpty()||(this._pieces.splice(r,1,l,u),r++,o++,s=s||{index:r})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=Yv(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSemanticTokens(e,t){const i=this._pieces;if(i.length===0)return t;const s=a2._findFirstPieceWithLine(i,e),r=i[s].getLineTokens(e);if(!r)return t;const o=t.getCount(),a=r.getCount();let l=0,u=[],h=0,c=0;const f=(g,m)=>{g!==c&&(c=g,u[h++]=g,u[h++]=m)};for(let g=0;g>>0,b=~w>>>0;for(;lt)s=r-1;else{for(;r>i&&e[r-1].startLineNumber<=t&&t<=e[r-1].endLineNumber;)r--;return r}}return i}acceptEdit(e,t,i,s,r){for(const o of this._pieces)o.acceptEdit(e,t,i,s,r)}}class Or{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let s=null;if(t1&&(r=Hr.getLanguageId(s[1])!==e),!r)return ou}if(!s||s.length===0){const r=new Uint32Array(2);return r[0]=t,r[1]=dB(e),r.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;let i=[];for(let s=0;s=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Or._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Or._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=Or._insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=Or._deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=Or._insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}static _deleteBeginning(e,t){return e===null||e===ou?e:Or._delete(e,0,t)}static _deleteEnding(e,t){if(e===null||e===ou)return e;const i=au(e),s=i[i.length-2];return Or._delete(e,t,s)}static _delete(e,t,i){if(e===null||e===ou||t===i)return e;const s=au(e),r=s.length>>>1;if(t===0&&s[s.length-2]===i)return ou;const o=pn.findIndexInTokensArray(s,t),a=o>0?s[o-1<<1]:0,l=s[o<<1];if(ih&&(s[u++]=m,s[u++]=s[(g<<1)+1],h=m)}if(u===s.length)return e;let f=new Uint32Array(u);return f.set(s.subarray(0,u),0),f.buffer}static _append(e,t){if(t===ou)return e;if(e===ou)return t;if(e===null)return e;if(t===null)return null;const i=au(e),s=au(t),r=s.length>>>1;let o=new Uint32Array(i.length+s.length);o.set(i,0);let a=i.length;const l=i[i.length-2];for(let u=0;u>>1;let o=pn.findIndexInTokensArray(s,t);o>0&&s[o-1<<1]===t&&o--;for(let a=o;aS.sortIndex-w.sortIndex)}this._mightContainRTL=s,this._mightContainUnusualLineTerminators=r,this._mightContainNonBasicASCII=o;const g=this._doApplyEdits(l);let m=null;if(t&&c.length>0){c.sort((v,S)=>S.lineNumber-v.lineNumber),m=[];for(let v=0,S=c.length;v0&&c[v-1].lineNumber===w)continue;let b=c[v].oldContent,y=this.getLineContent(w);y.length===0||y===b||us(y)!==-1||m.push(w)}}return this._onDidChangeContent.fire(),new yne(f,g,m)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,s=e[e.length-1].range,r=new M(i.startLineNumber,i.startColumn,s.endLineNumber,s.endColumn);let o=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,m=e.length;g0&&l.push(v.text),o=S.endLineNumber,a=S.endColumn}const u=l.join(""),[h,c,f]=Bp(u);return{sortIndex:0,identifier:e[0].identifier,range:r,rangeOffset:this.getOffsetAt(r.startLineNumber,r.startColumn),rangeLength:this.getValueLengthInRange(r,0),text:u,eolCount:h,firstLineLength:c,lastLineLength:f,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(hp._sortOpsDescending);let t=[];for(let i=0;i0){const f=l.eolCount+1;f===1?c=new M(u,h,u,h+l.firstLineLength):c=new M(u,h,u+f-1,l.lastLineLength+1)}else c=new M(u,h,u,h);i=c.endLineNumber,s=c.endColumn,t.push(c),r=l}return t}static _sortOpsAscending(e,t){let i=M.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=M.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class qse{constructor(e,t,i,s,r,o,a,l,u){this._chunks=e,this._bom=t,this._cr=i,this._lf=s,this._crlf=r,this._containsRTL=o,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=u}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` +`:`\r +`:i>t/2?`\r +`:` +`}create(e){const t=this._getEOL(e);let i=this._chunks;if(this._normalizeEOL&&(t===`\r +`&&(this._cr>0||this._lf>0)||t===` +`&&(this._cr>0||this._crlf>0)))for(let r=0,o=i.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)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=use(this._tmpLineStarts,e);this.chunks.push(new nd(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=Zy(e)),!this.isBasicASCII&&!this.containsUnusualLineTerminators&&(this.containsUnusualLineTerminators=q6(e))}finish(e=!0){return this._finish(),new qse(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=gu(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class Yse{constructor(){this.changeType=1}}class Ma{constructor(e,t,i,s,r){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=r}static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const r of t)i+=e.substring(s,r.column-1),s=r.column-1,i+=r.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new Ma(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new Ma(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}}class gB{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Xse{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Qse{constructor(e,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Jse{constructor(){this.changeType=5}}class Nd{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t>>0,new lL(s,t===null?uL:t)}class ire{constructor(){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0}_reset(e){this._beginState=[],this._valid=[],this._len=0,this._invalidLineStartIndex=0,e&&this._setBeginState(0,e)}flush(e){this._reset(e)}get invalidLineStartIndex(){return this._invalidLineStartIndex}_invalidateLine(e){e=this._len;)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[],s=[];for(let r=0;r=0;o--)this._invalidateLine(e.startLineNumber+o-1);this._acceptDeleteRange(e),this._acceptInsertText(new G(e.startLineNumber,e.startColumn),t)}_acceptDeleteRange(e){e.startLineNumber-1>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){e.lineNumber-1>=this._len||this._insertLines(e.lineNumber,t)}}class nre extends ie{constructor(e,t){super(),this._textModel=e,this._languageIdCodec=t,this._isDisposed=!1,this._tokenizationStateStore=new ire,this._tokenizationSupport=null,this._register(Ii.onDidChange(i=>{const s=this._textModel.getLanguageId();i.changedLanguages.indexOf(s)!==-1&&(this._resetTokenizationState(),this._textModel.clearTokens())})),this._register(this._textModel.onDidChangeContentFast(i=>{if(i.isFlush){this._resetTokenizationState();return}for(let s=0,r=i.changes.length;s{this._beginBackgroundTokenization()})),this._register(this._textModel.onDidChangeLanguage(()=>{this._resetTokenizationState(),this._textModel.clearTokens()})),this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}_resetTokenizationState(){const[e,t]=sre(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&YI(()=>{this._isDisposed||this._revalidateTokensNow()})}_revalidateTokensNow(){const e=this._textModel.getLineCount(),t=1,i=new Sk,s=ju.create(!1);let r=-1;for(;this._hasLinesToTokenize()&&!(s.elapsed()>t||(r=this._tokenizeOneInvalidLine(i),r>=e)););this._beginBackgroundTokenization(),this._textModel.setTokens(i.tokens,!this._hasLinesToTokenize())}tokenizeViewport(e,t){const i=new Sk;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens,!this._hasLinesToTokenize())}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new Sk;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens,!this._hasLinesToTokenize())}isCheapToTokenize(e){if(!this._tokenizationSupport)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return e>t?!1:e1&&u>=1;u--){const h=this._textModel.getLineFirstNonWhitespaceColumn(u);if(h!==0&&h=0;u--)l=yk(this._languageIdCodec,a,this._tokenizationSupport,r[u],!1,l).endState;for(let u=t;u<=i;u++){const h=this._textModel.getLineContent(u),c=yk(this._languageIdCodec,a,this._tokenizationSupport,h,!0,l);e.add(u,c.tokens),this._tokenizationStateStore.setFakeTokens(u-1),l=c.endState}}}function sre(n){const e=n.getLanguageId();let t=n.isTooLargeForTokenization()?null:Ii.get(e),i=null;if(t)try{i=t.getInitialState()}catch(s){Qe(s),t=null}return[t,i]}function yk(n,e,t,i,s,r){let o=null;if(t)try{o=t.tokenize2(i,s,r.clone(),0)}catch(a){Qe(a)}return o||(o=W9(n.encodeLanguageId(e),i,r,0)),pn.convertToEndOffset(o.tokens,i.length),o}var Ji;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Ji||(Ji={}));class Lk{constructor(e){if(this._standardAutoClosingPairConditionalBrand=void 0,this.open=e.open,this.close=e.close,this._standardTokenMask=0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t0&&n.getLanguageId(o-1)===s;)o--;return new ore(n,s,o,r+1,n.getStartOffset(o),n.getEndOffset(r))}class ore{constructor(e,t,i,s,r,o){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=r,this._lastCharOffset=o}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function nl(n){return(n&7)!==0}class Wp{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new Lk(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new Lk({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.colorizedBracketPairs?this._colorizedBracketPairs=pB(e.colorizedBracketPairs.map(t=>[t[0],t[1]])):e.brackets?this._colorizedBracketPairs=pB(e.brackets.map(t=>[t[0],t[1]]).filter(t=>!(t[0]==="<"&&t[1]===">"))):this._colorizedBracketPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Lk({open:t.open,close:t.close||""}))}this._autoCloseBefore=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Wp.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(){return this._autoCloseBefore}static shouldAutoClosePair(e,t,i){if(t.getTokenCount()===0)return!0;const s=t.findTokenIndexAtOffset(i-2),r=t.getStandardTokenType(s);return e.isOK(r)}getSurroundingPairs(){return this._surroundingPairs}getColorizedBrackets(){return this._colorizedBracketPairs}}Wp.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=`;:.,=}])> + `;function pB(n){return n.filter(([e,t])=>e!==""&&t!=="")}class NS{constructor(e,t,i,s,r,o){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=s,this.forwardRegex=r,this.reversedRegex=o,this._openSet=NS._toSet(this.open),this._closeSet=NS._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}function are(n){const e=n.length;n=n.map(o=>[o[0].toLowerCase(),o[1].toLowerCase()]);const t=[];for(let o=0;o{const[l,u]=o,[h,c]=a;return l===h||l===c||u===h||u===c},s=(o,a)=>{const l=Math.min(o,a),u=Math.max(o,a);for(let h=0;h0&&r.push({open:a,close:l})}return r}class lre{constructor(e,t){this._richEditBracketsBrand=void 0;const i=are(t);this.brackets=i.map((s,r)=>new NS(e,r,s.open,s.close,ure(s.open,s.close,i,r),hre(s.open,s.close,i,r))),this.forwardRegex=cre(this.brackets),this.reversedRegex=dre(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const r of s.open)this.textIsBracket[r]=s,this.textIsOpenBracket[r]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,r.length);for(const r of s.close)this.textIsBracket[r]=s,this.textIsOpenBracket[r]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,r.length)}}}function V9(n,e,t,i){for(let s=0,r=e.length;s=0&&i.push(a);for(const a of o.close)a.indexOf(n)>=0&&i.push(a)}}function H9(n,e){return n.length-e.length}function hL(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function ure(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let r=0,o=s.length;r=0;o--)s[r++]=i.charCodeAt(o);return f9().decode(s)}else{let s=[],r=0;for(let o=i.length-1;o>=0;o--)s[r++]=i.charAt(o);return s.join("")}}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class wo{static _findPrevBracketInText(e,t,i,s){let r=i.match(e);if(!r)return null;let o=i.length-(r.index||0),a=r[0].length,l=s+o;return new M(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,s,r){const a=u2(i).substring(i.length-r,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){let r=i.match(e);if(!r)return null;let o=r.index||0,a=r[0].length;if(a===0)return null;let l=s+o;return new M(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,s,r){const o=i.substring(s,r);return this.findNextBracketInText(e,t,o,s)}}class gre{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return e=e.filter((t,i,s)=>s.indexOf(t)===i),e}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(nl(t.getStandardTokenType(s)))return null;const r=this._richEditBrackets.reversedRegex,o=t.getLineContent().substring(0,i-1)+e,a=wo.findPrevBracketInRange(r,1,o,0,o.length);if(!a)return null;const l=o.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const h=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(h)?{matchOpenBracket:l}:null}}function VC(n){return n.global&&(n.lastIndex=0),!0}class pre{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&VC(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&VC(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&VC(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&VC(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class zg{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=zg._createOpenBracketRegExp(t[0]),s=zg._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=3)for(let r=0,o=this._regExpRules.length;ru.reg?(u.reg.lastIndex=0,u.reg.test(u.text)):!0))return a.action}if(e>=2&&i.length>0&&s.length>0)for(let r=0,o=this._brackets.length;r=2&&i.length>0){for(let r=0,o=this._brackets.length;r0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class _re{constructor(){this._onDidChangeSchema=new H,this.schemasById={}}registerSchema(e,t){this.schemasById[mre(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const vre=new _re;yn.add(dL.JSONContribution,vre);const bm={Configuration:"base.contributions.configuration"},Dk="vscode://schemas/settings/resourceLanguage",mB=yn.as(dL.JSONContribution);class bre{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new H,this._onDidUpdateConfiguration=new H,this.defaultValues={},this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:_("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},mB.registerSchema(Dk,this.resourceLanguageSettingsSchema)}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=this.doRegisterConfigurations(e,t);mB.registerSchema(Dk,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(i)}registerOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t){const i=[];return e.forEach(s=>{i.push(...this.validateAndRegisterProperties(s,t,s.extensionInfo)),this.configurationContributors.push(s),this.registerJSONConfiguration(s)}),i}validateAndRegisterProperties(e,t=!0,i,s=3){var r;s=Wr(e.scope)?s:e.scope;let o=[],a=e.properties;if(a)for(let u in a){if(t&&yre(u)){delete a[u];continue}const h=a[u];if(this.updatePropertyDefaultValue(u,h),h2.test(u)?h.scope=void 0:(h.scope=Wr(h.scope)?s:h.scope,h.restricted=Wr(h.restricted)?!!(!((r=i?.restrictedConfigurations)===null||r===void 0)&&r.includes(u)):h.restricted),a[u].hasOwnProperty("included")&&!a[u].included){this.excludedConfigurationProperties[u]=a[u],delete a[u];continue}else this.configurationProperties[u]=a[u];!a[u].deprecationMessage&&a[u].markdownDeprecationMessage&&(a[u].deprecationMessage=a[u].markdownDeprecationMessage),o.push(u)}let l=e.allOf;if(l)for(let u of l)o.push(...this.validateAndRegisterProperties(u,t,i,s));return o}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=i=>{let s=i.properties;if(s)for(const o in s)this.updateSchema(o,s[o]);let r=i.allOf;r&&r.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:_("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:_("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:Dk};this.updatePropertyDefaultValue(t,i)}this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.defaultValues[e];os(i)&&(i=t.default),os(i)&&(i=Sre(t.type)),t.default=i}}const Cre="\\[.*\\]$",h2=new RegExp(Cre);function wre(n){return n.substring(1,n.length-1)}function Sre(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const z9=new bre;yn.add(bm.Configuration,z9);function yre(n){return n.trim()?h2.test(n)?_("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):z9.getConfigurationProperties()[n]!==void 0?_("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):null:_("config.property.empty","Cannot register an empty property")}const Fi=wt("configurationService");function U9(n,e){const t=Object.create(null);for(let i in n)c2(t,i,n[i],e);return t}function c2(n,e,t,i){const s=e.split("."),r=s.pop();let o=n;for(let a=0;a"u"?t:r}function xre(){const n=yn.as(bm.Configuration).getConfigurationProperties();return Object.keys(n)}function kre(){const n=Object.create(null),e=yn.as(bm.Configuration).getConfigurationProperties();for(let t in e){let i=e[t].default;c2(n,t,i,s=>console.error(`Conflict in default settings: ${s}`))}return n}const Rs=wt("modeService");class xh{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const K9=[];function xf(n,e,t){e instanceof xh||(e=new xh(e,[],t)),K9.push([n,e])}function Ere(){return K9}var Ire=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},_B=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class xk{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const ob=wt("languageConfigurationService");let TS=class extends ie{constructor(e,t){super(),this.configurationService=e,this.modeService=t,this.onDidChangeEmitter=this._register(new H),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(IN));this._register(this.configurationService.onDidChangeConfiguration(s=>{const r=s.change.keys.some(a=>i.has(a)),o=s.change.overrides.filter(([a,l])=>l.some(u=>i.has(u))).map(([a])=>this.modeService.validateLanguageId(a));if(r)this.configurations.clear(),this.onDidChangeEmitter.fire(new xk(void 0));else for(const a of o)a&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new xk(a)))})),this._register(Jt.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new xk(s.languageId))}))}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=Nre(e,this.configurationService,this.modeService),this.configurations.set(e,t)),t}};TS=Ire([_B(0,Fi),_B(1,Rs)],TS);function Nre(n,e,t){let i=Jt.getLanguageConfiguration(n);if(!i){const a=t.validateLanguageId(n);if(!a)throw new Error("Unexpected languageId");i=new Jv(a,{})}const s=Tre(i.languageId,e),r=j9([i.underlyingConfig,s]);return new Jv(i.languageId,r)}const IN={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function Tre(n,e){const t=e.getValue(IN.brackets,{overrideIdentifier:n}),i=e.getValue(IN.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:vB(t),colorizedBracketPairs:vB(i)}}function vB(n){if(!!Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}class bB{constructor(e){this.languageId=e}}class Are{constructor(){this._entries=new Map,this._onDidChange=new H,this.onDidChange=this._onDidChange.event}register(e,t,i=0){let s=this._entries.get(e);s||(s=new Mre(e),this._entries.set(e,s));const r=s.register(t,i);return this._onDidChange.fire(new bB(e)),Ct(()=>{r.dispose(),this._onDidChange.fire(new bB(e))})}getLanguageConfiguration(e){let t=this._entries.get(e);return t?.getResolvedConfiguration()||null}getIndentationRules(e){const t=this.getLanguageConfiguration(e);return t&&t.indentationRules||null}_getElectricCharacterSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.electricCharacter||null}getElectricCharacters(e){let t=this._getElectricCharacterSupport(e);return t?t.getElectricCharacters():[]}onElectricCharacter(e,t,i){let s=WC(t,i-1),r=this._getElectricCharacterSupport(s.languageId);return r?r.onElectricCharacter(e,s,i-s.firstCharOffset):null}getComments(e){let t=this.getLanguageConfiguration(e);return t&&t.comments||null}_getCharacterPairSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.characterPair||null}getAutoClosingPairs(e){const t=this._getCharacterPairSupport(e);return new rre(t?t.getAutoClosingPairs():[])}getAutoCloseBeforeSet(e){let t=this._getCharacterPairSupport(e);return t?t.getAutoCloseBeforeSet():Wp.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED}getSurroundingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getSurroundingPairs():[]}shouldAutoClosePair(e,t,i){const s=WC(t,i-1);return Wp.shouldAutoClosePair(e,s,i-s.firstCharOffset)}getWordDefinition(e){let t=this.getLanguageConfiguration(e);return vS(t&&t.wordDefinition||null)}getFoldingRules(e){let t=this.getLanguageConfiguration(e);return t?t.foldingRules:{}}getIndentRulesSupport(e){let t=this.getLanguageConfiguration(e);return t&&t.indentRulesSupport||null}getPrecedingValidLine(e,t,i){let s=e.getLanguageIdAtPosition(t,0);if(t>1){let r,o=-1;for(r=t-1;r>=1;r--){if(e.getLanguageIdAtPosition(r,0)!==s)return o;let a=e.getLineContent(r);if(i.shouldIgnore(a)||/^\s+$/.test(a)||a===""){o=r;continue}return r}}return-1}getInheritIndentForLine(e,t,i,s=!0){if(e<4)return null;const r=this.getIndentRulesSupport(t.getLanguageId());if(!r)return null;if(i<=1)return{indentation:"",action:null};const o=this.getPrecedingValidLine(t,i,r);if(o<0)return null;if(o<1)return{indentation:"",action:null};const a=t.getLineContent(o);if(r.shouldIncrease(a)||r.shouldIndentNextLine(a))return{indentation:ri(a),action:Ji.Indent,line:o};if(r.shouldDecrease(a))return{indentation:ri(a),action:null,line:o};{if(o===1)return{indentation:ri(t.getLineContent(o)),action:null,line:o};const l=o-1,u=r.getIndentMetadata(t.getLineContent(l));if(!(u&3)&&u&4){let h=0;for(let c=l-1;c>0;c--)if(!r.shouldIndentNextLine(t.getLineContent(c))){h=c;break}return{indentation:ri(t.getLineContent(h+1)),action:null,line:h+1}}if(s)return{indentation:ri(t.getLineContent(o)),action:null,line:o};for(let h=o;h>0;h--){const c=t.getLineContent(h);if(r.shouldIncrease(c))return{indentation:ri(c),action:Ji.Indent,line:h};if(r.shouldIndentNextLine(c)){let f=0;for(let g=h-1;g>0;g--)if(!r.shouldIndentNextLine(t.getLineContent(h))){f=g;break}return{indentation:ri(t.getLineContent(f+1)),action:null,line:f+1}}else if(r.shouldDecrease(c))return{indentation:ri(c),action:null,line:h}}return{indentation:ri(t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,s,r){if(e<4)return null;const o=this.getLanguageConfiguration(i);if(!o)return null;const a=this.getIndentRulesSupport(i);if(!a)return null;const l=this.getInheritIndentForLine(e,t,s),u=t.getLineContent(s);if(l){const h=l.line;if(h!==void 0){const c=o.onEnter(e,"",t.getLineContent(h),"");if(c){let f=ri(t.getLineContent(h));return c.removeText&&(f=f.substring(0,f.length-c.removeText)),c.indentAction===Ji.Indent||c.indentAction===Ji.IndentOutdent?f=r.shiftIndent(f):c.indentAction===Ji.Outdent&&(f=r.unshiftIndent(f)),a.shouldDecrease(u)&&(f=r.unshiftIndent(f)),c.appendText&&(f+=c.appendText),ri(f)}}return a.shouldDecrease(u)?l.action===Ji.Indent?l.indentation:r.unshiftIndent(l.indentation):l.action===Ji.Indent?r.shiftIndent(l.indentation):l.indentation}return null}getIndentForEnter(e,t,i,s){if(e<4)return null;t.forceTokenization(i.startLineNumber);const r=t.getLineTokens(i.startLineNumber),o=WC(r,i.startColumn-1),a=o.getLineContent();let l=!1,u;o.firstCharOffset>0&&r.getLanguageId(0)!==o.languageId?(l=!0,u=a.substr(0,i.startColumn-1-o.firstCharOffset)):u=r.getLineContent().substring(0,i.startColumn-1);let h;i.isEmpty()?h=a.substr(i.startColumn-1-o.firstCharOffset):h=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-o.firstCharOffset);const c=this.getIndentRulesSupport(o.languageId);if(!c)return null;const f=u,g=ri(u),m={getLineTokens:b=>t.getLineTokens(b),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(b,y)=>t.getLanguageIdAtPosition(b,y),getLineContent:b=>b===i.startLineNumber?f:t.getLineContent(b)},v=ri(r.getLineContent()),S=this.getInheritIndentForLine(e,m,i.startLineNumber+1);if(!S){const b=l?v:g;return{beforeEnter:b,afterEnter:b}}let w=l?v:S.indentation;return S.action===Ji.Indent&&(w=s.shiftIndent(w)),c.shouldDecrease(h)&&(w=s.unshiftIndent(w)),{beforeEnter:l?v:g,afterEnter:w}}getIndentActionForType(e,t,i,s,r){if(e<4)return null;const o=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn);if(o.firstCharOffset)return null;const a=this.getIndentRulesSupport(o.languageId);if(!a)return null;const l=o.getLineContent(),u=l.substr(0,i.startColumn-1-o.firstCharOffset);let h;if(i.isEmpty()?h=l.substr(i.startColumn-1-o.firstCharOffset):h=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-o.firstCharOffset),!a.shouldDecrease(u+h)&&a.shouldDecrease(u+s+h)){const c=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!c)return null;let f=c.indentation;return c.action!==Ji.Indent&&(f=r.unshiftIndent(f)),f}return null}getIndentMetadata(e,t){const i=this.getIndentRulesSupport(e.getLanguageId());return!i||t<1||t>e.getLineCount()?null:i.getIndentMetadata(e.getLineContent(t))}getEnterAction(e,t,i){const s=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn),r=this.getLanguageConfiguration(s.languageId);if(!r)return null;const o=s.getLineContent(),a=o.substr(0,i.startColumn-1-s.firstCharOffset);let l;i.isEmpty()?l=o.substr(i.startColumn-1-s.firstCharOffset):l=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-s.firstCharOffset);let u="";if(i.startLineNumber>1&&s.firstCharOffset===0){const v=this.getScopedLineTokens(t,i.startLineNumber-1);v.languageId===s.languageId&&(u=v.getLineContent())}const h=r.onEnter(e,u,a,l);if(!h)return null;const c=h.indentAction;let f=h.appendText;const g=h.removeText||0;f?c===Ji.Indent&&(f=" "+f):c===Ji.Indent||c===Ji.IndentOutdent?f=" ":f="";let m=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return g&&(m=m.substring(0,m.length-g)),{indentAction:c,appendText:f,removeText:g,indentation:m}}getIndentationAtPosition(e,t,i){const s=e.getLineContent(t);let r=ri(s);return r.length>i-1&&(r=r.substring(0,i-1)),r}getScopedLineTokens(e,t,i){e.forceTokenization(t);const s=e.getLineTokens(t),r=typeof i>"u"?e.getLineMaxColumn(t)-1:i-1;return WC(s,r)}}const Jt=new Are;class Mre{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new CB(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ct(()=>{for(let s=0;se.configuration)))}}function j9(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class CB{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class Jv{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new zg(this.underlyingConfig):null,this.comments=Jv._handleComments(this.underlyingConfig),this.characterPair=new Wp(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||l9,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new pre(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{}}getWordDefinition(){return vS(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new lre(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new gre(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}static _handleComments(e){let t=e.comments;if(!t)return null;let i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){let[s,r]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=r}return i}}xf(ob,TS);function Jh(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class ot{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=Jh(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class ga{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Jh(Math.max(Math.min(1,t),0),3),this.l=Jh(Math.max(Math.min(1,i),0),3),this.a=Jh(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,r=e.a,o=Math.max(t,i,s),a=Math.min(t,i,s);let l=0,u=0;const h=(a+o)/2,c=o-a;if(c>0){switch(u=Math.min(h<=.5?c/(2*h):c/(2-2*h),1),o){case t:l=(i-s)/c+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:r}=e;let o,a,l;if(i===0)o=a=l=s;else{const u=s<.5?s*(1+i):s+i-s*i,h=2*s-u;o=ga._hue2rgb(h,u,t+1/3),a=ga._hue2rgb(h,u,t),l=ga._hue2rgb(h,u,t-1/3)}return new ot(Math.round(o*255),Math.round(a*255),Math.round(l*255),r)}}class bl{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Jh(Math.max(Math.min(1,t),0),3),this.v=Jh(Math.max(Math.min(1,i),0),3),this.a=Jh(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,r=Math.max(t,i,s),o=Math.min(t,i,s),a=r-o,l=r===0?0:a/r;let u;return a===0?u=0:r===t?u=((i-s)/a%6+6)%6:r===i?u=(s-t)/a+2:u=(t-i)/a+4,new bl(Math.round(u*60),l,r,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:r}=e,o=s*i,a=o*(1-Math.abs(t/60%2-1)),l=s-o;let[u,h,c]=[0,0,0];return t<60?(u=o,h=a):t<120?(u=a,h=o):t<180?(h=o,c=a):t<240?(h=a,c=o):t<300?(u=a,c=o):t<=360&&(u=o,c=a),u=Math.round((u+l)*255),h=Math.round((h+l)*255),c=Math.round((c+l)*255),new ot(u,h,c,r)}}class q{constructor(e){if(e)if(e instanceof ot)this.rgba=e;else if(e instanceof ga)this._hsla=e,this.rgba=ga.toRGBA(e);else if(e instanceof bl)this._hsva=e,this.rgba=bl.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}static fromHex(e){return q.Format.CSS.parseHex(e)||q.red}get hsla(){return this._hsla?this._hsla:ga.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:bl.fromRGBA(this.rgba)}equals(e){return!!e&&ot.equals(this.rgba,e.rgba)&&ga.equals(this.hsla,e.hsla)&&bl.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=q._relativeLuminanceForComponent(this.rgba.r),t=q._relativeLuminanceForComponent(this.rgba.g),i=q._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return Jh(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t=e}function zC(n){return wi(n.lineNumber-1,n.column-1)}function nv(n,e){const t=n,i=Math.floor(t/vr),s=t-i*vr,r=e,o=Math.floor(r/vr),a=r-o*vr;return new M(i+1,s+1,o+1,a+1)}function Hre(n){const e=Ml(n);return wi(e.length-1,e[e.length-1].length)}class SB{constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}}class zre{constructor(e,t){this.documentLength=t,this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(i=>d2.from(i))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):this.documentLength;return Vre(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?wi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):wi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=ec(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?wi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):wi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx=65536?2:1,l===9)o=Mt.nextRenderTabStop(o,i);else{let u=rg(l);for(;a=65536?2:1,u=c}Sa(l)||Z_(l)?o=o+2:o=o+1}}return o}static visibleColumnsByColumns(e,t){const i=e.length;let s=new Array;s.push(-1);let r=0,o=0;for(;o=65536?2:1,s.push(r),a>=65536&&s.push(r),a===9)r=Mt.nextRenderTabStop(r,t);else{let l=rg(a);for(;o=65536?2:1,s.push(r),a>=65536&&s.push(r),l=h}Sa(a)||Z_(a)?r=r+2:r=r+1}}return s.push(r),s}static visibleColumnFromColumn2(e,t,i){return this.visibleColumnFromColumn(t.getLineContent(i.lineNumber),i.column,e.tabSize)}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const s=e.length;let r=0,o=1,a=0;for(;a=65536?2:1;let u;if(l===9)u=Mt.nextRenderTabStop(r,i);else{let c=rg(l);for(;a=65536?2:1,c=g}Sa(l)||Z_(l)?u=r+2:u=r+1}const h=a+1;if(u>=t){const c=t-r;return u-ta?a:r}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}const o1=new Array;class Mi{constructor(e,t){this.items=e,this.additionalItems=t}static create(e,t){if(e<=128&&t.length===0){let i=Mi.cache[e];return i||(i=new Mi(e,t),Mi.cache[e]=i),i}return new Mi(e,t)}static getEmpty(){return this.empty}add(e,t){const i=t.getKey(e);let s=i>>5;if(s===0){const o=1<0;)t=t.getChild(i-1);return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let s=1;sthis.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const r=this.lineTokens,o=r.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=Fre(e,t,this.lineIdx,this.lineCharOffset);return new Th(s,0,-1,Mi.getEmpty(),new wg(s))}}class Yre{constructor(e,t){this.text=e,this._offset=qu,this.idx=0;const s=t.getRegExpStr()?new RegExp(t.getRegExpStr()+`| +`,"g"):null,r=[];let o,a=0,l=0,u=0,h=0;const c=new Array;for(let m=0;m<60;m++)c.push(new Th(wi(0,m),0,-1,Mi.getEmpty(),new wg(wi(0,m))));const f=new Array;for(let m=0;m<60;m++)f.push(new Th(wi(1,m),0,-1,Mi.getEmpty(),new wg(wi(1,m))));if(s)for(s.lastIndex=0;(o=s.exec(e))!==null;){const m=o.index,v=o[0];if(v===` +`)a++,l=m+1;else{if(u!==m){let S;if(h===a){const w=m-u;if(wXre(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"g"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e)}get isEmpty(){return this.map.size===0}}function Xre(n){const e=Na(n);return/^[\w ]+$/.test(n)?`\\b${e}\\b`:e}class Qre{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){const t=this.languageIdToBracketTokens.get(e);if(!t)return!1;const i=MS.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider).getRegExpStr();return t.getRegExpStr()!==i}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=MS.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Jre(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const o=e,a=n[o].listHeight;for(e++;e=2?q9(o===0&&e===n.length?n:n.slice(o,e),!1):n[o]}let i=t(),s=t();if(!s)return i;for(let o=t();o;o=t())LB(i,s)<=LB(s,o)?(i=kk(i,s),s=o):s=kk(s,o);return kk(i,s)}function q9(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s=3?n[2]:null,e)}function LB(n,e){return Math.abs(n.listHeight-e.listHeight)}function kk(n,e){return n.listHeight===e.listHeight?Ol.create23(n,e,null,!1):n.listHeight>e.listHeight?eoe(n,e):toe(e,n)}function eoe(n,e){n=n.toMutable();let t=n;const i=new Array;let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let r=i.length-1;r>=0;r--){const o=i[r];s?o.childrenLength>=3?s=Ol.create23(o.unappendChild(),s,null,!1):(o.appendChildOfSameHeight(s),s=void 0):o.handleChildrenChanged()}return s?Ol.create23(n,s,null,!1):n}function toe(n,e){n=n.toMutable();let t=n;const i=new Array;for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let r=i.length-1;r>=0;r--){const o=i[r];s?o.childrenLength>=3?s=Ol.create23(s,o.unprependChild(),null,!1):(o.prependChildOfSameHeight(s),s=void 0):o.handleChildrenChanged()}return s?Ol.create23(s,n,null,!1):n}class ioe{constructor(e){this.lastOffset=qu,this.nextNodes=[e],this.offsets=[qu],this.idxs=[]}readLongestNodeAt(e,t){if(r1(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=r_(this.nextNodes);if(!i)return;const s=r_(this.offsets);if(r1(e,s))return;if(r1(s,e))if(Cn(s,i.length)<=e)this.nextNodeAfterCurrent();else{const r=Ek(i);r!==-1?(this.nextNodes.push(i.getChild(r)),this.offsets.push(s),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const r=Ek(i);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(r)),this.offsets.push(s),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=r_(this.offsets),t=r_(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=r_(this.nextNodes),s=Ek(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(Cn(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function Ek(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function r_(n){return n.length>0?n[n.length-1]:void 0}function DB(n,e,t,i){return new noe(n,e,t,i).parseDocument()}class noe{constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new ioe(i):void 0,this.positionMapper=new zre(t,e.length)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Mi.getEmpty());return e||(e=Ol.getEmpty()),e}parseList(e){const t=new Array;for(;;){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;const r=this.parseChild(e);r.kind===4&&r.childrenLength===0||t.push(r)}return this.oldNodeReader?Jre(t):q9(t,this.createImmutableLists)}parseChild(e){if(this.oldNodeReader){const i=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(!Bre(i)){const s=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),r=>r1(r.length,i)?r.canBeReused(e):!1);if(s)return this._itemsFromCache++,this.tokenizer.skip(s.length),s}}this._itemsConstructed++;const t=this.tokenizer.read();switch(t.kind){case 2:return new Gre(t.bracketIds,t.length);case 0:return t.astNode;case 1:const i=e.merge(t.bracketIds),s=this.parseList(i),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===t.bracketId||r.bracketIds.intersects(t.bracketIds))?(this.tokenizer.read(),e0.create(t.astNode,s,r.astNode)):e0.create(t.astNode,s,null);default:throw new Error("unexpected")}}}class soe extends ie{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.cache=this._register(new xr),this.onDidChangeEmitter=new H,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(e.onDidChangeOptions(i=>{this.cache.clear(),this.updateCache()})),this._register(e.onDidChangeLanguage(i=>{this.cache.clear(),this.updateCache()})),this._register(this.languageConfigurationService.onDidChange(i=>{var s;(!i.languageId||((s=this.cache.value)===null||s===void 0?void 0:s.object.didLanguageChange(i.languageId)))&&(this.cache.clear(),this.updateCache())}))}get isDocumentSupported(){return this.textModel.getValueLength()<=5e6}updateCache(){if(this.bracketsRequested&&this.isDocumentSupported){if(!this.cache.value){const e=new pe;this.cache.value=roe(e.add(new ooe(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.cache.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.cache.clear(),this.onDidChangeEmitter.fire()}handleContentChanged(e){var t;(t=this.cache.value)===null||t===void 0||t.object.handleContentChanged(e)}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateCache(),((t=this.cache.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||[]}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateCache(),((t=this.cache.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||[]}getBracketsInRange(e){var t;return this.bracketsRequested=!0,this.updateCache(),((t=this.cache.value)===null||t===void 0?void 0:t.object.getBracketsInRange(e))||[]}}function roe(n,e){return{object:n,dispose:()=>e?.dispose()}}class ooe extends ie{constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new H,this.denseKeyProvider=new Ure,this.brackets=new Qre(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this._register(e.onBackgroundTokenizationStateChanged(()=>{if(e.backgroundTokenizationState===2){const i=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,i||this.didChangeEmitter.fire()}})),this._register(e.onDidChangeTokens(({ranges:i})=>{const s=i.map(r=>new SB(wi(r.fromLineNumber-1,0),wi(r.toLineNumber,0),wi(r.toLineNumber-r.fromLineNumber+1,0)));this.astWithTokens=this.parseDocumentFromTextBuffer(s,this.astWithTokens,!1),this.initialAstWithoutTokens||this.didChangeEmitter.fire()})),e.backgroundTokenizationState===0){const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new Yre(this.textModel.getValue(),i);this.initialAstWithoutTokens=DB(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}else e.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):e.backgroundTokenizationState===1&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens)}didLanguageChange(e){return this.brackets.didLanguageChange(e)}handleContentChanged(e){const t=e.changes.map(i=>{const s=M.lift(i.range);return new SB(zC(s.getStartPosition()),zC(s.getEndPosition()),Hre(i.text))}).reverse();this.astWithTokens=this.parseDocumentFromTextBuffer(t,this.astWithTokens,!1),this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(t,this.initialAstWithoutTokens,!1))}parseDocumentFromTextBuffer(e,t,i){const s=t,r=new qre(this.textModel,this.brackets);return DB(r,e,s,i)}getBracketsInRange(e){const t=wi(e.startLineNumber-1,e.startColumn-1),i=wi(e.endLineNumber-1,e.endColumn-1),s=new Array,r=this.initialAstWithoutTokens||this.astWithTokens;return T_(r,qu,r.length,t,i,s),s}getBracketPairsInRange(e,t){const i=new Array,s=zC(e.getStartPosition()),r=zC(e.getEndPosition()),o=this.initialAstWithoutTokens||this.astWithTokens,a=new aoe(i,t,this.textModel);return Z9(o,qu,o.length,s,r,a),i}}function T_(n,e,t,i,s,r,o=0){if(n.kind===1){const a=nv(e,t);r.push(new wB(a,o-1,!1))}else if(n.kind===3){const a=nv(e,t);r.push(new wB(a,o-1,!0))}else if(n.kind===4)for(const a of n.children)t=Cn(e,a.length),vd(e,s)&&HC(t,i)&&T_(a,e,t,i,s,r,o),e=t;else if(n.kind===2){o++;{const a=n.openingBracket;t=Cn(e,a.length),vd(e,s)&&HC(t,i)&&T_(a,e,t,i,s,r,o),e=t}if(n.child){const a=n.child;t=Cn(e,a.length),vd(e,s)&&HC(t,i)&&T_(a,e,t,i,s,r,o),e=t}if(n.closingBracket){const a=n.closingBracket;t=Cn(e,a.length),vd(e,s)&&HC(t,i)&&T_(a,e,t,i,s,r,o),e=t}}}class aoe{constructor(e,t,i){this.result=e,this.includeMinIndentation=t,this.textModel=i}}function Z9(n,e,t,i,s,r,o=0){var a;if(n.kind===2){const u=Cn(e,n.openingBracket.length);let h=-1;r.includeMinIndentation&&(h=n.computeMinIndentation(e,r.textModel)),r.result.push(new Ore(nv(e,t),nv(e,u),n.closingBracket?nv(Cn(u,((a=n.child)===null||a===void 0?void 0:a.length)||qu),t):void 0,o,h)),o++}let l=e;for(const u of n.children){const h=l;l=Cn(l,u.length),vd(h,s)&&vd(i,l)&&Z9(u,h,l,i,s,r,o)}}const Y9={ColorContribution:"base.contributions.colors"};class loe{constructor(){this._onDidChangeSchema=new H,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,r){let o={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:r};this.colorsById[e]=o;let a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const s=i.defaults[t.type];return pu(s,t)}}getColorSchema(){return this.colorSchema}toString(){let e=(t,i)=>{let s=t.indexOf(".")===-1?0:1,r=i.indexOf(".")===-1?0:1;return s!==r?s-r:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const fL=new loe;yn.add(Y9.ColorContribution,fL);function W(n,e,t,i,s){return fL.registerColor(n,e,t,i,s)}const Ee=W("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},_("foreground","Overall foreground color. This color is only used if not overridden by a component.")),uoe=W("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},_("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),Ik=W("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},_("iconForeground","The default color for icons in the workbench.")),gc=W("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},_("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Pi=W("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},_("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),As=W("contrastActiveBorder",{light:null,dark:null,hc:gc},_("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),gL=W("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},_("textLinkForeground","Foreground color for links in text.")),pL=W("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},_("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover.")),X9=W("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:q.black},_("textCodeBlockBackground","Background color for code blocks in text.")),Hp=W("widget.shadow",{dark:Yt(q.black,.36),light:Yt(q.black,.16),hc:null},_("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),Q9=W("input.background",{dark:"#3C3C3C",light:q.white,hc:q.black},_("inputBoxBackground","Input box background.")),J9=W("input.foreground",{dark:Ee,light:Ee,hc:Ee},_("inputBoxForeground","Input box foreground.")),eH=W("input.border",{dark:null,light:null,hc:Pi},_("inputBoxBorder","Input box border.")),NN=W("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:Pi},_("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),TN=W("inputOption.activeBackground",{dark:Yt(gc,.4),light:Yt(gc,.2),hc:q.transparent},_("inputOption.activeBackground","Background color of activated options in input fields.")),AN=W("inputOption.activeForeground",{dark:q.white,light:q.black,hc:null},_("inputOption.activeForeground","Foreground color of activated options in input fields.")),p2=W("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:q.black},_("inputValidationInfoBackground","Input validation background color for information severity.")),m2=W("inputValidation.infoForeground",{dark:null,light:null,hc:null},_("inputValidationInfoForeground","Input validation foreground color for information severity.")),_2=W("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:Pi},_("inputValidationInfoBorder","Input validation border color for information severity.")),tH=W("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:q.black},_("inputValidationWarningBackground","Input validation background color for warning severity.")),iH=W("inputValidation.warningForeground",{dark:null,light:null,hc:null},_("inputValidationWarningForeground","Input validation foreground color for warning severity.")),nH=W("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:Pi},_("inputValidationWarningBorder","Input validation border color for warning severity.")),sH=W("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:q.black},_("inputValidationErrorBackground","Input validation background color for error severity.")),rH=W("inputValidation.errorForeground",{dark:null,light:null,hc:null},_("inputValidationErrorForeground","Input validation foreground color for error severity.")),oH=W("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:Pi},_("inputValidationErrorBorder","Input validation border color for error severity.")),Nk=W("dropdown.background",{dark:"#3C3C3C",light:q.white,hc:q.black},_("dropdownBackground","Dropdown background.")),xB=W("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:q.white},_("dropdownForeground","Dropdown foreground.")),hoe=W("button.foreground",{dark:q.white,light:q.white,hc:q.white},_("buttonForeground","Button foreground color.")),MN=W("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},_("buttonBackground","Button background color.")),coe=W("button.hoverBackground",{dark:fH(MN,.2),light:dH(MN,.2),hc:null},_("buttonHoverBackground","Button background color when hovering.")),sv=W("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:q.black},_("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),rv=W("badge.foreground",{dark:q.white,light:"#333",hc:q.white},_("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),lb=W("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},_("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),ov=W("scrollbarSlider.background",{dark:q.fromHex("#797979").transparent(.4),light:q.fromHex("#646464").transparent(.4),hc:Yt(Pi,.6)},_("scrollbarSliderBackground","Scrollbar slider background color.")),av=W("scrollbarSlider.hoverBackground",{dark:q.fromHex("#646464").transparent(.7),light:q.fromHex("#646464").transparent(.7),hc:Yt(Pi,.8)},_("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),lv=W("scrollbarSlider.activeBackground",{dark:q.fromHex("#BFBFBF").transparent(.4),light:q.fromHex("#000000").transparent(.6),hc:Pi},_("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),doe=W("progressBar.background",{dark:q.fromHex("#0E70C0"),light:q.fromHex("#0E70C0"),hc:Pi},_("progressBarBackground","Background color of the progress bar that can show for long running operations.")),foe=W("editorError.background",{dark:null,light:null,hc:null},_("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),uv=W("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hc:null},_("editorError.foreground","Foreground color of error squigglies in the editor.")),aH=W("editorError.border",{dark:null,light:null,hc:q.fromHex("#E47777").transparent(.8)},_("errorBorder","Border color of error boxes in the editor.")),goe=W("editorWarning.background",{dark:null,light:null,hc:null},_("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Wu=W("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hc:null},_("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),mL=W("editorWarning.border",{dark:null,light:null,hc:q.fromHex("#FFCC00").transparent(.8)},_("warningBorder","Border color of warning boxes in the editor.")),poe=W("editorInfo.background",{dark:null,light:null,hc:null},_("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Da=W("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},_("editorInfo.foreground","Foreground color of info squigglies in the editor.")),v2=W("editorInfo.border",{dark:null,light:null,hc:q.fromHex("#3794FF").transparent(.8)},_("infoBorder","Border color of info boxes in the editor.")),moe=W("editorHint.foreground",{dark:q.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},_("editorHint.foreground","Foreground color of hint squigglies in the editor.")),_oe=W("editorHint.border",{dark:null,light:null,hc:q.fromHex("#eeeeee").transparent(.8)},_("hintBorder","Border color of hint boxes in the editor.")),Zr=W("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:q.black},_("editorBackground","Editor background color.")),tc=W("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:q.white},_("editorForeground","Editor default foreground color.")),zo=W("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},_("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),ic=W("editorWidget.foreground",{dark:Ee,light:Ee,hc:Ee},_("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Ad=W("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:Pi},_("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.")),voe=W("editorWidget.resizeBorder",{light:null,dark:null,hc:null},_("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.")),kB=W("quickInput.background",{dark:zo,light:zo,hc:zo},_("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),boe=W("quickInput.foreground",{dark:ic,light:ic,hc:ic},_("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Coe=W("quickInputTitle.background",{dark:new q(new ot(255,255,255,.105)),light:new q(new ot(0,0,0,.06)),hc:"#000000"},_("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),woe=W("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:q.white},_("pickerGroupForeground","Quick picker color for grouping labels.")),Soe=W("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:q.white},_("pickerGroupBorder","Quick picker color for grouping borders.")),yoe=W("keybindingLabel.background",{dark:new q(new ot(128,128,128,.17)),light:new q(new ot(221,221,221,.4)),hc:q.transparent},_("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Loe=W("keybindingLabel.foreground",{dark:q.fromHex("#CCCCCC"),light:q.fromHex("#555555"),hc:q.white},_("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Doe=W("keybindingLabel.border",{dark:new q(new ot(51,51,51,.6)),light:new q(new ot(204,204,204,.4)),hc:new q(new ot(111,195,223))},_("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),xoe=W("keybindingLabel.bottomBorder",{dark:new q(new ot(68,68,68,.6)),light:new q(new ot(187,187,187,.4)),hc:new q(new ot(111,195,223))},_("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),nc=W("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},_("editorSelectionBackground","Color of the editor selection.")),koe=W("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},_("editorSelectionForeground","Color of the selected text for high contrast.")),b2=W("editor.inactiveSelectionBackground",{light:Yt(nc,.5),dark:Yt(nc,.5),hc:Yt(nc,.5)},_("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),lH=W("editor.selectionHighlightBackground",{light:NB(nc,Zr,.3,.6),dark:NB(nc,Zr,.3,.6),hc:null},_("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);W("editor.selectionHighlightBorder",{light:null,dark:null,hc:As},_("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const Eoe=W("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},_("editorFindMatch","Color of the current search match.")),RN=W("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},_("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Ioe=W("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},_("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Noe=W("editor.findMatchBorder",{light:null,dark:null,hc:As},_("editorFindMatchBorder","Border color of the current search match.")),Toe=W("editor.findMatchHighlightBorder",{light:null,dark:null,hc:As},_("findMatchHighlightBorder","Border color of the other search matches.")),Aoe=W("editor.findRangeHighlightBorder",{dark:null,light:null,hc:Yt(As,.4)},_("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Moe=W("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},_("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),i0=W("editorHoverWidget.background",{light:zo,dark:zo,hc:zo},_("hoverBackground","Background color of the editor hover.")),Roe=W("editorHoverWidget.foreground",{light:ic,dark:ic,hc:ic},_("hoverForeground","Foreground color of the editor hover.")),Ooe=W("editorHoverWidget.border",{light:Ad,dark:Ad,hc:Ad},_("hoverBorder","Border color of the editor hover.")),Poe=W("editorHoverWidget.statusBarBackground",{dark:fH(i0,.2),light:dH(i0,.05),hc:zo},_("statusBarBackground","Background color of the editor hover status bar.")),Foe=W("editorLink.activeForeground",{dark:"#4E94CE",light:q.blue,hc:q.cyan},_("activeLinkForeground","Color of active links.")),cp=W("editorInlayHint.foreground",{dark:Yt(rv,.8),light:Yt(rv,.8),hc:rv},_("editorInlayHintForeground","Foreground color of inline hints")),dp=W("editorInlayHint.background",{dark:Yt(sv,.6),light:Yt(sv,.3),hc:sv},_("editorInlayHintBackground","Background color of inline hints"));W("editorInlayHint.typeForeground",{dark:cp,light:cp,hc:cp},_("editorInlayHintForegroundTypes","Foreground color of inline hints for types"));W("editorInlayHint.typeBackground",{dark:dp,light:dp,hc:dp},_("editorInlayHintBackgroundTypes","Background color of inline hints for types"));W("editorInlayHint.parameterForeground",{dark:cp,light:cp,hc:cp},_("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters"));W("editorInlayHint.parameterBackground",{dark:dp,light:dp,hc:dp},_("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));const Boe=W("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},_("editorLightBulbForeground","The color used for the lightbulb actions icon.")),Woe=W("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},_("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),ON=new q(new ot(155,185,85,.2)),PN=new q(new ot(255,0,0,.2)),uH=W("diffEditor.insertedTextBackground",{dark:ON,light:ON,hc:null},_("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),hH=W("diffEditor.removedTextBackground",{dark:PN,light:PN,hc:null},_("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),Voe=W("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},_("diffEditorInsertedOutline","Outline color for the text that got inserted.")),Hoe=W("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},_("diffEditorRemovedOutline","Outline color for text that got removed.")),zoe=W("diffEditor.border",{dark:null,light:null,hc:Pi},_("diffEditorBorder","Border color between the two text editors.")),Uoe=W("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},_("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),$oe=W("list.focusBackground",{dark:null,light:null,hc:null},_("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.")),Koe=W("list.focusForeground",{dark:null,light:null,hc:null},_("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.")),joe=W("list.focusOutline",{dark:gc,light:gc,hc:As},_("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),sc=W("list.activeSelectionBackground",{dark:"#094771",light:"#0060C0",hc:null},_("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.")),rc=W("list.activeSelectionForeground",{dark:q.white,light:q.white,hc:null},_("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.")),a1=W("list.activeSelectionIconForeground",{dark:null,light:null,hc:null},_("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Goe=W("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},_("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.")),qoe=W("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},_("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.")),Zoe=W("list.inactiveSelectionIconForeground",{dark:null,light:null,hc:null},_("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Yoe=W("list.inactiveFocusBackground",{dark:null,light:null,hc:null},_("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.")),Xoe=W("list.inactiveFocusOutline",{dark:null,light:null,hc:null},_("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Qoe=W("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},_("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Joe=W("list.hoverForeground",{dark:null,light:null,hc:null},_("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),eae=W("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},_("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),fp=W("list.highlightForeground",{dark:"#18A3FF",light:"#0066BF",hc:gc},_("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),Tk=W("list.focusHighlightForeground",{dark:fp,light:Tae(sc,fp,"#9DDDFF"),hc:fp},_("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),tae=W("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:q.black},_("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),iae=W("listFilterWidget.outline",{dark:q.transparent,light:q.transparent,hc:"#f38518"},_("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),nae=W("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:Pi},_("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),sae=W("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},_("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),rae=W("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hc:null},_("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),EB=W("quickInput.list.focusBackground",{dark:null,light:null,hc:null},"",void 0,_("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),l1=W("quickInputList.focusForeground",{dark:rc,light:rc,hc:rc},_("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),u1=W("quickInputList.focusIconForeground",{dark:a1,light:a1,hc:a1},_("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),h1=W("quickInputList.focusBackground",{dark:n0(EB,sc),light:n0(EB,sc),hc:null},_("quickInput.listFocusBackground","Quick picker background color for the focused item.")),oae=W("menu.border",{dark:null,light:null,hc:Pi},_("menuBorder","Border color of menus.")),aae=W("menu.foreground",{dark:xB,light:Ee,hc:xB},_("menuForeground","Foreground color of menu items.")),lae=W("menu.background",{dark:Nk,light:Nk,hc:Nk},_("menuBackground","Background color of menu items.")),uae=W("menu.selectionForeground",{dark:rc,light:rc,hc:rc},_("menuSelectionForeground","Foreground color of the selected menu item in menus.")),hae=W("menu.selectionBackground",{dark:sc,light:sc,hc:sc},_("menuSelectionBackground","Background color of the selected menu item in menus.")),cae=W("menu.selectionBorder",{dark:null,light:null,hc:As},_("menuSelectionBorder","Border color of the selected menu item in menus.")),dae=W("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:Pi},_("menuSeparatorBackground","Color of a separator menu item in menus.")),fae=W("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hc:null},_("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse")),gae=W("editor.snippetTabstopHighlightBackground",{dark:new q(new ot(124,124,124,.3)),light:new q(new ot(10,50,100,.2)),hc:new q(new ot(124,124,124,.3))},_("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),pae=W("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},_("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),mae=W("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},_("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),_ae=W("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new q(new ot(10,50,100,.5)),hc:"#525252"},_("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),C2=W("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},_("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),vae=W("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},_("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),cH=W("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},_("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),bae=W("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hc:"#ffffff"},_("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),IB=W("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},_("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Cae=W("minimap.errorHighlight",{dark:new q(new ot(255,18,18,.7)),light:new q(new ot(255,18,18,.7)),hc:new q(new ot(255,50,50,1))},_("minimapError","Minimap marker color for errors.")),wae=W("minimap.warningHighlight",{dark:Wu,light:Wu,hc:mL},_("overviewRuleWarning","Minimap marker color for warnings.")),Sae=W("minimap.background",{dark:null,light:null,hc:null},_("minimapBackground","Minimap background color.")),yae=W("minimap.foregroundOpacity",{dark:q.fromHex("#000f"),light:q.fromHex("#000f"),hc:q.fromHex("#000f")},_("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),Lae=W("minimapSlider.background",{light:Yt(ov,.5),dark:Yt(ov,.5),hc:Yt(ov,.5)},_("minimapSliderBackground","Minimap slider background color.")),Dae=W("minimapSlider.hoverBackground",{light:Yt(av,.5),dark:Yt(av,.5),hc:Yt(av,.5)},_("minimapSliderHoverBackground","Minimap slider background color when hovering.")),xae=W("minimapSlider.activeBackground",{light:Yt(lv,.5),dark:Yt(lv,.5),hc:Yt(lv,.5)},_("minimapSliderActiveBackground","Minimap slider background color when clicked on.")),kae=W("problemsErrorIcon.foreground",{dark:uv,light:uv,hc:uv},_("problemsErrorIconForeground","The color used for the problems error icon.")),Eae=W("problemsWarningIcon.foreground",{dark:Wu,light:Wu,hc:Wu},_("problemsWarningIconForeground","The color used for the problems warning icon.")),Iae=W("problemsInfoIcon.foreground",{dark:Da,light:Da,hc:Da},_("problemsInfoIconForeground","The color used for the problems info icon."));function Nae(n,e){var t,i,s;switch(n.op){case 0:return(t=pu(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=pu(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(s=pu(n.value,e))===null||s===void 0?void 0:s.transparent(n.factor);case 3:for(const a of n.values){const l=pu(a,e);if(l)return l}return;case 5:return pu(e.defines(n.if)?n.then:n.else,e);case 4:const r=pu(n.value,e);if(!r)return;const o=pu(n.background,e);return o?r.isDarkerThan(o)?q.getLighterColor(r,o,n.factor).transparent(n.transparency):q.getDarkerColor(r,o,n.factor).transparent(n.transparency):r.transparent(n.factor*n.transparency);default:throw rte()}}function dH(n,e){return{op:0,value:n,factor:e}}function fH(n,e){return{op:1,value:n,factor:e}}function Yt(n,e){return{op:2,value:n,factor:e}}function n0(...n){return{op:3,values:n}}function Tae(n,e,t){return{op:5,if:n,then:e,else:t}}function NB(n,e,t,i){return{op:4,value:n,background:e,factor:t,transparency:i}}function pu(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?q.fromHex(n):e.getColor(n);if(n instanceof q)return n;if(typeof n=="object")return Nae(n,e)}}const gH="vscode://schemas/workbench-colors";let pH=yn.as(dL.JSONContribution);pH.registerSchema(gH,fL.getColorSchema());const TB=new mi(()=>pH.notifySchemaChanged(gH),200);fL.onDidChangeSchema(()=>{TB.isScheduled()||TB.schedule()});const Aae=W("editor.lineHighlightBackground",{dark:null,light:null,hc:null},_("lineHighlight","Background color for the highlight of line at the cursor position.")),AB=W("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},_("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),Mae=W("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},_("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),Rae=W("editor.rangeHighlightBorder",{dark:null,light:null,hc:As},_("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),Oae=W("editor.symbolHighlightBackground",{dark:RN,light:RN,hc:null},_("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),Pae=W("editor.symbolHighlightBorder",{dark:null,light:null,hc:As},_("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),mH=W("editorCursor.foreground",{dark:"#AEAFAD",light:q.black,hc:q.white},_("caret","Color of the editor cursor.")),Fae=W("editorCursor.background",null,_("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Md=W("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},_("editorWhitespaces","Color of whitespace characters in the editor.")),_L=W("editorIndentGuide.background",{dark:Md,light:Md,hc:Md},_("editorIndentGuides","Color of the editor indentation guides.")),vL=W("editorIndentGuide.activeBackground",{dark:Md,light:Md,hc:Md},_("editorActiveIndentGuide","Color of the active editor indentation guides.")),_H=W("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:q.white},_("editorLineNumbers","Color of editor line numbers.")),Ak=W("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:As},_("editorActiveLineNumber","Color of editor active line number"),!1,_("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),Bae=W("editorLineNumber.activeForeground",{dark:Ak,light:Ak,hc:Ak},_("editorActiveLineNumber","Color of editor active line number")),Wae=W("editorRuler.foreground",{dark:"#5A5A5A",light:q.lightgrey,hc:q.white},_("editorRuler","Color of the editor rulers."));W("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hc:"#999999"},_("editorCodeLensForeground","Foreground color of editor CodeLens"));const Vae=W("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},_("editorBracketMatchBackground","Background color behind matching brackets")),Hae=W("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:Pi},_("editorBracketMatchBorder","Color for matching brackets boxes")),zae=W("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},_("editorOverviewRulerBorder","Color of the overview ruler border.")),Uae=W("editorOverviewRuler.background",null,_("editorOverviewRulerBackground","Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.")),$ae=W("editorGutter.background",{dark:Zr,light:Zr,hc:Zr},_("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),Kae=W("editorUnnecessaryCode.border",{dark:null,light:null,hc:q.fromHex("#fff").transparent(.8)},_("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),jae=W("editorUnnecessaryCode.opacity",{dark:q.fromHex("#000a"),light:q.fromHex("#0007"),hc:null},_("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.`)),vH=W("editorGhostText.border",{dark:null,light:null,hc:q.fromHex("#fff").transparent(.8)},_("editorGhostTextBorder","Border color of ghost text in the editor.")),bH=W("editorGhostText.foreground",{dark:q.fromHex("#ffffff56"),light:q.fromHex("#0007"),hc:null},_("editorGhostTextForeground","Foreground color of the ghost text in the editor.")),Mk=new q(new ot(0,122,204,.6));W("editorOverviewRuler.rangeHighlightForeground",{dark:Mk,light:Mk,hc:Mk},_("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0);const Gae=W("editorOverviewRuler.errorForeground",{dark:new q(new ot(255,18,18,.7)),light:new q(new ot(255,18,18,.7)),hc:new q(new ot(255,50,50,1))},_("overviewRuleError","Overview ruler marker color for errors.")),qae=W("editorOverviewRuler.warningForeground",{dark:Wu,light:Wu,hc:mL},_("overviewRuleWarning","Overview ruler marker color for warnings.")),Zae=W("editorOverviewRuler.infoForeground",{dark:Da,light:Da,hc:v2},_("overviewRuleInfo","Overview ruler marker color for infos.")),CH=W("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hc:"#FFD700"},_("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),wH=W("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hc:"#DA70D6"},_("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),SH=W("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hc:"#87CEFA"},_("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),yH=W("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),LH=W("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),DH=W("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Yae=W("editorBracketHighlight.unexpectedBracket.foreground",{dark:new q(new ot(255,18,18,.8)),light:new q(new ot(255,18,18,.8)),hc:new q(new ot(255,50,50,1))},_("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Xae=W("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Qae=W("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Jae=W("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),ele=W("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),tle=W("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),ile=W("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),nle=W("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),sle=W("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),rle=W("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),ole=W("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),ale=W("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),lle=W("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},_("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));ni((n,e)=>{const t=n.getColor(Zr);t&&e.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${t}; }`);const i=n.getColor(tc);i&&e.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${i}; }`);const s=n.getColor($ae);s&&e.addRule(`.monaco-editor .margin { background-color: ${s}; }`);const r=n.getColor(Mae);r&&e.addRule(`.monaco-editor .rangeHighlight { background-color: ${r}; }`);const o=n.getColor(Rae);o&&e.addRule(`.monaco-editor .rangeHighlight { border: 1px ${n.type==="hc"?"dotted":"solid"} ${o}; }`);const a=n.getColor(Oae);a&&e.addRule(`.monaco-editor .symbolHighlight { background-color: ${a}; }`);const l=n.getColor(Pae);l&&e.addRule(`.monaco-editor .symbolHighlight { border: 1px ${n.type==="hc"?"dotted":"solid"} ${l}; }`);const u=n.getColor(Md);u&&(e.addRule(`.monaco-editor .mtkw { color: ${u} !important; }`),e.addRule(`.monaco-editor .mtkz { color: ${u} !important; }`))});class ule extends ie{constructor(e){super(),this.textModel=e,this.colorProvider=new xH,this.onDidChangeEmitter=new H,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.onDidChangeOptions(t=>{this.colorizationOptions=e.getOptions().bracketPairColorizationOptions})),this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}getDecorationsInRange(e,t,i){if(t===void 0)return[];if(!this.colorizationOptions.enabled)return[];const s=new Array,r=this.textModel.bracketPairs.getBracketsInRange(e);for(const o of r)s.push({id:`bracket${o.range.toString()}-${o.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(o)},ownerId:0,range:o.range});return s}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new M(1,1,this.textModel.getLineCount(),1),e,t):[]}}class xH{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}ni((n,e)=>{const t=[CH,wH,SH,yH,LH,DH],i=new xH;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(Yae)}; }`);let s=t.map(r=>n.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const o=s[r%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(r)} { color: ${o}; }`)}});var hle=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},Rk=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function cle(){return new Zse}function dle(n){const e=cle();return e.acceptChunk(n),e.finish()}function MB(n,e){return(typeof n=="string"?dle(n):n).create(e)}let UC=0;const fle=999,gle=1e4;class ple{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,i=0;do{let s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const o_=()=>{throw new Error("Invalid change accessor")};class Su{constructor(){this._searchCanceledBrand=void 0}}Su.INSTANCE=new Su;function $C(n){return n instanceof Su?null:n}let Zs=class sl extends ie{constructor(e,t,i,s=null,r,o,a){super(),this._undoRedoService=r,this._modeService=o,this._languageConfigurationService=a,this._onWillDispose=this._register(new H),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new ble(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new H),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new H),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new H),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new H),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new H),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeContentOrInjectedText=this._register(new H),this.onDidChangeContentOrInjectedText=this._onDidChangeContentOrInjectedText.event,this._eventEmitter=this._register(new Cle),this._backgroundTokenizationState=0,this._onBackgroundTokenizationStateChanged=this._register(new H),this.onBackgroundTokenizationStateChanged=this._onBackgroundTokenizationStateChanged.event,this._register(this._eventEmitter.fastEvent(f=>{this._onDidChangeContentOrInjectedText.fire(f.rawContentChangedEvent)})),UC++,this.id="$model"+UC,this.isForSimpleWidget=t.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=$e.parse("inmemory://model/"+UC):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:l,disposable:u}=MB(e,t.defaultEOL);this._buffer=l,this._bufferDisposable=u,this._options=sl.resolveOptions(this._buffer,t);const h=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new M(1,1,h,this._buffer.getLineLength(h)+1),0);t.largeFileOptimizations?this._isTooLargeForTokenization=c>sl.LARGE_FILE_SIZE_THRESHOLD||h>sl.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=c>sl.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageId=i||fc,this._languageRegistryListener=this._languageConfigurationService.onDidChange(f=>{f.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}),this._instanceId=Z6(UC),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new RB,this._commandManager=new qR(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new Or(this._modeService.languageIdCodec),this._tokens2=new a2(this._modeService.languageIdCodec),this._tokenization=new nre(this,this._modeService.languageIdCodec),this._bracketPairColorizer=this._register(new soe(this,this._languageConfigurationService)),this._decorationProvider=this._register(new ule(this)),this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()}))}static resolveOptions(e,t){if(t.detectIndentation){const i=z5(e,t.tabSize,t.insertSpaces);return new i1({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new i1({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}onDidChangeContentFast(e){return this._eventEmitter.fastEvent(t=>e(t.contentChangedEvent))}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}get bracketPairs(){return this._bracketPairColorizer}get backgroundTokenizationState(){return this._backgroundTokenizationState}handleTokenizationProgress(e){if(this._backgroundTokenizationState===2)return;const t=e?2:1;this._backgroundTokenizationState!==t&&(this._backgroundTokenizationState=t,this._onBackgroundTokenizationStateChanged.fire())}dispose(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this._isDisposing=!1;const e=new hp([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._bracketPairColorizer.handleContentChanged(t),!this._isDisposing&&this._eventEmitter.fire(new IS(e,t))}setValue(e){if(this._assertNotDisposed(),e===null)return;const{textBuffer:t,disposable:i}=MB(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,s,r,o,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:r,isRedoing:o,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),r=this.getLineCount(),o=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokens.flush(),this._tokens2.flush(),this._decorations=Object.create(null),this._decorationsTree=new RB,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Nd([new Yse],this._versionId,!1,!1),this._createContentChanged2(new M(1,1,r,o),0,s,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r +`:` +`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),r=this.getLineCount(),o=this.getLineMaxColumn(r);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Nd([new Jse],this._versionId,!1,!1),this._createContentChanged2(new M(1,1,r,o),0,s,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,s=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let s=1;s<=i;s++){const r=this._buffer.getLineLength(s);r>=gle?t+=r:e+=r}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();let t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.indentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,r=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new i1({tabSize:t,indentSize:i,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:r,bracketPairColorizationOptions:o});if(this._options.equals(a))return;let l=this._options.createChangeEvent(a);this._options=a,this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();let i=z5(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}static _normalizeIndentationFromWhitespace(e,t,i){let s=0;for(let o=0;o({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();let t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueInRange(i,e);return t?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new ple(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+s:s}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,s=e.startColumn;let r=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),o=Math.floor(typeof s=="number"&&!isNaN(s)?s:1);if(r<1)r=1,o=1;else if(r>t)r=t,o=this.getLineMaxColumn(r);else if(o<=1)o=1;else{const c=this.getLineMaxColumn(r);o>=c&&(o=c)}const a=e.endLineNumber,l=e.endColumn;let u=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),h=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(u<1)u=1,h=1;else if(u>t)u=t,h=this.getLineMaxColumn(u);else if(h<=1)h=1;else{const c=this.getLineMaxColumn(u);h>=c&&(h=c)}return i===r&&s===o&&a===u&&l===h&&e instanceof M&&!(e instanceof Oe)?e:new M(r,o,u,h)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const s=this._buffer.getLineCount();if(e>s)return!1;if(t===1)return!0;const r=this.getLineMaxColumn(e);if(t>r)return!1;if(i===1){const o=this._buffer.getLineCharCode(e,t-2);if(fn(o))return!1}return!0}_validatePosition(e,t,i){const s=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),r=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),o=this._buffer.getLineCount();if(s<1)return new G(1,1);if(s>o)return new G(o,this.getLineMaxColumn(o));if(r<=1)return new G(s,1);const a=this.getLineMaxColumn(s);if(r>=a)return new G(s,a);if(i===1){const l=this._buffer.getLineCharCode(s,r-2);if(fn(l))return new G(s,r-1)}return new G(s,r)}validatePosition(e){return this._assertNotDisposed(),e instanceof G&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,s=e.startColumn,r=e.endLineNumber,o=e.endColumn;if(!this._isValidPosition(i,s,0)||!this._isValidPosition(r,o,0))return!1;if(t===1){const a=s>1?this._buffer.getLineCharCode(i,s-2):0,l=o>1&&o<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,o-2):0,u=fn(a),h=fn(l);return!u&&!h}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof M&&!(e instanceof Oe)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),s=this._validatePosition(e.endLineNumber,e.endColumn,0),r=i.lineNumber,o=i.column,a=s.lineNumber,l=s.column;{const u=o>1?this._buffer.getLineCharCode(r,o-2):0,h=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,c=fn(u),f=fn(h);return!c&&!f?new M(r,o,a,l):r===a&&o===l?new M(r,o-1,a,l-1):c&&f?new M(r,o-1,a,l+1):c?new M(r,o-1,a,l):new M(r,o,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();let i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new M(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,s){return this._buffer.findMatchesLineByLine(e,t,i,s)}findMatches(e,t,i,s,r,o,a=fle){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(c=>M.isIRange(c))&&(l=t.map(c=>this.validateRange(c)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((c,f)=>c.startLineNumber-f.startLineNumber||c.startColumn-f.startColumn);const u=[];u.push(l.reduce((c,f)=>M.areIntersecting(c,f)?c.plusRange(f):(u.push(c),f)));let h;if(!i&&e.indexOf(` +`)<0){const f=new Qc(e,i,s,r).parseSearchRequest();if(!f)return[];h=g=>this.findMatchesLineByLine(g,f,o,a)}else h=c=>PC.findMatches(this,new Qc(e,i,s,r),c,o,a);return u.map(h).reduce((c,f)=>c.concat(f),[])}findNextMatch(e,t,i,s,r,o){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` +`)<0){const u=new Qc(e,i,s,r).parseSearchRequest();if(!u)return null;const h=this.getLineCount();let c=new M(a.lineNumber,a.column,h,this.getLineMaxColumn(h)),f=this.findMatchesLineByLine(c,u,o,1);return PC.findNextMatch(this,new Qc(e,i,s,r),a,o),f.length>0||(c=new M(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),f=this.findMatchesLineByLine(c,u,o,1),f.length>0)?f[0]:null}return PC.findNextMatch(this,new Qc(e,i,s,r),a,o)}findPreviousMatch(e,t,i,s,r,o){this._assertNotDisposed();const a=this.validatePosition(t);return PC.findPreviousMatch(this,new Qc(e,i,s,r),a,o)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof uk?e:new uk(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,s=e.length;i({range:this.validateRange(o.range),text:o.text})),r=!0;if(e)for(let o=0,a=e.length;ol.endLineNumber,m=l.startLineNumber>f.endLineNumber;if(!g&&!m){u=!0;break}}if(!u){r=!1;break}}if(r)for(let o=0,a=this._trimAutoWhitespaceLines.length;og.endLineNumber)&&!(l===g.startLineNumber&&g.startColumn===u&&g.isEmpty()&&m&&m.length>0&&m.charAt(0)===` +`)&&!(l===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===` +`)){h=!1;break}}if(h){const c=new M(l,1,l,u);t.push(new uk(null,c,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,s){const r=e.map(o=>{const a=this.getPositionAt(o.newPosition),l=this.getPositionAt(o.newEnd);return{range:new M(a.lineNumber,a.column,l.lineNumber,l.column),text:o.oldText}});this._applyUndoRedoEdits(r,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const r=e.map(o=>{const a=this.getPositionAt(o.oldPosition),l=this.getPositionAt(o.oldEnd);return{range:new M(a.lineNumber,a.column,l.lineNumber,l.column),text:o.newText}});this._applyUndoRedoEdits(r,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,r,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(r)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),o=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,o.length!==0){for(let u=0,h=o.length;u0?c.text.charCodeAt(0):0),this._decorationsTree.acceptReplace(c.rangeOffset,c.rangeLength,c.text.length,c.forceMoveMarkers)}let a=[];this._increaseVersionId();let l=i;for(let u=0,h=o.length;u=0;A--){const z=g+A,V=y+A;k.takeFromEndWhile(ee=>ee.lineNumber>V);const Q=k.takeFromEndWhile(ee=>ee.lineNumber===V);a.push(new gB(z,this.getLineContent(V),Q))}if(wTe.lineNumberTe.lineNumber===Ie)}a.push(new Qse(z+1,g+S,Ce,ee))}l+=b}this._emitContentChangedEvent(new Nd(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=[...e].map(s=>new gB(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeContentOrInjectedText.fire(new B9(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){let i={addDecoration:(r,o)=>this._deltaDecorationsImpl(e,[],[{range:r,options:o}])[0],changeDecoration:(r,o)=>{this._changeDecorationImpl(r,o)},changeDecorationOptions:(r,o)=>{this._changeDecorationOptionsImpl(r,PB(o))},removeDecoration:r=>{this._deltaDecorationsImpl(e,[r],[])},deltaDecorations:(r,o)=>r.length===0&&o.length===0?[]:this._deltaDecorationsImpl(e,r,o)},s=null;try{s=t(i)}catch(r){Qe(r)}return i.addDecoration=o_,i.changeDecoration=o_,i.changeDecorationOptions=o_,i.removeDecoration=o_,i.deltaDecorations=o_,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:OB[i]}])[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),a=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),o,a,r),s.setOptions(OB[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1){let r=this.getLineCount(),o=Math.min(r,Math.max(1,e)),a=Math.min(r,Math.max(1,t)),l=this.getLineMaxColumn(a);const u=new M(o,1,a,l),h=this._getDecorationsInRange(u,i,s);return h.push(...this._decorationProvider.getDecorationsInRange(u,i,s)),h}getDecorationsInRange(e,t=0,i=!1){let s=this.validateRange(e);const r=this._getDecorationsInRange(s,t,i);return r.push(...this._decorationProvider.getDecorationsInRange(s,t,i)),r}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return Ma.fromDecorations(s).filter(r=>r.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}_getDecorationsInRange(e,t,i){const s=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,s,r,t,i)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),o=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),r,o,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),r=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const o=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber)}if(i.options.before||t.before){const o=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber)}s!==r?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i){const s=this.getVersionId(),r=t.length;let o=0;const a=i.length;let l=0,u=new Array(a);for(;o0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:i})}this.handleTokenizationProgress(t)}setSemanticTokens(e,t){this._tokens2.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]})}hasCompleteSemanticTokens(){return this._tokens2.isComplete()}hasSomeSemanticTokens(){return!this._tokens2.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._tokens2.setPartial(e,t);this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._buffer.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._buffer.getLineCount()}]})}_emitModelTokensChangedEvent(e){this._isDisposing||this._onDidChangeTokens.fire(e)}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this.getLineContent(e),i=this._tokens.getTokens(this._languageId,e-1,t);return this._tokens2.addSemanticTokens(e,i)}getLanguageId(){return this._languageId}setMode(e){if(this._languageId===e)return;let t={oldLanguage:this._languageId,newLanguage:e};this._languageId=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}getLanguageIdAtPosition(e,t){const i=this.validatePosition(new G(e,t)),s=this.getLineTokens(i.lineNumber);return s.getLanguageId(s.findTokenIndexAtOffset(i.column-1))}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}getWordAtPosition(e){this._assertNotDisposed();const t=this.validatePosition(e),i=this.getLineContent(t.lineNumber),s=this._getLineTokens(t.lineNumber),r=s.findTokenIndexAtOffset(t.column-1),[o,a]=sl._findLanguageBoundaries(s,r),l=bS(t.column,this.getLanguageConfiguration(s.getLanguageId(r)).getWordDefinition(),i.substring(o,a),o);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(r>0&&o===t.column-1){const[u,h]=sl._findLanguageBoundaries(s,r-1),c=bS(t.column,this.getLanguageConfiguration(s.getLanguageId(r-1)).getWordDefinition(),i.substring(u,h),u);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn)return c}return null}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)s=e.getStartOffset(o);let r=e.getLineContent().length;for(let o=t,a=e.getCount();o=0;u--){const h=t.getEndOffset(u);if(h<=a)break;if(nl(t.getStandardTokenType(u))||t.getLanguageId(u)!==o){a=h;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let u=s+1;u=l)break;if(nl(t.getStandardTokenType(u))||t.getLanguageId(u)!==o){l=h;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e){const t=e.lineNumber,i=this._getLineTokens(t),s=this._buffer.getLineContent(t),r=i.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const o=this.getLanguageConfiguration(i.getLanguageId(r)).brackets;if(o&&!nl(i.getStandardTokenType(r))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,i,o,r),u=null;for(;;){const h=wo.findNextBracketInRange(o.forwardRegex,t,s,a,l);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const c=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,o.textIsBracket[c],o.textIsOpenBracket[c],null);if(f){if(f instanceof Su)return null;u=f}}a=h.endColumn-1}if(u)return u}if(r>0&&i.getStartOffset(r)===e.column-1){const a=r-1,l=this.getLanguageConfiguration(i.getLanguageId(a)).brackets;if(l&&!nl(i.getStandardTokenType(a))){let{searchStartOffset:u,searchEndOffset:h}=this._establishBracketSearchOffsets(e,i,l,a);const c=wo.findPrevBracketInRange(l.reversedRegex,t,s,u,h);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn){const f=s.substring(c.startColumn-1,c.endColumn-1).toLowerCase(),g=this._matchFoundBracket(c,l.textIsBracket[f],l.textIsOpenBracket[f],null);if(g)return g instanceof Su?null:g}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const r=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return r?r instanceof Su?r:[e,r]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,r=e.reversedRegex;let o=-1,a=0;const l=(u,h,c,f)=>{for(;;){if(i&&++a%100===0&&!i())return Su.INSTANCE;const g=wo.findPrevBracketInRange(r,u,h,c,f);if(!g)break;const m=h.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(m)?o++:e.isClose(m)&&o--,o===0)return g;f=g.startColumn-1}return null};for(let u=t.lineNumber;u>=1;u--){const h=this._getLineTokens(u),c=h.getCount(),f=this._buffer.getLineContent(u);let g=c-1,m=f.length,v=f.length;u===t.lineNumber&&(g=h.findTokenIndexAtOffset(t.column-1),m=t.column-1,v=t.column-1);let S=!0;for(;g>=0;g--){const w=h.getLanguageId(g)===s&&!nl(h.getStandardTokenType(g));if(w)S?m=h.getStartOffset(g):(m=h.getStartOffset(g),v=h.getEndOffset(g));else if(S&&m!==v){const b=l(u,f,m,v);if(b)return b}S=w}if(S&&m!==v){const w=l(u,f,m,v);if(w)return w}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,r=e.forwardRegex;let o=1,a=0;const l=(h,c,f,g)=>{for(;;){if(i&&++a%100===0&&!i())return Su.INSTANCE;const m=wo.findNextBracketInRange(r,h,c,f,g);if(!m)break;const v=c.substring(m.startColumn-1,m.endColumn-1).toLowerCase();if(e.isOpen(v)?o++:e.isClose(v)&&o--,o===0)return m;f=m.endColumn-1}return null},u=this.getLineCount();for(let h=t.lineNumber;h<=u;h++){const c=this._getLineTokens(h),f=c.getCount(),g=this._buffer.getLineContent(h);let m=0,v=0,S=0;h===t.lineNumber&&(m=c.findTokenIndexAtOffset(t.column-1),v=t.column-1,S=t.column-1);let w=!0;for(;m=1;r--){const o=this._getLineTokens(r),a=o.getCount(),l=this._buffer.getLineContent(r);let u=a-1,h=l.length,c=l.length;if(r===t.lineNumber){u=o.findTokenIndexAtOffset(t.column-1),h=t.column-1,c=t.column-1;const g=o.getLanguageId(u);i!==g&&(i=g,s=this.getLanguageConfiguration(i).brackets)}let f=!0;for(;u>=0;u--){const g=o.getLanguageId(u);if(i!==g){if(s&&f&&h!==c){const v=wo.findPrevBracketInRange(s.reversedRegex,r,l,h,c);if(v)return this._toFoundBracket(s,v);f=!1}i=g,s=this.getLanguageConfiguration(i).brackets}const m=!!s&&!nl(o.getStandardTokenType(u));if(m)f?h=o.getStartOffset(u):(h=o.getStartOffset(u),c=o.getEndOffset(u));else if(s&&f&&h!==c){const v=wo.findPrevBracketInRange(s.reversedRegex,r,l,h,c);if(v)return this._toFoundBracket(s,v)}f=m}if(s&&f&&h!==c){const g=wo.findPrevBracketInRange(s.reversedRegex,r,l,h,c);if(g)return this._toFoundBracket(s,g)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let s=null,r=null;for(let o=t.lineNumber;o<=i;o++){const a=this._getLineTokens(o),l=a.getCount(),u=this._buffer.getLineContent(o);let h=0,c=0,f=0;if(o===t.lineNumber){h=a.findTokenIndexAtOffset(t.column-1),c=t.column-1,f=t.column-1;const m=a.getLanguageId(h);s!==m&&(s=m,r=this.getLanguageConfiguration(s).brackets)}let g=!0;for(;h"u")i=null;else{const g=Date.now();i=()=>Date.now()-g<=t}const s=this.validatePosition(e),r=this.getLineCount(),o=new Map;let a=[];const l=(g,m)=>{if(!o.has(g)){let v=[];for(let S=0,w=m?m.brackets.length:0;S{for(;;){if(i&&++u%100===0&&!i())return Su.INSTANCE;const b=wo.findNextBracketInRange(g.forwardRegex,m,v,S,w);if(!b)break;const y=v.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),L=g.textIsBracket[y];if(L&&(L.isOpen(y)?a[L.index]++:L.isClose(y)&&a[L.index]--,a[L.index]===-1))return this._matchFoundBracket(b,L,!1,i);S=b.endColumn-1}return null};let c=null,f=null;for(let g=s.lineNumber;g<=r;g++){const m=this._getLineTokens(g),v=m.getCount(),S=this._buffer.getLineContent(g);let w=0,b=0,y=0;if(g===s.lineNumber){w=m.findTokenIndexAtOffset(s.column-1),b=s.column-1,y=s.column-1;const E=m.getLanguageId(w);c!==E&&(c=E,f=this.getLanguageConfiguration(c).brackets,l(c,f))}let L=!0;for(;ws)throw new Error("Illegal value for lineNumber");const r=this.getLanguageConfiguration(this._languageId).foldingRules,o=Boolean(r&&r.offSide);let a=-2,l=-1,u=-2,h=-1;const c=x=>{if(a!==-1&&(a===-2||a>x-1)){a=-1,l=-1;for(let k=x-2;k>=0;k--){let A=this._computeIndentLevel(k);if(A>=0){a=k,l=A;break}}}if(u===-2){u=-1,h=-1;for(let k=x;k=0){u=k,h=A;break}}}};let f=-2,g=-1,m=-2,v=-1;const S=x=>{if(f===-2){f=-1,g=-1;for(let k=x-2;k>=0;k--){let A=this._computeIndentLevel(k);if(A>=0){f=k,g=A;break}}}if(m!==-1&&(m===-2||m=0){m=k,v=A;break}}}};let w=0,b=!0,y=0,L=!0,E=0,I=0;for(let x=0;b||L;x++){const k=e-x,A=e+x;x>1&&(k<1||k1&&(A>s||A>i)&&(L=!1),x>5e4&&(b=!1,L=!1);let z=-1;if(b){const Q=this._computeIndentLevel(k-1);Q>=0?(u=k-1,h=Q,z=Math.ceil(Q/this._options.indentSize)):(c(k),z=this._getIndentLevelForWhitespaceLine(o,l,h))}let V=-1;if(L){const Q=this._computeIndentLevel(A-1);Q>=0?(f=A-1,g=Q,V=Math.ceil(Q/this._options.indentSize)):(S(A),V=this._getIndentLevelForWhitespaceLine(o,g,v))}if(x===0){I=z;continue}if(x===1){if(A<=s&&V>=0&&I+1===V){b=!1,w=A,y=A,E=V;continue}if(k>=1&&z>=0&&z-1===I){L=!1,w=k,y=k,E=z;continue}if(w=e,y=e,E=I,E===0)return{startLineNumber:w,endLineNumber:y,indent:E}}b&&(z>=E?w=k:b=!1),L&&(V>=E?y=A:L=!1)}return{startLineNumber:w,endLineNumber:y,indent:E}}getLinesBracketGuides(e,t,i,s){var r,o,a,l,u;const h=[],c=this._bracketPairColorizer.getBracketPairsInRangeWithMinIndentation(new M(e,1,t,this.getLineMaxColumn(t)));let f;if(i&&c.length>0){const w=e<=i.lineNumber&&i.lineNumber<=t?c.filter(b=>b.range.containsPosition(i)):this._bracketPairColorizer.getBracketPairsInRange(M.fromPositions(i));f=(r=gse(w,b=>b.range.startLineNumber!==b.range.endLineNumber))===null||r===void 0?void 0:r.range}const g=new tv(c),m=new Array,v=new Array,S=new kH;for(let w=e;w<=t;w++){let b=new Array;v.length>0&&(b=b.concat(v),v.length=0),h.push(b);for(const L of g.takeWhile(E=>E.openingBracketRange.startLineNumber<=w)||[]){if(L.range.startLineNumber===L.range.endLineNumber)continue;const E=Math.min(this.getVisibleColumnFromPosition(L.openingBracketRange.getStartPosition()),this.getVisibleColumnFromPosition((a=(o=L.closingBracketRange)===null||o===void 0?void 0:o.getStartPosition())!==null&&a!==void 0?a:L.range.getEndPosition()),L.minVisibleColumnIndentation+1);let I=!1;L.closingBracketRange&&us(this.getLineContent(L.closingBracketRange.startLineNumber))=0;L--){const E=m[L];if(!E)continue;const I=s.highlightActive&&f&&E.bracketPair.range.equalsRange(f),x=S.getInlineClassNameOfLevel(E.nestingLevel)+(I?" "+S.activeClassName:"");(I||s.includeInactive)&&E.renderHorizontalEndLineAtTheBottom&&E.end.lineNumber===w+1&&v.push(new Hg(E.guideVisibleColumn,x,null)),!(E.end.lineNumber<=w||E.start.lineNumber>=w)&&(E.guideVisibleColumn>=y&&!I||(y=E.guideVisibleColumn,(I||s.includeInactive)&&b.push(new Hg(E.guideVisibleColumn,x,null))))}b.sort((L,E)=>L.visibleColumn-E.visibleColumn)}return h}getVisibleColumnFromPosition(e){return Mt.visibleColumnFromColumn(this.getLineContent(e.lineNumber),e.column,this._options.tabSize)+1}getLinesIndentGuides(e,t){this._assertNotDisposed();const i=this.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.getLanguageConfiguration(this._languageId).foldingRules,r=Boolean(s&&s.offSide);let o=new Array(t-e+1),a=-2,l=-1,u=-2,h=-1;for(let c=e;c<=t;c++){let f=c-e;const g=this._computeIndentLevel(c-1);if(g>=0){a=c-1,l=g,o[f]=Math.ceil(g/this._options.indentSize);continue}if(a===-2){a=-1,l=-1;for(let m=c-2;m>=0;m--){let v=this._computeIndentLevel(m);if(v>=0){a=m,l=v;break}}}if(u!==-1&&(u===-2||u=0){u=m,h=v;break}}}o[f]=this._getIndentLevelForWhitespaceLine(r,l,h)}return o}_getIndentLevelForWhitespaceLine(e,t,i){return t===-1||i===-1?0:ta.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i);return this._ensureNodesHaveRanges(e,s).filter(r=>r.options.showIfCollapsed||!r.range.isEmpty())}getAll(e,t,i,s){const r=e.getVersionId(),o=this._search(t,i,s,r);return this._ensureNodesHaveRanges(e,o)}_search(e,t,i,s){if(i)return this._decorationsTree1.search(e,t,s);{const r=this._decorationsTree0.search(e,t,s),o=this._decorationsTree1.search(e,t,s),a=this._injectedTextDecorationsTree.search(e,t,s);return r.concat(o).concat(a)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){Pk(e)?this._injectedTextDecorationsTree.insert(e):Ok(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Pk(e)?this._injectedTextDecorationsTree.delete(e):Ok(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){Pk(e)?this._injectedTextDecorationsTree.resolveNode(e,t):Ok(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function gh(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class EH{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class _le extends EH{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Rl.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;let i=e?t.getColor(e.id):null;return i?i.toString():""}}class vle extends EH{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?q.fromHex(e):t.getColor(e.id)}}class s0{constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1}static from(e){return e instanceof s0?e:new s0(e)}}class ft{constructor(e){this.description=e.description,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?gh(e.className):null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new _le(e.overviewRuler):null,this.minimap=e.minimap?new vle(e.minimap):null,this.glyphMarginClassName=e.glyphMarginClassName?gh(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?gh(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?gh(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?gh(e.marginClassName):null,this.inlineClassName=e.inlineClassName?gh(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?gh(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?gh(e.afterContentClassName):null,this.after=e.after?s0.from(e.after):null,this.before=e.before?s0.from(e.before):null}static register(e){return new ft(e)}static createDynamic(e){return new ft(e)}}ft.EMPTY=ft.register({description:"empty"});const OB=[ft.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),ft.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),ft.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),ft.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function PB(n){return n instanceof ft?n:ft.createDynamic(n)}class ble extends ie{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new H),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;if(this._deferredCnt--,this._deferredCnt===0){if(this._shouldFire){this.handleBeforeFire(this._affectedInjectedTextLines);const t={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler};this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._actual.fire(t)}(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null}}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._shouldFire=!0}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._shouldFire=!0}}class Cle extends ie{constructor(){super(),this._fastEmitter=this._register(new H),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new H),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}const wle=()=>!0,FB=()=>!1,Sle=n=>n===" "||n===" ";class Io{constructor(e,t,i){this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,r=s.get(129);this.readOnly=s.get(80),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(103),this.lineHeight=s.get(58),this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=s.get(114),this.wordSeparators=s.get(115),this.emptySelectionClipboard=s.get(32),this.copyWithSyntaxHighlighting=s.get(21),this.multiCursorMergeOverlapping=s.get(68),this.multiCursorPaste=s.get(70),this.autoClosingBrackets=s.get(5),this.autoClosingQuotes=s.get(8),this.autoClosingDelete=s.get(6),this.autoClosingOvertype=s.get(7),this.autoSurround=s.get(11),this.autoIndent=s.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:Io._getShouldAutoClose(e,this.autoClosingQuotes),bracket:Io._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=Jt.getAutoClosingPairs(e);let o=Io._getSurroundingPairs(e);if(o)for(const a of o)this.surroundingPairs[a.open]=a.close}static shouldRecreate(e){return e.hasChanged(129)||e.hasChanged(115)||e.hasChanged(32)||e.hasChanged(68)||e.hasChanged(70)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(114)||e.hasChanged(58)||e.hasChanged(80)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=Io._getElectricCharacters(this._languageId);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return Zs.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return Jt.getElectricCharacters(e)}catch(t){return Qe(t),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return Sle;case"languageDefined":return Io._getLanguageDefinedShouldAutoClose(e);case"always":return wle;case"never":return FB}}static _getLanguageDefinedShouldAutoClose(e){try{const t=Jt.getAutoCloseBeforeSet(e);return i=>t.indexOf(i)!==-1}catch(t){return Qe(t),FB}}static _getSurroundingPairs(e){try{return Jt.getSurroundingPairs(e)}catch(t){return Qe(t),null}}}class cn{constructor(e,t,i,s){this._singleCursorStateBrand=void 0,this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=s,this.selection=cn._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,s){return e?new cn(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new G(t,i),s):new cn(new M(t,i,t,i),s,new G(t,i),s)}static _computeSelection(e,t){let i,s,r,o;return e.isEmpty()?(i=e.startLineNumber,s=e.startColumn,r=t.lineNumber,o=t.column):t.isBeforeOrEqual(e.getStartPosition())?(i=e.endLineNumber,s=e.endColumn,r=t.lineNumber,o=t.column):(i=e.startLineNumber,s=e.startColumn,r=t.lineNumber,o=t.column),new Oe(i,s,r,o)}}class BB{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class yle{constructor(e){this.modelState=e,this.viewState=null}}class Lle{constructor(e){this.modelState=null,this.viewState=e}}class tt{constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}static fromModelState(e){return new yle(e)}static fromViewState(e){return new Lle(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,s=e.positionLineNumber,r=e.positionColumn,o=new cn(new M(t,i,t,i),0,new G(s,r),0);return tt.fromModelState(o)}static fromModelSelections(e){let t=[];for(let i=0,s=e.length;ir,u=s>o,h=so||ws||S0&&s--,sd.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const r=Math.min(i.fromViewLineNumber,i.toViewLineNumber),o=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=r;l<=o;l++){const u=t.getLineMaxColumn(l),h=Mt.visibleColumnFromColumn2(e,t,new G(l,u));s=Math.max(s,h)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-hie(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new G(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),r=e.getLineContent(t.lineNumber),o=r0.atomicPosition(r,t.column-1,i,0);if(o!==-1&&o+1>=s)return new G(t.lineNumber,o+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?Dt.leftPositionAtomicSoftTabs(t,i,e.tabSize):Dt.leftPosition(t,i);return new Fk(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,r){let o,a;if(i.hasSelection()&&!s)o=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(r-1)),u=t.normalizePosition(Dt.clipPositionColumn(l,t),0),h=Dt.left(e,t,u);o=h.lineNumber,a=h.column}return i.move(s,o,a,0)}static clipPositionColumn(e,t){return new G(e.lineNumber,Dt.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return iu?(i=u,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=Mt.columnFromVisibleColumn2(e,t,i,l),f?r=0:r=l-Mt.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),new Fk(i,s,r)}static down(e,t,i,s,r,o,a){return this.vertical(e,t,i,s,r,i+o,a)}static moveDown(e,t,i,s,r){let o,a;i.hasSelection()&&!s?(o=i.selection.endLineNumber,a=i.selection.endColumn):(o=i.position.lineNumber,a=i.position.column);let l=Dt.down(e,t,o,a,i.leftoverVisibleColumns,r,!0);return i.move(s,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateDown(e,t,i){let s=i.selection,r=Dt.down(e,t,s.selectionStartLineNumber,s.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),o=Dt.down(e,t,s.positionLineNumber,s.positionColumn,i.leftoverVisibleColumns,1,!1);return new cn(new M(r.lineNumber,r.column,r.lineNumber,r.column),r.leftoverVisibleColumns,new G(o.lineNumber,o.column),o.leftoverVisibleColumns)}static up(e,t,i,s,r,o,a){return this.vertical(e,t,i,s,r,i-o,a)}static moveUp(e,t,i,s,r){let o,a;i.hasSelection()&&!s?(o=i.selection.startLineNumber,a=i.selection.startColumn):(o=i.position.lineNumber,a=i.position.column);let l=Dt.up(e,t,o,a,i.leftoverVisibleColumns,r,!0);return i.move(s,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateUp(e,t,i){let s=i.selection,r=Dt.up(e,t,s.selectionStartLineNumber,s.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),o=Dt.up(e,t,s.positionLineNumber,s.positionColumn,i.leftoverVisibleColumns,1,!1);return new cn(new M(r.lineNumber,r.column,r.lineNumber,r.column),r.leftoverVisibleColumns,new G(o.lineNumber,o.column),o.leftoverVisibleColumns)}static _isBlankLine(e,t){return e.getLineFirstNonWhitespaceColumn(t)===0}static moveToPrevBlankLine(e,t,i,s){let r=i.position.lineNumber;for(;r>1&&this._isBlankLine(t,r);)r--;for(;r>1&&!this._isBlankLine(t,r);)r--;return i.move(s,r,t.getLineMinColumn(r),0)}static moveToNextBlankLine(e,t,i,s){const r=t.getLineCount();let o=i.position.lineNumber;for(;o=f.length+1)return!1;const g=f.charAt(c.column-2),m=s.get(g);if(!m)return!1;if(Sg(g)){if(i==="never")return!1}else if(t==="never")return!1;const v=f.charAt(c.column-1);let S=!1;for(const w of m)w.open===g&&w.close===v&&(S=!0);if(!S)return!1;if(e==="auto"){let w=!1;for(let b=0,y=a.length;b1){const r=t.getLineContent(s.lineNumber),o=us(r),a=o===-1?r.length+1:o+1;if(s.column<=a){const l=Mt.visibleColumnFromColumn2(i,t,s),u=Mt.prevIndentTabStop(l,i.indentSize),h=Mt.columnFromVisibleColumn2(i,t,s.lineNumber,u);return new M(s.lineNumber,h,s.lineNumber,s.column)}}return M.fromPositions(Xd.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=bie(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new G(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){let s=[],r=null;i.sort((o,a)=>G.compare(o.getStartPosition(),a.getEndPosition()));for(let o=0,a=i.length;o1&&r?.endLineNumber!==u.lineNumber?(h=u.lineNumber-1,c=t.getLineMaxColumn(u.lineNumber-1),f=u.lineNumber,g=t.getLineMaxColumn(u.lineNumber)):(h=u.lineNumber,c=1,f=u.lineNumber,g=t.getLineMaxColumn(u.lineNumber));let m=new M(h,c,f,g);r=m,m.isEmpty()?s[o]=null:s[o]=new Ss(m,"")}else s[o]=null;else s[o]=new Ss(l,"")}return new Hs(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class bi{static _createWord(e,t,i,s,r){return{start:s,end:r,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){let s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=0;for(let r=i.column-2;r>=0;r--){let o=e.charCodeAt(r),a=t.get(o);if(a===0){if(s===2)return this._createWord(e,s,a,r+1,this._findEndOfWord(e,t,s,r+1));s=1}else if(a===2){if(s===1)return this._createWord(e,s,a,r+1,this._findEndOfWord(e,t,s,r+1));s=2}else if(a===1&&s!==0)return this._createWord(e,s,a,r+1,this._findEndOfWord(e,t,s,r+1))}return s!==0?this._createWord(e,s,1,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){let r=e.length;for(let o=s;o=0;r--){let o=e.charCodeAt(r),a=t.get(o);if(a===1||i===1&&a===2||i===2&&a===0)return r+1}return 0}static moveWordLeft(e,t,i,s){let r=i.lineNumber,o=i.column;o===1&&r>1&&(r=r-1,o=t.getLineMaxColumn(r));let a=bi._findPreviousWordOnLine(e,t,new G(r,o));if(s===0)return new G(r,a?a.start+1:1);if(s===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=bi._findPreviousWordOnLine(e,t,new G(r,a.start+1))),new G(r,a?a.start+1:1);if(s===3){for(;a&&a.wordType===2;)a=bi._findPreviousWordOnLine(e,t,new G(r,a.start+1));return new G(r,a?a.start+1:1)}return a&&o<=a.end+1&&(a=bi._findPreviousWordOnLine(e,t,new G(r,a.start+1))),new G(r,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new G(i-1,e.getLineMaxColumn(i-1)):t;const r=e.getLineContent(i);for(let o=t.column-1;o>1;o--){const a=r.charCodeAt(o-2),l=r.charCodeAt(o-1);if(a===95&&l!==95)return new G(i,o);if(Wg(a)&&Dh(l))return new G(i,o);if(Dh(a)&&Dh(l)&&o+1=l.start+1&&(l=bi._findNextWordOnLine(e,t,new G(r,l.end+1))),l?o=l.start+1:o=t.getLineMaxColumn(r);return new G(r,o)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i1?u=1:(l--,u=s.getLineMaxColumn(l)):(h&&u<=h.end+1&&(h=bi._findPreviousWordOnLine(i,s,new G(l,h.start+1))),h?u=h.end+1:u>1?u=1:(l--,u=s.getLineMaxColumn(l))),new M(l,u,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new G(i.positionLineNumber,i.positionColumn);let r=this._deleteInsideWordWhitespace(t,s);return r||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let r=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,r))return null;let o=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,o))return null;for(;r>0&&this._charAtIsWhitespace(i,r-1);)r--;for(;o+11?new M(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberc.start+1<=i.column&&i.column<=c.end+1,a=(c,f)=>(c=Math.min(c,i.column),f=Math.max(f,i.column),new M(i.lineNumber,c,i.lineNumber,f)),l=c=>{let f=c.start+1,g=c.end+1,m=!1;for(;g-11&&this._charAtIsWhitespace(s,f-2);)f--;return a(f,g)},u=bi._findPreviousWordOnLine(e,t,i);if(u&&o(u))return l(u);const h=bi._findNextWordOnLine(e,t,i);return h&&o(h)?l(h):u&&h?a(u.end+1,h.start+1):u?a(u.start+1,u.end+1):h?a(h.start+1,h.end+1):a(1,r+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=bi._moveWordPartLeft(e,i);return new M(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let s=t;s=f.start+1&&(f=bi._findNextWordOnLine(i,s,new G(l,f.end+1))),f?u=f.start+1:uu&&(h=u,c=e.model.getLineMaxColumn(h)),tt.fromModelState(new cn(new M(o.lineNumber,1,h,c),0,new G(h,c),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumberl){const u=e.getLineCount();let h=a.lineNumber+1,c=1;return h>u&&(h=u,c=e.getLineMaxColumn(h)),tt.fromViewState(t.viewState.move(t.modelState.hasSelection(),h,c,0))}else{const u=t.modelState.selectionStart.getEndPosition();return tt.fromModelState(t.modelState.move(t.modelState.hasSelection(),u.lineNumber,u.column,0))}}static word(e,t,i,s){const r=e.model.validatePosition(s);return tt.fromModelState(bi.word(e.cursorConfig,e.model,t.modelState,i,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new tt(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return tt.fromViewState(new cn(new M(i,s,i,s),0,new G(i,s),0))}static moveTo(e,t,i,s,r){const o=e.model.validatePosition(s),a=r?e.coordinatesConverter.validateViewPosition(new G(r.lineNumber,r.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);return tt.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,r,o){switch(i){case 0:return o===4?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,r);case 1:return o===4?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,r);case 2:return o===2?this._moveUpByViewLines(e,t,s,r):this._moveUpByModelLines(e,t,s,r);case 3:return o===2?this._moveDownByViewLines(e,t,s,r):this._moveDownByModelLines(e,t,s,r);case 4:return o===2?t.map(a=>tt.fromViewState(Dt.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>tt.fromModelState(Dt.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 5:return o===2?t.map(a=>tt.fromViewState(Dt.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>tt.fromModelState(Dt.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 6:return this._moveToViewMinColumn(e,t,s);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case 8:return this._moveToViewCenterColumn(e,t,s);case 9:return this._moveToViewMaxColumn(e,t,s);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,r){const o=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(o);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,r),u=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,u)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,r),u=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,u)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),u=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,u)]}case 14:{let l=[];for(let u=0,h=t.length;ui.endLineNumber-1?o=i.endLineNumber-1:rtt.fromViewState(Dt.moveLeft(e.cursorConfig,e,r.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){let s=[];for(let r=0,o=t.length;rtt.fromViewState(Dt.moveRight(e.cursorConfig,e,r.viewState,i,s)))}static _moveHalfLineRight(e,t,i){let s=[];for(let r=0,o=t.length;r1&&Mt.visibleColumnFromColumn(f,g+1,r)%o!==0&&e.isCheapToTokenize(c-1)){let S=Jt.getEnterAction(this._opts.autoIndent,e,new M(c-1,e.getLineMaxColumn(c-1),c-1,e.getLineMaxColumn(c-1)));if(S){if(h=u,S.appendText)for(let w=0,b=S.appendText.length;w1){let a;for(a=i-1;a>=1;a--){const h=t.getLineContent(a);if(fm(h)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),u=Jt.getEnterAction(e.autoIndent,t,new M(a,l,a,l));u&&(r=u.indentation+u.appendText)}return s&&(s===Ji.Indent&&(r=Ci.shiftIndent(e,r)),s===Ji.Outdent&&(r=Ci.unshiftIndent(e,r)),r=e.normalizeIndentation(r)),r||null}static _replaceJumpToNextIndent(e,t,i,s){let r="",o=i.getStartPosition();if(e.insertSpaces){let a=Mt.visibleColumnFromColumn2(e,t,o),l=e.indentSize,u=l-a%l;for(let h=0;hthis._compositionType(i,h,r,o,a,l));return new Hs(4,u,{shouldPushStackElementBefore:jC(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,r,o){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-s),u=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+r),h=new M(a.lineNumber,l,a.lineNumber,u);return e.getValueInRange(h)===i&&o===0?null:new c1(h,i,0,o)}static _typeCommand(e,t,i){return i?new KC(e,t,!0):new Ss(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===0)return Ci._typeCommand(s,` +`,i);if(!t.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===1){let l=t.getLineContent(s.startLineNumber),u=ri(l).substring(0,s.startColumn-1);return Ci._typeCommand(s,` +`+e.normalizeIndentation(u),i)}const r=Jt.getEnterAction(e.autoIndent,t,s);if(r){if(r.indentAction===Ji.None)return Ci._typeCommand(s,` +`+e.normalizeIndentation(r.indentation+r.appendText),i);if(r.indentAction===Ji.Indent)return Ci._typeCommand(s,` +`+e.normalizeIndentation(r.indentation+r.appendText),i);if(r.indentAction===Ji.IndentOutdent){const l=e.normalizeIndentation(r.indentation),u=e.normalizeIndentation(r.indentation+r.appendText),h=` +`+u+` +`+l;return i?new KC(s,h,!0):new c1(s,h,-1,u.length-l.length,!0)}else if(r.indentAction===Ji.Outdent){const l=Ci.unshiftIndent(e,r.indentation);return Ci._typeCommand(s,` +`+e.normalizeIndentation(l+r.appendText),i)}}const o=t.getLineContent(s.startLineNumber),a=ri(o).substring(0,s.startColumn-1);if(e.autoIndent>=4){const l=Jt.getIndentForEnter(e.autoIndent,t,s,{unshiftIndent:u=>Ci.unshiftIndent(e,u),shiftIndent:u=>Ci.shiftIndent(e,u),normalizeIndentation:u=>e.normalizeIndentation(u)});if(l){let u=Mt.visibleColumnFromColumn2(e,t,s.getEndPosition());const h=s.endColumn,c=t.getLineContent(s.endLineNumber),f=us(c);if(f>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,f+1)):s=s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new KC(s,` +`+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return h<=f+1&&(e.insertSpaces||(u=Math.ceil(u/e.indentSize)),g=Math.min(u+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new c1(s,` +`+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return Ci._typeCommand(s,` +`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let s=0,r=i.length;sCi.shiftIndent(e,a),unshiftIndent:a=>Ci.unshiftIndent(e,a)});if(o===null)return null;if(o!==e.normalizeIndentation(r)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Ci._typeCommand(new M(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+s,!1):Ci._typeCommand(new M(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,t,i,s,r){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(r))return!1;for(let o=0,a=i.length;o2?h.charCodeAt(u.column-2):0)===92&&f)return!1;if(e.autoClosingOvertype==="auto"){let m=!1;for(let v=0,S=s.length;vt.startsWith(l.open)),a=r.some(l=>t.startsWith(l.close));return!o&&a}static _findAutoClosingPairOpen(e,t,i,s){const r=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!r)return null;let o=null;for(const a of r)if(o===null||a.open.length>o.open.length){let l=!0;for(const u of i)if(t.getValueInRange(new M(u.lineNumber,u.column-a.open.length+1,u.lineNumber,u.column))+s!==a.open){l=!1;break}l&&(o=a)}return o}static _findSubAutoClosingPairClose(e,t){if(t.open.length<=1)return"";const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let r=null;for(const o of s)o.open!==t.open&&t.open.includes(o.open)&&t.close.endsWith(o.close)&&(!r||o.open.length>r.open.length)&&(r=o);return r?r.close:""}static _getAutoClosingPairClose(e,t,i,s,r){const o=Sg(s),a=o?e.autoClosingQuotes:e.autoClosingBrackets;if(a==="never")return null;const l=this._findAutoClosingPairOpen(e,t,i.map(f=>f.getPosition()),s);if(!l)return null;const u=this._findSubAutoClosingPairClose(e,l);let h=!0;const c=o?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;for(let f=0,g=i.length;fv.column-1){const L=S.charAt(v.column-1);if(!Ci._isBeforeClosingBrace(e,w)&&!c(L))return null}if(!t.isCheapToTokenize(v.lineNumber))return null;if(l.open.length===1&&(s==="'"||s==='"')&&a!=="always"){const L=Op(e.wordSeparators);if(r&&v.column>1&&L.get(S.charCodeAt(v.column-2))===0||!r&&v.column>2&&L.get(S.charCodeAt(v.column-3))===0)return null}t.forceTokenization(v.lineNumber);const b=t.getLineTokens(v.lineNumber);let y=!1;try{y=Jt.shouldAutoClosePair(l,b,r?v.column:v.column-1)}catch(L){Qe(L)}if(!y)return null}return h?l.close.substring(0,l.close.length-u.length):l.close}static _runAutoClosingOpenCharType(e,t,i,s,r,o,a){let l=[];for(let u=0,h=s.length;unew Ss(new M(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new Hs(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const l=this._getAutoClosingPairClose(t,i,r,a,!1);return l!==null?this._runAutoClosingOpenCharType(e,t,i,r,a,!1,l):null}static typeWithInterceptors(e,t,i,s,r,o,a){if(!e&&a===` +`){let h=[];for(let c=0,f=r.length;c{const s=t.get(ei).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=document.activeElement;return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(ei).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var Xi;(function(n){class e extends xi{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,[hn.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)]),b.revealPrimaryCursor(y.source,!0)}}n.MoveTo=_e(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=_e(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends xi{runCoreEditorCommand(b,y){b.model.pushStackElement();const L=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),y);b.setCursorStates(y.source,3,L.viewStates.map(E=>tt.fromViewState(E))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:L.fromLineNumber,fromViewVisualColumn:L.fromVisualColumn,toViewLineNumber:L.toLineNumber,toViewVisualColumn:L.toVisualColumn}),L.reversed?b.revealTopMostCursor(y.source):b.revealBottomMostCursor(y.source)}}n.ColumnSelect=_e(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(w,b,y,L){const E=w.model.validatePosition(L.position),I=w.coordinatesConverter.validateViewPosition(new G(L.viewPosition.lineNumber,L.viewPosition.column),E);let x=L.doColumnSelect?y.fromViewLineNumber:I.lineNumber,k=L.doColumnSelect?y.fromViewVisualColumn:L.mouseColumn-1;return sd.columnSelect(w.cursorConfig,w,x,k,I.lineNumber,L.mouseColumn-1)}}),n.CursorColumnSelectLeft=_e(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(w,b,y,L){return sd.columnSelectLeft(w.cursorConfig,w,y)}}),n.CursorColumnSelectRight=_e(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(w,b,y,L){return sd.columnSelectRight(w.cursorConfig,w,y)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,L,E){return sd.columnSelectUp(b.cursorConfig,b,L,this._isPaged)}}n.CursorColumnSelectUp=_e(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=_e(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,L,E){return sd.columnSelectDown(b.cursorConfig,b,L,this._isPaged)}}n.CursorColumnSelectDown=_e(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=_e(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends xi{constructor(){super({id:"cursorMove",precondition:void 0,description:RS.description})}runCoreEditorCommand(b,y){const L=RS.parse(y);!L||this._runCursorMove(b,y.source,L)}_runCursorMove(b,y,L){b.model.pushStackElement(),b.setCursorStates(y,3,r._move(b,b.getCursorStates(),L)),b.revealPrimaryCursor(y,!0)}static _move(b,y,L){const E=L.select,I=L.value;switch(L.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return hn.simpleMove(b,y,L.direction,E,I,L.unit);case 11:case 13:case 12:case 14:return hn.viewportMove(b,y,L.direction,E,I);default:return null}}}n.CursorMoveImpl=r,n.CursorMove=_e(new r);class o extends xi{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,y){let L=this._staticArgs;this._staticArgs.value===-1&&(L={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(y.source,3,hn.simpleMove(b,b.getCursorStates(),L.direction,L.select,L.value,L.unit)),b.revealPrimaryCursor(y.source,!0)}}n.CursorLeft=_e(new o({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=_e(new o({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:1039}})),n.CursorRight=_e(new o({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=_e(new o({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:1041}})),n.CursorUp=_e(new o({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=_e(new o({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=_e(new o({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:11}})),n.CursorPageUpSelect=_e(new o({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:1035}})),n.CursorDown=_e(new o({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=_e(new o({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=_e(new o({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:12}})),n.CursorPageDownSelect=_e(new o({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:1036}})),n.CreateCursor=_e(new class extends xi{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(w,b){let y;b.wholeLine?y=hn.line(w,w.getPrimaryCursorState(),!1,b.position,b.viewPosition):y=hn.moveTo(w,w.getPrimaryCursorState(),!1,b.position,b.viewPosition);const L=w.getCursorStates();if(L.length>1){const E=y.modelState?y.modelState.position:null,I=y.viewState?y.viewState.position:null;for(let x=0,k=L.length;xI&&(E=I);const x=new M(E,1,E,w.model.getLineMaxColumn(E));let k=0;if(y.at)switch(y.at){case Ug.RawAtArgument.Top:k=3;break;case Ug.RawAtArgument.Center:k=1;break;case Ug.RawAtArgument.Bottom:k=4;break}const A=w.coordinatesConverter.convertModelRangeToViewRange(x);w.revealRange(b.source,!1,A,k,0)}}),n.SelectAll=new class extends FN{constructor(){super(Oie)}runDOMCommand(){ls&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(w,b,y){const L=b._getViewModel();!L||this.runCoreEditorCommand(L,y)}runCoreEditorCommand(w,b){w.model.pushStackElement(),w.setCursorStates("keyboard",3,[hn.selectAll(w,w.getPrimaryCursorState())])}},n.SetSelection=_e(new class extends xi{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(w,b){w.model.pushStackElement(),w.setCursorStates(b.source,3,[tt.fromModelSelection(b.selection)])}})})(Xi||(Xi={}));const xle=ye.and(K.textInputFocus,K.columnSelection);function Cm(n,e){ds.registerKeybindingRule({id:n,primary:e,when:xle,weight:vt+1})}Cm(Xi.CursorColumnSelectLeft.id,1039);Cm(Xi.CursorColumnSelectRight.id,1041);Cm(Xi.CursorColumnSelectUp.id,1040);Cm(Xi.CursorColumnSelectPageUp.id,1035);Cm(Xi.CursorColumnSelectDown.id,1042);Cm(Xi.CursorColumnSelectPageDown.id,1036);function HB(n){return n.register(),n}var hv;(function(n){class e extends io{runEditorCommand(i,s,r){const o=s._getViewModel();!o||this.runCoreEditingCommand(s,o,r||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=_e(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:K.writable,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Ci.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.modelState.selection)))}}),n.Outdent=_e(new class extends e{constructor(){super({id:"outdent",precondition:K.writable,kbOpts:{weight:vt,kbExpr:ye.and(K.editorTextFocus,K.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Ci.outdent(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),n.Tab=_e(new class extends e{constructor(){super({id:"tab",precondition:K.writable,kbOpts:{weight:vt,kbExpr:ye.and(K.editorTextFocus,K.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,Ci.tab(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=_e(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,s){const[r,o]=Xd.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());r&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(2)}}),n.DeleteRight=_e(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:vt,kbExpr:K.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,s){const[r,o]=Xd.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));r&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(3)}}),n.Undo=new class extends FN{constructor(){super($R)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(80)===!0))return i.getModel().undo()}},n.Redo=new class extends FN{constructor(){super(KR)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(80)===!0))return i.getModel().redo()}}})(hv||(hv={}));class zB extends nL{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(ei).getFocusedCodeEditor();!i||i.trigger("keyboard",this._handlerId,t)}}function kf(n,e){HB(new zB("default:"+n,n)),HB(new zB(n,n,e))}kf("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});kf("replacePreviousChar");kf("compositionType");kf("compositionStart");kf("compositionEnd");kf("paste");kf("cut");const kle=W("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hc:"#A0A0A0"},_("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class Ele extends mt{constructor(){super({id:"editor.action.jumpToBracket",label:_("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:3160,weight:100}})}run(e,t){let i=xa.get(t);!i||i.jumpToBracket()}}class Ile extends mt{constructor(){super({id:"editor.action.selectToBracket",label:_("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){const s=xa.get(t);if(!s)return;let r=!0;i&&i.selectBrackets===!1&&(r=!1),s.selectToBracket(r)}}class Nle{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class xa extends ie{constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=[],this._updateBracketsSoon=this._register(new mi(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(63),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._decorations=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(63)&&(this._matchBrackets=this._editor.getOption(63),this._decorations=this._editor.deltaDecorations(this._decorations,[]),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}static get(e){return e.getContribution(xa.ID)}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),r=e.matchBracket(s);let o=null;if(r)r[0].containsPosition(s)?o=r[1].getStartPosition():r[1].containsPosition(s)&&(o=r[0].getStartPosition());else{const a=e.findEnclosingBrackets(s);if(a)o=a[0].getStartPosition();else{const l=e.findNextBracket(s);l&&l.range&&(o=l.range.getStartPosition())}}return o?new Oe(o.lineNumber,o.column,o.lineNumber,o.column):new Oe(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const r=s.getStartPosition();let o=t.matchBracket(r);if(!o&&(o=t.findEnclosingBrackets(r),!o)){const u=t.findNextBracket(r);u&&u.range&&(o=t.matchBracket(u.range.getStartPosition()))}let a=null,l=null;if(o){o.sort(M.compareRangesUsingStarts);const[u,h]=o;if(a=e?u.getStartPosition():u.getEndPosition(),l=e?h.getEndPosition():h.getStartPosition(),h.containsPosition(r)){const c=a;a=l,l=c}}a&&l&&i.push(new Oe(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();let e=[],t=0;for(const i of this._lastBracketsData){let s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations=this._editor.deltaDecorations(this._decorations,e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);let r=[],o=0;for(let c=0,f=e.length;c1&&r.sort(G.compare);let a=[],l=0,u=0,h=s.length;for(let c=0,f=r.length;c{const t=n.getColor(Vae);t&&e.addRule(`.monaco-editor .bracket-match { background-color: ${t}; }`);const i=n.getColor(Hae);i&&e.addRule(`.monaco-editor .bracket-match { border: 1px solid ${i}; }`)});qr.appendMenuItem(ke.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:_({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class Tle{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,s=this._selection.startColumn,r=this._selection.endColumn;if(!(this._isMovingLeft&&s===1)&&!(!this._isMovingLeft&&r===e.getLineMaxColumn(i)))if(this._isMovingLeft){const o=new M(i,s-1,i,s),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new M(i,r,i,r),a)}else{const o=new M(i,r,i,r+1),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new M(i,s,i,s),a)}}computeCursorState(e,t){return this._isMovingLeft?new Oe(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Oe(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class TH extends mt{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let i=[],s=t.getSelections();for(const r of s)i.push(new Tle(r,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class Ale extends TH{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:_("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:K.writable})}}class Mle extends TH{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:_("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:K.writable})}}ze(Ale);ze(Mle);var Ao;(function(n){n.text="text/plain",n.binary="application/octet-stream",n.unknown="application/unknown",n.markdown="text/markdown",n.latex="text/latex"})(Ao||(Ao={}));let Rd=[],w2=[],PS=[];function GC(n,e=!1){const t=Rle(n);Rd.push(t),t.userConfigured?PS.push(t):w2.push(t),e&&!t.userConfigured&&Rd.forEach(i=>{i.mime===t.mime||i.userConfigured||(t.extension&&i.extension===t.extension&&console.warn(`Overwriting extension <<${t.extension}>> to now point to mime <<${t.mime}>>`),t.filename&&i.filename===t.filename&&console.warn(`Overwriting filename <<${t.filename}>> to now point to mime <<${t.mime}>>`),t.filepattern&&i.filepattern===t.filepattern&&console.warn(`Overwriting filepattern <<${t.filepattern}>> to now point to mime <<${t.mime}>>`),t.firstline&&i.firstline===t.firstline&&console.warn(`Overwriting firstline <<${t.firstline}>> to now point to mime <<${t.mime}>>`))})}function Rle(n){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:n.userConfigured,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?N9(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(ji.sep)>=0:!1}}function Ole(n){n?(Rd=Rd.filter(e=>!e.userConfigured),PS=[]):(Rd=[],w2=[],PS=[])}function Ple(n,e){let t;if(n)switch(n.scheme){case lt.file:t=n.fsPath;break;case lt.data:t=cc.parseMetaData(n).get(cc.META_DATA_LABEL);break;default:t=n.path}if(!t)return[Ao.unknown];t=t.toLowerCase();const i=Ed(t),s=UB(t,i,PS);if(s)return[s,Ao.text];const r=UB(t,i,w2);if(r)return[r,Ao.text];if(e){const o=Fle(e);if(o)return[o,Ao.text]}return[Ao.unknown]}function UB(n,e,t){var i;let s=null,r=null,o=null;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){s=l;break}if(l.filepattern&&(!r||l.filepattern.length>r.filepattern.length)){const u=l.filepatternOnPath?n:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,u)&&(r=l)}l.extension&&(!o||l.extension.length>o.extension.length)&&e.endsWith(l.extensionLowercase)&&(o=l)}return s?s.mime:r?r.mime:o?o.mime:null}function Fle(n){if(WR(n)&&(n=n.substr(1)),n.length>0)for(let e=Rd.length-1;e>=0;e--){const t=Rd[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t.mime}return null}class tn{constructor(e,t,i,s,r){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selectionStartPosition=s,this.selectionEndPosition=r}toString(){return"[ <"+this.value+">, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"}static readFromTextArea(e){return new tn(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new tn(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const s=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,s,-1)}if(e>=this.selectionEnd){const s=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,s,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition(this.selectionStartPosition,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,r=-1;for(;(r=t.indexOf(` +`,r+1))!==-1;)s++;return[e,i*t.length,s]}static selectedText(e){return new tn(e,0,e.length,null,null)}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};let s=e.value,r=e.selectionStart,o=e.selectionEnd,a=t.value,l=t.selectionStart,u=t.selectionEnd;const h=s.substring(o),c=a.substring(u),f=fN(h,c);a=a.substring(0,a.length-f),s=s.substring(0,s.length-f);const g=s.substring(0,r),m=a.substring(0,l),v=qv(g,m);if(a=a.substring(v),s=s.substring(v),l-=v,r-=v,u-=v,o-=v,i&&l===u&&s.length>0){let w=null;if(l===a.length?a.startsWith(s)&&(w=a.substring(s.length)):a.endsWith(s)&&(w=a.substring(0,a.length-s.length)),w!==null&&w.length>0&&(/\uFE0F/.test(w)||fie(w)))return{text:w,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0}}if(l===u){if(s===a&&r===0&&o===s.length&&l===a.length&&a.indexOf(` +`)===-1&&pie(a))return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const w=g.length-v;return{text:a,replacePrevCharCnt:w,replaceNextCharCnt:0,positionDelta:0}}const S=o-r;return{text:a,replacePrevCharCnt:S,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(qv(e.value,t.value),e.selectionEnd),s=Math.min(fN(e.value,t.value),e.value.length-e.selectionEnd),r=e.value.substring(i,e.value.length-s),o=t.value.substring(i,t.value.length-s);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:o,replacePrevCharCnt:a,replaceNextCharCnt:r.length-a,positionDelta:l-o.length}}}tn.EMPTY=new tn("",0,0,null,null);class $g{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,s=i+1,r=i+t;return new M(s,1,r+1,1)}static fromEditorSelection(e,t,i,s,r){const o=$g._getPageOfLine(i.startLineNumber,s),a=$g._getRangeForPage(o,s),l=$g._getPageOfLine(i.endLineNumber,s),u=$g._getRangeForPage(l,s),h=a.intersectRanges(new M(1,1,i.startLineNumber,i.startColumn));let c=t.getValueInRange(h,1);const f=t.getLineCount(),g=t.getLineMaxColumn(f),m=u.intersectRanges(new M(i.endLineNumber,i.endColumn,f,g));let v=t.getValueInRange(m,1),S;if(o===l||o+1===l)S=t.getValueInRange(i,1);else{const w=a.intersectRanges(i),b=u.intersectRanges(i);S=t.getValueInRange(w,1)+String.fromCharCode(8230)+t.getValueInRange(b,1)}return r&&(c.length>500&&(c=c.substring(c.length-500,c.length)),v.length>500&&(v=v.substring(0,500)),S.length>2*500&&(S=S.substring(0,500)+String.fromCharCode(8230)+S.substring(S.length-500,S.length))),new tn(c+S+v,c.length,c.length+S.length,new G(i.startLineNumber,i.startColumn),new G(i.endLineNumber,i.endColumn))}}var FS;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(FS||(FS={}));const BN={forceCopyWithSyntaxHighlighting:!1};class o0{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}o0.INSTANCE=new o0;class Ble extends ie{constructor(e,t){super(),this.textArea=t,this._onFocus=this._register(new H),this.onFocus=this._onFocus.event,this._onBlur=this._register(new H),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new H),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new H),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new H),this.onCut=this._onCut.event,this._onPaste=this._register(new H),this.onPaste=this._onPaste.event,this._onType=this._register(new H),this.onType=this._onType.event,this._onCompositionStart=this._register(new H),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new H),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new H),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new H),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._host=e,this._textArea=this._register(new Wle(t)),this._asyncTriggerCut=this._register(new mi(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new mi(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=tn.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._isDoingComposition=!1,this._nextCommand=0;let i=null;this._register(qi(t.domNode,"keydown",a=>{(a.keyCode===109||this._isDoingComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),i=a,this._onKeyDown.fire(a)})),this._register(qi(t.domNode,"keyup",a=>{this._onKeyUp.fire(a)})),this._register(ne(t.domNode,"compositionstart",a=>{if(!this._isDoingComposition){if(this._isDoingComposition=!0,pt&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===a.data&&(i&&i.equals(109)&&(i.code==="ArrowRight"||i.code==="ArrowLeft")||ls)){this._textAreaState=new tn(this._textAreaState.value,this._textAreaState.selectionStart-1,this._textAreaState.selectionEnd,this._textAreaState.selectionStartPosition?new G(this._textAreaState.selectionStartPosition.lineNumber,this._textAreaState.selectionStartPosition.column-1):null,this._textAreaState.selectionEndPosition),this._onCompositionStart.fire({revealDeltaColumns:-1});return}if(x_){this._onCompositionStart.fire({revealDeltaColumns:-this._textAreaState.selectionStart});return}this._setAndWriteTextAreaState("compositionstart",tn.EMPTY),this._onCompositionStart.fire({revealDeltaColumns:0})}}));const s=a=>{const l=this._textAreaState,u=tn.readFromTextArea(this._textArea);return[u,tn.deduceInput(l,u,a)]},r=()=>{const a=this._textAreaState,l=tn.readFromTextArea(this._textArea);return[l,tn.deduceAndroidCompositionInput(a,l)]},o=a=>{const l=this._textAreaState,u=tn.selectedText(a),h={text:u.value,replacePrevCharCnt:l.selectionEnd-l.selectionStart,replaceNextCharCnt:0,positionDelta:0};return[u,h]};this._register(ne(t.domNode,"compositionupdate",a=>{if(x_){const[h,c]=r();this._textAreaState=h,this._onType.fire(c),this._onCompositionUpdate.fire(a);return}const[l,u]=o(a.data||"");this._textAreaState=l,this._onType.fire(u),this._onCompositionUpdate.fire(a)})),this._register(ne(t.domNode,"compositionend",a=>{if(!this._isDoingComposition)return;if(this._isDoingComposition=!1,x_){const[h,c]=r();this._textAreaState=h,this._onType.fire(c),this._onCompositionEnd.fire();return}const[l,u]=o(a.data||"");this._textAreaState=l,this._onType.fire(u),(sS||ls)&&(this._textAreaState=tn.readFromTextArea(this._textArea)),this._onCompositionEnd.fire()})),this._register(ne(t.domNode,"input",()=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._isDoingComposition)return;const[a,l]=s(pt);l.replacePrevCharCnt===0&&l.text.length===1&&fn(l.text.charCodeAt(0))||(this._textAreaState=a,this._nextCommand===0?(l.text!==""||l.replacePrevCharCnt!==0)&&this._onType.fire(l):((l.text!==""||l.replacePrevCharCnt!==0)&&this._firePaste(l.text,null),this._nextCommand=0))})),this._register(ne(t.domNode,"cut",a=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(a),this._asyncTriggerCut.schedule()})),this._register(ne(t.domNode,"copy",a=>{this._ensureClipboardGetsEditorSelection(a)})),this._register(ne(t.domNode,"paste",a=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),a_.canUseTextData(a)){const[l,u]=a_.getTextData(a);l!==""&&this._firePaste(l,u)}else this._textArea.getSelectionStart()!==this._textArea.getSelectionEnd()&&this._setAndWriteTextAreaState("paste",tn.EMPTY),this._nextCommand=1})),this._register(ne(t.domNode,"focus",()=>{const a=this._hasFocus;this._setHasFocus(!0),Fo&&!a&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(ne(t.domNode,"blur",()=>{this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(ne(t.domNode,FS.Tap,()=>{x_&&this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return ne(document,"selectionchange",t=>{if(!this._hasFocus||this._isDoingComposition||!sS)return;const i=Date.now(),s=i-e;if(e=i,s<5)return;const r=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),r<100||!this._textAreaState.selectionStartPosition||!this._textAreaState.selectionEndPosition)return;const o=this._textArea.getValue();if(this._textAreaState.value!==o)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const u=this._textAreaState.deduceEditorPosition(a),h=this._host.deduceModelPosition(u[0],u[1],u[2]),c=this._textAreaState.deduceEditorPosition(l),f=this._host.deduceModelPosition(c[0],c[1],c[2]),g=new Oe(h.lineNumber,h.column,f.lineNumber,f.column);this._onSelectionChangeRequest.fire(g)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){const e=Cf(this.textArea.domNode);e?this._setHasFocus(e.activeElement===this.textArea.domNode):ER(this.textArea.domNode)?this._setHasFocus(document.activeElement===this.textArea.domNode):this._setHasFocus(!1)}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(a_.canUseTextData(e)),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};if(o0.INSTANCE.set(ls?t.text.replace(/\r\n/g,` +`):t.text,i),!a_.canUseTextData(e)){this._setAndWriteTextAreaState("copy or cut",tn.selectedText(t.text));return}a_.setTextData(e,t.text,t.html,i)}_firePaste(e,t){t||(t=o0.INSTANCE.get(e)),this._onPaste.fire({text:e,metadata:t})}}class a_{static canUseTextData(e){return!!e.clipboardData}static getTextData(e){if(e.clipboardData){e.preventDefault();const t=e.clipboardData.getData(Ao.text);let i=null;const s=e.clipboardData.getData("vscode-editor-data");if(typeof s=="string")try{i=JSON.parse(s),i.version!==1&&(i=null)}catch{}return[t,i]}throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")}static setTextData(e,t,i,s){if(e.clipboardData){e.clipboardData.setData(Ao.text,t),typeof i=="string"&&e.clipboardData.setData("text/html",i),e.clipboardData.setData("vscode-editor-data",JSON.stringify(s)),e.preventDefault();return}throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")}}class Wle extends ie{constructor(e){super(),this._actual=e,this._ignoreSelectionChangeTime=0}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.domNode.value}setValue(e,t){const i=this._actual.domNode;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.domNode.selectionDirection==="backward"?this._actual.domNode.selectionEnd:this._actual.domNode.selectionStart}getSelectionEnd(){return this._actual.domNode.selectionDirection==="backward"?this._actual.domNode.selectionStart:this._actual.domNode.selectionEnd}setSelectionRange(e,t,i){const s=this._actual.domNode;let r=null;const o=Cf(s);o?r=o.activeElement:r=document.activeElement;const a=r===s,l=s.selectionStart,u=s.selectionEnd;if(a&&l===t&&u===i){ls&&window.parent!==window&&s.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),ls&&window.parent!==window&&s.focus();return}try{const h=Gte(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),qte(s,h)}catch{}}}const kc=wt("clipboardService");var Vle=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const Qd="9_cutcopypaste",Hle=wa||document.queryCommandSupported("cut"),AH=wa||document.queryCommandSupported("copy"),zle=typeof navigator.clipboard>"u"||ls?document.queryCommandSupported("paste"):!0;function S2(n){return n.register(),n}const Ule=Hle?S2(new pm({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:wa?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:ke.MenubarEditMenu,group:"2_ccp",title:_({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:ke.EditorContext,group:Qd,title:_("actions.clipboard.cutLabel","Cut"),when:K.writable,order:1},{menuId:ke.CommandPalette,group:"",title:_("actions.clipboard.cutLabel","Cut"),order:1},{menuId:ke.SimpleEditorContext,group:Qd,title:_("actions.clipboard.cutLabel","Cut"),when:K.writable,order:1}]})):void 0,$le=AH?S2(new pm({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:wa?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:ke.MenubarEditMenu,group:"2_ccp",title:_({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:ke.EditorContext,group:Qd,title:_("actions.clipboard.copyLabel","Copy"),order:2},{menuId:ke.CommandPalette,group:"",title:_("actions.clipboard.copyLabel","Copy"),order:1},{menuId:ke.SimpleEditorContext,group:Qd,title:_("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;qr.appendMenuItem(ke.MenubarEditMenu,{submenu:ke.MenubarCopy,title:{value:_("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});qr.appendMenuItem(ke.EditorContext,{submenu:ke.EditorContextCopy,title:{value:_("copy as","Copy As"),original:"Copy As"},group:Qd,order:3});const Vk=zle?S2(new pm({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:wa?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:ke.MenubarEditMenu,group:"2_ccp",title:_({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:ke.EditorContext,group:Qd,title:_("actions.clipboard.pasteLabel","Paste"),when:K.writable,order:4},{menuId:ke.CommandPalette,group:"",title:_("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:ke.SimpleEditorContext,group:Qd,title:_("actions.clipboard.pasteLabel","Paste"),when:K.writable,order:4}]})):void 0;class Kle extends mt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:_("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(32)&&t.getSelection().isEmpty()||(BN.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),BN.forceCopyWithSyntaxHighlighting=!1)}}function MH(n,e){!n||(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(ei).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const r=s.getOption(32),o=s.getSelection();return o&&o.isEmpty()&&!r||document.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(document.execCommand(e),!0)))}MH(Ule,"cut");MH($le,"copy");Vk&&(Vk.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(ei),i=n.get(kc),s=t.getFocusedCodeEditor();return s&&s.hasTextFocus()?!document.execCommand("paste")&&cm?(()=>Vle(void 0,void 0,void 0,function*(){const o=yield i.readText();if(o!==""){const a=o0.INSTANCE.get(o);let l=!1,u=null,h=null;a&&(l=s.getOption(32)&&!!a.isFromEmptySelection,u=typeof a.multicursorText<"u"?a.multicursorText:null,h=a.mode),s.trigger("keyboard","paste",{text:o,pasteOnNewLine:l,multicursorText:u,mode:h})}}))():!0:!1}),Vk.addImplementation(0,"generic-dom",(n,e)=>(document.execCommand("paste"),!0)));AH&&ze(Kle);class ks{static insert(e,t){return{range:new M(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}class Bh{constructor(e,t){this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,r=e.length;if(i+s>r)return!1;for(let o=0;o=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,r,o){const a=e.startLineNumber,l=e.startColumn,u=e.endLineNumber,h=e.endColumn,c=r.getLineContent(a),f=r.getLineContent(u);let g=c.lastIndexOf(t,l-1+t.length),m=f.indexOf(i,h-1-i.length);if(g!==-1&&m!==-1)if(a===u)c.substring(g+t.length,m).indexOf(i)>=0&&(g=-1,m=-1);else{const S=c.substring(g+t.length),w=f.substring(0,m);(S.indexOf(i)>=0||w.indexOf(i)>=0)&&(g=-1,m=-1)}let v;g!==-1&&m!==-1?(s&&g+t.length0&&f.charCodeAt(m-1)===32&&(i=" "+i,m-=1),v=Bh._createRemoveBlockCommentOperations(new M(a,g+t.length+1,u,m+1),t,i)):(v=Bh._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=v.length===1?i:null);for(const S of v)o.addTrackedEditOperation(S.range,S.text)}static _createRemoveBlockCommentOperations(e,t,i){let s=[];return M.isEmpty(e)?s.push(ks.delete(new M(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(ks.delete(new M(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(ks.delete(new M(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){let r=[];return M.isEmpty(e)?r.push(ks.replace(new M(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(r.push(ks.insert(new G(e.startLineNumber,e.startColumn),t+(s?" ":""))),r.push(ks.insert(new G(e.endLineNumber,e.endColumn),(s?" ":"")+i))),r}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenizeIfCheap(i);const r=e.getLanguageIdAtPosition(i,s),o=Jt.getComments(r);!o||!o.blockCommentStartToken||!o.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,o.blockCommentStartToken,o.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],r=i[1];return new Oe(s.range.endLineNumber,s.range.endColumn,r.range.startLineNumber,r.range.startColumn)}else{const s=i[0].range,r=this._usedEndToken?-this._usedEndToken.length-1:0;return new Oe(s.endLineNumber,s.endColumn+r,s.endLineNumber,s.endColumn+r)}}}class mu{constructor(e,t,i,s,r,o){this._selection=e,this._tabSize=t,this._type=i,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=o||!1}static _gatherPreflightCommentStrings(e,t,i){e.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=Jt.getComments(s),o=r?r.lineCommentToken:null;if(!o)return null;let a=[];for(let l=0,u=i-t+1;lr?t[l].commentStrOffset=o-1:t[l].commentStrOffset=o}}}class y2 extends mt{constructor(e,t){super(t),this._type=e}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=[],r=i.getOptions(),o=t.getOption(19),a=t.getSelections().map((u,h)=>({selection:u,index:h,ignoreFirstLine:!1}));a.sort((u,h)=>M.compareRangesUsingStarts(u.selection,h.selection));let l=a[0];for(let u=1;u=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},qt;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(qt||(qt={}));class Tt extends ie{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(ne(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(ne(document,"touchend",e=>this.onTouchEnd(e))),this._register(ne(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){return Tt.isTouchDevice()?(Tt.INSTANCE||(Tt.INSTANCE=new Tt),Tt.INSTANCE.targets.push(e),{dispose:()=>{Tt.INSTANCE.targets=Tt.INSTANCE.targets.filter(t=>t!==e)}}):ie.None}static ignoreTarget(e){return Tt.isTouchDevice()?(Tt.INSTANCE||(Tt.INSTANCE=new Tt),Tt.INSTANCE.ignoreTargets.push(e),{dispose:()=>{Tt.INSTANCE.ignoreTargets=Tt.INSTANCE.ignoreTargets.filter(t=>t!==e)}}):ie.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i=Tt.HOLD_DELAY&&Math.abs(a.initialPageX-Rr(a.rollingPageX))<30&&Math.abs(a.initialPageY-Rr(a.rollingPageY))<30){let u=this.newGestureEvent(qt.Contextmenu,a.initialTarget);u.pageX=Rr(a.rollingPageX),u.pageY=Rr(a.rollingPageY),this.dispatchEvent(u)}else if(i===1){let u=Rr(a.rollingPageX),h=Rr(a.rollingPageY),c=Rr(a.rollingTimestamps)-a.rollingTimestamps[0],f=u-a.rollingPageX[0],g=h-a.rollingPageY[0];const m=this.targets.filter(v=>a.initialTarget instanceof Node&&v.contains(a.initialTarget));this.inertia(m,t,Math.abs(f)/c,f>0?1:-1,u,Math.abs(g)/c,g>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(qt.End,a.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===qt.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Tt.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===qt.Change||e.type===qt.Contextmenu)&&(this._lastSetTapCountTime=0);for(let t=0;t{e.initialTarget instanceof Node&&t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)})}inertia(e,t,i,s,r,o,a,l){this.handle=Tl(()=>{let u=Date.now(),h=u-t,c=0,f=0,g=!0;i+=Tt.SCROLL_FRICTION*h,o+=Tt.SCROLL_FRICTION*h,i>0&&(g=!1,c=s*i*h),o>0&&(g=!1,f=a*o*h);let m=this.newGestureEvent(qt.Change);m.translationX=c,m.translationY=f,e.forEach(v=>v.dispatchEvent(m)),g||this.inertia(e,u,i,s,r+c,o,a,l+f)})}onTouchMove(e){let t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(r.pageX),o.rollingPageY.push(r.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Tt.SCROLL_FRICTION=-.005;Tt.HOLD_DELAY=700;Tt.CLEAR_TAP_COUNT_TIME=400;Xle([Hi],Tt,"isTouchDevice",null);class Od extends ie{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Vo&&this._register(t.onDidChange(s=>{!this.element||this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new Ap)),this._actionRunner}set actionRunner(e){this._actionRunner=e}getAction(){return this._action}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Tt.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,ls&&this._register(ne(e,xe.DRAG_START,s=>{var r;return(r=s.dataTransfer)===null||r===void 0?void 0:r.setData(RH.TEXT,this._action.label)}))),this._register(ne(t,qt.Tap,s=>this.onClick(s,!0))),this._register(ne(t,xe.MOUSE_DOWN,s=>{i||Rt.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),pt&&this._register(ne(t,xe.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(ne(t,xe.CLICK,s=>{Rt.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(ne(t,xe.DBLCLICK,s=>{Rt.stop(s,!0)})),[xe.MOUSE_UP,xe.MOUSE_OUT].forEach(s=>{this._register(ne(t,s,r=>{Rt.stop(r),t.classList.remove("active")}))})}onClick(e,t=!1){var i;Rt.stop(e,!0);const s=Wr(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,s)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),super.dispose()}}class a0 extends Od{constructor(e,t,i={}){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=le(this.element,ge("a.action-label"))),this.label&&(this._action.id===Ho.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&&(le(this.element,ge("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.getAction().label)}updateTooltip(){let 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=_({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&this.label&&(this.label.title=e)}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getAction().class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label&&this.label.classList.remove("codicon")}updateEnabled(){this.getAction().enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element&&this.element.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element&&this.element.classList.add("disabled"))}updateChecked(){this.label&&(this.getAction().checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}const Ec=wt("contextViewService"),Ic=wt("contextMenuService"),Ni=wt("keybindingService");var Qle=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},l_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let zp=class OH{constructor(e,t,i,s,r,o){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=r,this._menuService=o,this._toDispose=new pe,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(a=>this._onContextMenu(a))),this._toDispose.add(this._editor.onMouseWheel(a=>{if(this._contextMenuIsBeingShownCount>0){const l=this._contextViewService.getContextViewElement(),u=a.srcElement;u.shadowRoot&&Cf(l)===u.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(a=>{a.keyCode===58&&(a.preventDefault(),a.stopPropagation(),this.showContextMenu())}))}static get(e){return e.getContribution(OH.ID)}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(20)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||(e.event.preventDefault(),e.event.stopPropagation(),e.target.type!==6&&e.target.type!==7&&e.target.type!==1))return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t={x:e.event.posx-1,width:2,y:e.event.posy-1,height:2}),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(20)||!this._editor.hasModel())return;if(!this._contextMenuService){this._editor.focus();return}const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?ke.SimpleEditorContext:ke.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.createMenu(t,this._contextKeyService),r=s.getActions({arg:e.uri});s.dispose();for(let o of r){const[,a]=o;let l=0;for(const u of a)if(u instanceof UR){const h=this._getMenuActions(e,u.item.submenu);h.length>0&&(i.push(new Gy(u.id,u.label,h)),l++)}else i.push(u),l++;l&&i.push(new Ho)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(52);if(this._editor.updateOptions({hover:{enabled:!1}}),!t){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),o=bn(this._editor.getDomNode()),a=o.left+r.left,l=o.top+r.top+r.height;t={x:a,y:l}}const s=this._editor.getOption(113)&&!Nl;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getDomNode():void 0,getAnchor:()=>t,getActions:()=>e,getActionViewItem:r=>{const o=this._keybindingFor(r);if(o)return new a0(r,r,{label:!0,keybinding:o.getLabel(),isMenu:!0});const a=r;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new a0(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.focus(),this._editor.updateOptions({hover:i})}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};zp.ID="editor.contrib.contextmenu";zp=Qle([l_(1,Ic),l_(2,Ec),l_(3,je),l_(4,Ni),l_(5,yf)],zp);class Jle extends mt{constructor(){super({id:"editor.action.showContextMenu",label:_("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:1092,weight:100}})}run(e,t){zp.get(t).showContextMenu()}}Ln(zp.ID,zp);ze(Jle);class Hk{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let s=0;s{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new Hk(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new zk(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}static get(e){return e.getContribution(Jd.ID)}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new zk(new Hk(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new zk(new Hk(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}Jd.ID="editor.contrib.cursorUndoRedoController";class eue extends mt{constructor(){super({id:"cursorUndo",label:_("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:K.textInputFocus,primary:2099,weight:100}})}run(e,t,i){Jd.get(t).cursorUndo()}}class tue extends mt{constructor(){super({id:"cursorRedo",label:_("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){Jd.get(t).cursorRedo()}}Ln(Jd.ID,Jd);ze(eue);ze(tue);class Un{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.deltaDecorations(this._allDecorations(),[]),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getCurrentMatchesPosition(e){let t=this._editor.getModel().getDecorationsInRange(e);for(const i of t){const s=i.options;if(s===Un._FIND_MATCH_DECORATION||s===Un._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let s=0,r=this._decorations.length;s{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,Un._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,Un._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let r=this._editor.getModel().getDecorationRange(t);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){let o=r.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(o);r=new M(r.startLineNumber,r.startColumn,o,a)}this._rangeHighlightDecorationId=s.addDecoration(r,Un._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=Un._FIND_MATCH_DECORATION,r=[];if(e.length>1e3){s=Un._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),u=this._editor.getLayoutInfo().height/a,h=Math.max(2,Math.ceil(3/u));let c=e[0].range.startLineNumber,f=e[0].range.endLineNumber;for(let g=1,m=e.length;g=v.startLineNumber?v.endLineNumber>f&&(f=v.endLineNumber):(r.push({range:new M(c,1,f,1),options:Un._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),c=v.startLineNumber,f=v.endLineNumber)}r.push({range:new M(c,1,f,1),options:Un._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let o=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Un._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){let i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return r;if(!(r.startColumn0){let i=[];for(let o=0;oM.compareRangesUsingStarts(o.range,a.range));let s=[],r=i[0];for(let o=1;o0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function $B(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function KB(n,e,t){const i=e.split(t),s=n[0].split(t);let r="";return i.forEach((o,a)=>{r+=PH([s[a]],o)+t}),r.slice(0,-1)}class jB{constructor(e){this.staticValue=e,this.kind=0}}class nue{constructor(e){this.pieces=e,this.kind=1}}class Up{constructor(e){!e||e.length===0?this._state=new jB(""):e.length===1&&e[0].staticValue!==null?this._state=new jB(e[0].staticValue):this._state=new nue(e)}static fromStaticValue(e){return new Up([Pd.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}buildReplaceString(e,t){if(this._state.kind===0)return t?PH(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,r=this._state.pieces.length;s0){let l=[],u=o.caseOps.length,h=0;for(let c=0,f=a.length;c=u){l.push(a.slice(c));break}switch(o.caseOps[h]){case"U":l.push(a[c].toUpperCase());break;case"u":l.push(a[c].toUpperCase()),h++;break;case"L":l.push(a[c].toLowerCase());break;case"l":l.push(a[c].toLowerCase()),h++;break;default:l.push(a[c])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=s)break;let o=n.charCodeAt(i);switch(o){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` +`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(o));break}continue}if(r===36){if(i++,i>=s)break;let o=n.charCodeAt(i);if(o===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(o===48||o===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=o&&o<=57){let a=o-48;if(i+1this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,ct(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||!this._editor.hasModel()||(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},oue)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new M(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));let s=this._findMatches(i,!1,Wh);this._decorations.set(s,i);const r=this._editor.getSelection();let o=this._decorations.getCurrentMatchesPosition(r);if(o===0&&s.length>0){const a=D9(s.map(l=>l.range),l=>M.compareRangesUsingStarts(l,r)>=0);o=a>0?a-1+1:o}this._state.changeMatchInfo(o,this._decorations.getCount(),void 0),e&&this._editor.getOption(35).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){let e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){let t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){let t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0),{lineNumber:i,column:s}=e,r=this._editor.getModel();return t||s===1?(i===1?i=r.getLineCount():i--,s=r.getLineMaxColumn(i)):s--,new G(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const h=this._decorations.matchAfterPosition(e);h&&this._setCurrentFindMatch(h);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0),{lineNumber:i,column:s}=e,r=this._editor.getModel();return t||s===r.getLineMaxColumn(i)?(i===r.getLineCount()?i=1:i++,s=1):s++,new G(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()cv._getSearchRange(this._editor.getModel(),r));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Wh?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new Qc(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(115):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let c="mu";i.ignoreCase&&(c+="i"),i.global&&(c+="g"),i=new RegExp(i.source,c)}const s=this._editor.getModel(),r=s.getValue(1),o=s.getFullModelRange(),a=this._getReplacePattern();let l;const u=this._state.preserveCase;a.hasReplacementPatterns||u?l=r.replace(i,function(){return a.buildReplaceString(arguments,u)}):l=r.replace(i,a.buildReplaceString(null,u));let h=new IH(o,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",h)}_regularReplaceAll(e){const t=this._getReplacePattern();let i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let o=0,a=i.length;oo.range),s);this._executeEditorCommand("replaceAll",r)}selectAllMatches(){if(!this._hasMatches())return;let e=this._decorations.getFindScopes(),i=this._findMatches(e,!1,1073741824).map(r=>new Oe(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn)),s=this._editor.getSelection();for(let r=0,o=i.length;rt(new Kr(i))))}onmousedown(e,t){this._register(ne(e,xe.MOUSE_DOWN,i=>t(new Kr(i))))}onmouseover(e,t){this._register(ne(e,xe.MOUSE_OVER,i=>t(new Kr(i))))}onnonbubblingmouseout(e,t){this._register(NR(e,i=>t(new Kr(i))))}onkeydown(e,t){this._register(ne(e,xe.KEY_DOWN,i=>t(new ci(i))))}onkeyup(e,t){this._register(ne(e,xe.KEY_UP,i=>t(new ci(i))))}oninput(e,t){this._register(ne(e,xe.INPUT,t))}onblur(e,t){this._register(ne(e,xe.BLUR,t))}onfocus(e,t){this._register(ne(e,xe.FOCUS,t))}ignoreGesture(e){Tt.ignoreTarget(e)}}const aue={inputActiveOptionBorder:q.fromHex("#007ACC00"),inputActiveOptionForeground:q.fromHex("#FFFFFF"),inputActiveOptionBackground:q.fromHex("#0E639C50")};class ub extends no{constructor(e){super(),this._onChange=this._register(new H),this.onChange=this._onChange.event,this._onKeyDown=this._register(new H),this.onKeyDown=this._onKeyDown.event,this._opts=Object.assign(Object.assign({},aue),e),this._checked=this._opts.isChecked;const t=["monaco-custom-checkbox"];this._opts.icon&&t.push(...Ks.asClassNameArray(this._opts.icon)),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault()}),this.ignoreGesture(this.domNode),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}style(e){e.inputActiveOptionBorder&&(this._opts.inputActiveOptionBorder=e.inputActiveOptionBorder),e.inputActiveOptionForeground&&(this._opts.inputActiveOptionForeground=e.inputActiveOptionForeground),e.inputActiveOptionBackground&&(this._opts.inputActiveOptionBackground=e.inputActiveOptionBackground),this.applyStyles()}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder?this._opts.inputActiveOptionBorder.toString():"transparent",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground?this._opts.inputActiveOptionForeground.toString():"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground?this._opts.inputActiveOptionBackground.toString():"transparent")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const lue=_("caseDescription","Match Case"),uue=_("wordsDescription","Match Whole Word"),hue=_("regexDescription","Use Regular Expression");class FH extends ub{constructor(e){super({icon:ve.caseSensitive,title:lue+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class BH extends ub{constructor(e){super({icon:ve.wholeWord,title:uue+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class WH extends ub{constructor(e){super({icon:ve.regex,title:hue+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class CL extends no{constructor(e,t,i,s){super(),this._hideSoon=this._register(new mi(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const r=s.getColorTheme().getColor(NN),o=s.getColorTheme().getColor(AN),a=s.getColorTheme().getColor(TN);this.caseSensitive=this._register(new FH({appendTitle:this._keybindingLabelFor(Gt.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,inputActiveOptionBorder:r,inputActiveOptionForeground:o,inputActiveOptionBackground:a})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new BH({appendTitle:this._keybindingLabelFor(Gt.ToggleWholeWordCommand),isChecked:this._state.wholeWord,inputActiveOptionBorder:r,inputActiveOptionForeground:o,inputActiveOptionBackground:a})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new WH({appendTitle:this._keybindingLabelFor(Gt.ToggleRegexCommand),isChecked:this._state.isRegex,inputActiveOptionBorder:r,inputActiveOptionForeground:o,inputActiveOptionBackground:a})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(l=>{let u=!1;l.isRegex&&(this.regex.checked=this._state.isRegex,u=!0),l.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,u=!0),l.matchCase&&(this.caseSensitive.checked=this._state.matchCase,u=!0),!this._state.isRevealed&&u&&this._revealTemporarily()})),this._register(NR(this._domNode,l=>this._onMouseOut())),this._register(ne(this._domNode,"mouseover",l=>this._onMouseOver())),this._applyTheme(s.getColorTheme()),this._register(s.onDidColorThemeChange(this._applyTheme.bind(this)))}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return CL.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseOut(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){!this._isVisible||(this._isVisible=!1,this._domNode.style.display="none")}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(NN),inputActiveOptionForeground:e.getColor(AN),inputActiveOptionBackground:e.getColor(TN)};this.caseSensitive.style(t),this.wholeWords.style(t),this.regex.style(t)}}CL.ID="editor.contrib.findOptionsWidget";ni((n,e)=>{const t=n.getColor(zo);t&&e.addRule(`.monaco-editor .findOptionsWidget { background-color: ${t}; }`);const i=n.getColor(ic);i&&e.addRule(`.monaco-editor .findOptionsWidget { color: ${i}; }`);const s=n.getColor(Hp);s&&e.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 0 8px 2px ${s}; }`);const r=n.getColor(Pi);r&&e.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${r}; }`)});function JC(n,e){return n===1?!0:n===2?!1:e}class cue extends ie{constructor(){super(),this._onFindReplaceStateChange=this._register(new H),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0}get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return JC(this._isRegexOverride,this._isRegex)}get wholeWord(){return JC(this._wholeWordOverride,this._wholeWord)}get matchCase(){return JC(this._matchCaseOverride,this._matchCase)}get preserveCase(){return JC(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}changeMatchInfo(e,t,i){let s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1},r=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,r=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,r=!0),typeof i<"u"&&(M.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,r=!0)),r&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){var s;let r={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1},o=!1;const a=this.isRegex,l=this.wholeWord,u=this.matchCase,h=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,r.searchString=!0,o=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,r.replaceString=!0,o=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,r.isRevealed=!0,o=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,r.isReplaceRevealed=!0,o=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((s=e.searchScope)===null||s===void 0)&&s.every(c=>{var f;return(f=this._searchScope)===null||f===void 0?void 0:f.some(g=>!M.equalsRange(g,c))})||(this._searchScope=e.searchScope,r.searchScope=!0,o=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,r.loop=!0,o=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(o=!0,r.isRegex=!0),l!==this.wholeWord&&(o=!0,r.wholeWord=!0),u!==this.matchCase&&(o=!0,r.matchCase=!0),h!==this.preserveCase&&(o=!0,r.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(r)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Wh}}class $t{constructor(e,t,i){const s=r=>this.emitter.fire(r);this.emitter=new H({onFirstListenerAdd:()=>e.addEventListener(t,s,i),onLastListenerRemove:()=>e.removeEventListener(t,s,i)})}get event(){return this.emitter.event}dispose(){this.emitter.dispose()}}function GB(n){return n.preventDefault(),n.stopPropagation(),n}var wm=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let due=!1;var BS;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(BS||(BS={}));let fue=4;const gue=new H;let pue=300;const mue=new H;class D2{constructor(){this.disposables=new pe}get onPointerMove(){return this.disposables.add(new $t(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new $t(window,"mouseup")).event}dispose(){this.disposables.dispose()}}wm([Hi],D2.prototype,"onPointerMove",null);wm([Hi],D2.prototype,"onPointerUp",null);class x2{constructor(e){this.el=e,this.disposables=new pe}get onPointerMove(){return this.disposables.add(new $t(this.el,qt.Change)).event}get onPointerUp(){return this.disposables.add(new $t(this.el,qt.End)).event}dispose(){this.disposables.dispose()}}wm([Hi],x2.prototype,"onPointerMove",null);wm([Hi],x2.prototype,"onPointerUp",null);class WS{constructor(e){this.factory=e}get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}dispose(){}}wm([Hi],WS.prototype,"onPointerMove",null);wm([Hi],WS.prototype,"onPointerUp",null);class An extends ie{constructor(e,t,i){super(),this.hoverDelay=pue,this.hoverDelayer=this._register(new dm(this.hoverDelay)),this._state=3,this._onDidEnablementChange=this._register(new H),this.onDidEnablementChange=this._onDidEnablementChange.event,this._onDidStart=this._register(new H),this.onDidStart=this._onDidStart.event,this._onDidChange=this._register(new H),this.onDidChange=this._onDidChange.event,this._onDidReset=this._register(new H),this.onDidReset=this._onDidReset.event,this._onDidEnd=this._register(new H),this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.orthogonalStartSashDisposables=this._register(new pe),this.orthogonalStartDragHandleDisposables=this._register(new pe),this.orthogonalEndSashDisposables=this._register(new pe),this.orthogonalEndDragHandleDisposables=this._register(new pe),this.el=le(e,ge(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),pt&&this.el.classList.add("mac");const s=this._register(new $t(this.el,"mousedown")).event;this._register(s(c=>this.onPointerStart(c,new D2),this));const r=this._register(new $t(this.el,"dblclick")).event;this._register(r(this.onPointerDoublePress,this));const o=this._register(new $t(this.el,"mouseenter")).event;this._register(o(()=>An.onMouseEnter(this)));const a=this._register(new $t(this.el,"mouseleave")).event;this._register(a(()=>An.onMouseLeave(this))),this._register(Tt.addTarget(this.el));const l=De.map(this._register(new $t(this.el,qt.Start)).event,c=>{var f;return Object.assign(Object.assign({},c),{target:(f=c.initialTarget)!==null&&f!==void 0?f:null})});this._register(l(c=>this.onPointerStart(c,new x2(this.el)),this));const u=this._register(new $t(this.el,qt.Tap)).event,h=De.map(De.filter(De.debounce(u,(c,f)=>{var g;return{event:f,count:((g=c?.count)!==null&&g!==void 0?g:0)+1}},250),({count:c})=>c===2),({event:c})=>{var f;return Object.assign(Object.assign({},c),{target:(f=c.initialTarget)!==null&&f!==void 0?f:null})});this._register(h(this.onPointerDoublePress,this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=fue,this._register(gue.event(c=>{this.size=c,this.layout()}))),this._register(mue.event(c=>this.hoverDelay=c)),this.hidden=!1,this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",due),this.layout()}get state(){return this._state}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this._onDidEnablementChange.fire(e))}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=le(this.el,ge(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ct(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new $t(this._orthogonalStartDragHandle,"mouseenter")).event(()=>An.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new $t(this._orthogonalStartDragHandle,"mouseleave")).event(()=>An.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=le(this.el,ge(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ct(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new $t(this._orthogonalEndDragHandle,"mouseenter")).event(()=>An.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new $t(this._orthogonalEndDragHandle,"mouseleave")).event(()=>An.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalEndSash=e}onPointerStart(e,t){Rt.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const m=this.getOrthogonalSash(e);m&&(i=!0,e.__orthogonalSashEvent=!0,m.onPointerStart(e,new WS(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new WS(t))),!this.state)return;const s=Qte("iframe");for(const m of s)m.style.pointerEvents="none";const r=e.pageX,o=e.pageY,a=e.altKey,l={startX:r,currentX:r,startY:o,currentY:o,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const u=Qr(this.el),h=()=>{let m="";i?m="all-scroll":this.orientation===1?this.state===1?m="s-resize":this.state===2?m="n-resize":m=pt?"row-resize":"ns-resize":this.state===1?m="e-resize":this.state===2?m="w-resize":m=pt?"col-resize":"ew-resize",u.textContent=`* { cursor: ${m} !important; }`},c=new pe;h(),i||this.onDidEnablementChange(h,null,c);const f=m=>{Rt.stop(m,!1);const v={startX:r,currentX:m.pageX,startY:o,currentY:m.pageY,altKey:a};this._onDidChange.fire(v)},g=m=>{Rt.stop(m,!1),this.el.removeChild(u),this.el.classList.remove("active"),this._onDidEnd.fire(),c.dispose();for(const v of s)v.style.pointerEvents="auto"};t.onPointerMove(f,null,c),t.onPointerUp(g,null,c),c.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&An.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&An.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){An.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}hide(){this.hidden=!0,this.el.style.display="none",this.el.setAttribute("aria-hidden","true")}getOrthogonalSash(e){if(!(!e.target||!(e.target instanceof HTMLElement))&&e.target.classList.contains("orthogonal-drag-handle"))return e.target.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}function _ue(n,e={}){const t=k2(e);return t.textContent=n,t}function vue(n,e={}){const t=k2(e);return VH(t,Cue(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function k2(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class bue{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function VH(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const r=document.createElement("a");r.href="#",t.disposables.add(qi(r,"click",o=>{t.callback(String(e.index),o)})),s=r}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(r=>{VH(s,r,t,i)})}function Cue(n,e){const t={type:1,children:[]};let i=0,s=t;const r=[],o=new bue(n);for(;!o.eos();){let a=o.next();const l=a==="\\"&&WN(o.peek(),e)!==0;if(l&&(a=o.next()),!l&&wue(a,e)&&a===o.peek()){o.advance(),s.type===2&&(s=r.pop());const u=WN(a,e);if(s.type===u||s.type===5&&u===6)s=r.pop();else{const h={type:u,children:[]};u===5&&(h.index=i,i++),s.children.push(h),r.push(s),s=h}}else if(a===` +`)s.type===2&&(s=r.pop()),s.children.push({type:8});else if(s.type!==2){const u={type:2,content:a};s.children.push(u),r.push(s),s=u}else s.content+=a}return s.type===2&&(s=r.pop()),t}function wue(n,e){return WN(n,e)!==0}function WN(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}var Sue=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class Zu extends ie{constructor(e,t={}){var i,s,r,o,a,l;super(),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new H),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new H({onFirstListenerAdd:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new H),this.onDidRun=this._onDidRun.event,this._onBeforeRun=this._register(new H),this.onBeforeRun=this._onBeforeRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(s=this.options.orientation)!==null&&s!==void 0?s:0,this._triggerKeys={keyDown:(o=(r=this.options.triggerKeys)===null||r===void 0?void 0:r.keyDown)!==null&&o!==void 0?o:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Ap,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun(c=>this._onDidRun.fire(c))),this._register(this._actionRunner.onBeforeRun(c=>this._onBeforeRun.fire(c))),this._actionIds=[],this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let u,h;switch(this._orientation){case 0:u=[15],h=[17];break;case 1:u=[16],h=[18],this.domNode.className+=" vertical";break}this._register(ne(this.domNode,xe.KEY_DOWN,c=>{const f=new ci(c);let g=!0;const m=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;u&&(f.equals(u[0])||f.equals(u[1]))?g=this.focusPrevious():h&&(f.equals(h[0])||f.equals(h[1]))?g=this.focusNext():f.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():f.equals(14)?g=this.focusFirst():f.equals(13)?g=this.focusLast():f.equals(2)&&m instanceof Od&&m.trapsArrowNavigation?g=this.focusNext():this.isTriggerKeyEvent(f)?this._triggerKeys.keyDown?this.doTrigger(f):this.triggerKeyDown=!0:g=!1,g&&(f.preventDefault(),f.stopPropagation())})),this._register(ne(this.domNode,xe.KEY_UP,c=>{const f=new ci(c);this.isTriggerKeyEvent(f)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(f)),f.preventDefault(),f.stopPropagation()):(f.equals(2)||f.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(Tp(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(sp()===this.domNode||!Ll(sp(),this.domNode))&&(this._onDidBlur.fire(),this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role","toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){e&&(this._actionRunner=e,this.viewItems.forEach(t=>t.actionRunner=e))}getContainer(){return this.domNode}push(e,t={}){const i=Array.isArray(e)?e:[e];let s=Gd(t.index)?t.index:null;i.forEach(r=>{const o=document.createElement("li");o.className="action-item",o.setAttribute("role","presentation"),this.options.allowContextMenu||this._register(ne(o,xe.CONTEXT_MENU,l=>{Rt.stop(l,!0)}));let a;this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(r)),a||(a=new a0(this.context,r,t)),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(o),this.focusable&&a instanceof Od&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(o),this.viewItems.push(a),this._actionIds.push(r.id)):(this.actionsList.insertBefore(o,this.actionsList.children[s]),this.viewItems.splice(s,0,a),this._actionIds.splice(s,0,r.id),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem)}clear(){ct(this.viewItems),this.viewItems=[],this._actionIds=[],On(this.actionsList)}length(){return this.viewItems.length}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const s=this.viewItems.findIndex(r=>r.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus()}else i!==void 0&&(this.focusedItem=i),this.updateFocus()}focusFirst(){return this.focusedItem=this.length()>1?1:0,this.focusPrevious()}focusLast(){return this.focusedItem=this.length()<2?0:this.length()-2,this.focusNext()}focusNext(){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=e,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(),!0}focusPrevious(){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(this.options.preventLoopNavigation)return this.focusedItem=e,!1;this.focusedItem=this.viewItems.length-1}t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(!0),!0}updateFocus(e,t){typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t});for(let i=0;i"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Od){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return Sue(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){ct(this.viewItems),this.viewItems=[],this._actionIds=[],this.getContainer().remove(),super.dispose()}}class HH{constructor(e){this.domNode=e,this._maxWidth=-1,this._width=-1,this._height=-1,this._top=-1,this._left=-1,this._bottom=-1,this._right=-1,this._fontFamily="",this._fontWeight="",this._fontSize=-1,this._fontFeatureSettings="",this._lineHeight=-1,this._letterSpacing=-100,this._className="",this._display="",this._position="",this._visibility="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth+"px")}setWidth(e){this._width!==e&&(this._width=e,this.domNode.style.width=this._width+"px")}setHeight(e){this._height!==e&&(this._height=e,this.domNode.style.height=this._height+"px")}setTop(e){this._top!==e&&(this._top=e,this.domNode.style.top=this._top+"px")}unsetTop(){this._top!==-1&&(this._top=-1,this.domNode.style.top="")}setLeft(e){this._left!==e&&(this._left=e,this.domNode.style.left=this._left+"px")}setBottom(e){this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom+"px")}setRight(e){this._right!==e&&(this._right=e,this.domNode.style.right=this._right+"px")}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize+"px")}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setLineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight+"px")}setLetterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing+"px")}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function bt(n){return new HH(n)}function Sm(n,e){let t=new Kr(e);return t.preventDefault(),{leftButton:t.leftButton,buttons:t.buttons,posx:t.posx,posy:t.posy}}class If{constructor(){this._hooks=new pe,this._mouseMoveEventMerger=null,this._mouseMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._mouseMoveEventMerger=null,this._mouseMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._mouseMoveEventMerger}startMonitoring(e,t,i,s,r){if(this.isMonitoring())return;this._mouseMoveEventMerger=i,this._mouseMoveCallback=s,this._onStopCallback=r;const o=iN.getSameOriginWindowChain(),a=Nl?"pointermove":"mousemove",l="mouseup",u=o.map(c=>c.window.document),h=Cf(e);h&&u.unshift(h);for(const c of u)this._hooks.add(TR(c,a,f=>{if(f.buttons!==t){this.stopMonitoring(!0);return}this._mouseMoveCallback(f)},(f,g)=>this._mouseMoveEventMerger(f,g))),this._hooks.add(ne(c,l,f=>this.stopMonitoring(!0)));if(iN.hasDifferentOriginAncestor()){let c=o[o.length-1];this._hooks.add(ne(c.window.document,"mouseout",f=>{new Kr(f).target.tagName.toLowerCase()==="html"&&this.stopMonitoring(!0)})),this._hooks.add(ne(c.window.document,"mouseover",f=>{new Kr(f).target.tagName.toLowerCase()==="html"&&this.stopMonitoring(!0)})),this._hooks.add(ne(c.window.document.body,"mouseleave",f=>{this.stopMonitoring(!0)}))}}}const $p=11;class yue extends no{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...e.icon.classNamesArray),this.domNode.style.position="absolute",this.domNode.style.width=$p+"px",this.domNode.style.height=$p+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new If),this.onmousedown(this.bgDomNode,t=>this._arrowMouseDown(t)),this.onmousedown(this.domNode,t=>this._arrowMouseDown(t)),this._mousedownRepeatTimer=this._register(new ib),this._mousedownScheduleRepeatTimer=this._register(new Ms)}_arrowMouseDown(e){const t=()=>{this._mousedownRepeatTimer.cancelAndSet(()=>this._onActivate(),41.666666666666664)};this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet(t,200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,Sm,i=>{},()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Lue extends ie{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Ms)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode&&this._domNode.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode&&this._domNode.setClassName(this._invisibleClassName+(e?" fade":"")))}}const Due=140;class zH extends no{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Lue(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new If),this._shouldRender=!0,this.domNode=bt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this.onmousedown(this.domNode.domNode,t=>this._domNodeMouseDown(t))}_createArrow(e){const t=this._register(new yue(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=bt(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this.onmousedown(this.slider.domNode,r=>{r.leftButton&&(r.preventDefault(),this._sliderMouseDown(r,()=>{}))}),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){!this._shouldRender||(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodeMouseDown(e){e.target===this.domNode.domNode&&this._onMouseDown(e)}delegateMouseDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderMousePosition(e);i<=r&&r<=s?e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{})):this._onMouseDown(e)}_onMouseDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.browserEvent.offsetX=="number"&&typeof e.browserEvent.offsetY=="number")t=e.browserEvent.offsetX,i=e.browserEvent.offsetY;else{const r=bn(this.domNode.domNode);t=e.posx-r.left,i=e.posy-r.top}const s=this._mouseDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,()=>{}))}_sliderMouseDown(e,t){const i=this._sliderMousePosition(e),s=this._sliderOrthogonalMousePosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,Sm,o=>{const a=this._sliderOrthogonalMousePosition(o),l=Math.abs(a-s);if(Pn&&l>Due){this._setDesiredScrollPositionNow(r.getScrollPosition());return}const h=this._sliderMousePosition(o)-i;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(h))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd(),t()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const xue=20;class l0{constructor(e,t,i,s,r,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=r,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new l0(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,r){const o=Math.max(0,i-e),a=Math.max(0,o-2*t),l=s>0&&s>i;if(!l)return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const u=Math.round(Math.max(xue,Math.floor(i*a/s))),h=(a-u)/(s-i),c=r*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(u),computedSliderRatio:h,computedSliderPosition:Math.round(c)}}_refreshComputedValues(){const e=l0._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new Ip(null,1,0))}),this._createArrow({className:"scra",icon:Eue,top:a,left:void 0,bottom:void 0,right:o,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Ip(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(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}_mouseDownRelativePosition(e,t){return e}_sliderMousePosition(e){return e.posx}_sliderOrthogonalMousePosition(e){return e.posy}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}const Nue=qo("scrollbar-button-up",ve.triangleUp),Tue=qo("scrollbar-button-down",ve.triangleDown);class Aue extends zH{constructor(e,t,i){const s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new l0(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const o=(t.arrowSize-$p)/2,a=(t.verticalScrollbarSize-$p)/2;this._createArrow({className:"scra",icon:Nue,top:o,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Ip(null,0,1))}),this._createArrow({className:"scra",icon:Tue,top:void 0,left:a,bottom:o,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Ip(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(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}_mouseDownRelativePosition(e,t){return t}_sliderMousePosition(e){return e.posy}_sliderOrthogonalMousePosition(e){return e.posx}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class VS{constructor(e,t,i,s,r,o){this._scrollStateBrand=void 0,e=e|0,t=t|0,i=i|0,s=s|0,r=r|0,o=o|0,this.rawScrollLeft=i,this.rawScrollTop=o,e<0&&(e=0),i+e>t&&(i=t-e),i<0&&(i=0),s<0&&(s=0),o+s>r&&(o=r-s),o<0&&(o=0),this.width=e,this.scrollWidth=t,this.scrollLeft=i,this.height=s,this.scrollHeight=r,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new VS(typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new VS(this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:r,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:l}}}class wL extends ie{constructor(e,t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new H),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e,this._scheduleAtNextAnimationFrame=t,this._state=new VS(0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const i=this._state.withScrollDimensions(e,t);this._setState(i,Boolean(this._smoothScrolling)),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new u0(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=u0.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{!this._smoothScrolling||(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{!this._smoothScrolling||(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class qB{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function Uk(n,e){const t=e-n;return function(i){return n+t*Oue(i)}}function Mue(n,e,t){return function(i){return i2.5*i){let r,o;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}VN.INSTANCE=new VN;class UH extends no{constructor(e,t,i){super(),this._onScroll=this._register(new H),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new H),e.style.overflow="hidden",this._options=Bue(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Aue(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Iue(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=bt(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=bt(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=bt(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onnonbubblingmouseout(this._listenOnDomNode,r=>this._onMouseOut(r)),this._hideTimeout=this._register(new Ms),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=ct(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarMouseDown(e){this._verticalScrollbar.delegateMouseDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,pt&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ct(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new Ip(s))};this._mouseWheelToDispose.push(ne(this._listenOnDomNode,xe.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){const t=VN.INSTANCE;{const r=window.devicePixelRatio/Qee();Pn||Ns?t.accept(Date.now(),e.deltaX/r,e.deltaY/r):t.accept(Date.now(),e.deltaX,e.deltaY)}let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(r)>=Math.abs(o)?o=0:r=0),this._options.flipAxes&&([r,o]=[o,r]);const a=!pt&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!o&&(o=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);const l=this._scrollable.getFutureScrollPosition();let u={};if(r){const h=ZB*r,c=l.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(u,c)}if(o){const h=ZB*o,c=l.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(u,c)}u=this._scrollable.validateScrollPosition(u),(l.scrollLeft!==u.scrollLeft||l.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(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()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(!!this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseOut(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Pue)}}class E2 extends UH{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new wL(0,s=>Tl(s));super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class I2 extends UH{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class SL extends E2{constructor(e,t){super(e,t),this._element=e,this.onScroll(i=>{i.scrollTopChanged&&(this._element.scrollTop=i.scrollTop),i.scrollLeftChanged&&(this._element.scrollLeft=i.scrollLeft)}),this.scanDomNode()}scanDomNode(){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})}}function Bue(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,pt&&(e.className+=" mac"),e}class Wue{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class Vue{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new Wue(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const u_=ge,Hue={inputBackground:q.fromHex("#3C3C3C"),inputForeground:q.fromHex("#CCCCCC"),inputValidationInfoBorder:q.fromHex("#55AAFF"),inputValidationInfoBackground:q.fromHex("#063B49"),inputValidationWarningBorder:q.fromHex("#B89500"),inputValidationWarningBackground:q.fromHex("#352A05"),inputValidationErrorBorder:q.fromHex("#BE1100"),inputValidationErrorBackground:q.fromHex("#5A1D1D")};class $H extends no{constructor(e,t,i){var s;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new H),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new H),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),Fa(this.options,Hue,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(s=this.options.tooltip)!==null&&s!==void 0?s:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=le(e,u_(".monaco-inputbox.idle"));let r=this.options.flexibleHeight?"textarea":"input",o=le(this.element,u_(".ibwrapper"));if(this.input=le(o,u_(r+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=le(o,u_("div.mirror")),this.mirror.innerText="\xA0",this.scrollableElement=new E2(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),le(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(u=>this.input.scrollTop=u.scrollTop));const a=this._register(new $t(document,"selectionchange")),l=De.filter(a.event,()=>{const u=document.getSelection();return u?.anchorNode===o});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this.ignoreGesture(this.input),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Zu(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:lN(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}get width(){return So(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const i=parseFloat(this.mirror.style.paddingLeft||"")||0,s=parseFloat(this.mirror.style.paddingRight||"")||0;t=i+s}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(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")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=i.border?`1px solid ${i.border}`:"",(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(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}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t=()=>e.style.width=So(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{if(!this.message)return null;e=le(s,u_(".monaco-inputbox-container")),t();const r={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?vue(this.message.content,r):_ue(this.message.content,r);o.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return o.style.backgroundColor=a.background?a.background.toString():"",o.style.color=a.foreground?a.foreground.toString():"",o.style.border=a.border?`1px solid ${a.border}`:"",le(e,o),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=_("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=_("alertWarningMessage","Warning: {0}",this.message.content):i=_("alertInfoMessage","Info: {0}",this.message.content),wf(i),this.state="open"}_hideMessage(){!this.contextViewProvider||(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText="\xA0",this.layout()}style(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()}applyStyles(){const e=this.inputBackground?this.inputBackground.toString():"",t=this.inputForeground?this.inputForeground.toString():"",i=this.inputBorder?this.inputBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor="inherit",this.input.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=lN(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))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,r=t.value;i!==null&&s!==null&&(this.value=r.substr(0,i)+e+r.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar&&this.actionbar.dispose(),super.dispose()}}class KH extends $H{constructor(e,t,i){const s=_({key:"history.inputbox.hint",comment:["Text will be prefixed with \u21C5 plus a single space, then used as a hint where input field keeps history"]},"for history"),r=` or \u21C5 ${s}`,o=` (\u21C5 ${s})`;super(e,t,i),this.history=new Vue(i.history,100);const a=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(r)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?r:o,u=this.placeholder+l;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=u:this.setPlaceHolder(u)}};this.observer=new MutationObserver((l,u)=>{l.forEach(h=>{h.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=u=>{if(this.placeholder.endsWith(u)){const h=this.placeholder.slice(0,this.placeholder.length-u.length);return i.showPlaceholderOnFocus?this.placeholder=h:this.setPlaceHolder(h),!0}else return!1};l(o)||l(r)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(){this.value&&this.value!==this.getCurrentValue()&&this.history.add(this.value)}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,uS(this.value))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,uS(this.value))}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()||this.history.last()}}const zue=_("defaultLabel","input");class Uue extends no{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this._onDidOptionChange=this._register(new H),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new H),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new H),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new H),this._onKeyUp=this._register(new H),this._onCaseSensitiveKeyDown=this._register(new H),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new H),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||zue,this.inputActiveOptionBorder=s.inputActiveOptionBorder,this.inputActiveOptionForeground=s.inputActiveOptionForeground,this.inputActiveOptionBackground=s.inputActiveOptionBackground,this.inputBackground=s.inputBackground,this.inputForeground=s.inputForeground,this.inputBorder=s.inputBorder,this.inputValidationInfoBorder=s.inputValidationInfoBorder,this.inputValidationInfoBackground=s.inputValidationInfoBackground,this.inputValidationInfoForeground=s.inputValidationInfoForeground,this.inputValidationWarningBorder=s.inputValidationWarningBorder,this.inputValidationWarningBackground=s.inputValidationWarningBackground,this.inputValidationWarningForeground=s.inputValidationWarningForeground,this.inputValidationErrorBorder=s.inputValidationErrorBorder,this.inputValidationErrorBackground=s.inputValidationErrorBackground,this.inputValidationErrorForeground=s.inputValidationErrorForeground;const r=s.appendCaseSensitiveLabel||"",o=s.appendWholeWordsLabel||"",a=s.appendRegexLabel||"",l=s.history||[],u=!!s.flexibleHeight,h=!!s.flexibleWidth,c=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new KH(this.domNode,this.contextViewProvider,{placeholder:this.placeholder||"",ariaLabel:this.label||"",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:l,showHistoryHint:s.showHistoryHint,flexibleHeight:u,flexibleWidth:h,flexibleMaxHeight:c})),this.regex=this._register(new WH({appendTitle:a,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.regex.onChange(m=>{this._onDidOptionChange.fire(m),!m&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(m=>{this._onRegexKeyDown.fire(m)})),this.wholeWords=this._register(new BH({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.wholeWords.onChange(m=>{this._onDidOptionChange.fire(m),!m&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new FH({appendTitle:r,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.caseSensitive.onChange(m=>{this._onDidOptionChange.fire(m),!m&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(m=>{this._onCaseSensitiveKeyDown.fire(m)})),this._showOptionButtons&&(this.inputBox.paddingRight=this.caseSensitive.width()+this.wholeWords.width()+this.regex.width());let f=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,m=>{if(m.equals(15)||m.equals(17)||m.equals(9)){let v=f.indexOf(document.activeElement);if(v>=0){let S=-1;m.equals(17)?S=(v+1)%f.length:m.equals(15)&&(v===0?S=f.length-1:S=v-1),m.equals(9)?(f[v].blur(),this.inputBox.focus()):S>=0&&f[S].focus(),Rt.stop(m,!0)}}});let g=document.createElement("div");g.className="controls",g.style.display=this._showOptionButtons?"block":"none",g.appendChild(this.caseSensitive.domNode),g.appendChild(this.wholeWords.domNode),g.appendChild(this.regex.domNode),this.domNode.appendChild(g),e&&e.appendChild(this.domNode),this._register(ne(this.inputBox.inputElement,"compositionstart",m=>{this.imeSessionInProgress=!0})),this._register(ne(this.inputBox.inputElement,"compositionend",m=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,m=>this._onKeyDown.fire(m)),this.onkeyup(this.inputBox.inputElement,m=>this._onKeyUp.fire(m)),this.oninput(this.inputBox.inputElement,m=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,m=>this._onMouseDown.fire(m))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,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()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);const 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)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive.checked}setCaseSensitive(e){this.caseSensitive.checked=e}getWholeWords(){return this.wholeWords.checked}setWholeWords(e){this.wholeWords.checked=e}getRegex(){return this.regex.checked}setRegex(e){this.regex.checked=e,this.validate()}focusOnCaseSensitive(){this.caseSensitive.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}clearMessage(){this.inputBox.hideMessage()}}const $ue=_("defaultLabel","input"),Kue=_("label.preserveCaseCheckbox","Preserve Case");class jue extends ub{constructor(e){super({icon:ve.preserveCase,title:Kue+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Gue extends no{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new H),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new H),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new H),this._onInput=this._register(new H),this._onKeyUp=this._register(new H),this._onPreserveCaseKeyDown=this._register(new H),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||$ue,this.inputActiveOptionBorder=s.inputActiveOptionBorder,this.inputActiveOptionForeground=s.inputActiveOptionForeground,this.inputActiveOptionBackground=s.inputActiveOptionBackground,this.inputBackground=s.inputBackground,this.inputForeground=s.inputForeground,this.inputBorder=s.inputBorder,this.inputValidationInfoBorder=s.inputValidationInfoBorder,this.inputValidationInfoBackground=s.inputValidationInfoBackground,this.inputValidationInfoForeground=s.inputValidationInfoForeground,this.inputValidationWarningBorder=s.inputValidationWarningBorder,this.inputValidationWarningBackground=s.inputValidationWarningBackground,this.inputValidationWarningForeground=s.inputValidationWarningForeground,this.inputValidationErrorBorder=s.inputValidationErrorBorder,this.inputValidationErrorBackground=s.inputValidationErrorBackground,this.inputValidationErrorForeground=s.inputValidationErrorForeground;const r=s.appendPreserveCaseLabel||"",o=s.history||[],a=!!s.flexibleHeight,l=!!s.flexibleWidth,u=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new KH(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:o,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:u})),this.preserveCase=this._register(new jue({appendTitle:r,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.preserveCase.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(f=>{this._onPreserveCaseKeyDown.fire(f)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;let h=[this.preserveCase.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(15)||f.equals(17)||f.equals(9)){let g=h.indexOf(document.activeElement);if(g>=0){let m=-1;f.equals(17)?m=(g+1)%h.length:f.equals(15)&&(g===0?m=h.length-1:m=g-1),f.equals(9)?(h[g].blur(),this.inputBox.focus()):m>=0&&h[m].focus(),Rt.stop(f,!0)}}});let c=document.createElement("div");c.className="controls",c.style.display=this._showOptionButtons?"block":"none",c.appendChild(this.preserveCase.domNode),this.domNode.appendChild(c),e&&e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,f=>this._onKeyDown.fire(f)),this.onkeyup(this.inputBox.inputElement,f=>this._onKeyUp.fire(f)),this.oninput(this.inputBox.inputElement,f=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,f=>this._onMouseDown.fire(f))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,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()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.preserveCase.style(e);const 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)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox&&this.inputBox.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}function jH(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function Zue(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function Yue(n,e){return HN(n.toLowerCase(),e.toLowerCase(),0,0)}function HN(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=HN(n,e,t+1,i+1))?qH({start:i,end:i+1},s):null}return HN(n,e,t,i+1)}function T2(n){return 97<=n&&n<=122}function yL(n){return 65<=n&&n<=90}function A2(n){return 48<=n&&n<=57}function Xue(n){return n===32||n===9||n===10||n===13}const Que=new Set;"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?".split("").forEach(n=>Que.add(n.charCodeAt(0)));function GH(n){return T2(n)||yL(n)||A2(n)}function qH(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function ZH(n,e){for(let t=e;t0&&!GH(n.charCodeAt(t-1)))return t}return n.length}function zN(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,r=i+1;for(s=zN(n,e,t+1,i+1);!s&&(r=ZH(e,r)).6}function the(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function ihe(n){let e=0,t=0,i=0,s=0;for(let r=0;r60)return null;const t=Jue(e);if(!the(t)){if(!ehe(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,r=e[e.length-1];r&&r.end===s?r.end=s+1:e.push({start:s,end:s+1})}return e}const Vh=128;function R2(){const n=[],e=[];for(let t=0;t<=Vh;t++)e[t]=0;for(let t=0;t<=Vh;t++)n.push(e.slice(0));return n}function XH(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const QH=XH(2*Vh),UN=XH(2*Vh),lu=R2(),Uc=R2(),ew=R2();function tw(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 40:case 91:return!0;case void 0:return!1;default:return!!Z_(t)}}function QB(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function d1(n,e,t){return e[n]!==t[n]}function ohe(n,e,t,i,s,r,o=!1){for(;eVh?Vh:n.length,l=i.length>Vh?Vh:i.length;if(t>=a||r>=l||a-t>l-r||!ohe(e,t,a,s,r,l,!0))return;ahe(a,l,t,r,e,s);let u=1,h=1,c=t,f=r;const g=[!1];for(u=1,c=t;cb,A=k?Uc[u][h-1]+(lu[u][h-1]>0?-5:0):0,z=f>b+1&&lu[u][h-1]>0,V=z?Uc[u][h-2]+(lu[u][h-2]>0?-5:0):0;if(z&&(!k||V>=A)&&(!I||V>=x))Uc[u][h]=V,ew[u][h]=3,lu[u][h]=0;else if(k&&(!I||A>=x))Uc[u][h]=A,ew[u][h]=2,lu[u][h]=0;else if(I)Uc[u][h]=x,ew[u][h]=1,lu[u][h]=lu[u-1][h-1]+1;else throw new Error("not possible")}}if(!g[0]&&!o)return;u--,h--;const m=[Uc[u][h],r];let v=0,S=0;for(;u>=1;){let b=h;do{const y=ew[u][b];if(y===3)b=b-2;else if(y===2)b=b-1;else break}while(b>=1);v>1&&e[t+u-1]===s[r+h-1]&&!d1(b+r-1,i,s)&&v+1>lu[u][b]&&(b=h),b===h?v++:v=1,S||(S=b),u--,h=b-1,m.push(h)}l===a&&(m[0]+=2);const w=S-a;return m[0]-=w,m}function ahe(n,e,t,i,s,r){let o=n-1,a=e-1;for(;o>=t&&a>=i;)s[o]===r[a]&&(UN[o]=a,o--),a--}function lhe(n,e,t,i,s,r,o,a,l,u,h){if(e[t]!==r[o])return Number.MIN_SAFE_INTEGER;let c=1,f=!1;return o===t-i?c=n[t]===s[o]?7:5:d1(o,s,r)&&(o===0||!d1(o-1,s,r))?(c=n[t]===s[o]?7:5,f=!0):tw(r,o)&&(o===0||!tw(r,o-1))?c=5:(tw(r,o-1)||QB(r,o-1))&&(c=5,f=!0),c>1&&t===i&&(h[0]=!0),f||(f=d1(o,s,r)||tw(r,o-1)||QB(r,o-1)),t===i?o>l&&(c-=f?3:5):u?c+=f?2:0:c+=f?0:1,o+1===a&&(c-=f?3:5),c}function uhe(n,e,t,i,s,r,o){return hhe(n,e,t,i,s,r,!0,o)}function hhe(n,e,t,i,s,r,o,a){let l=h0(n,e,t,i,s,r,a);if(l&&!o)return l;if(n.length>=3){const u=Math.min(7,n.length-1);for(let h=t+1;hl[0])&&(l=f))}}}return l}function che(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}class yo{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e=this.pos,t=0,i=this.value.charCodeAt(e),s;if(s=yo._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(yo.isDigitCharacter(i)){s=8;do t+=1,i=this.value.charCodeAt(e+t);while(yo.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(yo.isVariableCharacter(i)){s=9;do i=this.value.charCodeAt(e+ ++t);while(yo.isVariableCharacter(i)||yo.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof yo._table[i]>"u"&&!yo.isDigitCharacter(i)&&!yo.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}}yo._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class ym{constructor(){this._children=[]}appendChild(e){return e instanceof $s&&this._children[this._children.length-1]instanceof $s?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),r=i.children.slice(0);r.splice(s,1,...t),i._children=r,function o(a,l){for(const u of a)u.parent=l,o(u.children,u)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof LL)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class $s extends ym{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new $s(this.value)}}class JH extends ym{}class Mo extends JH{constructor(e){super(),this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof hb?this._children[0]:void 0}clone(){let e=new Mo(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class hb extends ym{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof $s&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new hb;return this.options.forEach(e.appendChild,e),e}}class O2 extends ym{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(r=>r instanceof ua&&Boolean(r.elseValue))&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof ua){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}clone(){let e=new O2;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class ua extends ym{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":Boolean(e)&&typeof this.ifValue=="string"?this.ifValue:!Boolean(e)&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1).toLowerCase()).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.toLowerCase():i.charAt(0).toUpperCase()+i.substr(1).toLowerCase()).join(""):e}clone(){return new ua(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class c0 extends JH{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new $s(t)],!0):!1}clone(){const e=new c0(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function JB(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class LL extends ym{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(i){return i instanceof Mo&&(e.push(i),t=!t||t.indexs===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return JB([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof Mo&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof c0&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let e=new LL;return this._children=this.children.map(t=>t.clone()),e}walk(e){JB(this.children,e)}}class DL{constructor(){this._scanner=new yo,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){this._scanner.text(e),this._token=this._scanner.next();const s=new LL;for(;this._parse(s););const r=new Map,o=[];let a=0;s.walk(l=>(l instanceof Mo&&(a+=1,l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));for(const l of o){const u=r.get(l.index);if(u){const h=new Mo(l.index);h.transform=l.transform;for(const c of u)h.appendChild(c.clone());s.replace(l,[h])}}return i||(i=a>0&&t),!r.has(0)&&i&&s.appendChild(new Mo(0)),s}_accept(e,t){if(e===void 0||this._token.type===e){let i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const s=this._scanner.next();if(s.type!==0&&s.type!==4&&s.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new $s(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Mo(Number(t)):new c0(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const r=new Mo(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new $s("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){const o=new hb;for(;;){if(this._parseChoiceElement(o)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(o),this._accept(4)))return e.appendChild(r),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let s;if((s=this._accept(5,!0))?s=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new $s(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const r=new c0(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new $s("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(i)}_parseTransform(e){let t=new O2,i="",s="";for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(6,!0)||r,i+=r;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(5,!0)||this._accept(6,!0)||r,t.appendChild(new $s(r));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let s=this._accept(8,!0);if(s)if(i){if(this._accept(4))return e.appendChild(new ua(Number(s))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new ua(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(6)){let r=this._accept(9,!0);return!r||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new ua(Number(s),r)),!0)}else if(this._accept(11)){let r=this._until(4);if(r)return e.appendChild(new ua(Number(s),void 0,r,void 0)),!0}else if(this._accept(12)){let r=this._until(4);if(r)return e.appendChild(new ua(Number(s),void 0,void 0,r)),!0}else if(this._accept(13)){let r=this._until(1);if(r){let o=this._until(4);if(o)return e.appendChild(new ua(Number(s),void 0,r,o)),!0}}else{let r=this._until(4);if(r)return e.appendChild(new ua(Number(s),void 0,void 0,r)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new $s(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var dv=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const rt={Visible:new Le("suggestWidgetVisible",!1,_("suggestWidgetVisible","Whether suggestion are visible")),DetailsVisible:new Le("suggestWidgetDetailsVisible",!1,_("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new Le("suggestWidgetMultipleSuggestions",!1,_("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new Le("suggestionMakesTextEdit",!0,_("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Le("acceptSuggestionOnEnter",!0,_("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Le("suggestionHasInsertAndReplaceRange",!1,_("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new Le("suggestionInsertMode",void 0,{type:"string",description:_("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new Le("suggestionCanResolve",!1,_("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},pc=new ke("suggestWidgetStatusBar");class dhe{constructor(e,t,i,s){this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=ka.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:t.label.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),M.isIRange(t.range)?(this.editStart=new G(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new G(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new G(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||M.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new G(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new G(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new G(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||M.spansMultipleLines(t.range.insert)||M.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return dv(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._isResolved=!1});this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(i=>{Object.assign(this.completion,i),this._isResolved=!0,t.dispose()},i=>{xc(i)&&(this._resolveCache=void 0,this._isResolved=!1)})}return this._resolveCache})}}class HS{constructor(e=2,t=new Set,i=new Set,s=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.showDeprecated=s}}HS.default=new HS;let fhe;function ghe(){return fhe}class phe{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}function ez(n,e,t=HS.default,i={triggerKind:0},s=ii.None){return dv(this,void 0,void 0,function*(){const r=new ju(!0);e=e.clone();const o=n.getWordAtPosition(e),a=o?new M(e.lineNumber,o.startColumn,e.lineNumber,o.endColumn):M.fromPositions(e),l={replace:a,insert:a.setEndPosition(e.lineNumber,e.column)},u=[],h=new pe,c=[];let f=!1;const g=(v,S,w)=>{var b,y,L;if(!!S){for(let E of S.suggestions)if(!t.kindFilter.has(E.kind)){if(!t.showDeprecated&&((b=E?.tags)===null||b===void 0?void 0:b.includes(1)))continue;E.range||(E.range=l),E.sortText||(E.sortText=typeof E.label=="string"?E.label:E.label.label),!f&&E.insertTextRules&&E.insertTextRules&4&&(f=DL.guessNeedsClipboard(E.insertText)),u.push(new dhe(e,E,S,v))}f6(S)&&h.add(S),c.push({providerName:(y=v._debugDisplayName)!==null&&y!==void 0?y:"unkown_provider",elapsedProvider:(L=S.duration)!==null&&L!==void 0?L:-1,elapsedOverall:w.elapsed()})}},m=(()=>dv(this,void 0,void 0,function*(){}))();for(let v of pa.orderedGroups(n)){let S=u.length;if(yield Promise.all(v.map(w=>dv(this,void 0,void 0,function*(){if(!(t.providerFilter.size>0&&!t.providerFilter.has(w)))try{const b=new ju(!0),y=yield w.provideCompletionItems(n,e,i,s);g(w,y,b)}catch(b){Go(b)}}))),S!==u.length||s.isCancellationRequested)break}return yield m,s.isCancellationRequested?(h.dispose(),Promise.reject(hm())):new phe(u.sort(tz(t.snippetSortOrder)),f,{entries:c,elapsed:r.elapsed()},h)})}function P2(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.completion.labele.completion.label?1:n.completion.kind-e.completion.kind}function mhe(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return P2(n,e)}function _he(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return P2(n,e)}const xL=new Map;xL.set(0,mhe);xL.set(2,_he);xL.set(1,P2);function tz(n){return xL.get(n)}Ft.registerCommand("_executeCompletionItemProvider",(n,...e)=>dv(void 0,void 0,void 0,function*(){const[t,i,s,r]=e;Ri($e.isUri(t)),Ri(G.isIPosition(i)),Ri(typeof s=="string"||!s),Ri(typeof r=="number"||!r);const o=yield n.get(Al).createModelReference(t);try{const a={incomplete:!1,suggestions:[]},l=[],u=yield ez(o.object.textEditorModel,G.lift(i),void 0,{triggerCharacter:s,triggerKind:s?1:0});for(const h of u.items)l.length<(r??0)&&l.push(h.resolve(ii.None)),a.incomplete=a.incomplete||h.container.incomplete,a.suggestions.push(h.completion);try{return yield Promise.all(l),a}finally{setTimeout(()=>u.disposable.dispose(),100)}}finally{o.dispose()}}));const $N=new class{constructor(){this.onlyOnceSuggestions=[]}provideCompletionItems(){let e={suggestions:this.onlyOnceSuggestions.slice(0)};return this.onlyOnceSuggestions.length=0,e}};pa.register("*",$N);function vhe(n,e){setTimeout(()=>{$N.onlyOnceSuggestions.push(...e),n.getContribution("editor.contrib.suggestController").triggerSuggest(new Set().add($N))},0)}var iz=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},nz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const d0="historyNavigationWidget",sz="historyNavigationForwardsEnabled",rz="historyNavigationBackwardsEnabled";function bhe(n,e,t){new Le(t,e).bindTo(n)}function Che(n,e){return n.createScoped(e.target)}function oz(n,e){return n.getContext(document.activeElement).getValue(e)}function az(n,e){const t=Che(n,e);bhe(t,e,d0);const i=new Le(sz,!0).bindTo(t),s=new Le(rz,!0).bindTo(t);return{scopedContextKeyService:t,historyNavigationForwardsEnablement:i,historyNavigationBackwardsEnablement:s}}let KN=class extends Uue{constructor(e,t,i,s,r=!1){super(e,t,r,i),this._register(az(s,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};KN=iz([nz(3,je)],KN);let jN=class extends Gue{constructor(e,t,i,s,r=!1){super(e,t,r,i),this._register(az(s,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};jN=iz([nz(3,je)],jN);ds.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:ye.and(ye.has(d0),ye.equals(rz,!0),rt.Visible.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{const e=oz(n.get(je),d0);e&&e.historyNavigator.showPreviousValue()}});ds.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:ye.and(ye.has(d0),ye.equals(sz,!0),rt.Visible.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{const e=oz(n.get(je),d0);e&&e.historyNavigator.showNextValue()}});function e3(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}const whe={IconContribution:"base.contributions.icons"};class She{constructor(){this._onDidChange=new H,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:_("iconDefintion.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:_("iconDefintion.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Ks.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const r=this.iconsById[e];if(r){if(i&&!r.description){r.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return r}let o={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=o;let a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconFont(e){return this.iconFontsById[e]}toString(){const e=(r,o)=>r.id.localeCompare(o.id),t=r=>{for(;ui.isThemeIcon(r.defaults);)r=this.iconsById[r.defaults.id];return`codicon codicon-${r?r.id:""}`};let i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(r=>this.iconsById[r]);for(const r of s.filter(o=>!!o.description).sort(e))i.push(`||${r.id}|${ui.isThemeIcon(r.defaults)?r.defaults.id:r.id}|${r.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const r of s.filter(o=>!ui.isThemeIcon(o.defaults)).sort(e))i.push(`||${r.id}|`);return i.join(` +`)}}const ef=new She;yn.add(whe.IconContribution,ef);function Yn(n,e,t,i){return ef.registerIcon(n,e,t,i)}function yhe(){return ef}function Lhe(){for(const n of dS.all)ef.registerIcon(n.id,n.definition,n.description);dS.onDidRegister(n=>ef.registerIcon(n.id,n.definition,n.description))}Lhe();const lz="vscode://schemas/icons";let uz=yn.as(dL.JSONContribution);uz.registerSchema(lz,ef.getIconSchema());const t3=new mi(()=>uz.notifySchemaChanged(lz),200);ef.onDidChange(()=>{t3.isScheduled()||t3.schedule()});const Dhe=Yn("widget-close",ve.close,_("widgetClose","Icon for the close action in widgets."));var xhe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const khe=Yn("find-selection",ve.selection,_("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),i3=Yn("find-collapsed",ve.chevronRight,_("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),n3=Yn("find-expanded",ve.chevronDown,_("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),Ehe=Yn("find-replace",ve.replace,_("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),Ihe=Yn("find-replace-all",ve.replaceAll,_("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),Nhe=Yn("find-previous-match",ve.arrowUp,_("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),The=Yn("find-next-match",ve.arrowDown,_("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),Ahe=_("label.find","Find"),Mhe=_("placeholder.find","Find"),Rhe=_("label.previousMatchButton","Previous Match"),Ohe=_("label.nextMatchButton","Next Match"),Phe=_("label.toggleSelectionFind","Find in Selection"),Fhe=_("label.closeButton","Close"),Bhe=_("label.replace","Replace"),Whe=_("placeholder.replace","Replace"),Vhe=_("label.replaceButton","Replace"),Hhe=_("label.replaceAllButton","Replace All"),zhe=_("label.toggleReplaceButton","Toggle Replace"),Uhe=_("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Wh),$he=_("label.matchesLocation","{0} of {1}"),s3=_("label.noResults","No results"),Ja=419,Khe=275,jhe=Khe-54;let h_=69;const Ghe=33,r3="ctrlEnterReplaceAll.windows.donotask",o3=pt?256:2048;class $k{constructor(e){this.afterLineNumber=e,this.heightInPx=Ghe,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function a3(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function l3(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(h=>this._onStateChanged(h))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(h=>{if(h.hasChanged(80)&&(this._codeEditor.getOption(80)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),h.hasChanged(129)&&this._tryUpdateWidgetWidth(),h.hasChanged(2)&&this.updateAccessibilitySupport(),h.hasChanged(35)){const c=this._codeEditor.getOption(35).addExtraSpaceOnTop;c&&!this._viewZone&&(this._viewZone=new $k(0),this._showViewZone()),!c&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>xhe(this,void 0,void 0,function*(){if(this._isVisible){let h=yield this._controller.getGlobalBufferTerm();h&&h!==this._state.searchString&&(this._state.change({searchString:h},!1),this._findInput.select())}}))),this._findInputFocused=bL.bindTo(o),this._findFocusTracker=this._register(Tp(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=L2.bindTo(o),this._replaceFocusTracker=this._register(Tp(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(35).addExtraSpaceOnTop&&(this._viewZone=new $k(0)),this._applyTheme(a.getColorTheme()),this._register(a.onDidColorThemeChange(this._applyTheme.bind(this))),this._register(this._codeEditor.onDidChangeModel(()=>{!this._isVisible||(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(h=>{if(h.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return kL.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){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.getOption(80)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=So(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.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){let t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,Qe)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=h_+"px",this._state.matchesCount>=Wh?this._matchesCount.title=Uhe:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=Wh&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=Eo($he,i,t)}else e=s3;this._matchesCount.appendChild(document.createTextNode(e)),wf(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),h_=Math.max(h_,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===s3)return i===""?_("ariaSearchNoResultEmpty","{0} found",e):_("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const s=_("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),r=this._codeEditor.getModel();return r&&t.startLineNumber<=r.getLineCount()&&t.startLineNumber>=1?`${r.getLineContent(t.startLineNumber)}, ${s}`:s}return _("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){let e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);let e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);let i=!this._codeEditor.getOption(80);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(35).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(35).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=bn(i),r=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),o=s.left+(r?r.left:0),a=r?r.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=O6(this._domNode).left;o>l&&(t=!1);const u=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(u?u.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(35).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(35).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new $k(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const r=this._getHeight();if(r===i.heightInPx)return;let o=r-i.heightInPx;i.heightInPx=r,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o);return}else{let r=this._getHeight();if(r-=this._codeEditor.getOption(74).top,r<=0)return;i.heightInPx=r,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_applyTheme(e){let t={inputActiveOptionBorder:e.getColor(NN),inputActiveOptionBackground:e.getColor(TN),inputActiveOptionForeground:e.getColor(AN),inputBackground:e.getColor(Q9),inputForeground:e.getColor(J9),inputBorder:e.getColor(eH),inputValidationInfoBackground:e.getColor(p2),inputValidationInfoForeground:e.getColor(m2),inputValidationInfoBorder:e.getColor(_2),inputValidationWarningBackground:e.getColor(tH),inputValidationWarningForeground:e.getColor(iH),inputValidationWarningBorder:e.getColor(nH),inputValidationErrorBackground:e.getColor(sH),inputValidationErrorForeground:e.getColor(rH),inputValidationErrorBorder:e.getColor(oH)};this._findInput.style(t),this._replaceInput.style(t),this._toggleSelectionFind.style(t)}_tryUpdateWidgetWidth(){if(!this._isVisible||!ER(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let r=!1,o=!1,a=!1;if(this._resized&&So(this._domNode)>Ja){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=So(this._findInput.domNode);return}if(Ja+28+s>=i&&(o=!0),Ja+28+s-h_>=i&&(a=!0),Ja+28+s-h_>=i+50&&(r=!0),this._domNode.classList.toggle("collapsed-find-widget",r),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",o),!a&&!r&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._resized){this._findInput.inputBox.layout();let l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=So(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(!!this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){let e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!M.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(o3|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return a3(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return l3(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(o3|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Pn&&wa&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(_("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(r3,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return a3(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return l3(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new KN(null,this._contextViewProvider,{width:jhe,label:Ahe,placeholder:Mhe,appendCaseSensitiveLabel:this._keybindingLabelFor(Gt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Gt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Gt.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(u){return{content:u.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>e3(this._keybindingService)},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(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Ns&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new ug({label:Rhe+this._keybindingLabelFor(Gt.PreviousMatchFindAction),icon:Nhe,onTrigger:()=>{this._codeEditor.getAction(Gt.PreviousMatchFindAction).run().then(void 0,Qe)}})),this._nextBtn=this._register(new ug({label:Ohe+this._keybindingLabelFor(Gt.NextMatchFindAction),icon:The,onTrigger:()=>{this._codeEditor.getAction(Gt.NextMatchFindAction).run().then(void 0,Qe)}}));let i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",i.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new ub({icon:khe,title:Phe+this._keybindingLabelFor(Gt.ToggleSearchScopeCommand),isChecked:!1})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let l=this._codeEditor.getSelections();l.map(u=>(u.endColumn===1&&u.endLineNumber>u.startLineNumber&&(u=u.setEndPosition(u.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(u.endLineNumber-1))),u.isEmpty()?null:u)).filter(u=>!!u),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),s.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new ug({label:Fhe+this._keybindingLabelFor(Gt.CloseFindWidgetCommand),icon:Dhe,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),s.appendChild(this._closeBtn.domNode),this._replaceInput=this._register(new jN(null,void 0,{label:Bhe,placeholder:Whe,appendPreserveCaseLabel:this._keybindingLabelFor(Gt.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>e3(this._keybindingService)},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),l.preventDefault())})),this._replaceBtn=this._register(new ug({label:Vhe+this._keybindingLabelFor(Gt.ReplaceOneAction),icon:Ehe,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new ug({label:Hhe+this._keybindingLabelFor(Gt.ReplaceAllAction),icon:Ihe,onTrigger:()=>{this._controller.replaceAll()}}));let r=document.createElement("div");r.className="replace-part",r.appendChild(this._replaceInput.domNode);const o=document.createElement("div");o.className="replace-actions",r.appendChild(o),o.appendChild(this._replaceBtn.domNode),o.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new ug({label:zhe,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=So(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),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=`${Ja}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(r),this._resizeSash=new An(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=Ja;this._register(this._resizeSash.onDidStart(()=>{a=So(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;let u=a+l.startX-l.currentX;if(uh||(this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=So(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=So(this._domNode);if(l{this._opts.onTrigger(),i.preventDefault()}),this.onkeydown(this._domNode,i=>{if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}this._opts.onKeyDown&&this._opts.onKeyDown(i)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...ui.asClassNameArray(i3)),this._domNode.classList.add(...ui.asClassNameArray(n3))):(this._domNode.classList.remove(...ui.asClassNameArray(n3)),this._domNode.classList.add(...ui.asClassNameArray(i3)))}}ni((n,e)=>{const t=(m,v)=>{v&&e.addRule(`.monaco-editor ${m} { background-color: ${v}; }`)};t(".findMatch",n.getColor(RN)),t(".currentFindMatch",n.getColor(Eoe)),t(".findScope",n.getColor(Ioe));const i=n.getColor(zo);t(".find-widget",i);const s=n.getColor(Hp);s&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${s}; }`);const r=n.getColor(Toe);r&&e.addRule(`.monaco-editor .findMatch { border: 1px ${n.type==="hc"?"dotted":"solid"} ${r}; box-sizing: border-box; }`);const o=n.getColor(Noe);o&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${o}; padding: 1px; box-sizing: border-box; }`);const a=n.getColor(Aoe);a&&e.addRule(`.monaco-editor .findScope { border: 1px ${n.type==="hc"?"dashed":"solid"} ${a}; }`);const l=n.getColor(Pi);l&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${l}; }`);const u=n.getColor(ic);u&&e.addRule(`.monaco-editor .find-widget { color: ${u}; }`);const h=n.getColor(uoe);h&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${h}; }`);const c=n.getColor(voe);if(c)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${c}; }`);else{const m=n.getColor(Ad);m&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${m}; }`)}const f=n.getColor(fae);f&&e.addRule(` + .monaco-editor .find-widget .button:not(.disabled):hover, + .monaco-editor .find-widget .codicon-find-selection:hover { + background-color: ${f} !important; + } + `);const g=n.getColor(gc);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var f0;(function(n){n[n.Ignore=0]="Ignore",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(f0||(f0={}));(function(n){const e="error",t="warning",i="warn",s="info",r="ignore";function o(l){return l?k_(e,l)?n.Error:k_(t,l)||k_(i,l)?n.Warning:k_(s,l)?n.Info:n.Ignore:n.Ignore}n.fromValue=o;function a(l){switch(l){case n.Error:return e;case n.Warning:return t;case n.Info:return s;default:return r}}n.toString=a})(f0||(f0={}));const Si=f0,Wn=wt("notificationService");class qhe{}var f1=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},Kg;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(Kg||(Kg={}));class g0 extends ie{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new H),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Kg.None,this.cache=new Map,this.flushDelayer=new vte(g0.DEFAULT_FLUSH_DELAY),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;(t=e.changed)===null||t===void 0||t.forEach((s,r)=>this.accept(r,s)),(i=e.deleted)===null||i===void 0||i.forEach(s=>this.accept(s,void 0))}accept(e,t){if(this.state===Kg.Closed)return;let i=!1;Wr(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire(e)}get(e,t){const i=this.cache.get(e);return Wr(i)?t:i}getBoolean(e,t){const i=this.get(e);return Wr(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Wr(i)?t:parseInt(i,10)}set(e,t){return f1(this,void 0,void 0,function*(){if(this.state===Kg.Closed)return;if(Wr(t))return this.delete(e);const i=String(t);if(this.cache.get(e)!==i)return this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger(()=>this.flushPending())})}delete(e){return f1(this,void 0,void 0,function*(){if(!(this.state===Kg.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger(()=>this.flushPending())})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return f1(this,void 0,void 0,function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}dispose(){this.flushDelayer.dispose(),super.dispose()}}g0.DEFAULT_FLUSH_DELAY=100;class u3{constructor(){this.onDidChangeItemsExternal=De.None,this.items=new Map}updateItems(e){return f1(this,void 0,void 0,function*(){e.insert&&e.insert.forEach((t,i)=>this.items.set(i,t)),e.delete&&e.delete.forEach(t=>this.items.delete(t))})}}const iw="__$__targetStorageMarker",Nf=wt("storageService");var GN;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(GN||(GN={}));class EL extends ie{constructor(e={flushInterval:EL.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new iS),this._onDidChangeTarget=this._register(new iS),this._onWillSaveState=this._register(new H),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===iw?(e===0?this._globalKeyTargets=void 0:e===1&&(this._workspaceKeyTargets=void 0),this._onDidChangeTarget.fire({scope:e})):this._onDidChangeValue.fire({scope:e,key:t,target:this.getKeyTargets(e)[t]})}get(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.get(e,i)}getBoolean(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getBoolean(e,i)}getNumber(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getNumber(e,i)}store(e,t,i,s){if(Wr(t)){this.remove(e,i);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,s),(r=this.getStorage(i))===null||r===void 0||r.set(e,t)})}remove(e,t){this.withPausedEmitters(()=>{var i;this.updateKeyTarget(e,t,void 0),(i=this.getStorage(t))===null||i===void 0||i.delete(e)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){var s,r;const o=this.getKeyTargets(t);typeof i=="number"?o[e]!==i&&(o[e]=i,(s=this.getStorage(t))===null||s===void 0||s.set(iw,JSON.stringify(o))):typeof o[e]=="number"&&(delete o[e],(r=this.getStorage(t))===null||r===void 0||r.set(iw,JSON.stringify(o)))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get globalKeyTargets(){return this._globalKeyTargets||(this._globalKeyTargets=this.loadKeyTargets(0)),this._globalKeyTargets}getKeyTargets(e){return e===0?this.globalKeyTargets:this.workspaceKeyTargets}loadKeyTargets(e){const t=this.get(iw,e);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}}EL.DEFAULT_FLUSH_INTERVAL=60*1e3;class Zhe extends EL{constructor(){super(),this.globalStorage=this._register(new g0(new u3)),this.workspaceStorage=this._register(new g0(new u3)),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.globalStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e)))}getStorage(e){return e===0?this.globalStorage:this.workspaceStorage}}var hz=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},ll=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Kp=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const Yhe=524288;function qN(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(r))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{let r=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),r&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(35).loop})}))}get editor(){return this._editor}static get(e){return e.getContribution(cz.ID)}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,0),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,0),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,0),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,0)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!bL.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=Na(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e){return Kp(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;let t={isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){let i=qN(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);i&&(this._state.isRegex?t.searchString=Na(i):t.searchString=i)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){let i=qN(this._editor,e.seedSearchStringFromSelection);i&&(t.searchString=i)}if(!t.searchString&&e.seedSearchStringFromGlobalClipboard){let i=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;i&&(t.searchString=i)}if(e.forceRevealReplace?t.isReplaceRevealed=!0:this._findWidgetVisible.get()||(t.isReplaceRevealed=!1),e.updateSearchScope){let i=this._editor.getSelections();i.some(s=>!s.isEmpty())&&(t.searchScope=i)}t.loop=e.loop,this._state.change(t,!1),this._model||(this._model=new cv(this._editor,this._state))})}start(e){return this._start(e)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){return this._model?(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return Kp(this,void 0,void 0,function*(){return this._editor.getOption(35).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(35).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};Lr.ID="editor.contrib.findController";Lr=hz([ll(1,je),ll(2,Nf),ll(3,kc)],Lr);let ZN=class extends Lr{constructor(e,t,i,s,r,o,a,l){super(e,i,a,l),this._contextViewService=t,this._keybindingService=s,this._themeService=r,this._notificationService=o,this._widget=null,this._findOptionsWidget=null}_start(e){const t=Object.create(null,{_start:{get:()=>super._start}});return Kp(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const i=this._editor.getSelection();let s=!1;switch(this._editor.getOption(35).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":s=!!i&&i.startLineNumber!==i.endLineNumber;break}e.updateSearchScope=s,yield t._start.call(this,e),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())})}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new kL(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new CL(this._editor,this._state,this._keybindingService,this._themeService))}};ZN=hz([ll(1,Ec),ll(2,je),ll(3,Ni),ll(4,ai),ll(5,Wn),ll(6,Nf),ll(7,kc)],ZN);const Xhe=r9(new s9({id:Gt.StartFindAction,label:_("startFindAction","Find"),alias:"Find",precondition:ye.or(K.focus,ye.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:ke.MenubarEditMenu,group:"3_find",title:_({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));Xhe.addImplementation(0,(n,e,t)=>{const i=Lr.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(35).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(35).loop}):!1});class Qhe extends mt{constructor(){super({id:Gt.StartFindWithSelection,label:_("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return Kp(this,void 0,void 0,function*(){let i=Lr.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class dz extends mt{run(e,t){return Kp(this,void 0,void 0,function*(){let i=Lr.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(i))})}}class Jhe extends dz{constructor(){super({id:Gt.NextMatchFindAction,label:_("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:K.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:ye.and(K.focus,bL),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class ece extends dz{constructor(){super({id:Gt.PreviousMatchFindAction,label:_("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:K.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:ye.and(K.focus,bL),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class fz extends mt{run(e,t){return Kp(this,void 0,void 0,function*(){let i=Lr.get(t);if(!i)return;const s=t.getOption(35).seedSearchStringFromSelection==="selection";let r=null;t.getOption(35).seedSearchStringFromSelection!=="never"&&(r=qN(t,"single",s)),r&&i.setSearchString(r),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:s,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(i))})}}class tce extends fz{constructor(){super({id:Gt.NextSelectionMatchFindAction,label:_("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class ice extends fz{constructor(){super({id:Gt.PreviousSelectionMatchFindAction,label:_("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:K.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const nce=r9(new s9({id:Gt.StartFindReplaceAction,label:_("startReplace","Replace"),alias:"Replace",precondition:ye.or(K.focus,ye.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:ke.MenubarEditMenu,group:"3_find",title:_({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));nce.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(80))return!1;const i=Lr.get(e);if(!i)return!1;const s=e.getSelection(),r=i.isFindInputFocused(),o=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(35).seedSearchStringFromSelection!=="never"&&!r,a=r||o?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:o?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(35).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(35).loop})});Ln(Lr.ID,ZN);ze(Qhe);ze(Jhe);ze(ece);ze(tce);ze(ice);const Ba=io.bindToContribution(Lr.get);_e(new Ba({id:Gt.CloseFindWidgetCommand,precondition:Ef,handler:n=>n.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:ye.and(K.focus,ye.not("isComposing")),primary:9,secondary:[1033]}}));_e(new Ba({id:Gt.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:qC.primary,mac:qC.mac,win:qC.win,linux:qC.linux}}));_e(new Ba({id:Gt.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:ZC.primary,mac:ZC.mac,win:ZC.win,linux:ZC.linux}}));_e(new Ba({id:Gt.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:YC.primary,mac:YC.mac,win:YC.win,linux:YC.linux}}));_e(new Ba({id:Gt.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:XC.primary,mac:XC.mac,win:XC.win,linux:XC.linux}}));_e(new Ba({id:Gt.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:QC.primary,mac:QC.mac,win:QC.win,linux:QC.linux}}));_e(new Ba({id:Gt.ReplaceOneAction,precondition:Ef,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:3094}}));_e(new Ba({id:Gt.ReplaceOneAction,precondition:Ef,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:ye.and(K.focus,L2),primary:3}}));_e(new Ba({id:Gt.ReplaceAllAction,precondition:Ef,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:2563}}));_e(new Ba({id:Gt.ReplaceAllAction,precondition:Ef,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:ye.and(K.focus,L2),primary:void 0,mac:{primary:2051}}}));_e(new Ba({id:Gt.SelectAllMatchesAction,precondition:Ef,handler:n=>n.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:K.focus,primary:515}}));const F2=wt("IEditorCancelService"),gz=new Le("cancellableOperation",!1,_("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));xf(F2,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const r=gz.bindTo(s.get(je)),o=new _r;return{key:r,tokens:o}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},!0);class sce extends Pa{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(F2).add(e,this))}dispose(){this._unregister(),super.dispose()}}_e(new class extends io{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:gz})}runEditorCommand(n,e){n.get(F2).cancel(e)}});class zS{constructor(e,t){if(this.flags=t,(this.flags&1)!==0){const i=e.getModel();this.modelVersionId=i?Eo("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;(this.flags&4)!==0?this.position=e.getPosition():this.position=null,(this.flags&2)!==0?this.selection=e.getSelection():this.selection=null,(this.flags&8)!==0?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof zS))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new zS(e,this.flags))}}class rce extends sce{constructor(e,t,i,s){super(e,s),this._listener=new pe,t&4&&this._listener.add(e.onDidChangeCursorPosition(r=>{(!i||!M.containsPosition(i,r.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(r=>{(!i||!M.containsRange(i,r.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(r=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(r=>this.cancel())),this._listener.add(e.onDidChangeModelContent(r=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class oce extends Pa{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class jp{constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}static capture(e){let t=null,i=0;if(e.getScrollTop()!==0){const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const r=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-r}}return new jp(t,i,e.getPosition())}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}const h3=65535,Eu=16777215,c3=4278190080;class p0{constructor(e,t,i){if(e.length!==t.length||e.length>h3)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Uint32Array(Math.ceil(e.length/32)),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;let e=[],t=(i,s)=>{let r=e[e.length-1];return this.getStartLineNumber(r)<=i&&this.getEndLineNumber(r)>=s};for(let i=0,s=this._startIndexes.length;iEu||o>Eu)throw new Error("startLineNumber or endLineNumber must not exceed "+Eu);for(;e.length>0&&!t(r,o);)e.pop();let a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=r+((a&255)<<24),this._endIndexes[i]=o+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Eu}getEndLineNumber(e){return this._endIndexes[e]&Eu}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){let t=e/32|0,i=e%32;return(this._collapseStates[t]&1<>>24)+((this._endIndexes[e]&c3)>>>16);return t===h3?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){let e=[];for(let t=0;t=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class lce{constructor(e,t){this._updateEventEmitter=new H,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new p0(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[],this._isInitialized=!1}get regions(){return this._regions}get textModel(){return this._textModel}get isInitialized(){return this._isInitialized}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,r=-1,o=-1;const a=l=>{for(;so&&(o=u),s++}};for(let l of e){let u=l.regionIndex,h=this._editorDecorationIds[u];if(h&&!t[h]){t[h]=!0,a(u);let c=!this._regions.isCollapsed(u);this._regions.setCollapsed(u,c),r=Math.max(r,this._regions.getEndLineNumber(u))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}update(e,t=[]){let i=[],s=(c,f)=>{for(let g of t)if(c{const g=e.getStartLineNumber(c),m=e.getEndLineNumber(c);f||(f=e.isCollapsed(c)),f&&s(g,m)&&(f=!1),e.setCollapsed(c,f);const v=this._textModel.getLineMaxColumn(g),S={startLineNumber:g,startColumn:Math.max(v-1,1),endLineNumber:g,endColumn:v};i.push({range:S,options:this._decorationProvider.getDecorationOption(f,m<=r)}),f&&m>r&&(r=m)},a=0,l=()=>{for(;a=g)o(u,f===g),u++;else break}}h=l()}for(;u0)return e}applyMemento(e){if(!Array.isArray(e))return;let t=[];for(let i of e){let s=this.getRegionAtLine(i.startLineNumber);s&&!s.isCollapsed&&t.push(s)}this.toggleCollapseState(t)}dispose(){this._decorationProvider.deltaDecorations(this._editorDecorationIds,[])}getAllRegionsAtLine(e,t){let i=[];if(this._regions){let s=this._regions.findRange(e),r=1;for(;s>=0;){let o=this._regions.toRegion(s);(!t||t(o,r))&&i.push(o),r++,s=o.parentIndex}}return i}getRegionAtLine(e){if(this._regions){let t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){let i=[],s=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const o=[];for(let a=s,l=this._regions.length;a0&&!u.containedBy(o[o.length-1]);)o.pop();o.push(u),t(u,o.length)&&i.push(u)}else break}}else for(let o=s,a=this._regions.length;o1){let a=n.getRegionsInside(r,(l,u)=>l.isCollapsed!==o&&u0)for(let r of i){let o=n.getRegionAtLine(r);if(o&&(o.isCollapsed!==e&&s.push(o),t>1)){let a=n.getRegionsInside(o,(l,u)=>l.isCollapsed!==e&&uo.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...o)}n.toggleCollapseState(s)}function hce(n,e,t){let i=[];for(let s of t){let r=n.getAllRegionsAtLine(s,o=>o.isCollapsed!==e);r.length>0&&i.push(r[0])}n.toggleCollapseState(i)}function cce(n,e,t,i){let s=(o,a)=>a===e&&o.isCollapsed!==t&&!i.some(l=>o.containsLine(l)),r=n.getRegionsInside(null,s);n.toggleCollapseState(r)}function mz(n,e,t){let i=[];for(let o of t)i.push(n.getAllRegionsAtLine(o,void 0)[0]);let s=o=>i.every(a=>!a.containedBy(o)&&!o.containedBy(a))&&o.isCollapsed!==e,r=n.getRegionsInside(null,s);n.toggleCollapseState(r)}function B2(n,e,t){let i=n.textModel,s=n.regions,r=[];for(let o=s.length-1;o>=0;o--)if(t!==s.isCollapsed(o)){let a=s.getStartLineNumber(o);e.test(i.getLineContent(a))&&r.push(s.toRegion(o))}n.toggleCollapseState(r)}function W2(n,e,t){let i=n.regions,s=[];for(let r=i.length-1;r>=0;r--)t!==i.isCollapsed(r)&&e===i.getType(r)&&s.push(i.toRegion(r));n.toggleCollapseState(s)}function dce(n,e){let t=null,i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){let s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function fce(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{let i=t.parentIndex,s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function gce(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){let i=t.parentIndex,s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}updateHiddenRanges(){let e=!1,t=[],i=0,s=0,r=Number.MAX_VALUE,o=-1,a=this._foldingModel.regions;for(;i({startLineNumber:e.startLineNumber-1,endLineNumber:e.endLineNumber}))}applyHiddenRanges(e){this._hiddenRanges=e,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return d3(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1,i=this._foldingModel.textModel,s=null,r=o=>((!s||!mce(o,s))&&(s=d3(this._hiddenRanges,o)),s?s.startLineNumber-1:null);for(let o=0,a=e.length;o0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function mce(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function d3(n,e){let t=D9(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const _ce=5e3,vce="indent";class bce{constructor(e){this.editorModel=e,this.id=vce}dispose(){}compute(e){let t=Jt.getFoldingRules(this.editorModel.getLanguageId()),i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(wce(this.editorModel,i,s))}}class Cce{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Eu||t>Eu)return;let s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){if(this._length<=this._foldingRangesLimit){let t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=this._length-1,r=0;s>=0;s--,r++)t[r]=this._startIndexes[s],i[r]=this._endIndexes[s];return new p0(t,i)}else{let t=0,i=this._indentOccurrences.length;for(let a=0;athis._foldingRangesLimit){i=a;break}t+=l}}const s=e.getOptions().tabSize;let r=new Uint32Array(this._foldingRangesLimit),o=new Uint32Array(this._foldingRangesLimit);for(let a=this._length-1,l=0;a>=0;a--){let u=this._startIndexes[a],h=e.getLineContent(u),c=Zs.computeIndentLevel(h,s);(c0;u--){let h=n.getLineContent(u),c=Zs.computeIndentLevel(h,s),f=a[a.length-1];if(c===-1){e&&(f.endAbove=u);continue}let g;if(o&&(g=h.match(o)))if(g[1]){let m=a.length-1;for(;m>0&&a[m].indent!==-2;)m--;if(m>0){a.length=m+1,f=a[m],r.insertFirst(u,f.line,c),f.line=u,f.indent=c,f.endAbove=u;continue}}else{a.push({indent:-2,endAbove:u,line:u});continue}if(f.indent>c){do a.pop(),f=a[a.length-1];while(f.indent>c);let m=f.endAbove-1;m-u>=1&&r.insertFirst(u,m,c)}f.indent===c?f.endAbove=u:a.push({indent:c,endAbove:u,line:u})}return r.toIndentRanges(n)}const Sce=5e3,yce={},_z="syntax";class Lce{constructor(e,t,i,s=Sce){this.editorModel=e,this.providers=t,this.limit=s,this.id=_z;for(const r of t)typeof r.onDidChange=="function"&&(this.disposables||(this.disposables=new pe),this.disposables.add(r.onDidChange(i)))}compute(e){return Dce(this.providers,this.editorModel,e).then(t=>t?vz(t,this.limit):null)}dispose(){var e;(e=this.disposables)===null||e===void 0||e.dispose()}}function Dce(n,e,t){let i=null,s=n.map((r,o)=>Promise.resolve(r.provideFoldingRanges(e,yce,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);let l=e.getLineCount();for(let u of a)u.start>0&&u.end>u.start&&u.end<=l&&i.push({start:u.start,end:u.end,rank:o,kind:u.kind})}},Go));return Promise.all(s).then(r=>i)}class xce{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>Eu||t>Eu)return;let r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=s,this._types[r]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;ithis._foldingRangesLimit){t=o;break}e+=a}}let i=new Uint32Array(this._foldingRangesLimit),s=new Uint32Array(this._foldingRangesLimit),r=[];for(let o=0,a=0;o{let l=o.start-a.start;return l===0&&(l=o.rank-a.rank),l}),i=new xce(e),s,r=[];for(let o of t)if(!s)s=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else if(o.start>s.start)if(o.end<=s.end)r.push(s),s=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else{if(o.start>s.end){do s=r.pop();while(s&&o.start>s.end);s&&r.push(s),s=o}i.add(o.start,o.end,o.kind&&o.kind.value,r.length)}return i.toIndentRanges()}const bz="init";class kce{constructor(e,t,i,s){if(this.editorModel=e,this.id=bz,t.length){let r=o=>({range:{startLineNumber:o.startLineNumber,startColumn:0,endLineNumber:o.endLineNumber,endColumn:e.getLineLength(o.endLineNumber)},options:{description:"folding-initializing-range-provider",stickiness:1}});this.decorationIds=e.deltaDecorations([],t.map(r)),this.timeout=setTimeout(i,s)}}dispose(){this.decorationIds&&(this.editorModel.deltaDecorations(this.decorationIds,[]),this.decorationIds=void 0),typeof this.timeout=="number"&&(clearTimeout(this.timeout),this.timeout=void 0)}compute(e){let t=[];if(this.decorationIds)for(let i of this.decorationIds){let s=this.editorModel.getDecorationRange(i);s&&t.push({start:s.startLineNumber,end:s.endLineNumber,rank:1})}return Promise.resolve(vz(t,Number.MAX_VALUE))}}const V2=Yn("folding-expanded",ve.chevronDown,_("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),H2=Yn("folding-collapsed",ve.chevronRight,_("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin."));class Ro{constructor(e){this.editor=e,this.autoHideFoldingControls=!0,this.showFoldingHighlights=!0}getDecorationOption(e,t){return t?Ro.HIDDEN_RANGE_DECORATION:e?this.showFoldingHighlights?Ro.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ro.COLLAPSED_VISUAL_DECORATION:this.autoHideFoldingControls?Ro.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ro.EXPANDED_VISUAL_DECORATION}deltaDecorations(e,t){return this.editor.deltaDecorations(e,t)}changeDecorations(e){return this.editor.changeDecorations(e)}}Ro.COLLAPSED_VISUAL_DECORATION=ft.register({description:"folding-collapsed-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:ui.asClassName(H2)});Ro.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=ft.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:1,afterContentClassName:"inline-folded",className:"folded-background",isWholeLine:!0,firstLineDecorationClassName:ui.asClassName(H2)});Ro.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=ft.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:ui.asClassName(V2)});Ro.EXPANDED_VISUAL_DECORATION=ft.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ui.asClassName(V2)});Ro.HIDDEN_RANGE_DECORATION=ft.register({description:"folding-hidden-range-decoration",stickiness:1});var Ece=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},Ice=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const fs=new Le("foldingEnabled",!1);let Gp=class Cz extends ie{constructor(e,t){super(),this.contextKeyService=t,this.localToDispose=this._register(new pe),this.editor=e;const i=this.editor.getOptions();this._isEnabled=i.get(37),this._useFoldingProviders=i.get(38)!=="indentation",this._unfoldOnClickAfterEndOfLine=i.get(41),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=i.get(40),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingStateMemento=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ro(e),this.foldingDecorationProvider.autoHideFoldingControls=i.get(98)==="mouseover",this.foldingDecorationProvider.showFoldingHighlights=i.get(39),this.foldingEnabled=fs.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(s=>{if(s.hasChanged(37)&&(this._isEnabled=this.editor.getOptions().get(37),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),s.hasChanged(98)||s.hasChanged(39)){const r=this.editor.getOptions();this.foldingDecorationProvider.autoHideFoldingControls=r.get(98)==="mouseover",this.foldingDecorationProvider.showFoldingHighlights=r.get(39),this.onModelContentChanged()}s.hasChanged(38)&&(this._useFoldingProviders=this.editor.getOptions().get(38)!=="indentation",this.onFoldingStrategyChanged()),s.hasChanged(41)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(41)),s.hasChanged(40)&&(this._foldingImportsByDefault=this.editor.getOptions().get(40))})),this.onModelChanged()}static get(e){return e.getContribution(Cz.ID)}saveViewState(){let e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){let t=this.foldingModel.isInitialized?this.foldingModel.getMemento():this.hiddenRangeModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){let t=this.editor.getModel();if(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel||!e||e.lineCount!==t.getLineCount()||(this._currentModelHasFoldedImports=!!e.foldedImports,!e.collapsedRegions))return;(e.provider===_z||e.provider===bz)&&(this.foldingStateMemento=e);const i=e.collapsedRegions;if(this.hiddenRangeModel.applyMemento(i)){const s=this.getFoldingModel();s&&s.then(r=>{if(r){this._restoringViewState=!0;try{r.applyMemento(i)}finally{this._restoringViewState=!1}}}).then(void 0,Qe)}}onModelChanged(){this.localToDispose.clear();let e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new lce(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new pce(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new dm(200),this.cursorChangedScheduler=new mi(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(EN.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(()=>this.onModelContentChanged())),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler&&this.updateScheduler.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.foldingStateMemento=null,this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null}}),this.onModelContentChanged())}onFoldingStrategyChanged(){this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null,this.onModelContentChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;if(this.rangeProvider=new bce(e),this._useFoldingProviders&&this.foldingModel){let t=EN.ordered(this.foldingModel.textModel);if(t.length===0&&this.foldingStateMemento&&this.foldingStateMemento.collapsedRegions)return this.rangeProvider=new kce(e,this.foldingStateMemento.collapsedRegions,()=>{this.foldingStateMemento=null,this.onFoldingStrategyChanged()},3e4);t.length>0&&(this.rangeProvider=new Lce(e,t,()=>this.onModelContentChanged()))}return this.foldingStateMemento=null,this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onModelContentChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=this.getRangeProvider(e.textModel);let i=this.foldingRegionPromise=kr(s=>t.compute(s));return i.then(s=>{if(s&&i===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const l=s.setCollapsedAllOfType(Aa.Imports.value,!0);l&&(r=jp.capture(this.editor),this._currentModelHasFoldedImports=l)}let o=this.editor.getSelections(),a=o?o.map(l=>l.startLineNumber):[];e.update(s,a),r&&r.restore(this.editor)}return e})}).then(void 0,e=>(Qe(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){let t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();!e||e.then(t=>{if(t){let i=this.editor.getSelections();if(i&&i.length>0){let s=[];for(let r of i){let o=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(o)&&s.push(...t.getAllRegionsAtLine(o,a=>a.isCollapsed&&o>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,Qe)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:const s=e.target.detail,r=e.target.element.offsetLeft;if(s.offsetX-r<5)return;i=!0;break;case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){let a=this.editor.getModel();if(a&&t.startColumn===a.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.getFoldingModel();if(!t||!this.mouseDownInfo||!e.target)return;let i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,r=e.target.range;if(!(!r||r.startLineNumber!==i)){if(s){if(e.target.type!==4)return}else{let o=this.editor.getModel();if(!o||r.startColumn!==o.getLineMaxColumn(i))return}t.then(o=>{if(o){let a=o.getRegionAtLine(i);if(a&&a.startLineNumber===i){let l=a.isCollapsed;if(s||l){let u=e.event.altKey,h=[];if(u){let c=g=>!g.containedBy(a)&&!a.containedBy(g),f=o.getRegionsInside(null,c);for(const g of f)g.isCollapsed&&h.push(g);h.length===0&&(h=f)}else{let c=e.event.middleButton||e.event.shiftKey;if(c)for(const f of o.getRegionsInside(a))f.isCollapsed===l&&h.push(f);(l||!c||h.length===0)&&h.push(a)}o.toggleCollapseState(h),this.reveal({lineNumber:i,column:1})}}}}).then(void 0,Qe)}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Gp.ID="editor.contrib.folding";Gp=Ece([Ice(1,je)],Gp);class Os extends mt{runEditorCommand(e,t,i){let s=Gp.get(t);if(!s)return;let r=s.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(o=>{if(o){this.invoke(s,o,t,i);const a=t.getSelection();a&&s.reveal(a.getStartPosition())}})}getSelectedLines(e){let t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function wz(n){if(!os(n)){if(!Es(n))return!1;const e=n;if(!os(e.levels)&&!Gd(e.levels)||!os(e.direction)&&!Ia(e.direction)||!os(e.selectionLines)&&(!b6(e.selectionLines)||!e.selectionLines.every(Gd)))return!1}return!0}class Nce extends Os{constructor(){super({id:"editor.unfold",label:_("unfoldAction.label","Unfold"),alias:"Unfold",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:3161,mac:{primary:2649},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: + * 'levels': Number of levels to unfold. If not set, defaults to 1. + * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. + * 'selectionLines': The start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. + `,constraint:wz,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){let r=s&&s.levels||1,o=this.getLineNumbers(s,i);s&&s.direction==="up"?pz(t,!1,r,o):Lm(t,!1,r,o)}}class Tce extends Os{constructor(){super({id:"editor.unfoldRecursively",label:_("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2137),weight:100}})}invoke(e,t,i,s){Lm(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class Ace extends Os{constructor(){super({id:"editor.fold",label:_("foldAction.label","Fold"),alias:"Fold",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:3159,mac:{primary:2647},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: + * 'levels': Number of levels to fold. + * 'direction': If 'up', folds given number of levels up otherwise folds down. + * 'selectionLines': The start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. + If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. + `,constraint:wz,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){let r=this.getLineNumbers(s,i);const o=s&&s.levels,a=s&&s.direction;typeof o!="number"&&typeof a!="string"?hce(t,!0,r):a==="up"?pz(t,!0,o||1,r):Lm(t,!0,o||1,r)}}class Mce extends Os{constructor(){super({id:"editor.toggleFold",label:_("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2090),weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);uce(t,1,s)}}class Rce extends Os{constructor(){super({id:"editor.foldRecursively",label:_("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2135),weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);Lm(t,!0,Number.MAX_VALUE,s)}}class Oce extends Os{constructor(){super({id:"editor.foldAllBlockComments",label:_("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2133),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())W2(t,Aa.Comment.value,!0);else{const s=i.getModel();if(!s)return;const r=Jt.getComments(s.getLanguageId());if(r&&r.blockCommentStartToken){let o=new RegExp("^\\s*"+Na(r.blockCommentStartToken));B2(t,o,!0)}}}}class Pce extends Os{constructor(){super({id:"editor.foldAllMarkerRegions",label:_("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2077),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())W2(t,Aa.Region.value,!0);else{const s=i.getModel();if(!s)return;const r=Jt.getFoldingRules(s.getLanguageId());if(r&&r.markers&&r.markers.start){let o=new RegExp(r.markers.start);B2(t,o,!0)}}}}class Fce extends Os{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:_("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2078),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())W2(t,Aa.Region.value,!1);else{const s=i.getModel();if(!s)return;const r=Jt.getFoldingRules(s.getLanguageId());if(r&&r.markers&&r.markers.start){let o=new RegExp(r.markers.start);B2(t,o,!1)}}}}class Bce extends Os{constructor(){super({id:"editor.foldAllExcept",label:_("foldAllExcept.label","Fold All Regions Except Selected"),alias:"Fold All Regions Except Selected",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2131),weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);mz(t,!0,s)}}class Wce extends Os{constructor(){super({id:"editor.unfoldAllExcept",label:_("unfoldAllExcept.label","Unfold All Regions Except Selected"),alias:"Unfold All Regions Except Selected",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2129),weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);mz(t,!1,s)}}class Vce extends Os{constructor(){super({id:"editor.foldAll",label:_("foldAllAction.label","Fold All"),alias:"Fold All",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2069),weight:100}})}invoke(e,t,i){Lm(t,!0)}}class Hce extends Os{constructor(){super({id:"editor.unfoldAll",label:_("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2088),weight:100}})}invoke(e,t,i){Lm(t,!1)}}class tf extends Os{getFoldingLevel(){return parseInt(this.id.substr(tf.ID_PREFIX.length))}invoke(e,t,i){cce(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}tf.ID_PREFIX="editor.foldLevel";tf.ID=n=>tf.ID_PREFIX+n;class zce extends Os{constructor(){super({id:"editor.gotoParentFold",label:_("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);if(s.length>0){let r=dce(s[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class Uce extends Os{constructor(){super({id:"editor.gotoPreviousFold",label:_("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);if(s.length>0){let r=fce(s[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class $ce extends Os{constructor(){super({id:"editor.gotoNextFold",label:_("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,weight:100}})}invoke(e,t,i){let s=this.getSelectedLines(i);if(s.length>0){let r=gce(s[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}Ln(Gp.ID,Gp);ze(Nce);ze(Tce);ze(Ace);ze(Rce);ze(Vce);ze(Hce);ze(Oce);ze(Pce);ze(Fce);ze(Bce);ze(Wce);ze(Mce);ze(zce);ze(Uce);ze($ce);for(let n=1;n<=7;n++)o9(new tf({id:tf.ID(n),label:_("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:fs,kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,2048|21+n),weight:100}}));const Kce=W("editor.foldBackground",{light:Yt(nc,.3),dark:Yt(nc,.3),hc:null},_("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0),jce=W("editorGutter.foldingControlForeground",{dark:Ik,light:Ik,hc:Ik},_("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));ni((n,e)=>{const t=n.getColor(Kce);t&&e.addRule(`.monaco-editor .folded-background { background-color: ${t}; }`);const i=n.getColor(jce);i&&e.addRule(` + .monaco-editor .cldr${ui.asCSSSelector(V2)}, + .monaco-editor .cldr${ui.asCSSSelector(H2)} { + color: ${i} !important; + } + `)});const Yu=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new H,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(n){n=Math.min(Math.max(-5,n),20),this._zoomLevel!==n&&(this._zoomLevel=n,this._onDidChangeZoomLevel.fire(this._zoomLevel))}};class Gce extends mt{constructor(){super({id:"editor.action.fontZoomIn",label:_("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){Yu.setZoomLevel(Yu.getZoomLevel()+1)}}class qce extends mt{constructor(){super({id:"editor.action.fontZoomOut",label:_("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){Yu.setZoomLevel(Yu.getZoomLevel()-1)}}class Zce extends mt{constructor(){super({id:"editor.action.fontZoomReset",label:_("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){Yu.setZoomLevel(0)}}ze(Gce);ze(qce);ze(Zce);const fv="$(",z2=new RegExp(`\\$\\(${Ks.iconNameExpression}(?:${Ks.iconModifierExpression})?\\)`,"g"),Yce=new RegExp(`(\\\\)?${z2.source}`,"g");function Xce(n){return n.replace(Yce,(e,t)=>t?e:`\\${e}`)}const Qce=new RegExp(`\\\\${z2.source}`,"g");function Jce(n){return n.replace(Qce,e=>`\\${e}`)}const ede=new RegExp(`(\\s)?(\\\\)?${z2.source}(\\s)?`,"g");function tde(n){return n.indexOf(fv)===-1?n:n.replace(ede,(e,t,i,s)=>i?e:t||s||"")}function nw(n){const e=n.indexOf(fv);return e===-1?{text:n}:ide(n,e)}function ide(n,e){const t=[];let i="";function s(f){if(f){i+=f;for(const g of f)t.push(a)}}let r=-1,o="",a=0,l,u,h=e;const c=n.length;for(s(n.substr(0,e));h" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`:` + +`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=` +`,this.value+=t,this.value+="\n```\n",this}}function gv(n){return Sz(n)?!n.value:Array.isArray(n)?n.every(gv):!0}function Sz(n){return n instanceof qp?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function nde(n){return n.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")}function Kk(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1")}function sde(n){const e=[],t=n.split("|").map(s=>s.trim());n=t[0];const i=t[1];if(i){const s=/height=(\d+)/.exec(i),r=/width=(\d+)/.exec(i),o=s?s[1]:"",a=r?r[1]:"",l=isFinite(parseInt(a)),u=isFinite(parseInt(o));l&&e.push(`width="${a}"`),u&&e.push(`height="${o}"`)}return{href:n,dimensions:e}}function YN(n,e){return!!n[e]}class jk{constructor(e,t){this.target=e.target,this.hasTriggerModifier=YN(e.event,t.triggerModifier),this.hasSideBySideModifier=YN(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class f3{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=YN(e,t.triggerModifier)}}class rw{constructor(e,t,i,s){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function g3(n){return n==="altKey"?pt?new rw(57,"metaKey",6,"altKey"):new rw(5,"ctrlKey",6,"altKey"):pt?new rw(6,"altKey",57,"metaKey"):new rw(6,"altKey",5,"ctrlKey")}class rde extends ie{constructor(e){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new H),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new H),this.onExecute=this._onExecute.event,this._onCancel=this._register(new H),this.onCancel=this._onCancel.event,this._editor=e,this._opts=g3(this._editor.getOption(69)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(t=>{if(t.hasChanged(69)){const i=g3(this._editor.getOption(69));if(this._opts.equals(i))return;this._opts=i,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(t=>this._onEditorMouseMove(new jk(t,this._opts)))),this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(new jk(t,this._opts)))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(new jk(t,this._opts)))),this._register(this._editor.onKeyDown(t=>this._onEditorKeyDown(new f3(t,this._opts)))),this._register(this._editor.onKeyUp(t=>this._onEditorKeyUp(new f3(t,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(t=>this._onDidChangeCursorSelection(t))),this._register(this._editor.onDidChangeModel(t=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(t=>{(t.scrollTopChanged||t.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}const U2=wt("markerDecorationsService");var ode=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},ade=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let m0=class{constructor(e,t){}dispose(){}};m0.ID="editor.contrib.markerDecorations";m0=ode([ade(1,U2)],m0);Ln(m0.ID,m0);class lde{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class $2{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=this._bareFontInfo.getMassagedFontFamily(Fo?hs.fontFamily:null),t=document.createElement("div");t.style.position="absolute",t.style.top="-50000px",t.style.width="50000px";const i=document.createElement("div");i.style.fontFamily=e,i.style.fontWeight=this._bareFontInfo.fontWeight,i.style.fontSize=this._bareFontInfo.fontSize+"px",i.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,i.style.lineHeight=this._bareFontInfo.lineHeight+"px",i.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",t.appendChild(i);const s=document.createElement("div");s.style.fontFamily=e,s.style.fontWeight="bold",s.style.fontSize=this._bareFontInfo.fontSize+"px",s.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,s.style.lineHeight=this._bareFontInfo.lineHeight+"px",s.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",t.appendChild(s);const r=document.createElement("div");r.style.fontFamily=e,r.style.fontWeight=this._bareFontInfo.fontWeight,r.style.fontSize=this._bareFontInfo.fontSize+"px",r.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,r.style.lineHeight=this._bareFontInfo.lineHeight+"px",r.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",r.style.fontStyle="italic",t.appendChild(r);const o=[];for(const a of this._requests){let l;a.type===0&&(l=i),a.type===2&&(l=s),a.type===1&&(l=r),l.appendChild(document.createElement("br"));const u=document.createElement("span");$2._render(u,a),l.appendChild(u),o.push(u)}this._container=t,this._testElements=o}static _render(e,t){if(t.chr===" "){let i="\xA0";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()}),this.resizeObserver.observe(this.referenceDomElement)):this.measureReferenceDomElementToken===-1&&(this.measureReferenceDomElementToken=setInterval(()=>this.observe(),100))}stopObserving(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.measureReferenceDomElementToken!==-1&&(clearInterval(this.measureReferenceDomElementToken),this.measureReferenceDomElementToken=-1)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this.referenceDomElement&&(i=this.referenceDomElement.clientWidth,s=this.referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this.width!==i||this.height!==s)&&(this.width=i,this.height=s,e&&this.changeCallback())}}const hde=pt?1.5:1.35,Gk=8;class Fd{constructor(e){this._bareFontInfoBrand=void 0,this.zoomLevel=e.zoomLevel,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}static createFromValidatedSettings(e,t,i,s){const r=e.get(42),o=e.get(46),a=e.get(45),l=e.get(44),u=e.get(58),h=e.get(55);return Fd._create(r,o,a,l,u,h,t,i,s)}static _create(e,t,i,s,r,o,a,l,u){r===0?r=hde*i:r{const b=u.filteredTypes[w.key];b===!1&&(u[w.value]=b)})}const h=n.hover;h===!0?n.hover={enabled:!0}:h===!1&&(n.hover={enabled:!1});const c=n.parameterHints;c===!0?n.parameterHints={enabled:!0}:c===!1&&(n.parameterHints={enabled:!1});const f=n.autoIndent;f===!0?n.autoIndent="full":f===!1&&(n.autoIndent="advanced");const g=n.matchBrackets;g===!0?n.matchBrackets="always":g===!1&&(n.matchBrackets="never");const{renderIndentGuides:m,highlightActiveIndentGuide:v}=n;n.guides||(n.guides={}),m!==void 0&&(n.guides.indentation=!!m),v!==void 0&&(n.guides.highlightActiveIndentation=!!v)}function m3(n){const e=Ih(n);return _de(e),e}class US extends ie{constructor(e,t){super(),this._onDidChange=this._register(new H),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new H),this.onDidChangeFast=this._onDidChangeFast.event,this.isSimpleWidget=e,this._isDominatedByLongLines=!1,this._computeOptionsMemory=new h9,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._rawOptions=m3(t),this._readOptions=yu.readOptions(this._rawOptions),this._validatedOptions=yu.validateOptions(this._readOptions),this._register(Yu.onDidChangeZoomLevel(i=>this._recomputeOptions())),this._register(p3.onDidChangeTabFocus(i=>this._recomputeOptions()))}observeReferenceElement(e){}updatePixelRatio(){}_recomputeOptions(){const e=this.options,t=this._computeInternalOptions();if(!e)this.options=t;else{const i=yu.checkEquals(e,t);if(i===null)return;this.options=t,this._onDidChangeFast.fire(i),this._onDidChange.fire(i)}}getRawOptions(){return this._rawOptions}_computeInternalOptions(){const e=this._getEnvConfiguration(),t=Fd.createFromValidatedSettings(this._validatedOptions,e.zoomLevel,e.pixelRatio,this.isSimpleWidget),i={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,fontInfo:this.readConfiguration(t),extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:p3.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return yu.computeOptions(this._validatedOptions,i)}static _subsetEquals(e,t){for(const i in t)if(Lz.call(t,i)){const s=t[i],r=e[i];if(r===s)continue;if(Array.isArray(r)&&Array.isArray(s)){if(!xl(r,s))return!1;continue}if(r&&typeof r=="object"&&s&&typeof s=="object"){if(!this._subsetEquals(r,s))return!1;continue}return!1}return!0}updateOptions(e){if(typeof e>"u")return;const t=m3(e);US._subsetEquals(this._rawOptions,t)||(this._rawOptions=Fa(this._rawOptions,t||{}),this._readOptions=yu.readOptions(this._rawOptions),this._validatedOptions=yu.validateOptions(this._readOptions),this._recomputeOptions())}setIsDominatedByLongLines(e){this._isDominatedByLongLines=e,this._recomputeOptions()}setMaxLineNumber(e){const t=US._digitCount(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}static _digitCount(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}}const vde=Object.freeze({id:"editor",order:5,type:"object",title:_("editorConfigurationTitle","Editor"),scope:5}),bde=yn.as(bm.Configuration),$S=Object.assign(Object.assign({},vde),{properties:{"editor.tabSize":{type:"number",default:jn.tabSize,minimum:1,markdownDescription:_("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.insertSpaces":{type:"boolean",default:jn.insertSpaces,markdownDescription:_("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.detectIndentation":{type:"boolean",default:jn.detectIndentation,markdownDescription:_("detectIndentation","Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.")},"editor.trimAutoWhitespace":{type:"boolean",default:jn.trimAutoWhitespace,description:_("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:jn.largeFileOptimizations,description:_("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:_("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[_("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),_("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),_("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:_("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[_("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),_("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),_("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:_("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:_("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:_("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.language.brackets":{type:"array",default:!1,description:_("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:_("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:_("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:"array",default:!1,description:_("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:_("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:_("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:_("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:50,description:_("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:_("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:_("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:_("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:_("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[_("wordWrap.off","Lines will never wrap."),_("wordWrap.on","Lines will wrap at the viewport width."),_("wordWrap.inherit","Lines will wrap according to the `#editor.wordWrap#` setting.")]}}});function Cde(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of Vg){const e=n.schema;if(typeof e<"u")if(Cde(e))$S.properties[`editor.${n.name}`]=e;else for(let t in e)Lz.call(e,t)&&($S.properties[t]=e[t])}let ow=null;function Dz(){return ow===null&&(ow=Object.create(null),Object.keys($S.properties).forEach(n=>{ow[n]=!0})),ow}function wde(n){return Dz()[`editor.${n}`]||!1}function Sde(n){return Dz()[`diffEditor.${n}`]||!1}bde.registerConfiguration($S);class _3{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}function yde(){nf.INSTANCE.clearCache()}class nf extends ie{constructor(){super(),this._onDidChange=this._register(new H),this.onDidChange=this._onDidChange.event,this._cache=new _3,this._evictUntrustedReadingsTimeout=-1}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearCache(){this._cache=new _3,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),!t.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readConfiguration(e){if(!this._cache.has(e)){let t=nf._actualReadConfiguration(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new XN({zoomLevel:XI(),pixelRatio:nS(),fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}static createRequest(e,t,i,s){const r=new lde(e,t);return i.push(r),s&&s.push(r),r}static _actualReadConfiguration(e){const t=[],i=[],s=this.createRequest("n",0,t,i),r=this.createRequest("\uFF4D",0,t,null),o=this.createRequest(" ",0,t,i),a=this.createRequest("0",0,t,i),l=this.createRequest("1",0,t,i),u=this.createRequest("2",0,t,i),h=this.createRequest("3",0,t,i),c=this.createRequest("4",0,t,i),f=this.createRequest("5",0,t,i),g=this.createRequest("6",0,t,i),m=this.createRequest("7",0,t,i),v=this.createRequest("8",0,t,i),S=this.createRequest("9",0,t,i),w=this.createRequest("\u2192",0,t,i),b=this.createRequest("\uFFEB",0,t,null),y=this.createRequest("\xB7",0,t,i),L=this.createRequest(String.fromCharCode(11825),0,t,null),E="|/-_ilm%";for(let V=0,Q=E.length;V.001){x=!1;break}}let A=!0;x&&b.width!==k&&(A=!1),b.width>w.width&&(A=!1);const z=Xee()>2e3;return new XN({zoomLevel:XI(),pixelRatio:nS(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:x,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:A,spaceWidth:o.width,middotWidth:y.width,wsmiddotWidth:L.width,maxDigitWidth:I},z)}}nf.INSTANCE=new nf;class Bn extends US{constructor(e,t,i=null,s){super(e,t),this.accessibilityService=s,this._elementSizeObserver=this._register(new yz(i,t.dimension,()=>this._recomputeOptions())),this._register(nf.INSTANCE.onDidChange(()=>this._recomputeOptions())),this._validatedOptions.get(10)&&this._elementSizeObserver.startObserving(),this._register(_6(r=>this._recomputeOptions())),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._recomputeOptions()}static applyFontInfoSlow(e,t){e.style.fontFamily=t.getMassagedFontFamily(Fo?hs.fontFamily:null),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"}static applyFontInfo(e,t){e.setFontFamily(t.getMassagedFontFamily(Fo?hs.fontFamily:null)),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)}observeReferenceElement(e){this._elementSizeObserver.observe(e)}updatePixelRatio(){this._recomputeOptions()}static _getExtraEditorClassName(){let e="";return!Fo&&!Jee&&(e+="no-user-select "),Fo&&(e+="no-minimap-shadow "),pt&&(e+="mac "),e}_getEnvConfiguration(){return{extraEditorClassName:Bn._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:kd||ls,pixelRatio:nS(),zoomLevel:XI(),accessibilitySupport:this.accessibilityService.isScreenReaderOptimized()?2:this.accessibilityService.getAccessibilitySupport()}}readConfiguration(e){return nf.INSTANCE.readConfiguration(e)}}class K2{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new xz(this.x-Bu.scrollX,this.y-Bu.scrollY)}}class xz{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new K2(this.clientX+Bu.scrollX,this.clientY+Bu.scrollY)}}class Lde{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}function kz(n){const e=bn(n);return new Lde(e.left,e.top,e.width,e.height)}class sf extends Kr{constructor(e,t){super(e),this._editorMouseEventBrand=void 0,this.pos=new K2(this.posx,this.posy),this.editorPos=kz(t)}}class Dde{constructor(e){this._editorViewDomNode=e}_create(e){return new sf(e,this._editorViewDomNode)}onContextMenu(e,t){return ne(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return ne(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return ne(e,"mousedown",i=>{t(this._create(i))})}onMouseLeave(e,t){return NR(e,i=>{t(this._create(i))})}onMouseMoveThrottled(e,t,i,s){return TR(e,"mousemove",t,(o,a)=>i(o,this._create(a)),s)}}class xde{constructor(e){this._editorViewDomNode=e}_create(e){return new sf(e,this._editorViewDomNode)}onPointerUp(e,t){return ne(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return ne(e,"pointerdown",i=>{t(this._create(i))})}onPointerLeave(e,t){return Wte(e,i=>{t(this._create(i))})}onPointerMoveThrottled(e,t,i,s){return TR(e,"pointermove",t,(o,a)=>i(o,this._create(a)),s)}}class kde extends ie{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new If),this._keydownListener=null}startMonitoring(e,t,i,s,r){this._keydownListener=qi(document,"keydown",a=>{a.toKeybinding().isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,a.browserEvent)},!0);const o=(a,l)=>i(a,new sf(l,this._editorViewDomNode));this._globalMouseMoveMonitor.startMonitoring(e,t,o,s,a=>{this._keydownListener.dispose(),r(a)})}stopMonitoring(){this._globalMouseMoveMonitor.stopMonitoring(!0)}}class cb extends ie{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,s=e.length;i=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t){if(!e||e.length===0)return null;const i=[];for(let s=0,r=e.length;su)return null;if(t=Math.min(u,Math.max(0,t)),s=Math.min(u,Math.max(0,s)),t===s&&i===r&&i===0&&!e.children[t].firstChild){const g=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(g,o)}t!==s&&s>0&&r===0&&(s--,r=1073741824);let h=e.children[t].firstChild,c=e.children[s].firstChild;if((!h||!c)&&(!h&&i===0&&t>0&&(h=e.children[t-1].firstChild,i=1073741824),!c&&r===0&&s>0&&(c=e.children[s-1].firstChild,r=1073741824)),!h||!c)return null;i=Math.min(h.textContent.length,Math.max(0,i)),r=Math.min(c.textContent.length,Math.max(0,r));const f=this._readClientRects(h,i,c,r,a);return this._createHorizontalRangesFromClientRects(f,o)}}class br{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let r=0;r=r||(a[l++]=new br(Math.max(1,u.startColumn-s+1),Math.min(o+1,u.endColumn-s+1),u.className,u.type));return a}static filter(e,t,i,s){if(e.length===0)return[];let r=[],o=0;for(let a=0,l=e.length;at||h.isEmpty()&&(u.type===0||u.type===3))continue;const c=h.startLineNumber===t?h.startColumn:i,f=h.endLineNumber===t?h.endColumn:s;r[o++]=new br(c,f,u.inlineClassName,u.type)}return r}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=br._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class Mde{static normalize(e,t){if(t.length===0)return[];let i=[];const s=new KS;let r=0;for(let o=0,a=t.length;o1){const v=e.charCodeAt(u-2);fn(v)&&u--}if(h>1){const v=e.charCodeAt(h-2);fn(v)&&h--}const g=u-1,m=h-2;r=s.consumeLowerThan(g,r,i),s.count===0&&(r=g),s.insert(m,c,f)}return s.consumeLowerThan(1073741824,r,i),i}}class sn{constructor(e,t,i){this._linePartBrand=void 0,this.endIndex=e,this.type=t,this.metadata=i}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class Rde{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Tf{constructor(e,t,i,s,r,o,a,l,u,h,c,f,g,m,v,S,w,b,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=r,this.containsRTL=o,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=u.sort(br.compare),this.tabSize=h,this.startVisibleColumn=c,this.spaceWidth=f,this.stopRenderingLineAfter=v,this.renderWhitespace=S==="all"?4:S==="boundary"?1:S==="selection"?2:S==="trailing"?3:0,this.renderControlCharacters=w,this.fontLigatures=b,this.selectionsOnLine=y&&y.sort((I,x)=>I.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}setColumnInfo(e,t,i,s){const r=(t<<16|i<<0)>>>0;this._data[e-1]=r,this._absoluteOffsets[e-1]=s+i}getAbsoluteOffset(e){return this._absoluteOffsets.length===0?0:this._absoluteOffsets[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=hl.getPartIndex(t),s=hl.getCharIndex(t);return new j2(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;let s=(e<<16|i<<0)>>>0,r=0,o=this.length-1;for(;r+1>>1,S=this._data[v];if(S===s)return v;S>s?o=v:r=v}if(r===o)return r;let a=this._data[r],l=this._data[o];if(a===s)return r;if(l===s)return o;let u=hl.getPartIndex(a),h=hl.getCharIndex(a),c=hl.getPartIndex(l),f;u!==c?f=t:f=hl.getCharIndex(l);let g=i-h,m=f-i;return g<=m?r:o}}class QN{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function NL(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendASCIIString("");let t=0,i=0,s=0;for(const o of n.lineDecorations)(o.type===1||o.type===2)&&(e.appendASCIIString(''),o.type===1&&(s|=1,t++),o.type===2&&(s|=2,i++));e.appendASCIIString("");const r=new hl(1,t+i);return r.setColumnInfo(1,t,0,0),new QN(r,!1,s)}return e.appendASCIIString(""),new QN(new hl(0,0),!1,0)}return Ude(Fde(n),e)}class Ode{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function TL(n){let e=Yd(1e4),t=NL(n,e);return new Ode(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class Pde{constructor(e,t,i,s,r,o,a,l,u,h,c,f,g,m,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=r,this.parts=o,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=u,this.startVisibleColumn=h,this.containsRTL=c,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=m,this.renderControlCharacters=v}}function Fde(n){const e=n.lineContent;let t,i;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let o=0,a=n.lineDecorations.length;o0&&(i[s++]=new sn(e,"",0));for(let r=0,o=n.getCount();r=t){i[s++]=new sn(t,l,0);break}i[s++]=new sn(a,l,0)}return i}function Wde(n,e,t){let i=0,s=[],r=0;if(t)for(let o=0,a=e.length;o=50&&(s[r++]=new sn(f+1,h,c),g=f+1,f=-1);g!==u&&(s[r++]=new sn(u,h,c))}else s[r++]=l;i=u}else for(let o=0,a=e.length;o50){const c=l.type,f=l.metadata,g=Math.ceil(h/50);for(let m=1;m=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function Vde(n,e){let t=[],i=new sn(0,"",0),s=0;for(const r of e){const o=r.endIndex;for(;si.endIndex&&(i=new sn(s,r.type,r.metadata),t.push(i)),i=new sn(s+1,"mtkcontrol",r.metadata),t.push(i))}s>i.endIndex&&(i=new sn(o,r.type,r.metadata),t.push(i))}return t}function Hde(n,e,t,i){const s=n.continuesWithWrappedLine,r=n.fauxIndentLength,o=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,u=n.selectionsOnLine,h=n.renderWhitespace===1,c=n.renderWhitespace===3,f=n.renderSpaceWidth!==n.spaceWidth;let g=[],m=0,v=0,S=i[v].type,w=i[v].endIndex;const b=i.length;let y=!1,L=us(e),E;L===-1?(y=!0,L=t,E=t):E=fm(e);let I=!1,x=0,k=u&&u[x],A=a%o;for(let V=r;V=k.endOffset&&(x++,k=u&&u[x]);let ee;if(VE)ee=!0;else if(Q===9)ee=!0;else if(Q===32)if(h)if(I)ee=!0;else{const Ce=V+1V),ee&&c&&(ee=y||V>E),I){if(!ee||!l&&A>=o){if(f){const Ce=m>0?g[m-1].endIndex:r;for(let Se=Ce+1;Se<=V;Se++)g[m++]=new sn(Se,"mtkw",1)}else g[m++]=new sn(V,"mtkw",1);A=A%o}}else(V===w||ee&&V>r)&&(g[m++]=new sn(V,S,0),A=A%o);for(Q===9?A=o:Sa(Q)?A+=2:A++,I=ee;V===w&&(v++,v0?e.charCodeAt(t-1):0,Q=t>1?e.charCodeAt(t-2):0;V===32&&Q!==32&&Q!==9||(z=!0)}else z=!0;if(z)if(f){const V=m>0?g[m-1].endIndex:r;for(let Q=V+1;Q<=t;Q++)g[m++]=new sn(Q,"mtkw",1)}else g[m++]=new sn(t,"mtkw",1);else g[m++]=new sn(t,S,0);return g}function zde(n,e,t,i){i.sort(br.compare);const s=Mde.normalize(n,i),r=s.length;let o=0,a=[],l=0,u=0;for(let c=0,f=t.length;cu&&(u=w.startOffset,a[l++]=new sn(u,v,S)),w.endOffset+1<=m)u=w.endOffset+1,a[l++]=new sn(u,v+" "+w.className,S|w.metadata),o++;else{u=m,a[l++]=new sn(u,v+" "+w.className,S|w.metadata);break}}m>u&&(u=m,a[l++]=new sn(u,v,S))}const h=t[t.length-1].endIndex;if(o'):e.appendASCIIString("");for(let A=0,z=l.length;A=u&&(fe+=We)}}for(Se&&(e.appendASCIIString(' style="width:'),e.appendASCIIString(String(g*Te)),e.appendASCIIString('px"')),e.appendASCII(62);y1?e.write1(8594):e.write1(65515);for(let Me=2;Me<=fe;Me++)e.write1(160)}else fe=1,e.write1(m);E+=fe,y>=u&&(L+=fe)}x=Te}else{let Te=0;for(e.appendASCII(62);y=u&&(L+=Me)}x=Te}Ie?I++:I=0,y>=o&&!b&&V.isPseudoAfter()&&(b=!0,w.setColumnInfo(y+1,A,E,k)),e.appendASCIIString("")}return b||w.setColumnInfo(o+1,l.length-1,E,k),a&&e.appendASCIIString(""),e.appendASCIIString(""),new QN(w,f,s)}function $de(n){return n.toString(16).toUpperCase().padStart(4,"0")}const Kde=function(){return wa?!0:!(Ns||ls||Fo)}();let pp=!0;class b3{constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}get clientRectDeltaLeft(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft}}class C3{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(43);this.renderWhitespace=i.get(87),this.renderControlCharacters=i.get(82),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(29),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(58),this.stopRenderingLineAfter=i.get(104),this.fontLigatures=i.get(44)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class ml{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=bt(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return this._options.themeType===ya.HIGH_CONTRAST||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=i.getViewLineRenderingData(e),o=this._options,a=br.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let l=null;if(o.themeType===ya.HIGH_CONTRAST||this._options.renderWhitespace==="selection"){const f=i.selections;for(const g of f){if(g.endLineNumbere)continue;const m=g.startLineNumber===e?g.startColumn:r.minColumn,v=g.endLineNumber===e?g.endColumn:r.maxColumn;m');const h=NL(u,s);s.appendASCIIString("");let c=null;return pp&&Kde&&r.isBasicASCII&&o.useMonospaceOptimizations&&h.containsForeignElements===0&&r.content.length<300&&u.lineTokens.getCount()<100&&(c=new aw(this._renderedViewLine?this._renderedViewLine.domNode:null,u,h.characterMapping)),c||(c=Nz(this._renderedViewLine?this._renderedViewLine.domNode:null,u,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=c,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof aw:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof aw?this._renderedViewLine.monospaceAssumptionsAreValid():pp}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof aw&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=t|0,i=i|0,t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const r=this._renderedViewLine.input.stopRenderingLineAfter|0;let o=!1;r!==-1&&t>r+1&&i>r+1&&(o=!0),r!==-1&&t>r+1&&(t=r+1),r!==-1&&i>r+1&&(i=r+1);const a=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return a&&a.length>0?new Ade(o,a):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}ml.CLASS_NAME="view-line";class aw{constructor(e,t,i){this.domNode=e,this.input=t,this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){return Math.round(this._getCharPosition(this._characterMapping.length))}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){if(!this.domNode)return pp;const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;return Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),pp=!1),pp}toSlowRenderedLine(){return Nz(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,s){const r=this._getCharPosition(t),o=this._getCharPosition(i);return[new gp(r,o-r)]}_getCharPosition(e){const t=this._characterMapping.getAbsoluteOffset(e);return this._charWidth*t}getColumnOfNodeOffset(e,t,i){const s=t.textContent.length;let r=-1;for(;t;)t=t.previousSibling,r++;return this._characterMapping.getColumn(new j2(r,i),s)}}class Iz{constructor(e,t,i,s,r){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=r,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let o=0,a=this._characterMapping.length;o<=a;o++)this._pixelOffsetCache[o]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const r=this._readPixelOffset(this.domNode,e,t,s);if(r===-1)return null;const o=this._readPixelOffset(this.domNode,e,i,s);return o===-1?null:[new gp(r,o-r)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,r){if(i===s){const o=this._readPixelOffset(e,t,i,r);return o===-1?null:[new gp(o,0)]}else return this._readRawVisibleRangesForRange(e,i,s,r)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth();const r=this._getReadingTarget(e);return r.firstChild?r.firstChild.offsetWidth:0}if(this._pixelOffsetCache!==null){const r=this._pixelOffsetCache[i];if(r!==-1)return r;const o=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=o,o}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const l=qk.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s.clientRectDeltaLeft,s.endNode);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth();const r=this._characterMapping.getDomPosition(i),o=qk.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,r.partIndex,r.charIndex,s.clientRectDeltaLeft,s.endNode);if(!o||o.length===0)return-1;const a=o[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getAbsoluteOffset(i),u=Math.round(this.input.spaceWidth*l);if(Math.abs(u-a)<=1)return u}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new gp(0,this.getWidth())];const r=this._characterMapping.getDomPosition(t),o=this._characterMapping.getDomPosition(i);return qk.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,o.partIndex,o.charIndex,s.clientRectDeltaLeft,s.endNode)}getColumnOfNodeOffset(e,t,i){const s=t.textContent.length;let r=-1;for(;t;)t=t.previousSibling,r++;return this._characterMapping.getColumn(new j2(r,i),s)}}class jde extends Iz{_readVisibleRangesForRange(e,t,i,s,r){const o=super._readVisibleRangesForRange(e,t,i,s,r);if(!o||o.length===0||i===s||i===1&&s===this._characterMapping.length)return o;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,r);if(a!==-1){const l=o[o.length-1];l.left=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class Zp{constructor(e,t,i){this.model=e.model;const s=e.configuration.options;this.layoutInfo=s.get(129),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(58),this.stickyTabStops=s.get(103),this.typicalHalfwidthCharacterWidth=s.get(43).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Zp.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,r=e.model.getLineCount();let o=null,a,l=null;return i.afterLineNumber!==r&&(l=new G(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(o=new G(i.afterLineNumber,e.model.getLineMaxColumn(i.afterLineNumber))),l===null?a=o:o===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,Nn._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class G2 extends Yde{constructor(e,t,i,s){super(e,t,i),this._ctx=e,s?(this.target=s,this.targetPath=Pl.collect(s,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}fulfill(e,t=null,i=null,s=null){let r=this.mouseColumn;return t&&t.columno.contentLeft+o.width)continue;const a=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(a<=r&&r<=a+o.height)return t.fulfill(6,o.position,null,{mightBeForeignElement:!1})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const s=t.isInContentArea?8:5;return t.fulfill(s,i.position,null,i)}return null}static _hitTestTextArea(e,t){return bo.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfill(6,e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1}):t.fulfill(1,e.lastRenderData.lastTextareaPosition):null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let r=Math.abs(t.pos.x-t.editorPos.x);const o={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:r};return r-=e.layoutInfo.glyphMarginLeft,r<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,s,i.range,o):(r-=e.layoutInfo.glyphMarginWidth,r<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,s,i.range,o):(r-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,s,i.range,o)))}return null}static _hitTestViewLines(e,t,i){if(!bo.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfill(7,new G(1,1),null,w3);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return t.fulfill(7,new G(r,o),null,w3)}if(i){if(bo.isStrictChildOfViewLines(t.targetPath)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.model.getLineLength(r)===0){const a=e.getLineWidth(r),l=Zk(t.mouseContentHorizontalOffset-a);return t.fulfill(7,new G(r,1),null,l)}const o=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>=o){const a=Zk(t.mouseContentHorizontalOffset-o),l=new G(r,e.model.getLineMaxColumn(r));return t.fulfill(7,l,null,a)}}return t.fulfill(0)}const s=Nn._doHitTest(e,t);return s.type===1?Nn.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}static _hitTestMinimap(e,t){if(bo.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.model.getLineMaxColumn(i);return t.fulfill(11,new G(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(bo.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.model.getLineMaxColumn(s);return t.fulfill(11,new G(s,r))}}return null}static _hitTestScrollbar(e,t){if(bo.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.model.getLineMaxColumn(i);return t.fulfill(11,new G(i,s))}return null}getMouseColumn(e,t){const i=this._context.configuration.options,s=i.get(129),r=this._context.viewLayout.getCurrentScrollLeft()+t.x-e.x-s.contentLeft;return Nn._getMouseColumn(r,i.get(43).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,r){const o=s.lineNumber,a=s.column,l=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>l){const S=Zk(t.mouseContentHorizontalOffset-l);return t.fulfill(7,s,null,S)}const u=e.visibleRangeForPosition(o,a);if(!u)return t.fulfill(0,s);const h=u.left;if(t.mouseContentHorizontalOffset===h)return t.fulfill(6,s,null,{mightBeForeignElement:!!r});const c=[];if(c.push({offset:u.left,column:a}),a>1){const S=e.visibleRangeForPosition(o,a-1);S&&c.push({offset:S.left,column:a-1})}const f=e.model.getLineMaxColumn(o);if(aS.offset-w.offset);const g=t.pos.toClientCoordinates(),m=i.getBoundingClientRect(),v=m.left<=g.clientX&&g.clientX<=m.right;for(let S=1;S=t.editorPos.y+e.layoutInfo.height&&(o=t.editorPos.y+e.layoutInfo.height-1);const a=new K2(t.pos.x,o),l=this._actualDoHitTestWithCaretRangeFromPoint(e,a.toClientCoordinates());return l.type===1?l:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Cf(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=Xde(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=document.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new wh;const r=s.startContainer;if(r.nodeType===r.TEXT_NODE){const o=r.parentNode,a=o?o.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===ml.CLASS_NAME?rd.createFromDOMInfo(e,o,s.startOffset):new wh(r.parentNode)}else if(r.nodeType===r.ELEMENT_NODE){const o=r.parentNode,a=o?o.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===ml.CLASS_NAME?rd.createFromDOMInfo(e,r,r.textContent.length):new wh(r)}return new wh}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,r=s?s.parentNode:null,o=r?r.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===ml.CLASS_NAME?rd.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new wh(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,r=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,o=s?s.parentNode:null,a=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(r===ml.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return rd.createFromDOMInfo(e,l,0)}else if(a===ml.CLASS_NAME)return rd.createFromDOMInfo(e,i.offsetNode,0)}return new wh(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.getTextModelOptions(),r=r0.atomicPosition(i,e.column-1,s,2);return r!==-1?new G(e.lineNumber,r+1):e}static _doHitTest(e,t){let i=new wh;if(typeof document.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1){const s=e.model.getInjectedTextAt(i.position),r=e.model.normalizePosition(i.position,2);(s||!r.equals(i.position))&&(i=new JN(r,i.spanNode,s))}return i.type===1&&e.stickyTabStops&&(i=new JN(this._snapToSoftTabBoundary(i.position,e.model),i.spanNode,i.injectedText)),i}}function Xde(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const r=s.getBoundingClientRect(),o=window.getComputedStyle(s,null).getPropertyValue("font"),a=s.innerText;let l=r.left,u=0,h;if(e>r.left+r.width)u=a.length;else{const c=bd.getInstance();for(let f=0;fthis._createMouseTarget(o,a),o=>this._getMouseColumn(o))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(129).height;const s=new Dde(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,o=>this._onContextMenu(o,!0))),this._register(s.onMouseMoveThrottled(this.viewHelper.viewDomNode,o=>this._onMouseMove(o),jS(this.mouseTargetFactory),rf.MOUSE_MOVE_MINIMUM_TIME)),this._register(s.onMouseUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onMouseDown(this.viewHelper.viewDomNode,o=>this._onMouseDown(o)));const r=o=>{if(this.viewController.emitMouseWheel(o),!this._context.configuration.options.get(67))return;const a=new Ip(o);if(pt?(o.metaKey||o.ctrlKey)&&!o.shiftKey&&!o.altKey:o.ctrlKey&&!o.metaKey&&!o.shiftKey&&!o.altKey){const u=Yu.getZoomLevel(),h=a.deltaY>0?1:-1;Yu.setZoomLevel(u+h),a.preventDefault(),a.stopPropagation()}};this._register(ne(this.viewHelper.viewDomNode,xe.MOUSE_WHEEL,r,{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(129)){const t=this._context.configuration.options.get(129).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}onScrollChanged(e){return this._mouseDownOperation.onScrollChanged(),!1}getTargetAtClientPoint(e,t){const s=new xz(e,t).toPageCoordinates(),r=kz(this.viewHelper.viewDomNode);return s.yr.y+r.height||s.xr.x+r.width?null:this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),r,s,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=Cf(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(i||r&&o))h(),this._mouseDownOperation.start(t.type,e);else if(s)e.preventDefault();else if(a){const c=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(c.viewZoneId)&&(h(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}rf.MOUSE_MOVE_MINIMUM_TIME=100;class Qde extends ie{constructor(e,t,i,s,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._createMouseTarget=s,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new kde(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new Ms),this._mouseState=new AL,this._currentSelection=new Oe(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!0);!t||(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):this._dispatchMouse(t,!0))}start(e,t){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const i=this._findMousePosition(t,!0);if(!i||!i.position)return;this._mouseState.trySetCount(t.detail,i.position),t.detail=this._mouseState.count;const s=this._context.configuration.options;if(!s.get(80)&&s.get(31)&&!s.get(18)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&i.type===6&&i.position&&this._currentSelection.containsPosition(i.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,jS(null),r=>this._onMouseDownThenMove(r),r=>{const o=this._findMousePosition(this._lastMouseEvent,!0);r&&r instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:o?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(i,t.shiftKey),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,jS(null),r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onScrollChanged(){!this._isActive||this._onScrollTimeout.setIfNotSet(()=>{if(!this._lastMouseEvent)return;const e=this._findMousePosition(this._lastMouseEvent,!1);!e||this._mouseState.isDragAndDrop||this._dispatchMouse(e,!0)},10)}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.model,s=this._context.viewLayout,r=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=s.getCurrentScrollTop()+(e.posy-t.y),l=Zp.getZoneAtCoord(this._context,a);if(l){const h=this._helpPositionJumpOverViewZone(l);if(h)return new ha(null,13,r,h)}const u=s.getLineNumberAtVerticalOffset(a);return new ha(null,13,r,new G(u,i.getLineMaxColumn(u)))}const o=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+(e.posy-t.y));return e.posxt.x+t.width?new ha(null,13,r,new G(o,i.getLineMaxColumn(o))):null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===8||s.type===5){const o=this._helpPositionJumpOverViewZone(s.detail);if(o)return new ha(s.element,s.type,s.mouseColumn,o,null,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new G(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(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})}}class AL{constructor(){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}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>AL.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}AL.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class Jde extends rf{constructor(e,t,i){super(e,t,i),this._register(Tt.addTarget(this.viewHelper.linesContentDomNode)),this._register(ne(this.viewHelper.linesContentDomNode,qt.Tap,r=>this.onTap(r))),this._register(ne(this.viewHelper.linesContentDomNode,qt.Change,r=>this.onChange(r))),this._register(ne(this.viewHelper.linesContentDomNode,qt.Contextmenu,r=>this._onContextMenu(new sf(r,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ne(this.viewHelper.linesContentDomNode,"pointerdown",r=>{const o=r.pointerType;if(o==="mouse"){this._lastPointerType="mouse";return}else o==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new xde(this.viewHelper.viewDomNode);this._register(s.onPointerMoveThrottled(this.viewHelper.viewDomNode,r=>this._onMouseMove(r),jS(this.mouseTargetFactory),rf.MOUSE_MOVE_MINIMUM_TIME)),this._register(s.onPointerUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new sf(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1})}onChange(e){this._lastPointerType==="touch"&&this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e)}}class efe extends rf{constructor(e,t,i){super(e,t,i),this._register(Tt.addTarget(this.viewHelper.linesContentDomNode)),this._register(ne(this.viewHelper.linesContentDomNode,qt.Tap,s=>this.onTap(s))),this._register(ne(this.viewHelper.linesContentDomNode,qt.Change,s=>this.onChange(s))),this._register(ne(this.viewHelper.linesContentDomNode,qt.Contextmenu,s=>this._onContextMenu(new sf(s,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new sf(e,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(FS.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position)}}onChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}}class tfe extends ie{constructor(e,t,i){super(),Nl&&Ky.pointerEvents?this.handler=this._register(new Jde(e,t,i)):window.TouchEvent?this.handler=this._register(new efe(e,t,i)):this.handler=this._register(new rf(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Dm extends cb{}class Yp extends Dm{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new G(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(58);const t=e.get(59);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(83);const i=e.get(129);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new G(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?''+i+"":String(s)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Ns?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r='
',o=this._context.model.getLineCount(),a=[];for(let l=i;l<=s;l++){const u=l-i;if(!this._renderFinalNewline&&l===o&&this._context.model.getLineLength(l)===0){a[u]="";continue}const h=this._getLineRenderLineNumber(l);h?l===this._activeLineNumber?a[u]='
'+h+"
":a[u]=r+h+"
":a[u]=""}this._renderResult=a}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Yp.CLASS_NAME="line-numbers";ni((n,e)=>{const t=n.getColor(_H);t&&e.addRule(`.monaco-editor .line-numbers { color: ${t}; }`);const i=n.getColor(Bae);i&&e.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${i}; }`)});class of extends so{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=bt(document.createElement("div")),this._domNode.setClassName(of.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=bt(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(of.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}of.CLASS_NAME="glyph-margin";of.OUTER_CLASS_NAME="margin";const Bd="monaco-mouse-cursor-text";class q2{constructor(e,t,i){this._visibleTextAreaBrand=void 0,this.top=e,this.left=t,this.width=i}setWidth(e){return new q2(this.top,this.left,e)}}const c_=ls;class ife extends so{constructor(e,t,i){super(e),this._primaryCursorPosition=new G(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._viewHelper=i,this._scrollLeft=0,this._scrollTop=0;const s=this._context.configuration.options,r=s.get(129);this._setAccessibilityOptions(s),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=s.get(43),this._lineHeight=s.get(58),this._emptySelectionClipboard=s.get(32),this._copyWithSyntaxHighlighting=s.get(21),this._visibleTextArea=null,this._selections=[new Oe(1,1,1,1)],this._modelSelections=[new Oe(1,1,1,1)],this._lastRenderPosition=null,this.textArea=bt(document.createElement("textarea")),Pl.write(this.textArea,6),this.textArea.setClassName(`inputarea ${Bd}`),this.textArea.setAttribute("wrap","off"),this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(s)),this.textArea.setAttribute("tabindex",String(s.get(111))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",_("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),s.get(30)&&s.get(80)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=bt(document.createElement("div")),this.textAreaCover.setPosition("absolute");const o={getLineCount:()=>this._context.model.getLineCount(),getLineMaxColumn:l=>this._context.model.getLineMaxColumn(l),getValueInRange:(l,u)=>this._context.model.getValueInRange(l,u)},a={getDataToCopy:l=>{const u=this._context.model.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Pn),h=this._context.model.getEOL(),c=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),f=Array.isArray(u)?u:null,g=Array.isArray(u)?u.join(h):u;let m,v=null;if(l&&(BN.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&g.length<65536)){const S=this._context.model.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);S&&(m=S.html,v=S.mode)}return{isFromEmptySelection:c,multicursorText:f,text:g,html:m,mode:v}},getScreenReaderContent:l=>{if(this._accessibilitySupport===1){if(pt){const u=this._selections[0];if(u.isEmpty()){const h=u.getStartPosition();let c=this._getWordBeforePosition(h);if(c.length===0&&(c=this._getCharacterBeforePosition(h)),c.length>0)return new tn(c,c.length,c.length,h,h)}}return tn.EMPTY}if(x_){const u=this._selections[0];if(u.isEmpty()){const h=u.getStartPosition(),[c,f]=this._getAndroidWordAtPosition(h);if(c.length>0)return new tn(c,f,f,h,h)}return tn.EMPTY}return $g.fromEditorSelection(l,o,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(l,u,h)=>this._context.model.deduceModelPositionRelativeToViewPosition(l,u,h)};this._textAreaInput=this._register(new Ble(a,this.textArea)),this._register(this._textAreaInput.onKeyDown(l=>{this._viewController.emitKeyDown(l)})),this._register(this._textAreaInput.onKeyUp(l=>{this._viewController.emitKeyUp(l)})),this._register(this._textAreaInput.onPaste(l=>{let u=!1,h=null,c=null;l.metadata&&(u=this._emptySelectionClipboard&&!!l.metadata.isFromEmptySelection,h=typeof l.metadata.multicursorText<"u"?l.metadata.multicursorText:null,c=l.metadata.mode),this._viewController.paste(l.text,u,h,c)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(l=>{l.replacePrevCharCnt||l.replaceNextCharCnt||l.positionDelta?this._viewController.compositionType(l.text,l.replacePrevCharCnt,l.replaceNextCharCnt,l.positionDelta):this._viewController.type(l.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(l=>{this._viewController.setSelection(l)})),this._register(this._textAreaInput.onCompositionStart(l=>{const u=this._selections[0].startLineNumber,h=this._selections[0].startColumn+l.revealDeltaColumns;this._context.model.revealRange("keyboard",!0,new M(u,h,u,h),0,1);const c=this._viewHelper.visibleRangeForPositionRelativeToEditor(u,h);c&&(this._visibleTextArea=new q2(this._context.viewLayout.getVerticalOffsetForLineNumber(u),c.left,c_?0:1),this._render()),this.textArea.setClassName(`inputarea ${Bd} ime-input`),this._viewController.compositionStart(),this._context.model.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(l=>{!this._visibleTextArea||(this._visibleTextArea=this._visibleTextArea.setWidth(nfe(l.data,this._fontInfo)),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName(`inputarea ${Bd}`),this._viewController.compositionEnd(),this._context.model.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.model.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.model.setHasFocus(!1)}))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.model.getLineContent(e.lineNumber),s=Op(t);let r=!0,o=e.column,a=!0,l=e.column,u=0;for(;u<50&&(r||a);){if(r&&o<=1&&(r=!1),r){const h=i.charCodeAt(o-2);s.get(h)!==0?r=!1:o--}if(a&&l>i.length&&(a=!1),a){const h=i.charCodeAt(l-1);s.get(h)!==0?a=!1:l++}u++}return[i.substring(o-1,l-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.model.getLineContent(e.lineNumber),i=Op(this._context.configuration.options.get(115));let s=e.column,r=0;for(;s>1;){const o=t.charCodeAt(s-2);if(i.get(o)!==0||r>50)return t.substring(s-1,e.column-1);r++,s--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.model.getLineContent(e.lineNumber).charAt(e.column-2);if(!fn(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){return e.get(2)===1?_("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",Ns?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Df.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(43),this._lineHeight=t.get(58),this._emptySelectionClipboard=t.get(32),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(111))),(e.hasChanged(30)||e.hasChanged(80))&&(t.get(30)&&t.get(80)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}prepareRender(e){this._primaryCursorPosition=new G(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){if(this._visibleTextArea){this._renderInsideEditor(null,this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight);return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(pt){this._renderInsideEditor(this._primaryCursorPosition,t,e,c_?0:1,this._lineHeight);return}this._renderInsideEditor(this._primaryCursorPosition,t,e,c_?0:1,c_?0:1)}_renderInsideEditor(e,t,i,s,r){this._lastRenderPosition=e;const o=this.textArea,a=this.textAreaCover;Bn.applyFontInfo(o,this._fontInfo),o.setTop(t),o.setLeft(i),o.setWidth(s),o.setHeight(r),a.setTop(0),a.setLeft(0),a.setWidth(0),a.setHeight(0)}_renderAtTopLeft(){this._lastRenderPosition=null;const e=this.textArea,t=this.textAreaCover;if(Bn.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),c_){e.setWidth(0),e.setHeight(0),t.setWidth(0),t.setHeight(0);return}e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1);const i=this._context.configuration.options;i.get(49)?t.setClassName("monaco-editor-background textAreaCover "+of.OUTER_CLASS_NAME):i.get(59).renderType!==0?t.setClassName("monaco-editor-background textAreaCover "+Yp.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")}}function nfe(n,e){const i=document.createElement("canvas").getContext("2d");i.font=sfe(e);const s=i.measureText(n);return ls?s.width+2:s.width}function sfe(n){return rfe("normal",n.fontWeight,n.fontSize,n.lineHeight,n.fontFamily)}function rfe(n,e,t,i,s){return`${n} normal ${e} ${t}px / ${i}px ${s}`}class ofe{constructor(e,t,i,s){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=s}paste(e,t,i,s){this.commandDelegate.paste(e,t,i,s)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,s){this.commandDelegate.compositionType(e,t,i,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Xi.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):e.mouseDownCount===2?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,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){Xi.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){Xi.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Xi.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Xi.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){Xi.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){Xi.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){Xi.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){Xi.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){Xi.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){Xi.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){Xi.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){Xi.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){Xi.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class ML{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown&&this.onKeyDown(e)}emitKeyUp(e){this.onKeyUp&&this.onKeyUp(e)}emitContextMenu(e){this.onContextMenu&&this.onContextMenu(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove&&this.onMouseMove(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave&&this.onMouseLeave(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown&&this.onMouseDown(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp&&this.onMouseUp(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag&&this.onMouseDrag(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop&&this.onMouseDrop(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled&&this.onMouseDropCanceled()}emitMouseWheel(e){this.onMouseWheel&&this.onMouseWheel(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return ML.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){return new afe(e.element,e.type,e.mouseColumn,e.position?t.convertViewPositionToModelPosition(e.position):null,e.range?t.convertViewRangeToModelRange(e.range):null,e.detail)}}class afe{constructor(e,t,i,s,r,o){this.element=e,this.type=t,this.mouseColumn=i,this.position=s,this.range=r,this.detail=o}toString(){return ha.toString(this)}}var Yk;class Tz{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),s=this.getEndLineNumber();if(ts)return null;let r=0,o=0;for(let l=i;l<=s;l++){const u=l-this._rendLineNumberStart;e<=l&&l<=t&&(o===0?(r=u,o=1):o++)}if(e=i&&o<=s&&(this._lines[o-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,s=this.getStartLineNumber(),r=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=i,null;if(e>r)return null;if(i+e>r)return this._lines.splice(e-this._rendLineNumberStart,r-e+1);const o=[];for(let c=0;ci)continue;const l=Math.max(t,a.fromLineNumber),u=Math.min(i,a.toLineNumber);for(let h=l;h<=u;h++){const c=h-this._rendLineNumberStart;this._lines[c].onTokensChanged(),s=!0}}return s}}class Az{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Tz(()=>this._host.createVisibleLine())}_createDomNode(){const e=bt(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(129)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;it){const o=t,a=Math.min(i,r.rendLineNumberStart-1);o<=a&&(this._insertLinesBefore(r,o,a,s,t),r.linesLength+=a-o+1)}else if(r.rendLineNumberStart0&&(this._removeLinesBefore(r,o),r.linesLength-=o)}if(r.rendLineNumberStart=t,r.rendLineNumberStart+r.linesLength-1i){const o=Math.max(0,i-r.rendLineNumberStart+1),l=r.linesLength-1-o+1;l>0&&(this._removeLinesAfter(r,l),r.linesLength-=l)}return this._finishRendering(r,!1,s),r}_renderUntouchedLines(e,t,i,s,r){const o=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const u=o+l;a[l].layoutLine(u,s[u-r])}}_insertLinesBefore(e,t,i,s,r){const o=[];let a=0;for(let l=t;l<=i;l++)o[a++]=this.host.createVisibleLine();e.lines=o.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const l=e.lines[a];s[a]&&(l.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const s=document.createElement("div");Iu._ttPolicy&&(t=Iu._ttPolicy.createHTML(t)),s.innerHTML=t;for(let r=0;rn});Iu._sb=Yd(1e5);class Mz extends so{constructor(e){super(e),this._visibleLines=new Az(this),this.domNode=this._visibleLines.domNode,this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,s=t.length;i'),s.appendASCIIString(r),s.appendASCIIString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class ufe extends Mz{constructor(e){super(e);const i=this._context.configuration.options.get(129);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(129);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class hfe extends Mz{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Bn.applyFontInfo(this.domNode,t.get(43))}onConfigurationChanged(e){const t=this._context.configuration.options;Bn.applyFontInfo(this.domNode,t.get(43));const i=t.get(129);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class d_{constructor(e,t){this._coordinateBrand=void 0,this.top=e,this.left=t}}class cfe extends so{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=bt(document.createElement("div")),Pl.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=bt(document.createElement("div")),Pl.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onLineMappingChanged(e);return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}addWidget(e){const t=new dfe(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i){this._widgets[e.getId()].setPosition(t,i),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const i=this._widgets[t];delete this._widgets[t];const s=i.domNode.domNode;s.parentNode.removeChild(s),s.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class dfe{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=bt(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const s=this._context.configuration.options,r=s.get(129);this._fixedOverflowWidgets=s.get(36),this._contentWidth=r.contentWidth,this._contentLeft=r.contentLeft,this._lineHeight=s.get(58),this._range=null,this._viewRange=null,this._preference=[],this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(58),e.hasChanged(129)){const i=t.get(129);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}onLineMappingChanged(e){this._setPosition(this._range)}_setPosition(e){if(this._range=e,this._viewRange=null,this._range){const t=this._context.model.validateModelRange(this._range);(this._context.model.coordinatesConverter.modelPositionIsVisible(t.getStartPosition())||this._context.model.coordinatesConverter.modelPositionIsVisible(t.getEndPosition()))&&(this._viewRange=this._context.model.coordinatesConverter.convertModelRangeToViewRange(t))}}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:this._contentWidth}setPosition(e,t){this._setPosition(e),this._preference=t,this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1}_layoutBoxInViewport(e,t,i,s,r){const o=e.top,a=o,l=t.top+this._lineHeight,u=r.viewportHeight-l,h=o-s,c=a>=s,f=l,g=u>=s;let m=e.left,v=t.left;return m+i>r.scrollLeft+r.viewportWidth&&(m=r.scrollLeft+r.viewportWidth-i),v+i>r.scrollLeft+r.viewportWidth&&(v=r.scrollLeft+r.viewportWidth-i),mo){const l=a-(o-s);a-=l,i-=l}if(a=S,y=h+s<=c.height-w;return this._fixedOverflowWidgets?{fitsAbove:b,aboveTop:Math.max(u,S),aboveLeft:g,fitsBelow:y,belowTop:h,belowLeft:v}:{fitsAbove:b,aboveTop:o,aboveLeft:f,fitsBelow:y,belowTop:a,belowLeft:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new d_(e.top,e.left+this._contentLeft)}_getTopAndBottomLeft(e){if(!this._viewRange)return[null,null];const t=e.linesVisibleRangesForRange(this._viewRange,!1);if(!t||t.length===0)return[null,null];let i=t[0],s=t[0];for(const c of t)c.lineNumbers.lineNumber&&(s=c);let r=1073741824;for(const c of i.ranges)c.lefte.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&Xk(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&Xk(this._actual.afterRender,this._actual,this._renderData.position)}}function Xk(n,e,...t){try{return n.call(e,...t)}catch{return null}}let eT=!0;class Rz extends Dm{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._renderLineHighlight=t.get(84),this._renderLineHighlightOnlyWhenFocus=t.get(85),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Oe(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=eT?this._selections.slice(0,1):this._selections,i=t.map(r=>r.positionLineNumber);i.sort((r,o)=>r-o),xl(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const s=t.every(r=>r.isEmpty());return this._selectionIsEmpty!==s&&(this._selectionIsEmpty=s,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(129);return this._lineHeight=t.get(58),this._renderLineHighlight=t.get(84),this._renderLineHighlightOnlyWhenFocus=t.get(85),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=this._renderOne(e),i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=this._cursorLineNumbers.length;let o=0;const a=[];for(let l=i;l<=s;l++){const u=l-i;for(;o=this._renderData.length?"":this._renderData[i]}}class ffe extends Rz{_renderOne(e){return`
`}_shouldRenderThis(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderOther(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class gfe extends Rz{_renderOne(e){return`
`}_shouldRenderMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderThis(){return!0}_shouldRenderOther(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}ni((n,e)=>{eT=!1;const t=n.getColor(Aae);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(AB)){const i=n.getColor(AB);i&&(eT=!0,e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),n.type==="hc"&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class pfe extends Dm{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let l=0,u=t.length;l{if(l.options.zIndexu.options.zIndex)return 1;const h=l.options.className,c=u.options.className;return hc?1:M.compareRangesUsingStarts(l.range,u.range)});const r=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,a=[];for(let l=r;l<=o;l++){const u=l-r;a[u]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=String(this._lineHeight),r=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',c=Math.max(u.range.startLineNumber,r),f=Math.min(u.range.endLineNumber,o);for(let g=c;g<=f;g++){const m=g-r;i[m]+=h}}}_renderNormalDecorations(e,t,i){const s=String(this._lineHeight),r=e.visibleRange.startLineNumber;let o=null,a=!1,l=null;for(let u=0,h=t.length;u';a[f]+=S}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class mfe extends so{constructor(e,t,i,s){super(e);const r=this._context.configuration.options,o=r.get(91),a=r.get(66),l=r.get(34),u=r.get(94),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+mS(e.theme.type),useShadows:!1,lazyRender:!0,vertical:o.vertical,horizontal:o.horizontal,verticalHasArrows:o.verticalHasArrows,horizontalHasArrows:o.horizontalHasArrows,verticalScrollbarSize:o.verticalScrollbarSize,verticalSliderSize:o.verticalSliderSize,horizontalScrollbarSize:o.horizontalScrollbarSize,horizontalSliderSize:o.horizontalSliderSize,handleMouseWheel:o.handleMouseWheel,alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel,arrowSize:o.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:u,scrollByPage:o.scrollByPage};this.scrollbar=this._register(new I2(t.domNode,h,this._context.viewLayout.getScrollable())),Pl.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=bt(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const c=(f,g,m)=>{const v={};if(g){const S=f.scrollTop;S&&(v.scrollTop=this._context.viewLayout.getCurrentScrollTop()+S,f.scrollTop=0)}if(m){const S=f.scrollLeft;S&&(v.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+S,f.scrollLeft=0)}this._context.model.setScrollPosition(v,1)};this._register(ne(i.domNode,"scroll",f=>c(i.domNode,!0,!0))),this._register(ne(t.domNode,"scroll",f=>c(t.domNode,!0,!1))),this._register(ne(s.domNode,"scroll",f=>c(s.domNode,!0,!1))),this._register(ne(this.scrollbarDomNode.domNode,"scroll",f=>c(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(129);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(64).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarMouseDown(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)}onConfigurationChanged(e){if(e.hasChanged(91)||e.hasChanged(66)||e.hasChanged(34)){const t=this._context.configuration.options,i=t.get(91),s=t.get(66),r=t.get(34),o=t.get(94),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:r,scrollPredominantAxis:o};this.scrollbar.updateOptions(a)}return e.hasChanged(129)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+mS(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}ni((n,e)=>{const t=n.getColor(lb);t&&e.addRule(` + .monaco-scrollable-element > .shadow.top { + box-shadow: ${t} 0 6px 6px -6px inset; + } + + .monaco-scrollable-element > .shadow.left { + box-shadow: ${t} 6px 0 6px -6px inset; + } + + .monaco-scrollable-element > .shadow.top.left { + box-shadow: ${t} 6px 6px 6px -6px inset; + } + `);const i=n.getColor(ov);i&&e.addRule(` + .monaco-scrollable-element > .scrollbar > .slider { + background: ${i}; + } + `);const s=n.getColor(av);s&&e.addRule(` + .monaco-scrollable-element > .scrollbar > .slider:hover { + background: ${s}; + } + `);const r=n.getColor(lv);r&&e.addRule(` + .monaco-scrollable-element > .scrollbar > .slider.active { + background: ${r}; + } + `)});class GS{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class Z2 extends Dm{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const l=a-e;s[l]=[]}if(i.length===0)return s;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.className',u=[];for(let h=t;h<=i;h++){const c=h-t,f=s[c];f.length===0?u[c]="":u[c]='
=this._renderResult.length?"":this._renderResult[i]}}class vfe extends Dm{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(130),s=t.get(43);this._lineHeight=t.get(58),this._spaceWidth=s.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*s.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(130),s=t.get(43);return this._lineHeight=t.get(58),this._spaceWidth=s.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*s.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(13),!0}onCursorStateChanged(e){var t;const s=e.selections[0].getPosition();return!((t=this._primaryPosition)===null||t===void 0)&&t.equals(s)?!1:(this._primaryPosition=s,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,s,r;if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}const o=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,l=e.scrollWidth,u=this._lineHeight,h=this._primaryPosition,c=this.getGuidesByLine(o,a,h),f=[];for(let g=o;g<=a;g++){const m=g-o,v=c[m];let S="";const w=(i=(t=e.visibleRangeForPosition(new G(g,1)))===null||t===void 0?void 0:t.left)!==null&&i!==void 0?i:0;for(const b of v){const y=w+(b.visibleColumn-1)*this._spaceWidth;if(y>l||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const L=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",E=b.horizontalLine?((r=(s=e.visibleRangeForPosition(new G(g,b.horizontalLine.endColumn)))===null||s===void 0?void 0:s.left)!==null&&r!==void 0?r:y+this._spaceWidth)-y:this._spaceWidth;S+=`
`}f[m]=S}this._renderResult=f}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.model.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Id.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?Id.EnabledForActive:Id.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,r=this._bracketPairGuideOptions.indentation?this._context.model.getLinesIndentGuides(e,t):null;let o=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation&&i){const c=this._context.model.getActiveIndentGuide(i.lineNumber,e,t);o=c.startLineNumber,a=c.endLineNumber,l=c.indent}const{indentSize:u}=this._context.model.getTextModelOptions(),h=[];for(let c=e;c<=t;c++){const f=new Array;h.push(f);const g=s?s[c-e]:[],m=new tv(g),v=r?r[c-e]:[];for(let S=1;S<=v;S++){const w=(S-1)*u+1,b=g.length===0&&o<=c&&c<=a&&S===l;f.push(...m.takeWhile(L=>L.visibleColumn!0)||[])}return h}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function lw(n){if(!(n&&n.isTransparent()))return n}ni((n,e)=>{const t=n.getColor(_L);t&&e.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 ${t} inset; }`);const i=n.getColor(vL)||t;i&&e.addRule(`.monaco-editor .lines-content .core-guide-indent-active { box-shadow: 1px 0 0 0 ${i} inset; }`);const s=[{bracketColor:CH,guideColor:Xae,guideColorActive:nle},{bracketColor:wH,guideColor:Qae,guideColorActive:sle},{bracketColor:SH,guideColor:Jae,guideColorActive:rle},{bracketColor:yH,guideColor:ele,guideColorActive:ole},{bracketColor:LH,guideColor:tle,guideColorActive:ale},{bracketColor:DH,guideColor:ile,guideColorActive:lle}],r=new kH;let o=s.map(a=>{var l,u;const h=n.getColor(a.bracketColor),c=n.getColor(a.guideColor),f=n.getColor(a.guideColorActive),g=lw((l=lw(c))!==null&&l!==void 0?l:h?.transparent(.3)),m=lw((u=lw(f))!==null&&u!==void 0?u:h);if(!(!g||!m))return{guideColor:g,guideColorActive:m}}).filter(ete);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${r.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${r.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${r.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${r.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}});class bfe{constructor(){this._currentVisibleRange=new M(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Cfe{constructor(e,t,i,s,r,o){this.lineNumber=e,this.startColumn=t,this.endColumn=i,this.startScrollTop=s,this.stopScrollTop=r,this.scrollType=o,this.type="range",this.minLineNumber=e,this.maxLineNumber=e}}class wfe{constructor(e,t,i,s){this.selections=e,this.startScrollTop=t,this.stopScrollTop=i,this.scrollType=s,this.type="selections";let r=e[0].startLineNumber,o=e[0].endLineNumber;for(let a=1,l=e.length;a{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new mi(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new bfe,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new ml(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(130)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(43),s=t.get(130);return this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(88),this._cursorSurroundingLines=t.get(25),this._cursorSurroundingLinesStyle=t.get(26),this._canUseLayerHinting=!t.get(28),Bn.applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(129)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new C3(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let r=i;r<=s;r++)this._visibleLines.getVisibleLine(r).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let r=t;r<=i;r++)s=this._visibleLines.getVisibleLine(r).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Cfe(e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new wfe(e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.model.setScrollPosition(i,r),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.model.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.model.getLineCount())return null;if(this._context.model.getLineMaxColumn(s)===1)return new G(s,1);const r=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(so)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(s,e,t);const l=this._context.model.getLineMinColumn(s);return ai?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=M.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;let r=[],o=0;const a=new b3(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new G(s.startLineNumber,1)).lineNumber);const u=this._visibleLines.getStartLineNumber(),h=this._visibleLines.getEndLineNumber();for(let c=s.startLineNumber;c<=s.endLineNumber;c++){if(ch)continue;const f=c===s.startLineNumber?s.startColumn:1,g=c===s.endLineNumber?s.endColumn:this._context.model.getLineMaxColumn(c),m=this._visibleLines.getVisibleLine(c).getVisibleRangesForRange(c,f,g,a);if(!!m){if(t&&cthis._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,new b3(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Tde(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,r=!0;for(let o=t;o<=i;o++){const a=this._visibleLines.getVisibleLine(o);if(e&&!a.getWidthIsFast()){r=!1;continue}s=Math.max(s,a.getWidth())}return r&&t===1&&i===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),r}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let r=i;r<=s;r++){const o=this._visibleLines.getVisibleLine(r);if(o.needsMonospaceFontCheck()){const a=o.getWidth();a>t&&(t=a,e=r)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let r=i;r<=s;r++)this._visibleLines.getVisibleLine(r).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(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){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.model.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),Ns&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let r=i;r<=s;r++)if(this._visibleLines.getVisibleLine(r).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let m=s[0].startLineNumber,v=s[0].endLineNumber;for(let S=1,w=s.length;Sa){if(!u)return-1;g=h}else if(r===5||r===6)if(r===6&&o<=h&&c<=l)g=o;else{const m=Math.max(5*this._lineHeight,a*.2),v=h-m,S=c-a;g=Math.max(S,v)}else if(r===1||r===2)if(r===2&&o<=h&&c<=l)g=o;else{const m=(h+c)/2;g=Math.max(0,m-a/2)}else g=this._computeMinimumScrolling(o,l,h,c,r===3,r===4);return g}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=t.left,s=i+t.width;let r=1073741824,o=0;if(e.type==="range"){const l=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!l)return null;for(const u of l.ranges)r=Math.min(r,Math.round(u.left)),o=Math.max(o,Math.round(u.left+u.width))}else for(const l of e.selections){if(l.startLineNumber!==l.endLineNumber)return null;const u=this._visibleRangesForLineRange(l.startLineNumber,l.startColumn,l.endColumn);if(!u)return null;for(const h of u.ranges)r=Math.min(r,Math.round(h.left)),o=Math.max(o,Math.round(h.left+h.width))}return r=Math.max(0,r-RL.HORIZONTAL_EXTRA_PX),o+=this._revealHorizontalRightPadding,e.type==="selections"&&o-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(i,s,r,o),maxHorizontalOffset:o}}_computeMinimumScrolling(e,t,i,s,r,o){e=e|0,t=t|0,i=i|0,s=s|0,r=!!r,o=!!o;const a=t-e;if(s-it)return Math.max(0,s-a)}else return i;return e}}RL.HORIZONTAL_EXTRA_PX=30;class Sfe extends Z2{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(129);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(129);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let r=0,o=t.length;r
',l=[];for(let u=t;u<=i;u++){const h=u-t,c=s[h];let f="";for(let g=0,m=c.length;g';r[a]=u}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class jr{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=jr._clamp(e),this.g=jr._clamp(t),this.b=jr._clamp(i),this.a=jr._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}jr.Empty=new jr(0,0,0,0);class db extends ie{constructor(){super(),this._onDidChange=new H,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Ii.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}static getInstance(){return this._INSTANCE||(this._INSTANCE=new db),this._INSTANCE}_updateColorMap(){const e=Ii.getColorMap();if(!e){this._colors=[jr.Empty],this._backgroundIsLight=!0;return}this._colors=[jr.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}db._INSTANCE=null;class S3{constructor(e,t,i,s){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=s|0}}class Lfe{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e,t){const i=this.outputLineIndex>0?t:0;return new G(e+this.outputLineIndex,i+this.outputOffset+1)}}class pv{constructor(e,t,i,s,r){this.breakOffsets=e,this.breakOffsetsVisibleColumn=t,this.wrappedTextIndentLength=i,this.injectionOffsets=s,this.injectionOptions=r}getInputOffsetOfOutputPosition(e,t){let i=0;if(e===0?i=t:i=this.breakOffsets[e-1]+t,this.injectionOffsets!==null)for(let s=0;sthis.injectionOffsets[s];s++)i0?this.breakOffsets[r-1]:0,t===0)if(e<=o)s=r-1;else if(e>a)i=r+1;else break;else if(e=a)i=r+1;else break}return new Lfe(r,e-o)}outputPositionToOffsetInUnwrappedLine(e,t){let i=(e>0?this.breakOffsets[e-1]:0)+t;return e>0&&(i-=this.wrappedTextIndentLength),i}normalizeOffsetAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2)return e===i.offsetInUnwrappedLine+i.length?i.offsetInUnwrappedLine+i.length:i.offsetInUnwrappedLine;if(t===1){let o=i.offsetInUnwrappedLine+i.length,a=i.injectedTextIndex;for(;a+1=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)s-=this.injectionOptions[r-1].content.length,r++;return s}getInjectedText(e,t){const i=this.outputPositionToOffsetInUnwrappedLine(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let r=0;re)break;if(e<=l)return{injectedTextIndex:r,offsetInUnwrappedLine:a,length:o};s+=o}}}}class Dfe{constructor(e,t){this.tabSize=e,this.data=t}}class Y2{constructor(e,t,i,s,r,o,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=s,this.startVisibleColumn=r,this.tokens=o,this.inlineDecorations=a}}class Dr{constructor(e,t,i,s,r,o,a,l,u,h){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=s,this.isBasicASCII=Dr.isBasicASCII(i,o),this.containsRTL=Dr.containsRTL(i,this.isBasicASCII,r),this.tokens=a,this.inlineDecorations=l,this.tabSize=u,this.startVisibleColumn=h}static isBasicASCII(e,t){return t?BR(e):!0}static containsRTL(e,t,i){return!t&&i?Zy(e):!1}}class mv{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class xfe{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new mv(new M(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Oz{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class Pz{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static cmp(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}}const kfe=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),Efe=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:96-1:n);class _0{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=_0.soften(e,12/15),this.charDataLight=_0.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let s=0,r=e.length;se.width||i+m>e.height){console.warn("bad render request outside image data");return}const v=h?this.charDataLight:this.charDataNormal,S=Efe(s,u),w=e.width*4,b=a.r,y=a.g,L=a.b,E=r.r-b,I=r.g-y,x=r.b-L,k=Math.max(o,l),A=e.data;let z=S*f*g,V=i*w+t*4;for(let Q=0;Qe.width||i+c>e.height){console.warn("bad render request outside image data");return}const f=e.width*4,g=.5*(r/255),m=o.r,v=o.g,S=o.b,w=s.r-m,b=s.g-v,y=s.b-S,L=m+w*g,E=v+b*g,I=S+y*g,x=Math.max(r,a),k=e.data;let A=i*f+t*4;for(let z=0;z{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=y3[n[t]]<<4|y3[n[t+1]]&15;return e},D3={1:Kd(()=>L3("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:Kd(()=>L3("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class _v{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return D3[e]?i=new _0(D3[e](),e):i=_v.createFromSampleData(_v.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height=`${16}px`,t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold ${16}px ${e}`,i.textBaseline="middle";let s=0;for(const r of kfe)i.fillText(String.fromCharCode(r),s,16/2),s+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");let s=_v._downsample(e,t);return new _0(s,t)}static _downsampleChar(e,t,i,s,r){const o=1*r,a=2*r;let l=s,u=0;for(let h=0;h0){const u=255/l;for(let h=0;h_v.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=v0._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=v0._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Sae);return i?new jr(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(yae);return t?jr._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.showSlider===e.showSlider&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class vv{constructor(e,t,i,s,r,o,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=r,this.sliderHeight=o,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}static create(e,t,i,s,r,o,a,l,u,h,c){const f=e.pixelRatio,g=e.minimapLineHeight,m=Math.floor(e.canvasInnerHeight/g),v=e.lineHeight;if(e.minimapHeightIsEditorHeight){const E=l*e.lineHeight+(e.scrollBeyondLastLine?r-e.lineHeight:0),I=Math.max(1,Math.floor(r*r/E)),x=Math.max(0,e.minimapHeight-I),k=x/(h-r),A=u*k,z=x>0,V=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new vv(u,h,z,k,A,I,1,Math.min(a,V))}let S;if(o&&i!==a){const E=i-t+1;S=Math.floor(E*g/f)}else{const E=r/v;S=Math.floor(E*g/f)}let w;e.scrollBeyondLastLine?w=(a-1)*g/f:w=Math.max(0,a*g/f-S),w=Math.min(e.minimapHeight-S,w);const b=w/(h-r),y=u*b;let L=0;if(e.scrollBeyondLastLine&&(L=r/v-1),m>=a+L){const I=a,x=w>0;return new vv(u,h,x,b,y,S,1,I)}else{let E=Math.max(1,Math.floor(t-y*f/g));c&&c.scrollHeight===h&&(c.scrollTop>u&&(E=Math.min(E,c.startLineNumber)),c.scrollTopqS.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,r=i.length;s1){for(let L=0,E=a-1;L0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let r=this.minimapLines.length-1;r>=0&&!(this.minimapLines[r]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=b0.compute(this.options,this._context.model.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.model.getLineCount()}getRealLineCount(){return this._context.model.getLineCount()}getLineContent(e){return this._samplingState?this._context.model.getLineContent(this._samplingState.minimapLines[e-1]):this._context.model.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.model.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.model.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){let s=[];for(let r=0,o=t-e+1;r{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.leftButton&&this._lastRenderData){const u=bn(this._slider.domNode),h=u.top+u.height/2;this._startSliderDragging(i.buttons,i.posx,h,i.posy,this._lastRenderData.renderedLayout)}return}const r=this._model.options.minimapLineHeight,o=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.browserEvent.offsetY;let l=Math.floor(o/r)+this._lastRenderData.renderedLayout.startLineNumber;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderMouseMoveMonitor=new If,this._sliderMouseDownListener=qi(this._slider.domNode,"mousedown",i=>{i.preventDefault(),i.stopPropagation(),i.leftButton&&this._lastRenderData&&this._startSliderDragging(i.buttons,i.posx,i.posy,i.posy,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Tt.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ne(this._domNode.domNode,qt.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=ne(this._domNode.domNode,qt.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=qi(this._domNode.domNode,qt.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i,s,r){this._slider.toggleClassName("active",!0);const o=(a,l)=>{const u=Math.abs(l-t);if(Pn&&u>Ife){this._model.setScrollTop(r.scrollTop);return}const h=a-i;this._model.setScrollTop(r.getDesiredScrollTopFromDelta(h))};s!==i&&o(s,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,Sm,a=>o(a.posy,a.posx),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){return this._model.options.showSlider==="always"?"minimap slider-always":"minimap slider-mouseover"}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new X2(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(IB),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=vv.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(M.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((f,g)=>(f.options.zIndex||0)-(g.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:r}=this._model.options,o=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,u=this._decorationsCanvas.domNode.getContext("2d");u.clearRect(0,0,s,r);const h=new k3(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(u,t,h,e,o),this._renderDecorationsLineHighlights(u,i,h,e,o);const c=new k3(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(u,t,c,e,o,l,a,s),this._renderDecorationsHighlights(u,i,c,e,o,l,a,s)}}_renderSelectionLineHighlights(e,t,i,s,r){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let o=0,a=0;for(const l of t){const u=Math.max(s.startLineNumber,l.startLineNumber),h=Math.min(s.endLineNumber,l.endLineNumber);if(u>h)continue;for(let g=u;g<=h;g++)i.set(g,!0);const c=(u-s.startLineNumber)*r,f=(h-s.startLineNumber)*r+r;a>=c||(a>o&&e.fillRect(bh,o,e.canvas.width,a-o),o=c),a=f}a>o&&e.fillRect(bh,o,e.canvas.width,a-o)}_renderDecorationsLineHighlights(e,t,i,s,r){const o=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],u=l.options.minimap;if(!u||u.position!==Dl.Inline)continue;const h=Math.max(s.startLineNumber,l.range.startLineNumber),c=Math.min(s.endLineNumber,l.range.endLineNumber);if(h>c)continue;const f=u.getColor(this._theme);if(!f||f.isTransparent())continue;let g=o.get(f.toString());g||(g=f.transparent(.5).toString(),o.set(f.toString(),g)),e.fillStyle=g;for(let m=h;m<=c;m++){if(i.has(m))continue;i.set(m,!0);const v=(h-s.startLineNumber)*r;e.fillRect(bh,v,e.canvas.width,r)}}}_renderSelectionsHighlights(e,t,i,s,r,o,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const u of t){const h=Math.max(s.startLineNumber,u.startLineNumber),c=Math.min(s.endLineNumber,u.endLineNumber);if(!(h>c))for(let f=h;f<=c;f++)this.renderDecorationOnLine(e,i,u,this._selectionColor,s,f,r,r,o,a,l)}}_renderDecorationsHighlights(e,t,i,s,r,o,a,l){for(const u of t){const h=u.options.minimap;if(!h)continue;const c=Math.max(s.startLineNumber,u.range.startLineNumber),f=Math.min(s.endLineNumber,u.range.endLineNumber);if(c>f)continue;const g=h.getColor(this._theme);if(!(!g||g.isTransparent()))for(let m=c;m<=f;m++)switch(h.position){case Dl.Inline:this.renderDecorationOnLine(e,i,u.range,g,s,m,r,r,o,a,l);continue;case Dl.Gutter:const v=(m-s.startLineNumber)*r,S=2;this.renderDecoration(e,g,S,v,Nfe,r);continue}}}renderDecorationOnLine(e,t,i,s,r,o,a,l,u,h,c){const f=(o-r.startLineNumber)*l;if(f+a<0||f>this._model.options.canvasInnerHeight)return;const{startLineNumber:g,endLineNumber:m}=i,v=g===o?i.startColumn:1,S=m===o?i.endColumn:this._model.getLineMaxColumn(o),w=this.getXOffsetForPosition(t,o,v,u,h,c),b=this.getXOffsetForPosition(t,o,S,u,h,c);this.renderDecoration(e,s,w,f,b-w,a)}getXOffsetForPosition(e,t,i,s,r,o){if(i===1)return bh;if((i-1)*r>=o)return o;let l=e.get(t);if(!l){const u=this._model.getLineContent(t);l=[bh];let h=bh;for(let c=1;c=o){l[c]=o;break}l[c]=m,h=m}e.set(t,l)}return i-1E?Math.floor((s-E)/2):0,x=f.a/255,k=new jr(Math.round((f.r-c.r)*x+c.r),Math.round((f.g-c.g)*x+c.g),Math.round((f.b-c.b)*x+c.b),255);let A=0;const z=[];for(let Se=0,Ie=i-t+1;Se=0&&zb)return;const Q=S.charCodeAt(E);if(Q===9){const ee=f-(E+I)%f;I+=ee-1,L+=ee*o}else if(Q===32)L+=o;else{const ee=Sa(Q)?2:1;for(let Ce=0;Ceb)return}}}}}class k3{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,r=this._endLineNumber-this._startLineNumber+1;sthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}ni((n,e)=>{const t=n.getColor(Lae);t&&e.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${t}; }`);const i=n.getColor(Dae);i&&e.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${i}; }`);const s=n.getColor(xae);s&&e.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${s}; }`);const r=n.getColor(lb);r&&e.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${r} -6px 0 6px -6px inset; }`)});class Afe extends so{constructor(e){super(e);const i=this._context.configuration.options.get(129);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=bt(document.createElement("div")),Pl.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(129);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=bt(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()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?!1:(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.parentNode.removeChild(s),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(e.preference===null){t.unsetTop();return}if(e.preference===0)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(e.preference===1){const i=t.domNode.clientHeight;t.setTop(this._editorHeight-i-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else e.preference===2&&(t.setTop(0),t.domNode.style.right="50%")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let i=0,s=t.length;i=3){const r=Math.floor(s/3),o=Math.floor(s/3),a=s-r-o,l=e,u=l+r,h=l+r+a;return[[0,l,u,l,h,l,u,l],[0,r,a,r+a,o,r+a+o,a+o,r+a+o]]}else if(i===2){const r=Math.floor(s/2),o=s-r,a=e,l=a+r;return[[0,a,a,a,l,a,a,a],[0,r,r,r,o,r+o,r+o,r+o]]}else{const r=e,o=s;return[[0,r,r,r,r,r,r,r],[0,o,o,o,o,o,o,o]]}}equals(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}}class Rfe extends so{constructor(e){super(e),this._domNode=bt(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=Ii.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Mfe(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(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)}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;tt&&(V=t-u),k=V-u,A=V+u}k>b+1||E!==S?(y!==0&&h.fillRect(c[S],w,f[S],b-w),S=E,w=k,b=A):A>b&&(b=A)}h.fillRect(c[S],w,f[S],b-w)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,m=g/2|0,v=this._settings.x[7],S=this._settings.w[7];h.fillStyle=this._settings.cursorColor;let w=-100,b=-100;for(let y=0,L=this._cursorPositions.length;yt&&(I=t-m);const x=I-m,k=x+g;x>b+1?(y!==0&&h.fillRect(v,w,S,b-w),w=x,b=k):k>b&&(b=k)}h.fillRect(v,w,S,b-w)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,t),h.stroke(),h.moveTo(0,0),h.lineTo(e,0),h.stroke())}}class E3{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class C0{constructor(e,t,i){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.color=i,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.colori&&(g=i-m);const v=h.color;let S=this._color2Id[v];S||(S=++this._lastAssignedId,this._color2Id[v]=S,this._id2Color[S]=v);const w=new E3(g-m,g+m,S);h.setColorZone(w),a.push(w)}return this._colorZonesInvalid=!1,a.sort(E3.compare),a}}class Pfe extends cb{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=bt(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Ofe(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(58)),this._zoneManager.setPixelRatio(i.get(127)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(58)&&(this._zoneManager.setLineHeight(t.get(58)),this._render()),e.hasChanged(127)&&(this._zoneManager.setPixelRatio(t.get(127)),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}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,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())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),r=this._domNode.domNode.getContext("2d");return r.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(r,i,s,e),!0}_renderOneLane(e,t,i,s){let r=0,o=0,a=0;for(const l of t){const u=l.colorId,h=l.from,c=l.to;u!==r?(e.fillRect(0,o,s,a-o),r=u,e.fillStyle=i[r],o=h,a=c):a>=h?a=Math.max(a,c):(e.fillRect(0,o,s,a-o),o=h,a=c)}e.fillRect(0,o,s,a-o)}}class Ffe extends so{constructor(e){super(e),this.domNode=bt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=bt(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(r),this.domNode.appendChild(a),this._renderedRulers.push(a),o--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t{const t=n.getColor(Wae);t&&e.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${t} inset; }`)});class Bfe extends so{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const i=this._context.configuration.options.get(91);this._useShadows=i.useShadows,this._domNode=bt(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(129);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.minimap.minimapWidth-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(91);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}ni((n,e)=>{const t=n.getColor(lb);t&&e.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${t} 0 6px 6px -6px inset; }`)});class Wfe{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Vfe{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Hfe(n){return new Wfe(n)}function zfe(n){return new Vfe(n.lineNumber,n.ranges.map(Hfe))}class gi extends Dm{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(58),this._roundedSelection=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(58),this._roundedSelection=t.get(89),this._typicalHalfwidthCharacterWidth=t.get(43).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let r=null,o=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let u=0;!r&&u=0;u--)i[u].lineNumber===l&&(o=i[u].ranges[0]);r&&!r.startStyle&&(r=null),o&&!o.startStyle&&(o=null)}for(let a=0,l=t.length;a0){const m=t[a-1].ranges[0].left,v=t[a-1].ranges[0].left+t[a-1].ranges[0].width;uw(h-m)m&&(f.top=1),uw(c-v)'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const r=!!s[0].ranges[0].startStyle,o=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=s[0].lineNumber,u=s[s.length-1].lineNumber;for(let h=0,c=s.length;h1,u)}this._previousFrameVisibleRangesWithStyle=r,this._renderResult=t.map(([o,a])=>o+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}gi.SELECTION_CLASS_NAME="selected-text";gi.SELECTION_TOP_LEFT="top-left-radius";gi.SELECTION_BOTTOM_LEFT="bottom-left-radius";gi.SELECTION_TOP_RIGHT="top-right-radius";gi.SELECTION_BOTTOM_RIGHT="bottom-right-radius";gi.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";gi.ROUNDED_PIECE_WIDTH=10;ni((n,e)=>{const t=n.getColor(nc);t&&e.addRule(`.monaco-editor .focused .selected-text { background-color: ${t}; }`);const i=n.getColor(b2);i&&e.addRule(`.monaco-editor .selected-text { background-color: ${i}; }`);const s=n.getColor(koe);s&&!s.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${s}; }`)});function uw(n){return n<0?-n:n}class I3{constructor(e,t,i,s,r,o){this.top=e,this.left=t,this.width=i,this.height=s,this.textContent=r,this.textContentClassName=o}}class N3{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(43);this._cursorStyle=t.get(24),this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=bt(document.createElement("div")),this._domNode.setClassName(`cursor ${Bd}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Bn.applyFontInfo(this._domNode,i),this._domNode.setDisplay("none"),this._position=new G(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(43);return this._cursorStyle=t.get(24),this._lineHeight=t.get(58),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),Bn.applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_prepareRender(e){let t="";if(this._cursorStyle===gn.Line||this._cursorStyle===gn.LineThin){const f=e.visibleRangeForPosition(this._position);if(!f||f.outsideRenderedLine)return null;let g;if(this._cursorStyle===gn.Line){if(g=A5(this._lineCursorWidth>0?this._lineCursorWidth:2),g>2){const S=this._context.model.getLineContent(this._position.lineNumber),w=fS(S,this._position.column-1);t=S.substr(this._position.column-1,w)}}else g=A5(1);let m=f.left;g>=2&&m>=1&&(m-=1);const v=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new I3(v,m,g,this._lineHeight,t,"")}const i=this._context.model.getLineContent(this._position.lineNumber),s=fS(i,this._position.column-1),r=e.linesVisibleRangesForRange(new M(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+s),!1);if(!r||r.length===0)return null;const o=r[0];if(o.outsideRenderedLine||o.ranges.length===0)return null;const a=o.ranges[0],l=a.width<1?this._typicalHalfwidthCharacterWidth:a.width;let u="";if(this._cursorStyle===gn.Block){const f=this._context.model.getViewLineData(this._position.lineNumber);t=i.substr(this._position.column-1,s);const g=f.tokens.findTokenIndexAtOffset(this._position.column-1);u=f.tokens.getClassName(g)}let h=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,c=this._lineHeight;return(this._cursorStyle===gn.Underline||this._cursorStyle===gn.UnderlineThin)&&(h+=this._lineHeight-2,c=2),new I3(h,a.left,l,c,t,u)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${Bd} ${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)}}class w0 extends so{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(80),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new N3(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=bt(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new Ms,this._cursorFlatBlinkInterval=new ib,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(80),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;it.length){const i=this._secondaryCursors.length-t.length;for(let s=0;s{for(let s=0,r=e.ranges.length;s{this._isVisible?this._hide():this._show()},w0.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},w0.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case gn.Line:e+=" cursor-line-style";break;case gn.Block:e+=" cursor-block-style";break;case gn.Underline:e+=" cursor-underline-style";break;case gn.LineThin:e+=" cursor-line-thin-style";break;case gn.BlockOutline:e+=" cursor-block-outline-style";break;case gn.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return this._cursorSmoothCaretAnimation&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=n.getColor(mH);if(t){let i=n.getColor(Fae);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),n.type==="hc"&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const Qk=()=>{throw new Error("Invalid change accessor")};class Ufe extends so{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(129);this._lineHeight=t.get(58),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=bt(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=bt(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.model.changeWhitespace(s=>{const r=Object.keys(this._zones);for(let o=0,a=r.length;o{const s={addZone:r=>(t=!0,this._addZone(i,r)),removeZone:r=>{!r||(t=this._removeZone(i,r)||t)},layoutZone:r=>{!r||(t=this._layoutZone(i,r)||t)}};$fe(e,s),s.addZone=Qk,s.removeZone=Qk,s.layoutZone=Qk}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:bt(t.domNode),marginDomNode:t.marginDomNode?bt(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,i.heightInPx),r.domNode.setPosition("absolute"),r.domNode.domNode.style.width="100%",r.domNode.setDisplay("none"),r.domNode.setAttribute("monaco-view-zone",r.whitespaceId),this.domNode.appendChild(r.domNode),r.marginDomNode&&(r.marginDomNode.setPosition("absolute"),r.marginDomNode.domNode.style.width="100%",r.marginDomNode.setDisplay("none"),r.marginDomNode.setAttribute("monaco-view-zone",r.whitespaceId),this.marginDomNode.appendChild(r.marginDomNode)),this._zones[r.whitespaceId]=r,this.setShouldRender(),r.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){Qe(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){Qe(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const o of t)this._zones[o.id].isInHiddenArea||(i[o.id]=o,s=!0);const r=Object.keys(this._zones);for(let o=0,a=r.length;o{this._context.theme.update(v),this._context.model.onDidColorThemeChange(),this.render(!0,!1)})),this._viewParts=[],this._textAreaHandler=new ife(this._context,a,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=bt(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=bt(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=bt(document.createElement("div")),Pl.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new mfe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new RL(this._context,this._linesContent),this._viewZones=new Ufe(this._context),this._viewParts.push(this._viewZones);const l=new Rfe(this._context);this._viewParts.push(l);const u=new Bfe(this._context);this._viewParts.push(u);const h=new ufe(this._context);this._viewParts.push(h),h.addDynamicOverlay(new ffe(this._context)),h.addDynamicOverlay(new gi(this._context)),h.addDynamicOverlay(new vfe(this._context)),h.addDynamicOverlay(new pfe(this._context));const c=new hfe(this._context);this._viewParts.push(c),c.addDynamicOverlay(new gfe(this._context)),c.addDynamicOverlay(new _fe(this._context)),c.addDynamicOverlay(new yfe(this._context)),c.addDynamicOverlay(new Sfe(this._context)),c.addDynamicOverlay(new Yp(this._context));const f=new of(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(c.getDomNode()),this._viewParts.push(f),this._contentWidgets=new cfe(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new w0(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Afe(this._context),this._viewParts.push(this._overlayWidgets);const g=new Ffe(this._context);this._viewParts.push(g);const m=new Tfe(this._context);if(this._viewParts.push(m),l){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(l.getDomNode(),v.insertBefore)}this._linesContent.appendChild(h.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(m.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),o?o.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new tfe(this._context,a,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Zde(e,t)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new G(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPositionRelativeToEditor:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new G(e,t)))}}_applyLayout(){const t=this._context.configuration.options.get(129);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(126)+" "+mS(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this._configPixelRatio=this._context.configuration.options.get(127),this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=R6(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){Zfe(()=>this._actualRender())}_getViewPartsToRender(){let e=[],t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!ER(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.model.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Gfe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.model);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const s=new Ide(this._context.viewLayout,i,this._viewLines);for(const r of e)r.prepareRender(s);for(const r of e)r.render(s),r.onDidRender();Math.abs(nS()-this._configPixelRatio)>.001&&this._context.configuration.updatePixelRatio()}delegateVerticalScrollbarMouseDown(e){this._scrollbar.delegateVerticalScrollbarMouseDown(e)}restoreState(e){this._context.model.setScrollPosition({scrollTop:e.scrollTop},1),this._context.model.tokenizeViewport(),this._renderNow(),this._viewLines.updateLineWidths(),this._context.model.setScrollPosition({scrollLeft:e.scrollLeft},1)}getOffsetForColumn(e,t){const i=this._context.model.validateModelPosition({lineNumber:e,column:t}),s=this._context.model.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const r=this._viewLines.visibleRangeForPosition(new G(s.lineNumber,s.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?ML.convertViewToModelMouseTarget(i,this._context.model.coordinatesConverter):null}createOverviewRuler(e){return new Pfe(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){let t=e.position&&e.position.range||null;if(t===null){const s=e.position?e.position.position:null;s!==null&&(t=new M(s.lineNumber,s.column,s.lineNumber,s.column))}const i=e.position?e.position.preference:null;this._contentWidgets.setWidgetPosition(e.widget,t,i),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}function Zfe(n){try{return n()}catch(e){Qe(e)}}class YS{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new cn(new M(1,1,1,1),0,new G(1,1),0),new cn(new M(1,1,1,1),0,new G(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){!this._trackSelection||(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new tt(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.getDirection()===0?new Oe(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new Oe(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),r=t.selectionStart.getEndPosition(),o=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,s,i,o),l=this._validatePositionWithCache(e,r,s,a);return i.equals(o)&&s.equals(a)&&r.equals(l)?t:new cn(M.fromPositions(a,l),t.selectionStartLeftoverVisibleColumns+s.column-a.column,o,t.leftoverVisibleColumns+i.column-o.column)}_setState(e,t,i){if(i&&(i=YS._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),r=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),a=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new cn(s,r,o,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),r=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new cn(s,i.selectionStartLeftoverVisibleColumns,r,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),r=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new cn(s,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new G(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),r=e.coordinatesConverter.convertModelPositionToViewPosition(new G(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),o=new M(s.lineNumber,s.column,r.lineNumber,r.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new cn(o,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class T3{constructor(e){this.context=e,this.primaryCursor=new YS(e),this.secondaryCursors=[],this.lastAddedCursorIndex=0}dispose(){this.primaryCursor.dispose(this.context),this.killSecondaryCursors()}startTrackingSelections(){this.primaryCursor.startTrackingSelection(this.context);for(let e=0,t=this.secondaryCursors.length;ei){let s=t-i;for(let r=0;r=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)}_getAll(){let e=[];e[0]=this.primaryCursor;for(let t=0,i=this.secondaryCursors.length;ti.selection.startLineNumber===s.selection.startLineNumber?i.selection.startColumn-s.selection.startColumn:i.selection.startLineNumber-s.selection.startLineNumber);for(let i=0;ic&&v.index--;e.splice(c,1),t.splice(h,1),this._removeSecondaryCursor(c-1),i--}}}}class Yfe{constructor(){this.type=0}}class Xfe{constructor(){this.type=1}}class Qfe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Jfe{constructor(e,t){this.type=3,this.selections=e,this.modelSelections=t}}class hg{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class hw{constructor(){this.type=5}}class ege{constructor(e){this.type=6,this.isFocused=e}}class tge{constructor(){this.type=7}}class cw{constructor(){this.type=8}}class Fz{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}}class tT{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class iT{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class g1{constructor(e,t,i,s,r,o){this.type=12,this.source=e,this.range=t,this.selections=i,this.verticalType=s,this.revealHorizontal=r,this.scrollType=o}}class ige{constructor(e){this.type=13,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}}class nge{constructor(){this.type=14}}class sge{constructor(e){this.type=15,this.ranges=e}}class rge{constructor(){this.type=16}}class oge{constructor(){this.type=17}}class age extends ie{constructor(){super(),this._onEvent=this._register(new H),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class lge{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class Q2{constructor(e,t,i,s){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}merge(e){return e.kind!==0?this:new Q2(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class J2{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}merge(e){return e.kind!==1?this:new J2(this.oldHasFocus,e.hasFocus)}}class eO{constructor(e,t,i,s,r,o,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=r,this.scrollLeft=o,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}merge(e){return e.kind!==2?this:new eO(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class A3{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class XS{constructor(e,t,i,s,r,o,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=r,this.reason=o,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let r=0;r=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class Xp extends ie{constructor(e,t,i,s){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new BB(this._model,this._viewModel,this._coordinatesConverter,s),this._cursors=new T3(this.context),this._hasFocus=!1,this._isHandling=!1,this._isDoingComposition=!1,this._selectionsWhenCompositionStarted=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=ct(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new BB(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){let e=this._cursors.getSelections();for(let t=0;tXp.MAX_CURSOR_COUNT&&(s=s.slice(0,Xp.MAX_CURSOR_COUNT),r=!0);const o=new Jk(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,o,r)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,s){const r=this._cursors.getViewPositions();if(r.length>1){this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),0,i,s);return}else{const o=r[0],a=new M(o.lineNumber,o.column,o.lineNumber,o.column);this._emitCursorRevealRange(e,t,a,null,0,i,s)}}_revealPrimaryCursor(e,t,i,s,r){const o=this._cursors.getViewPositions();if(o.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),i,s,r);else{const a=o[0],l=new M(a.lineNumber,a.column,a.lineNumber,a.column);this._emitCursorRevealRange(e,t,l,null,i,s,r)}}_emitCursorRevealRange(e,t,i,s,r,o,a){e.emitViewEvent(new g1(t,i,s,r,o,a))}saveState(){let e=[];const t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const s=tt.fromModelSelections(t.resultingSelection);this.setStates(e,"modelChange",t.isUndoing?5:t.isRedoing?6:2,s)&&this._revealPrimaryCursor(e,"modelChange",0,!0,0)}else{const s=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,tt.fromModelSelections(s))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:Mt.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:Mt.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,s){this.setStates(e,t,s,tt.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],s=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,r){const o=new Jk(this._model,this);if(o.equals(s))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new Jfe(l,a)),!s||s.cursorState.length!==o.cursorState.length||o.cursorState.some((u,h)=>!u.modelState.equals(s.cursorState[h].modelState))){const u=s?s.cursorState.map(c=>c.modelState.selection):null,h=s?s.modelVersionId:0;e.emitOutgoingEvent(new XS(u,a,h,o.modelVersionId,t||"keyboard",i,r))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let i=0,s=e.length;i=0)return null;const o=r.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const a=o[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const u=l[0].open,h=r.text.length-o[2].length-1,c=r.text.lastIndexOf(u,h-1);if(c===-1)return null;t.push([c,h])}return t}executeEdits(e,t,i,s){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(i)),r&&(i[0]._isTracked=!0);let o=[],a=[];const l=this._model.pushEditOperations(this.getSelections(),i,u=>{if(r)for(let c=0,f=r.length;c0&&this._pushAutoClosedAction(o,a)}_executeEdit(e,t,i,s=0){if(this.context.cursorConfig.readOnly)return;const r=new Jk(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(o){Qe(o)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,r,!1)&&this._revealPrimaryCursor(t,i,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}getAutoClosedCharacters(){return M3.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{t==="keyboard"&&(this._executeEditOperation(Ci.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),this.getAutoClosedCharacters())),this._selectionsWhenCompositionStarted=null)},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let r=0;for(;r{const u=l.getPosition();return new Oe(u.lineNumber,u.column+r,u.lineNumber,u.column+r)});this.setSelections(e,o,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Ci.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,r))},e,o)}paste(e,t,i,s,r){this._executeEdit(()=>{this._executeEditOperation(Ci.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,r,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Xd.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Hs(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Hs(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}Xp.MAX_CURSOR_COUNT=1e4;class hge{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(s,i);for(let o=0,a=s.trackedRanges.length;o0&&(o[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,o,u=>{let h=[];for(let g=0;gg.identifier.minor-m.identifier.minor;let f=[];for(let g=0;g0?(h[g].sort(c),f[g]=t[g].computeCursorState(e.model,{getInverseEditOperations:()=>h[g],getTrackedSelection:m=>{const v=parseInt(m,10),S=e.model._getTrackedRange(e.trackedRanges[v]);return e.trackedRangesDirection[v]===0?new Oe(S.startLineNumber,S.startColumn,S.endLineNumber,S.endColumn):new Oe(S.endLineNumber,S.endColumn,S.startLineNumber,S.startColumn)}})):f[g]=e.selectionsBefore[g];return f});a||(a=e.selectionsBefore);let l=[];for(let u in r)r.hasOwnProperty(u)&&l.push(parseInt(u,10));l.sort((u,h)=>h-u);for(const u of l)a.splice(u,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{M.isEmpty(c)&&f===""||s.push({identifier:{major:t,minor:r++},range:c,text:f,forceMoveMarkers:g,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const h={addEditOperation:o,addTrackedEditOperation:(c,f,g)=>{a=!0,o(c,f,g)},trackSelection:(c,f)=>{const g=Oe.liftSelection(c);let m;if(g.isEmpty())if(typeof f=="boolean")f?m=2:m=3;else{const w=e.model.getLineMaxColumn(g.startLineNumber);g.startColumn===w?m=2:m=3}else m=1;const v=e.trackedRanges.length,S=e.model._setTrackedRange(null,g,m);return e.trackedRanges[v]=S,e.trackedRangesDirection[v]=g.getDirection(),v.toString()}};try{i.getEditOperations(e.model,h)}catch(c){return Qe(c),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-M.compareRangesUsingEnds(i.range,s.range));let t={};for(let i=1;ir.identifier.major?o=s.identifier.major:o=r.identifier.major,t[o.toString()]=!0;for(let a=0;a0&&i--}}return t}}class Bz{constructor(e,t,i,s,r,o){this.id=e,this.label=t,this.alias=i,this._precondition=s,this._run=r,this._contextKeyService=o}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}function cge(n){return n&&typeof n.id=="string"}const OL={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},R3={getInitialState:()=>uL,tokenize2:(n,e,t,i)=>W9(0,n,t,i)};function Wz(n,e,t=R3){return fge(n,e,t||R3)}function dge(n,e,t,i,s,r,o){let a="
",l=i,u=0,h=!0;for(let c=0,f=e.getCount();c0;)o&&h?(m+=" ",h=!1):(m+=" ",h=!0),S--;break;case 60:m+="<",h=!1;break;case 62:m+=">",h=!1;break;case 38:m+="&",h=!1;break;case 0:m+="�",h=!1;break;case 65279:case 8232:case 8233:case 133:m+="\uFFFD",h=!1;break;case 13:m+="​",h=!1;break;case 32:o&&h?(m+=" ",h=!1):(m+=" ",h=!0);break;default:m+=String.fromCharCode(v),h=!1}}if(a+=`${m}`,g>s||l>=s)break}return a+="
",a}function fge(n,e,t){let i='
';const s=Ml(n);let r=t.getInitialState();for(let o=0,a=s.length;o0&&(i+="
");const u=t.tokenize2(l,!0,r,0);pn.convertToEndOffset(u.tokens,l.length);const c=new pn(u.tokens,l,e).inflate();let f=0;for(let g=0,m=c.getCount();g${RR(l.substring(f,S))}`,f=S}r=u.endState}return i+="
",i}class gge{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,s)}}class pge{constructor(e,t,i,s,r){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=s,this.minWidth=r,this.prefixSum=0}}class S0{constructor(e,t,i,s){this._instanceId=Z6(++S0.INSTANCE_COUNT),this._pendingChanges=new gge,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=s}static findInsertionIndex(e,t,i){let s=0,r=e.length;for(;s>>1;t===e[o].afterLineNumber?i{t=!0,s=s|0,r=r|0,o=o|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new pge(l,s,r,o,a)),l},changeOneWhitespace:(s,r,o)=>{t=!0,r=r|0,o=o|0,this._pendingChanges.change({id:s,newAfterLineNumber:r,newHeight:o})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const u=this._findWhitespaceIndex(l.id);u!==-1&&this._removeWhitespace(u)}return}const s=new Set;for(const l of i)s.add(l.id);const r=new Map;for(const l of t)r.set(l.id,l);const o=l=>{let u=[];for(const h of l)if(!s.has(h.id)){if(r.has(h.id)){const c=r.get(h.id);h.afterLineNumber=c.newAfterLineNumber,h.height=c.newHeight}u.push(h)}return u},a=o(this._arr).concat(o(e));a.sort((l,u)=>l.afterLineNumber===u.afterLineNumber?l.ordinal-u.ordinal:l.afterLineNumber-u.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=S0.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?t=this._lineHeight*(e-1):t=0;const i=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e);return t+i+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,r=t;for(;s=a+i)s=o+1;else{if(e>=a)return o;r=o}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,r=this.getVerticalOffsetForLineNumber(s)|0;let o=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const l=this.getWhitespacesCount()|0;let u,h;a===-1?(a=l,h=o+1,u=0):(h=this.getAfterLineNumberForWhitespaceIndex(a)|0,u=this.getHeightForWhitespaceIndex(a)|0);let c=r,f=c;const g=5e5;let m=0;r>=g&&(m=Math.floor(r/g)*g,m=Math.floor(m/i)*i,f-=m);const v=[],S=e+(t-e)/2;let w=-1;for(let E=s;E<=o;E++){if(w===-1){const I=c,x=c+i;(I<=S&&SS)&&(w=E)}for(c+=i,v[E-s]=f,f+=i;h===E;)f+=u,c+=u,a++,a>=l?h=o+1:(h=this.getAfterLineNumberForWhitespaceIndex(a)|0,u=this.getHeightForWhitespaceIndex(a)|0);if(c>=t){o=E;break}}w===-1&&(w=o);const b=this.getVerticalOffsetForLineNumber(o)|0;let y=s,L=o;return yt&&L--,{bigNumbersDelta:m,startLineNumber:s,endLineNumber:o,relativeVerticalOffset:v,centeredLineNumber:w,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:L}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),r=this.getHeightForWhitespaceIndex(i);if(e>=s+r)return-1;for(;t=a+l)t=o+1;else{if(e>=a)return o;i=o}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),r=this.getIdForWhitespaceIndex(t),o=this.getAfterLineNumberForWhitespaceIndex(t);return{id:r,afterLineNumber:o,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];let r=[];for(let o=i;o<=s;o++){const a=this.getVerticalOffsetForWhitespaceIndex(o),l=this.getHeightForWhitespaceIndex(o);if(a>=t)break;r.push({id:this.getIdForWhitespaceIndex(o),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(o),verticalOffset:a,height:l})}return r}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}}S0.INSTANCE_COUNT=0;const mge=125;class A_{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class _ge extends ie{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new H),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new A_(0,0,0,0),this._scrollable=this._register(new wL(e,t)),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new Q2(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}}class vge extends ie{constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,r=s.get(129),o=s.get(74);this._linesLayout=new S0(t,s.get(58),o.top,o.bottom),this._scrollable=this._register(new _ge(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new A_(r.contentWidth,0,r.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(102)?mge:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(58)&&this._linesLayout.setLineHeight(t.get(58)),e.hasChanged(74)){const i=t.get(74);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(129)){const i=t.get(129),s=i.contentWidth,r=i.height,o=this._scrollable.getScrollDimensions(),a=o.contentWidth;this._scrollable.setScrollDimensions(new A_(s,o.contentWidth,r,this._getContentHeight(s,r,a)))}else this._updateHeight();e.hasChanged(102)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(91);return s.horizontal===2||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let r=this._linesLayout.getLinesTotalHeight();return s.get(93)?r+=Math.max(0,t-s.get(58)-s.get(74).bottom):r+=this._getHorizontalScrollbarHeight(e,i),r}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new A_(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new S3(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new S3(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(130),s=t.get(43);if(i.isViewportWrapping){const r=t.get(129),o=t.get(64);return e>r.contentWidth+s.typicalHalfwidthCharacterWidth&&o.enabled&&o.side==="right"?e+r.verticalScrollbarWidth:e}else{const r=t.get(92)*s.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+r,o)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new A_(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition();let t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const 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)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class Vz{constructor(e,t){this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class bge{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=lg(e);const i=this.values,s=this.prefixSum,r=t.length;return r===0?!1:(this.values=new Uint32Array(i.length+r),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+r),this.values.set(t,e),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}changeValue(e,t){return e=lg(e),t=lg(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;let r=i.length-e;return t>=r&&(t=r),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=lg(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,r=0,o=0;for(;t<=i;)if(s=t+(i-t)/2|0,r=this.prefixSum[s],o=r-this.values[s],e=r)t=s+1;else break;return new Vz(s,e-o)}}class Cge{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class wge{constructor(e){this._counts=e,this._isValid=!1,this._validEndIndex=-1,this._modelToView=[],this._viewToModel=[]}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._counts.length;e0?this._modelToView[e-1]:0;this._modelToView[e]=s+i;for(let r=0;r0?this._modelToView[t-1]:0;return new Vz(t,e-i)}}class Sge{constructor(e,t,i,s,r,o,a,l,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=r,this.tabSize=o,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])}createCoordinatesConverter(){return new Cge(this)}_constructLines(e,t){this.lines=[],e&&(this.hiddenAreasIds=[]);const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),r=i.length,o=this.createLineBreaksComputer(),a=new tv(Ma.fromDecorations(s));for(let v=0;vw.lineNumber===v+1);o.addRequest(i[v],S,t?t[v]:null)}const l=o.finalize();let u=[],h=this.hiddenAreasIds.map(v=>this.model.getDecorationRange(v)).sort(M.compareRangesUsingStarts),c=1,f=0,g=-1,m=g+1=c&&S<=f,b=tE(l[v],!w);u[v]=b.getViewLineCount(),this.lines[v]=b}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new wge(u)}getHiddenAreas(){return this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e))}_reduceRanges(e){if(e.length===0)return[];let t=e.map(o=>this.model.validateRange(o)).sort(M.compareRangesUsingStarts),i=[],s=t[0].startLineNumber,r=t[0].endLineNumber;for(let o=1,a=t.length;or+1?(i.push(new M(s,1,r,1)),s=l.startLineNumber,r=l.endLineNumber):l.endLineNumber>r&&(r=l.endLineNumber)}return i.push(new M(s,1,r,1)),i}setHiddenAreas(e){let t=this._reduceRanges(e),i=this.hiddenAreasIds.map(c=>this.model.getDecorationRange(c)).sort(M.compareRangesUsingStarts);if(t.length===i.length){let c=!1;for(let f=0;f=o&&f<=a?this.lines[c].isVisible()&&(this.lines[c]=this.lines[c].setVisible(!1),g=!0):(h=!0,this.lines[c].isVisible()||(this.lines[c]=this.lines[c].setVisible(!0),g=!0)),g){let m=this.lines[c].getViewLineCount();this.prefixSumComputer.changeValue(c,m)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.lines.length?!1:this.lines[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.lines.length?1:this.lines[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s){const r=this.fontInfo.equals(e),o=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===s;if(r&&o&&a&&l)return!1;const u=r&&o&&!a&&l;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s;let h=null;if(u){h=[];for(let c=0,f=this.lines.length;c2&&!this.lines[t-2].isVisible();let o=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,a=0,l=[],u=[];for(let h=0,c=s.length;hl?(h=t===1?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,c=h+l-1,m=c+1,v=m+(r-l)-1,u=!0):rt?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),o=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.getActiveIndentGuide(s.lineNumber,r.lineNumber,o.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),u=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:u.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);let t=this.prefixSumComputer.getIndexOf(e-1),i=t.index,s=t.remainder;return new O3(i+1,s)}getMinColumnOfViewLine(e){return this.lines[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.lines[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new G(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.lines[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new G(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),r=new Array;let o=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=s.modelLineNumber;l++){const u=this.lines[l-1];if(u.isVisible()){let h=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,c=l===s.modelLineNumber?s.modelLineWrappedLineIdx+1:u.getViewLineCount();for(let f=h;ff.horizontalLine?new Hg(f.visibleColumn,f.className,new _N(f.horizontalLine.top,this.convertModelPositionToViewPosition(h.modelLineNumber,f.horizontalLine.endColumn).column)):f),o.push(c)}}return o}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let r=[],o=[],a=[];const l=i.lineNumber-1,u=s.lineNumber-1;let h=null;for(let m=l;m<=u;m++){const v=this.lines[m];if(v.isVisible()){let S=v.getViewLineNumberOfModelPosition(0,m===l?i.column:1),w=v.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(m+1)),b=w-S+1,y=0;b>1&&v.getViewLineMinColumn(this.model,m+1,w)===1&&(y=S===0?1:2),o.push(b),a.push(y),h===null&&(h=new G(m+1,0))}else h!==null&&(r=r.concat(this.model.getLinesIndentGuides(h.lineNumber,m)),h=null)}h!==null&&(r=r.concat(this.model.getLinesIndentGuides(h.lineNumber,s.lineNumber)),h=null);const c=t-e+1;let f=new Array(c),g=0;for(let m=0,v=r.length;mt&&(m=!0,g=t-r+1);let v=f+g;if(c.getViewLinesData(this.model,u+1,f,v,r-e,i,l),r+=g,m)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);let s=this.prefixSumComputer.getIndexOf(e-1),r=s.index,o=s.remainder,a=this.lines[r],l=a.getViewLineMinColumn(this.model,r+1,o),u=a.getViewLineMaxColumn(this.model,r+1,o);tu&&(t=u);let h=a.getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new G(r+1,h)).equals(i)?new G(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new M(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){e=this._toValidViewLineNumber(e);let i=this.prefixSumComputer.getIndexOf(e-1),s=i.index,r=i.remainder,o=this.lines[s].getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new G(s+1,o))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new M(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2){const s=this.model.validatePosition(new G(e,t)),r=s.lineNumber,o=s.column;let a=r-1,l=!1;for(;a>0&&!this.lines[a].isVisible();)a--,l=!0;if(a===0&&!this.lines[a].isVisible())return new G(1,1);const u=1+(a===0?0:this.prefixSumComputer.getAccumulatedValue(a-1));let h;return l?h=this.lines[a].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(a+1),i):h=this.lines[r-1].getViewPositionOfModelPosition(u,o,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return M.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new M(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.lines[i].isVisible()){const r=1+(i===0?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(r,t)}for(;i>0&&!this.lines[i].isVisible();)i--;if(i===0&&!this.lines[i].isVisible())return 1;const s=1+(i===0?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),r=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(r.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new M(s.lineNumber,1,r.lineNumber,r.column),t,i);let o=[];const a=s.lineNumber-1,l=r.lineNumber-1;let u=null;for(let g=a;g<=l;g++)if(this.lines[g].isVisible())u===null&&(u=new G(g+1,g===a?s.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(g);o=o.concat(this.model.getDecorationsInRange(new M(u.lineNumber,u.column,g,v),t,i)),u=null}u!==null&&(o=o.concat(this.model.getDecorationsInRange(new M(u.lineNumber,u.column,r.lineNumber,r.column),t,i)),u=null),o.sort((g,m)=>{const v=M.compareRangesUsingStarts(g.range,m.range);return v===0?g.idm.id?1:0:v});let h=[],c=0,f=null;for(const g of o){const m=g.id;f!==m&&(f=m,h[c++]=g)}return h}getInjectedTextAt(e){const t=this._toValidViewLineNumber(e.lineNumber),i=this.prefixSumComputer.getIndexOf(t-1),s=i.index,r=i.remainder;return this.lines[s].getInjectedTextAt(r,e.column)}normalizePosition(e,t){const i=this._toValidViewLineNumber(e.lineNumber),s=this.prefixSumComputer.getIndexOf(i-1),r=s.index,o=s.remainder;return this.lines[r].normalizePosition(this.model,r+1,o,e,t)}getLineIndentColumn(e){const t=this._toValidViewLineNumber(e),i=this.prefixSumComputer.getIndexOf(t-1),s=i.index;return i.remainder===0?this.model.getLineIndentColumn(s+1):0}}class O3{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}}class P3{constructor(e,t){this.modelRange=e,this.viewLines=t}}class QS{constructor(){}isVisible(){return!0}setVisible(e){return e?this:JS.INSTANCE}getLineBreakData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){let s=e.getLineTokens(t),r=s.getLineContent();return new Y2(r,!1,1,r.length+1,0,s.inflate(),null)}getViewLinesData(e,t,i,s,r,o,a){if(!o[r]){a[r]=null;return}a[r]=this.getViewLineData(e,t,0)}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new G(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i,s,r){return s}getInjectedTextAt(e,t){return null}}QS.INSTANCE=new QS;class JS{constructor(){}isVisible(){return!1}setVisible(e){return e?QS.INSTANCE:this}getLineBreakData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,s,r,o,a){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i,s,r){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}JS.INSTANCE=new JS;class yge{constructor(e,t){this._lineBreakData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getLineBreakData(){return this._lineBreakData}getViewLineCount(){return this._isVisible?this._lineBreakData.breakOffsets.length:0}getInputStartOffsetOfOutputLineIndex(e){return this._lineBreakData.getInputOffsetOfOutputPosition(e,0)}getInputEndOffsetOfOutputLineIndex(e,t,i){return i+1===this._lineBreakData.breakOffsets.length?e.getLineMaxColumn(t)-1:this._lineBreakData.getInputOffsetOfOutputPosition(i+1,0)}getViewLineContent(e,t,i){if(!this._isVisible)throw new Error("Not supported");const s=i>0?this._lineBreakData.breakOffsets[i-1]:0,r=inew Ma(0,0,l+1,this._lineBreakData.injectionOptions[u],0));o=Ma.applyInjectedText(e.getLineContent(t),a).substring(s,r)}else o=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:r+1});return i>0&&(o=F3(this._lineBreakData.wrappedTextIndentLength)+o),o}getViewLineLength(e,t,i){if(!this._isVisible)throw new Error("Not supported");const s=i>0?this._lineBreakData.breakOffsets[i-1]:0;let o=(i0&&(o=this._lineBreakData.wrappedTextIndentLength+o),o}getViewLineMinColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this._getViewLineMinColumn(i)}_getViewLineMinColumn(e){return e>0?this._lineBreakData.wrappedTextIndentLength+1:1}getViewLineMaxColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineLength(e,t,i)+1}getViewLineData(e,t,i){if(!this._isVisible)throw new Error("Not supported");const s=this._lineBreakData,r=i>0?s.wrappedTextIndentLength:0,o=s.injectionOffsets,a=s.injectionOptions;let l,u,h;if(o){const v=e.getLineTokens(t).withInserted(o.map((y,L)=>({offset:y,text:a[L].content,tokenMetadata:pn.defaultTokenMetadata}))),S=i>0?s.breakOffsets[i-1]:0,w=s.breakOffsets[i];l=v.getLineContent().substring(S,w),u=v.sliceAndInflate(S,w,r),h=new Array;let b=0;for(let y=0;yw)break;if(S0?s.wrappedTextIndentLength:0,A=k+Math.max(E-S,0),z=k+Math.min(I-S,w);A!==z&&h.push(new xfe(A,z,x.inlineClassName,x.inlineClassNameAffectsLetterSpacing))}}b+=L}}else{const v=this.getInputStartOffsetOfOutputLineIndex(i),S=this.getInputEndOffsetOfOutputLineIndex(e,t,i),w=e.getLineTokens(t);l=e.getValueInRange({startLineNumber:t,startColumn:v+1,endLineNumber:t,endColumn:S+1}),u=w.sliceAndInflate(v,S,r),h=null}i>0&&(l=F3(s.wrappedTextIndentLength)+l);const c=i>0?s.wrappedTextIndentLength+1:1,f=l.length+1,g=i+10&&(i0&&(o+=this._lineBreakData.wrappedTextIndentLength),new G(e+r,o)}getViewLineNumberOfModelPosition(e,t){if(!this._isVisible)throw new Error("Not supported");const i=this._lineBreakData.getOutputPositionOfInputOffset(t-1);return e+i.outputLineIndex}normalizePosition(e,t,i,s,r){if(this._lineBreakData.injectionOffsets!==null){const o=s.lineNumber-i,a=this._lineBreakData.outputPositionToOffsetInUnwrappedLine(i,s.column-1),l=this._lineBreakData.normalizeOffsetAroundInjections(a,r);if(l!==a)return this._lineBreakData.getOutputPositionOfOffsetInUnwrappedLine(l,r).toPosition(o,this._lineBreakData.wrappedTextIndentLength)}if(r===0){if(i>0&&s.column===this._getViewLineMinColumn(i))return new G(s.lineNumber-1,this.getViewLineMaxColumn(e,t,i-1))}else if(r===1){const o=this.getViewLineCount()-1;if(i=eE.length)for(let e=1;e<=n;e++)eE[e]=Lge(e);return eE[n]}function Lge(n){return new Array(n+1).join(" ")}function tE(n,e){return n===null?e?QS.INSTANCE:JS.INSTANCE:new yge(n,e)}class Dge{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class xge{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Dge(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){let e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new tT(t,i)}onModelLinesInserted(e,t,i,s){return new iT(t,i)}onModelLineChanged(e,t,i){return[!1,new Fz(t,t),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1;let s=new Array(i);for(let r=0;r{for(let t=0,i=this._languages.length;t"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0);class Tge extends ie{constructor(e,t,i,s,r,o){if(super(),this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new age,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Io(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._tokenizeViewportSoon=this._register(new mi(()=>this.tokenizeViewport(),50)),this._updateConfigurationViewLineCount=this._register(new mi(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,this.model.isTooLargeForTokenization())this._lines=new xge(this.model);else{const a=this._configuration.options,l=a.get(43),u=a.get(123),h=a.get(130),c=a.get(122);this._lines=new Sge(this._editorId,this.model,s,r,l,this.model.getOptions().tabSize,u,h.wrappingColumn,c)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Xp(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new vge(this._configuration,this.getLineCount(),o)),this._register(this.viewLayout.onDidScroll(a=>{a.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new ige(a)),this._eventDispatcher.emitOutgoingEvent(new eO(a.oldScrollWidth,a.oldScrollLeft,a.oldScrollHeight,a.oldScrollTop,a.scrollWidth,a.scrollLeft,a.scrollHeight,a.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(a=>{this._eventDispatcher.emitOutgoingEvent(a)})),this._decorations=new kge(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(a=>{try{const l=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(l,a)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(db.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new rge)})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this.invalidateMinimapColorCache(),this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,null,1),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=new M(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber)),i=this._toModelVisibleRanges(t);for(const s of i)this.model.tokenizeViewport(s.startLineNumber,s.endLineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new ege(e)),this._eventDispatcher.emitOutgoingEvent(new J2(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Yfe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Xfe)}onDidColorThemeChange(){this._eventDispatcher.emitSingleViewEvent(new nge)}_onConfigurationChanged(e,t){let i=null;if(this._viewportStartLine!==-1){let h=new G(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(h)}let s=!1;const r=this._configuration.options,o=r.get(43),a=r.get(123),l=r.get(130),u=r.get(122);if(this._lines.setWrappingSettings(o,a,l.wrappingColumn,u)&&(e.emitViewEvent(new hw),e.emitViewEvent(new cw),e.emitViewEvent(new hg(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.getCurrentScrollTop()!==0&&(s=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(80)&&(this._decorations.reset(),e.emitViewEvent(new hg(null))),e.emitViewEvent(new Qfe(t)),this.viewLayout.onConfigurationChanged(t),s&&i){const h=this.coordinatesConverter.convertModelPositionToViewPosition(i),c=this.viewLayout.getVerticalOffsetForLineNumber(h.lineNumber);this.viewLayout.setScrollPosition({scrollTop:c+this._viewportStartLineDelta},1)}Io.shouldRecreate(t)&&(this.cursorConfig=new Io(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,s=!1;const r=e.changes,o=e instanceof Nd?e.versionId:null,a=this._lines.createLineBreaksComputer();for(const h of r)switch(h.changeType){case 4:{for(let c=0;c!m.ownerId||m.ownerId===this._editorId)),a.addRequest(f,g,null)}break}case 2:{let c=null;h.injectedText&&(c=h.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),a.addRequest(h.detail,c,null);break}}const l=a.finalize();let u=0;for(const h of r)switch(h.changeType){case 1:{this._lines.onModelFlushed(),t.emitViewEvent(new hw),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break}case 3:{const c=this._lines.onModelLinesDeleted(o,h.fromLineNumber,h.toLineNumber);c!==null&&(t.emitViewEvent(c),this.viewLayout.onLinesDeleted(c.fromLineNumber,c.toLineNumber)),i=!0;break}case 4:{const c=l.slice(u,u+h.detail.length);u+=h.detail.length;const f=this._lines.onModelLinesInserted(o,h.fromLineNumber,h.toLineNumber,c);f!==null&&(t.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),i=!0;break}case 2:{const c=l[u];u++;const[f,g,m,v]=this._lines.onModelLineChanged(o,h.lineNumber,c);s=f,g&&t.emitViewEvent(g),m&&(t.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),v&&(t.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}o!==null&&this._lines.acceptVersionId(o),this.viewLayout.onHeightMaybeChanged(),!i&&s&&(t.emitViewEvent(new cw),t.emitViewEvent(new hg(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}if(this._viewportStartLine=-1,this._configuration.setMaxLineNumber(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&this._viewportStartLineTrackedRange){const t=this.model._getTrackedRange(this._viewportStartLineTrackedRange);if(t){const i=this.coordinatesConverter.convertModelPositionToViewPosition(t.getStartPosition()),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber);this.viewLayout.setScrollPosition({scrollTop:s+this._viewportStartLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(this.model.onDidChangeTokens(e=>{let t=[];for(let i=0,s=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new tge),this.cursorConfig=new Io(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Io(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new hw),t.emitViewEvent(new cw),t.emitViewEvent(new hg(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Io(this.model.getLanguageId(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new hg(e))}))}setHiddenAreas(e){let t=!1;try{const i=this._eventDispatcher.beginEmitViewEvents();t=this._lines.setHiddenAreas(e),t&&(i.emitViewEvent(new hw),i.emitViewEvent(new cw),i.emitViewEvent(new hg(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),t&&this._eventDispatcher.emitOutgoingEvent(new A3)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(129),t=this._configuration.options.get(58),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),r=Math.max(1,s.completelyVisibleStartLineNumber-i),o=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new M(r,this.getLineMinColumn(r),o,this.getLineMaxColumn(o)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];let s=[],r=0,o=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,u=t.endColumn;for(let h=0,c=i.length;hl||(o"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getTextModelOptions(){return this.model.getOptions()}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStartLine=e;let s=this.coordinatesConverter.convertViewPositionToModelPosition(new G(e,this.getLineMinColumn(e)));this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,new M(s.lineNumber,s.column,s.lineNumber,s.column),1);const r=this.viewLayout.getVerticalOffsetForLineNumber(e),o=this.viewLayout.getCurrentScrollTop();this._viewportStartLineDelta=o-r}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=us(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=fm(this.getLineContent(e));return t===-1?0:t+2}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewLineRenderingData(e,t){let i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),r=this.getTabSize(),o=this._lines.getViewLineData(t),l=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return o.inlineDecorations&&(l=[...l,...o.inlineDecorations.map(u=>u.toInlineDecoration(t))]),new Dr(o.minColumn,o.maxColumn,o.content,o.continuesWithWrappedLine,i,s,o.tokens,l,r,o.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){let s=this._lines.getViewLinesData(e,t,i);return new Dfe(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,jR(this._configuration.options)),i=new Age;for(const s of t){const r=s.options,o=r.overviewRuler;if(!o)continue;const a=o.position;if(a===0)continue;const l=o.getColor(e),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),h=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(l,r.zIndex,u,h,a)}return i.asArray}invalidateOverviewRulerColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i&&i.invalidateCachedColor()}}invalidateMinimapColorCache(){const e=this.model.getAllDecorations();for(const t of e){const i=t.options.minimap;i&&i.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getModelLineMaxColumn(e){return this.model.getLineMaxColumn(e)}validateModelPosition(e){return this.model.validatePosition(e)}validateModelRange(e){return this.model.validateRange(e)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(o)}getEOL(){return this.model.getEOL()}getPlainTextToCopy(e,t,i){const s=i?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(M.compareRangesUsingStarts);let r=!1,o=!1;for(const l of e)l.isEmpty()?r=!0:o=!0;if(!o){if(!t)return"";const l=e.map(h=>h.startLineNumber);let u="";for(let h=0;h0&&l[h-1]===l[h]||(u+=this.model.getLineContent(l[h])+s);return u}if(r&&t){let l=[],u=0;for(const h of e){const c=h.startLineNumber;h.isEmpty()?c!==u&&l.push(this.model.getLineContent(c)):l.push(this.model.getValueInRange(h,i?2:0)),u=c}return l.length===1?l[0]:l}let a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===xm||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const h=s.startLineNumber;s=new M(h,this.model.getLineMinColumn(h),h,this.model.getLineMaxColumn(h))}const r=this._configuration.options.get(43),o=this._getColorMap(),l=/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===hs.fontFamily;let u;return l?u=hs.fontFamily:(u=r.fontFamily,u=u.replace(/"/g,"'"),/[,']/.test(u)||/[+ ]/.test(u)&&(u=`'${u}'`),u=`${u}, ${hs.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(s,o)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,r=e.endLineNumber,o=e.endColumn,a=this.getTabSize();let l="";for(let u=i;u<=r;u++){const h=this.model.getLineTokens(u),c=h.getLineContent(),f=u===i?s-1:0,g=u===r?o-1:c.length;c===""?l+="
":l+=dge(c,h.inflate(),t,f,g,a,Pn)}return l}_getColorMap(){let e=Ii.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;ithis._cursor.setStates(s,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(s=>this._cursor.setSelections(s,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new uge);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i))}startComposition(){this._cursor.setIsDoingComposition(!0),this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._cursor.setIsDoingComposition(!1),this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,s,r){this._executeCursorEdit(o=>this._cursor.compositionType(o,e,t,i,s,r))}paste(e,t,i,s){this._executeCursorEdit(r=>this._cursor.paste(r,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t){this._withViewEventsCollector(i=>this._cursor.revealPrimary(i,e,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new M(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new g1(e,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new M(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new g1(e,i,null,0,!0,0)))}revealRange(e,t,i,s,r){this._withViewEventsCollector(o=>o.emitViewEvent(new g1(e,i,null,s,t,r)))}getVerticalOffsetForLineNumber(e){return this.viewLayout.getVerticalOffsetForLineNumber(e)}getScrollTop(){return this.viewLayout.getCurrentScrollTop()}setScrollTop(e,t){this.viewLayout.setScrollPosition({scrollTop:e},t)}setScrollPosition(e,t){this.viewLayout.setScrollPosition(e,t)}deltaScrollNow(e,t){this.viewLayout.deltaScrollNow(e,t)}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new oge),this._eventDispatcher.emitOutgoingEvent(new A3))}setMaxLineWidth(e){this.viewLayout.setMaxLineWidth(e)}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class Age{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,r){const o=this._asMap[e];if(o){const a=o.data,l=a[a.length-3],u=a[a.length-1];if(l===r&&u+1>=i){s>u&&(a[a.length-1]=s);return}a.push(r,i,s)}else{const a=new Pz(e,t,[r,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class y0{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}const er=wt("accessibilityService"),Mge=new Le("accessibilityModeEnabled",!1);class Rge extends vm{constructor(e,t){super(0);for(let i=0;i=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let nT=[],sT=[];class tO{constructor(e,t){this.classifier=new Rge(e,t)}static create(e){return new tO(e.get(118),e.get(117))}createLineBreaksComputer(e,t,i,s){t=t|0,i=+i;const r=[],o=[],a=[];return{addRequest:(l,u,h)=>{r.push(l),o.push(u),a.push(h)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth;let u=[];for(let h=0,c=r.length;h=0){let L=Math.abs(u[y]-w);for(;y+1=L)break;L=E,y++}}for(;yL&&(L=v,E=S);let I=0,x=0,k=0,A=0;if(E<=w){let V=E,Q=L===0?0:t.charCodeAt(L-1),ee=L===0?0:n.get(Q),Ce=!0;for(let Se=L;Sev&&rT(Q,ee,Te,oe)&&(I=Ie,x=V),V+=fe,V>w){Ie>v?(k=Ie,A=V-fe):(k=Se+1,A=V),V-x>c&&(I=0),Ce=!1;break}Q=Te,ee=oe}if(Ce){m>0&&(f[m]=l[l.length-1],g[m]=u[l.length-1],m++);break}}if(I===0){let V=E,Q=t.charCodeAt(L),ee=n.get(Q),Ce=!1;for(let Se=L-1;Se>=v;Se--){const Ie=Se+1,Te=t.charCodeAt(Se);if(Te===9){Ce=!0;break}let oe,fe;if(Mp(Te)?(Se--,oe=0,fe=2):(oe=n.get(Te),fe=Sa(Te)?r:1),V<=w){if(k===0&&(k=Ie,A=V),V<=w-c)break;if(rT(Te,oe,Q,ee)){I=Ie,x=V;break}}V-=fe,Q=Te,ee=oe}if(I!==0){const Se=c-(A-x);if(Se<=i){const Ie=t.charCodeAt(k);let Te;fn(Ie)?Te=2:Te=bv(Ie,A,i,r),Se-Te<0&&(I=0)}}if(Ce){y--;continue}}if(I===0&&(I=k,x=A),I<=v){const V=t.charCodeAt(v);fn(V)?(I=v+2,x=S+2):(I=v+1,x=S+bv(V,S,i,r))}for(v=I,f[m]=I,S=x,g[m]=x,m++,w=x+c;y<0||y=z)break;z=V,y++}}return m===0?null:(f.length=m,g.length=m,nT=e.breakOffsets,sT=e.breakOffsetsVisibleColumn,e.breakOffsets=f,e.breakOffsetsVisibleColumn=g,e.wrappedTextIndentLength=h,e)}function Pge(n,e,t,i,s,r,o){const a=Ma.applyInjectedText(e,t);let l,u;if(t&&t.length>0?(l=t.map(x=>x.options),u=t.map(x=>x.column-1)):(l=null,u=null),s===-1)return l?new pv([a.length],[],0,u,l):null;const h=a.length;if(h<=1)return l?new pv([a.length],[],0,u,l):null;const c=Hz(a,i,s,r,o),f=s-c;let g=[],m=[],v=0,S=0,w=0,b=s,y=a.charCodeAt(0),L=n.get(y),E=bv(y,0,i,r),I=1;fn(y)&&(E+=1,y=a.charCodeAt(1),L=n.get(y),I++);for(let x=I;xb&&((S===0||E-w>f)&&(S=k,w=E-V),g[v]=S,m[v]=w,v++,b=w+f,S=0),y=A,L=z}return v===0&&(!t||t.length===0)?null:(g[v]=h,m[v]=E,new pv(g,m,c,u,l))}function bv(n,e,t,i){return n===9?t-e%t:Sa(n)||n<32?i:1}function B3(n,e){return e-n%e}function rT(n,e,t,i){return t!==32&&(e===2||e===3&&i!==2||i===1||i===3&&e!==1)}function Hz(n,e,t,i,s){let r=0;if(s!==0){const o=us(n);if(o!==-1){for(let l=0;lt&&(r=0)}}return r}var iE;const nE=(iE=window.trustedTypes)===null||iE===void 0?void 0:iE.createPolicy("domLineBreaksComputer",{createHTML:n=>n});class iO{static create(){return new iO}constructor(){}createLineBreaksComputer(e,t,i,s){t=t|0,i=+i;let r=[],o=[];return{addRequest:(a,l,u)=>{r.push(a),o.push(l)},finalize:()=>Fge(r,e,t,i,s,o)}}}function Fge(n,e,t,i,s,r){var o;function a(k){const A=r[k];if(A){const z=Ma.applyInjectedText(n[k],A),V=A.map(ee=>ee.options),Q=A.map(ee=>ee.column-1);return new pv([z.length],[],0,Q,V)}else return null}if(i===-1){const k=[];for(let A=0,z=n.length;Al?(z=0,V=0):Q=l-Se}const ee=A.substr(z),Ce=Bge(ee,V,t,Q,g,c);m[k]=z,v[k]=V,S[k]=ee,w[k]=Ce[0],b[k]=Ce[1]}const y=g.build(),L=(o=nE?.createHTML(y))!==null&&o!==void 0?o:y;f.innerHTML=L,f.style.position="absolute",f.style.top="10000",f.style.wordWrap="break-word",document.body.appendChild(f);let E=document.createRange();const I=Array.prototype.slice.call(f.children,0);let x=[];for(let k=0;koe.options),Ie=Te.map(oe=>oe.column-1)):(Se=null,Ie=null),x[k]=new pv(z,Ce,Q,Ie,Se)}return document.body.removeChild(f),x}function Bge(n,e,t,i,s,r){if(r!==0){let f=String(r);s.appendASCIIString('
');const o=n.length;let a=e,l=0,u=[],h=[],c=0");for(let f=0;f"),u[f]=l,h[f]=a;const g=c;c=f+1"),u[n.length]=l,h[n.length]=a,s.appendASCIIString("
"),[u,h]}function Wge(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),r=[];try{oT(n,s,i,0,null,t.length-1,null,r)}catch(o){return console.log(o),null}return r.length===0?null:(r.push(t.length),r)}function oT(n,e,t,i,s,r,o,a){if(i===r||(s=s||sE(n,e,t[i],t[i+1]),o=o||sE(n,e,t[r],t[r+1]),Math.abs(s[0].top-o[0].top)<=.1))return;if(i+1===r){a.push(r);return}const l=i+(r-i)/2|0,u=sE(n,e,t[l],t[l+1]);oT(n,e,t,i,s,l,u,a),oT(n,e,t,l,u,r,o,a)}function sE(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}var Vge=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},$c=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Hge=0;class zge{constructor(e,t,i,s,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=r}dispose(){ct(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let L0=class p1 extends ie{constructor(e,t,i,s,r,o,a,l,u,h){super(),this._onDidDispose=this._register(new H),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new H),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new H),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new H),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new H),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new H),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeConfiguration=this._register(new H),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new H),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new H),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new H),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new H),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new H),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new W3),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new W3),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new H),this.onWillType=this._onWillType.event,this._onDidType=this._register(new H),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new H),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new H),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new H),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new H),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new H),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new H),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new H),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new H),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onContextMenu=this._register(new H),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new H),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new H),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new H),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new H),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new H),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new H),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new H),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new H),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new H),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event;const c=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=c.overflowWidgetsDomNode,delete c.overflowWidgetsDomNode,this._id=++Hge,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this.isSimpleWidget=i.isSimpleWidget||!1,this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(c,h)),this._register(this._configuration.onDidChange(g=>{this._onDidChangeConfiguration.fire(g);const m=this._configuration.options;if(g.hasChanged(129)){const v=m.get(129);this._onDidLayoutChange.fire(v)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=u,this._codeEditorService=r,this._commandService=o,this._themeService=l,this._register(new Uge(this,this._contextKeyService)),this._register(new $ge(this,this._contextKeyService)),this._instantiationService=s.createChild(new y0([je,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new Kge(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={};let f;Array.isArray(i.contributions)?f=i.contributions:f=ap.getEditorContributions();for(const g of f){if(this._contributions[g.id]){Qe(new Error(`Cannot have two contributions with the same id ${g.id}`));continue}try{const m=this._instantiationService.createInstance(g.ctor,this);this._contributions[g.id]=m}catch(m){Qe(m)}}ap.getEditorActions().forEach(g=>{if(this._actions[g.id]){Qe(new Error(`Cannot have two actions with the same id ${g.id}`));return}const m=new Bz(g.id,g.label,g.alias,pd(g.precondition),()=>this._instantiationService.invokeFunction(v=>Promise.resolve(g.runEditorCommand(v,this,null))),this._contextKeyService);this._actions[m.id]=m}),this._codeEditorService.addCodeEditor(this)}_createConfiguration(e,t){return new Bn(this.isSimpleWidget,e,this._domElement,t)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return OL.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;tM.lift(t)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Mt.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e){if(!!this._modelData){if(!G.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections("api",[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,s){if(!this._modelData)return;if(!M.isIRange(e))throw new Error("Invalid arguments");const r=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(r);this._modelData.viewModel.revealRange("api",i,o,t,s)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new M(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,s){if(!G.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new M(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e){const t=Oe.isISelection(e),i=M.isIRange(e);if(!t&&!i)throw new Error("Invalid arguments");if(t)this._setSelectionImpl(e);else if(i){const s={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(s)}}_setSelectionImpl(e){if(!this._modelData)return;const t=new Oe(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections("api",[t])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new M(e,1,t,1),i,!1,s)}revealRange(e,t=0,i=!1,s=!0){this._revealRange(e,i?1:0,s,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,s){if(!M.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(M.lift(e),t,i,s)}setSelections(e,t="api",i=0){if(!!this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,r=e.length;st.isSupported()),e}getAction(e){return this._actions[e]||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const r=i;this._type(e,r.text||"");return}case"replacePreviousChar":{const r=i;this._compositionType(e,r.text||"",r.replaceCharCnt||0,0,0);return}case"compositionType":{const r=i;this._compositionType(e,r.text||"",r.replacePrevCharCnt||0,r.replaceNextCharCnt||0,r.positionDelta||0);return}case"paste":{const r=i;this._paste(e,r.text||"",r.pasteOnNewLine||!1,r.multicursorText||null,r.mode||null);return}case"cut":this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run()).then(void 0,Qe);return}!this._modelData||this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i)}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){!this._modelData||(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){!this._modelData||(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,r){!this._modelData||this._modelData.viewModel.compositionType(t,i,s,r,e)}_paste(e,t,i,s,r){if(!this._modelData||t.length===0)return;const o=this._modelData.viewModel.getSelection().getStartPosition();this._modelData.viewModel.paste(t,i,s,e);const a=this._modelData.viewModel.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new M(o.lineNumber,o.column,a.lineNumber,a.column),languageId:r})}_cut(e){!this._modelData||this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=ap.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(r=>{Promise.resolve(s.runEditorCommand(r,this,i)).then(void 0,Qe)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(80)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(80)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(80))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){!this._modelData||this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){!this._modelData||this._modelData.viewModel.executeCommands(t,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,jR(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(129)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarMouseDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarMouseDown(e)}layout(e){this._configuration.observeReferenceElement(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(129),r=p1._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),o=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:r,left:o,height:i.get(58)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Bn.applyFontInfoSlow(e,this._configuration.options.get(43))}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setMaxLineNumber(e.getLineCount()),e.onBeforeAttached();const i=new Tge(this._id,this._configuration,e,iO.create(),tO.create(this._configuration.options),o=>Tl(o));t.push(e.onDidChangeDecorations(o=>this._onDidChangeModelDecorations.fire(o))),t.push(e.onDidChangeLanguage(o=>{this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(o)})),t.push(e.onDidChangeLanguageConfiguration(o=>this._onDidChangeModelLanguageConfiguration.fire(o))),t.push(e.onDidChangeContent(o=>this._onDidChangeModelContent.fire(o))),t.push(e.onDidChangeOptions(o=>this._onDidChangeModelOptions.fire(o))),t.push(e.onWillDispose(()=>this.setModel(null))),t.push(i.onEvent(o=>{switch(o.kind){case 0:this._onDidContentSizeChange.fire(o);break;case 1:this._editorTextFocus.setValue(o.hasFocus);break;case 2:this._onDidScrollChange.fire(o);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{o.reachedMaxCursorCount&&this._notificationService.warn(_("cursors.maximum","The number of cursors has been limited to {0}.",Xp.MAX_CURSOR_COUNT));const a=[];for(let h=0,c=o.selections.length;h{this._paste("keyboard",r,o,a,l)},type:r=>{this._type("keyboard",r)},compositionType:(r,o,a,l)=>{this._compositionType("keyboard",r,o,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(r,o,a,l)=>{const u={text:r,pasteOnNewLine:o,multicursorText:a,mode:l};this._commandService.executeCommand("paste",u)},type:r=>{const o={text:r};this._commandService.executeCommand("type",o)},compositionType:(r,o,a,l)=>{if(a||l){const u={text:r,replacePrevCharCnt:o,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",u)}else{const u={text:r,replaceCharCnt:o};this._commandService.executeCommand("replacePreviousChar",u)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new ML(e.coordinatesConverter);return i.onKeyDown=r=>this._onKeyDown.fire(r),i.onKeyUp=r=>this._onKeyUp.fire(r),i.onContextMenu=r=>this._onContextMenu.fire(r),i.onMouseMove=r=>this._onMouseMove.fire(r),i.onMouseLeave=r=>this._onMouseLeave.fire(r),i.onMouseDown=r=>this._onMouseDown.fire(r),i.onMouseUp=r=>this._onMouseUp.fire(r),i.onMouseDrag=r=>this._onMouseDrag.fire(r),i.onMouseDrop=r=>this._onMouseDrop.fire(r),i.onMouseDropCanceled=r=>this._onMouseDropCanceled.fire(r),i.onMouseWheel=r=>this._onMouseWheel.fire(r),[new qfe(t,this._configuration,this._themeService,e,i,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){e&&e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}};L0=Vge([$c(3,jt),$c(4,ei),$c(5,mn),$c(6,je),$c(7,ai),$c(8,Wn),$c(9,er)],L0);class W3 extends ie{constructor(){super(),this._onDidChangeToTrue=this._register(new H),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new H),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class Uge extends ie{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=K.editorSimpleInput.bindTo(t),this._editorFocus=K.focus.bindTo(t),this._textInputFocus=K.textInputFocus.bindTo(t),this._editorTextFocus=K.editorTextFocus.bindTo(t),this._editorTabMovesFocus=K.tabMovesFocus.bindTo(t),this._editorReadonly=K.readOnly.bindTo(t),this._inDiffEditor=K.inDiffEditor.bindTo(t),this._editorColumnSelection=K.columnSelection.bindTo(t),this._hasMultipleSelections=K.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=K.hasNonEmptySelection.bindTo(t),this._canUndo=K.canUndo.bindTo(t),this._canRedo=K.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(128)),this._editorReadonly.set(e.get(80)),this._inDiffEditor.set(e.get(53)),this._editorColumnSelection.set(e.get(18))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class $ge extends ie{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this._langId=K.languageId.bindTo(t),this._hasCompletionItemProvider=K.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=K.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=K.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=K.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=K.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=K.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=K.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=K.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=K.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=K.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=K.hasReferenceProvider.bindTo(t),this._hasRenameProvider=K.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=K.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=K.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=K.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=K.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=K.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=K.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=K.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(pa.onDidChange(i)),this._register(Il.onDidChange(i)),this._register(xN.onDidChange(i)),this._register(Qv.onDidChange(i)),this._register(LS.onDidChange(i)),this._register(DS.onDidChange(i)),this._register(xS.onDidChange(i)),this._register(Xv.onDidChange(i)),this._register(yS.onDidChange(i)),this._register(DN.onDidChange(i)),this._register(SS.onDidChange(i)),this._register(yN.onDidChange(i)),this._register(iv.onDidChange(i)),this._register(Nh.onDidChange(i)),this._register(LN.onDidChange(i)),this._register(kN.onDidChange(i)),i()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(pa.has(e)),this._hasCodeActionsProvider.set(Il.has(e)),this._hasCodeLensProvider.set(xN.has(e)),this._hasDefinitionProvider.set(Qv.has(e)),this._hasDeclarationProvider.set(LS.has(e)),this._hasImplementationProvider.set(DS.has(e)),this._hasTypeDefinitionProvider.set(xS.has(e)),this._hasHoverProvider.set(Xv.has(e)),this._hasDocumentHighlightProvider.set(yS.has(e)),this._hasDocumentSymbolProvider.set(DN.has(e)),this._hasReferenceProvider.set(SS.has(e)),this._hasRenameProvider.set(yN.has(e)),this._hasSignatureHelpProvider.set(LN.has(e)),this._hasInlayHintsProvider.set(kN.has(e)),this._hasDocumentFormattingProvider.set(iv.has(e)||Nh.has(e)),this._hasDocumentSelectionFormattingProvider.set(Nh.has(e)),this._hasMultipleDocumentFormattingProvider.set(iv.all(e).length+Nh.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(Nh.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===lt.walkThroughSnippet)})}}class Kge extends ie{constructor(e){super(),this._onChange=this._register(new H),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Tp(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}const jge=encodeURIComponent("");function rE(n){return jge+encodeURIComponent(n.toString())+Gge}const qge=encodeURIComponent('');function Yge(n){return qge+encodeURIComponent(n.toString())+Zge}ni((n,e)=>{const t=n.getColor(aH);t&&e.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${t}; }`);const i=n.getColor(uv);i&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${rE(i)}") repeat-x bottom left; }`);const s=n.getColor(foe);s&&e.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${s}; }`);const r=n.getColor(mL);r&&e.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${r}; }`);const o=n.getColor(Wu);o&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${rE(o)}") repeat-x bottom left; }`);const a=n.getColor(goe);a&&e.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=n.getColor(v2);l&&e.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const u=n.getColor(Da);u&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${rE(u)}") repeat-x bottom left; }`);const h=n.getColor(poe);h&&e.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${h}; }`);const c=n.getColor(_oe);c&&e.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${c}; }`);const f=n.getColor(moe);f&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Yge(f)}") no-repeat bottom left; }`);const g=n.getColor(jae);g&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${g.rgba.a}; }`);const m=n.getColor(Kae);m&&e.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${m}; }`);const v=n.getColor(tc)||"inherit";e.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${v}}`)});var Xge=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},Kc=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let af=class extends L0{constructor(e,t,i,s,r,o,a,l,u,h){super(e,Object.assign(Object.assign({},i.getRawOptions()),{overflowWidgetsDomNode:i.getOverflowWidgetsDomNode()}),{},s,r,o,a,l,u,h),this._parentEditor=i,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(i.onDidChangeConfiguration(c=>this._onParentConfigurationChanged(c)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){Fa(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};af=Xge([Kc(3,jt),Kc(4,ei),Kc(5,mn),Kc(6,je),Kc(7,ai),Kc(8,Wn),Kc(9,er)],af);class nO{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const zz=new nO("id#");const V3=new q(new ot(0,122,204)),Qge={showArrow:!0,showFrame:!0,className:"",frameColor:V3,arrowColor:V3,keepEditorSelection:!1},Jge="vs.editor.contrib.zoneWidget";class epe{constructor(e,t,i,s,r,o){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this._onDomNodeTop=r,this._onComputedHeight=o}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class tpe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class PL{constructor(e){this._editor=e,this._ruleName=PL._IdGenerator.nextId(),this._decorations=[],this._color=null,this._height=-1}dispose(){this.hide(),lS(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){lS(this._ruleName),uN(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){this._decorations=this._editor.deltaDecorations(this._decorations,[{range:M.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._editor.deltaDecorations(this._decorations,[])}}PL._IdGenerator=new nO(".arrow-decoration-");class ipe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._positionMarkerId=[],this._viewZone=null,this._disposables=new pe,this.container=null,this._isShowing=!1,this.editor=e,this.options=Ih(t),Fa(this.options,Qge,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this.editor.deltaDecorations(this._positionMarkerId,[]),this._positionMarkerId=[],this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new PL(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){let t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash&&this._resizeSash.layout()}get position(){const[e]=this._positionMarkerId;if(!e)return;const t=this.editor.getModel();if(!t)return;const i=t.getDecorationRange(e);if(!!i)return i.getStartPosition()}show(e,t){const i=M.isIRange(e)?M.lift(e):M.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:i,options:ft.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()}_decoratingElementsHeight(){let e=this.editor.getOption(58),t=0;if(this.options.showArrow){let i=Math.round(e/3);t+=2*i}if(this.options.showFrame){let i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),r=this._getWidth(s);this.domNode.style.width=`${r}px`,this.domNode.style.left=this._getLeft(s)+"px";const o=document.createElement("div");o.style.overflow="hidden";const a=this.editor.getOption(58),l=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,l);let u=0,h=0;if(this._arrow&&this.options.showArrow&&(u=Math.round(a/3),this._arrow.height=u,this._arrow.show(i)),this.options.showFrame&&(h=Math.round(a/9)),this.editor.changeViewZones(g=>{this._viewZone&&g.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new epe(o,i.lineNumber,i.column,t,m=>this._onViewZoneTop(m),m=>this._onViewZoneHeight(m)),this._viewZone.id=g.addZone(this._viewZone),this._overlayWidget=new tpe(Jge+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const g=this.options.frameWidth?this.options.frameWidth:h;this.container.style.borderTopWidth=g+"px",this.container.style.borderBottomWidth=g+"px"}let c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=u+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,r),this.options.keepEditorSelection||this.editor.setSelection(e);const f=this.editor.getModel();if(f){const g=e.endLineNumber+1;g<=f.getLineCount()?this.revealLine(g,!1):this.revealLine(f.getLineCount(),!0)}}revealLine(e,t){t?this.editor.revealLineInCenter(e,0):this.editor.revealLine(e,0)}setCssClass(e,t){!this.container||(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new An(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.hide(),this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){let i=(t.currentY-e.startY)/this.editor.getOption(58),s=i<0?Math.ceil(i):Math.floor(i),r=e.heightInLines+s;r>5&&r<35&&this._relayout(r)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}class npe extends Ap{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new H),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=le(e,ge(".monaco-dropdown")),this._label=le(this._element,ge(".dropdown-label"));let i=t.labelRenderer;i||(i=r=>(r.textContent=t.label||"",null));for(const r of[xe.CLICK,xe.MOUSE_DOWN,qt.Tap])this._register(ne(this.element,r,o=>Rt.stop(o,!0)));for(const r of[xe.MOUSE_DOWN,qt.Tap])this._register(ne(this._label,r,o=>{o instanceof MouseEvent&&o.detail>1||(this.visible?this.hide():this.show())}));this._register(ne(this._label,xe.KEY_UP,r=>{const o=new ci(r);(o.equals(3)||o.equals(10))&&(Rt.stop(r,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Tt.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class spe extends npe{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:e=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class Uz extends Od{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new H),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=r=>{this.element=le(r,ge("a.action-label"));let o=[];return typeof this.options.classNames=="string"?o=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(o=this.options.classNames),o.find(a=>a==="icon")||o.push("codicon"),this.element.classList.add(...o),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new spe(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(r=>{var o;(o=this.element)===null||o===void 0||o.setAttribute("aria-expanded",`${r}`),this._onDidChangeVisibility.fire(r)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const r=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return r.options.anchorAlignmentProvider()}})}this.updateEnabled()}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}updateEnabled(){var e,t;const i=!this.getAction().enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}}class sO{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(t.length===0)return null;const s=[];for(let r=0,o=t.length;r=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},cl=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$z=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function lpe(n,e,t,i,s,r,o){const a=n.getActions(e);return hpe(a,t,!1,typeof i=="string"?u=>u===i:i,s,r,o),upe(a)}function upe(n){const e=new pe;for(const[,t]of n)for(const i of t)e.add(i);return e}function hpe(n,e,t,i=a=>a==="navigation",s=Number.MAX_SAFE_INTEGER,r=()=>!1,o=!1){let a,l;Array.isArray(e)?(a=e,l=e):(a=e.primary,l=e.secondary);const u=new Set;for(const[h,c]of n){let f;i(h)?(f=a,f.length>0&&o&&f.push(new Ho)):(f=l,f.length>0&&f.push(new Ho));for(let g of c){t&&(g=g instanceof hc&&g.alt?g.alt:g);const m=f.push(g);g instanceof Gy&&u.add({group:h,action:g,index:m-1})}}for(const{group:h,action:c,index:f}of u){const g=i(h)?a:l,m=c.actions;(m.length<=1||g.length+m.length-2<=s)&&r(c,h,g.length)&&g.splice(f,1,...m)}if(a!==l&&a.length>s){const h=a.splice(s,a.length-s);l.unshift(...h,new Ho)}}let Qp=class extends a0{constructor(e,t,i,s,r){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable}),this._keybindingService=i,this._notificationService=s,this._contextKeyService=r,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new xr),this._altKey=_d.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return $z(this,void 0,void 0,function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}})}render(e){super.render(e),e.classList.add("menu-entry"),this._updateItemClass(this._menuItemAction.item);let t=!1,i=this._altKey.keyStatus.altKey||(Pn||Ns)&&this._altKey.keyStatus.shiftKey;const s=()=>{const r=t&&i;r!==this._wantsAltCommand&&(this._wantsAltCommand=r,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._menuItemAction.alt&&this._register(this._altKey.event(r=>{i=r.altKey||(Pn||Ns)&&r.shiftKey,s()})),this._register(ne(e,"mouseleave",r=>{t=!1,s()})),this._register(ne(e,"mouseenter",r=>{t=!0,s()}))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}updateTooltip(){if(this.label){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let s=t?_("titleAndKb","{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt){const r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,o=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),a=o&&o.getLabel(),l=a?_("titleAndKb","{0} ({1})",r,a):r;s+=` +[${rO.modifierLabels[No].altKey}] ${l}`}this.label.title=s}}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;const{element:i,label:s}=this;if(!i||!s)return;const r=this._commandAction.checked&&((t=e.toggled)===null||t===void 0?void 0:t.icon)?e.toggled.icon:e.icon;if(!!r)if(ui.isThemeIcon(r)){const o=ui.asClassNameArray(r);s.classList.add(...o),this._itemClassDispose.value=Ct(()=>{s.classList.remove(...o)})}else r.light&&s.style.setProperty("--menu-entry-icon-light",Gu(r.light)),r.dark&&s.style.setProperty("--menu-entry-icon-dark",Gu(r.dark)),s.classList.add("icon"),this._itemClassDispose.value=Ct(()=>{s.classList.remove("icon"),s.style.removeProperty("--menu-entry-icon-light"),s.style.removeProperty("--menu-entry-icon-dark")})}};Qp=oO([cl(2,Ni),cl(3,Wn),cl(4,je)],Qp);let aT=class extends Uz{constructor(e,t,i){var s,r;const o=Object.assign({},t??Object.create(null),{menuAsChild:(s=t?.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(r=t?.classNames)!==null&&r!==void 0?r:ui.isThemeIcon(e.item.icon)?ui.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},i,o)}render(e){if(super.render(e),this.element){e.classList.add("menu-entry");const{icon:t}=this._action.item;t&&!ui.isThemeIcon(t)&&(this.element.classList.add("icon"),t.light&&this.element.style.setProperty("--menu-entry-icon-light",Gu(t.light)),t.dark&&this.element.style.setProperty("--menu-entry-icon-dark",Gu(t.dark)))}}};aT=oO([cl(2,Ic)],aT);let lT=class extends Od{constructor(e,t,i,s,r,o,a,l){var u,h,c;super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=r,this._menuService=o,this._instaService=a,this._storageService=l,this._container=null,this._storageKey=`${e.item.submenu._debugName}_lastActionId`;let f,g=l.get(this._storageKey,1);g&&(f=e.actions.find(v=>g===v.id)),f||(f=e.actions[0]),this._defaultAction=this._instaService.createInstance(Qp,f,void 0);const m=Object.assign({},t??Object.create(null),{menuAsChild:(u=t?.menuAsChild)!==null&&u!==void 0?u:!0,classNames:(h=t?.classNames)!==null&&h!==void 0?h:["codicon","codicon-chevron-down"],actionRunner:(c=t?.actionRunner)!==null&&c!==void 0?c:new Ap});this._dropdown=new Uz(e,e.actions,this._contextMenuService,m),this._dropdown.actionRunner.onDidRun(v=>{v.action instanceof hc&&this.update(v.action)})}update(e){this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Qp,e,void 0),this._defaultAction.actionRunner=new class extends Ap{runAction(t,i){return $z(this,void 0,void 0,function*(){yield t.run(void 0)})}},this._container&&this._defaultAction.render(Yte(this._container,ge(".action-container")))}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=ge(".action-container");this._defaultAction.render(le(this._container,t)),this._register(ne(t,xe.KEY_DOWN,s=>{const r=new ci(s);r.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),r.stopPropagation())}));const i=ge(".dropdown-action-container");this._dropdown.render(le(this._container,i)),this._register(ne(i,xe.KEY_DOWN,s=>{var r;const o=new ci(s);o.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(r=this._defaultAction.element)===null||r===void 0||r.focus(),o.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};lT=oO([cl(2,Ni),cl(3,Wn),cl(4,Ic),cl(5,yf),cl(6,jt),cl(7,Nf)],lT);function cpe(n,e,t){return e instanceof hc?n.createInstance(Qp,e,void 0):e instanceof UR?e.item.rememberDefaultAction?n.createInstance(lT,e,t):n.createInstance(aT,e,t):void 0}var Kz=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},jz=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Gz=wt("IPeekViewService");xf(Gz,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}});var Ys;(function(n){n.inPeekEditor=new Le("inReferenceSearchEditor",!0,_("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(Ys||(Ys={}));let D0=class{constructor(e,t){e instanceof af&&Ys.inPeekEditor.bindTo(t)}dispose(){}};D0.ID="editor.contrib.referenceController";D0=Kz([jz(1,je)],D0);Ln(D0.ID,D0);function dpe(n){let e=n.get(ei).getFocusedCodeEditor();return e instanceof af?e.getParentEditor():e}const fpe={headerBackgroundColor:q.white,primaryHeadingColor:q.fromHex("#333333"),secondaryHeadingColor:q.fromHex("#6c6c6cb3")};let ey=class extends ipe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new H,this.onDidClose=this._onDidClose.event,Fa(this.options,fpe,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){let t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=ge(".head"),this._bodyElement=ge(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){const i=ge(".peekview-title");this.options.supportOnTitleClick&&(i.classList.add("clickable"),qi(i,"click",o=>this._onTitleClick(o))),le(this._headElement,i),this._fillTitleIcon(i),this._primaryHeading=ge("span.filename"),this._secondaryHeading=ge("span.dirname"),this._metaHeading=ge("span.meta"),le(i,this._primaryHeading,this._secondaryHeading,this._metaHeading);const s=ge(".peekview-actions");le(this._headElement,s);const r=this._getActionBarOptions();this._actionbarWidget=new Zu(s,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Vo("peekview.close",_("label.close","Close"),ve.close.classNames,!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:cpe.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:On(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,fr(this._metaHeading)):Ds(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(58)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};ey=Kz([jz(2,jt)],ey);const gpe=W("peekViewTitle.background",{dark:Yt(Da,.1),light:Yt(Da,.1),hc:null},_("peekViewTitleBackground","Background color of the peek view title area.")),qz=W("peekViewTitleLabel.foreground",{dark:q.white,light:q.black,hc:q.white},_("peekViewTitleForeground","Color of the peek view title.")),Zz=W("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hc:"#FFFFFF99"},_("peekViewTitleInfoForeground","Color of the peek view title info.")),ppe=W("peekView.border",{dark:Da,light:Da,hc:Pi},_("peekViewBorder","Color of the peek view borders and arrow.")),Yz=W("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:q.black},_("peekViewResultsBackground","Background color of the peek view result list.")),mpe=W("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:q.white},_("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),_pe=W("peekViewResult.fileForeground",{dark:q.white,light:"#1E1E1E",hc:q.white},_("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),vpe=W("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},_("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),bpe=W("peekViewResult.selectionForeground",{dark:q.white,light:"#6C6C6C",hc:q.white},_("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),m1=W("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:q.black},_("peekViewEditorBackground","Background color of the peek view editor.")),Cpe=W("peekViewEditorGutter.background",{dark:m1,light:m1,hc:m1},_("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),wpe=W("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},_("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),Spe=W("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},_("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),ype=W("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:As},_("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));function aO(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===OL.ICodeEditor:!1}class Lpe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class jc extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}var Tn;(function(n){function e(r,o){if(r.start>=o.end||o.start>=r.end)return{start:0,end:0};const a=Math.max(r.start,o.start),l=Math.min(r.end,o.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(r){return r.end-r.start<=0}n.isEmpty=t;function i(r,o){return!t(e(r,o))}n.intersects=i;function s(r,o){const a=[],l={start:r.start,end:Math.min(o.start,r.end)},u={start:Math.max(o.end,r.start),end:r.end};return t(l)||a.push(l),t(u)||a.push(u),a}n.relativeComplement=s})(Tn||(Tn={}));function H3(n,e){const t=[];for(let i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class z3{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const s=i.length-t,r=H3({start:0,end:e},this.groups),o=H3({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:uT(l.range,s),size:l.size})),a=i.map((l,u)=>({range:{start:e+u,end:e+u+1},size:l.size}));this.groups=xpe(r,a,o),this._size=this.groups.reduce((l,u)=>l+u.size*(u.range.end-u.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;let t=0,i=0;for(let s of this.groups){const r=s.range.end-s.range.start,o=i+r*s.size;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var Af=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};const el={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class fb{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Ipe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Npe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class Wa{constructor(e,t,i,s=el){if(this.virtualDelegate=t,this.domId=`list_id_${++Wa.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new dm(50),this.splicing=!1,this.dragOverAnimationStopDisposable=ie.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=ie.None,this.onDragLeaveTimeout=ie.None,this.disposables=new pe,this._onDidChangeContentHeight=new H,this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new z3;for(const o of i)this.renderers.set(o.templateId,o);this.cache=this.disposables.add(new Epe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=Qa(s,o=>o.horizontalScrolling,el.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=typeof s.additionalScrollHeight>"u"?0:s.additionalScrollHeight,this.accessibilityProvider=new Ape(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",Qa(s,o=>o.transformOptimization,el.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(Tt.addTarget(this.rowsContainer)),this.scrollable=new wL(Qa(s,o=>o.smoothScrolling,!1)?125:0,o=>Tl(o)),this.scrollableElement=this.disposables.add(new I2(this.rowsContainer,{alwaysConsumeMouseWheel:Qa(s,o=>o.alwaysConsumeMouseWheel,el.alwaysConsumeMouseWheel),horizontal:1,vertical:Qa(s,o=>o.verticalScrollMode,el.verticalScrollMode),useShadows:Qa(s,o=>o.useShadows,el.useShadows),mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ne(this.rowsContainer,qt.Change,o=>this.onTouchChange(o))),this.disposables.add(ne(this.scrollableElement.getDomNode(),"scroll",o=>o.target.scrollTop=0)),this.disposables.add(ne(this.domNode,"dragover",o=>this.onDragOver(this.toDragEvent(o)))),this.disposables.add(ne(this.domNode,"drop",o=>this.onDrop(this.toDragEvent(o)))),this.disposables.add(ne(this.domNode,"dragleave",o=>this.onDragLeave(this.toDragEvent(o)))),this.disposables.add(ne(this.domNode,"dragend",o=>this.onDragEnd(o))),this.setRowLineHeight=Qa(s,o=>o.setRowLineHeight,el.setRowLineHeight),this.setRowHeight=Qa(s,o=>o.setRowHeight,el.setRowHeight),this.supportDynamicHeights=Qa(s,o=>o.supportDynamicHeights,el.supportDynamicHeights),this.dnd=Qa(s,o=>o.dnd,el.dnd),this.layout()}get contentHeight(){return this.rangeMap.size}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:ok(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}updateOptions(e){e.additionalScrollHeight!==void 0&&(this.additionalScrollHeight=e.additionalScrollHeight,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling),e.mouseWheelScrollSensitivity!==void 0&&this.scrollableElement.updateOptions({mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&this.scrollableElement.updateOptions({fastScrollSensitivity:e.fastScrollSensitivity})}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r={start:e,end:e+t},o=Tn.intersect(s,r),a=new Map;for(let I=o.start;I({id:String(this.itemId++),element:I,templateId:this.virtualDelegate.getTemplateId(I),size:this.virtualDelegate.getHeight(I),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(I),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:ie.None}));let f;e===0&&t>=this.items.length?(this.rangeMap=new z3,this.rangeMap.splice(0,0,c),f=this.items,this.items=c):(this.rangeMap.splice(e,t,c),f=this.items.splice(e,t,...c));const g=i.length-t,m=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),v=uT(u,g),S=Tn.intersect(m,v);for(let I=S.start;IuT(I,g)),L=[{start:e,end:e+i.length},...b].map(I=>Tn.intersect(m,I)),E=this.getNextToLastElement(L);for(const I of L)for(let x=I.start;xI.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Tl(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10})}rerender(){if(!!this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let i={height:typeof e=="number"?e:Kte(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:ok(this.domNode)})}render(e,t,i,s,r,o=!1){const a=this.getRenderRange(t,i),l=Tn.relativeComplement(a,e),u=Tn.relativeComplement(e,a),h=this.getNextToLastElement(l);if(o){const c=Tn.intersect(e,a);for(let f=c.start;fthis.onDragStart(s.element,l,u))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=ls?"-moz-fit-content":"fit-content",e.width=ok(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.additionalScrollHeight}get onMouseClick(){return De.map(this.disposables.add(new $t(this.domNode,"click")).event,e=>this.toMouseEvent(e))}get onMouseDblClick(){return De.map(this.disposables.add(new $t(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e))}get onMouseMiddleClick(){return De.filter(De.map(this.disposables.add(new $t(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e)),e=>e.browserEvent.button===1)}get onMouseDown(){return De.map(this.disposables.add(new $t(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e))}get onContextMenu(){return De.any(De.map(this.disposables.add(new $t(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e)),De.map(this.disposables.add(new $t(this.domNode,qt.Contextmenu)).event,e=>this.toGestureEvent(e)))}get onTouchStart(){return De.map(this.disposables.add(new $t(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e))}get onTap(){return De.map(this.disposables.add(new $t(this.rowsContainer,qt.Tap)).event,e=>this.toGestureEvent(e))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(RH.TEXT,t),i.dataTransfer.setDragImage){let r;this.dnd.getDragLabel&&(r=this.dnd.getDragLabel(s,i)),typeof r>"u"&&(r=String(s.length));const o=ge(".monaco-drag-image");o.textContent=r,document.body.appendChild(o),i.dataTransfer.setDragImage(o,-10,-10),setTimeout(()=>document.body.removeChild(o),0)}this.currentDragData=new fb(s),_u.CurrentDragAndDropData=new Ipe(s),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),_u.CurrentDragAndDropData&&_u.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(_u.CurrentDragAndDropData)this.currentDragData=_u.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new Npe}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect===0?"copy":"move";let i;if(typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=wS(i).filter(s=>s>=-1&&ss-r),i=i[0]===-1?[-1]:i,Tpe(this.currentDragFeedback,i))return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Ct(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const s of i){const r=this.items[s];r.dropTarget=!0,r.row&&r.row.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=Ct(()=>{for(const s of i){const r=this.items[s];r.dropTarget=!1,r.row&&r.row.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Np(()=>this.clearDragOverFeedback(),100),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,_u.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,_u.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=ie.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=O6(this.domNode).top;this.dragOverAnimationDisposable=Jte(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Np(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const r=Number(s);if(!isNaN(r))return r}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let r,o;e===this.elementTop(s.start)?(r=s.start,o=0):s.end-s.start>1&&(r=s.start+1,o=this.elementTop(r)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let u=!1;for(let h=l.start;h=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},U3=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class Mpe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.trait}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(r=>r.templateData===i);if(s>=0){const r=this.renderedElements[s];this.trait.unrender(i),r.index=t}else{const r={index:t,templateData:i};this.renderedElements.push(r)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const r of this.renderedElements)r.index=e+t&&s.push({index:r.index+i-t,templateData:r.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}class ty{constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new H,this.onChange=this._onChange.event}get trait(){return this._trait}get renderer(){return new Mpe(this)}splice(e,t,i){var s;t=Math.max(0,Math.min(t,this.length-e));const r=i.length-t,o=e+t,a=[...this.sortedIndexes.filter(u=>uu?h+e:-1).filter(u=>u!==-1),...this.sortedIndexes.filter(u=>u>=o).map(u=>u+r)],l=this.length+r;if(this.sortedIndexes.length>0&&a.length===0&&l>0){const u=(s=this.sortedIndexes.find(h=>h>=e))!==null&&s!==void 0?s:l-1;a.push(Math.min(u,l-1))}this.renderer.splice(e,t,i.length),this._set(a,a),this.length=l}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(K3),t)}_set(e,t,i){const s=this.indexes,r=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const o=hT(r,e);return this.renderer.renderIndexes(o),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return JR(this.sortedIndexes,e,K3)>=0}dispose(){ct(this._onChange)}}Mf([Hi],ty.prototype,"renderer",null);class Rpe extends ty{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class oE{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,i.map(()=>!1));const s=this.trait.get().map(o=>this.identityProvider.getId(this.view.element(o)).toString()),r=i.map(o=>s.indexOf(this.identityProvider.getId(o).toString())>-1);this.trait.splice(e,t,r)}}function mc(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function jg(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:jg(n.parentElement)}class Xz{constructor(e,t,i){this.list=e,this.view=t,this.disposables=new pe,this.multipleSelectionDisposables=new pe,this.onKeyDown.filter(s=>s.keyCode===3).on(this.onEnter,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===16).on(this.onUpArrow,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===18).on(this.onDownArrow,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===11).on(this.onPageUpArrow,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===12).on(this.onPageDownArrow,this,this.disposables),this.onKeyDown.filter(s=>s.keyCode===9).on(this.onEscape,this,this.disposables),i.multipleSelectionSupport!==!1&&this.onKeyDown.filter(s=>(pt?s.metaKey:s.ctrlKey)&&s.keyCode===31).on(this.onCtrlA,this,this.multipleSelectionDisposables)}get onKeyDown(){return De.chain(this.disposables.add(new $t(this.view.domNode,"keydown")).event).filter(e=>!mc(e.target)).map(e=>new ci(e))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionDisposables.clear(),e.multipleSelectionSupport&&this.onKeyDown.filter(t=>(pt?t.metaKey:t.ctrlKey)&&t.keyCode===31).on(this.onCtrlA,this,this.multipleSelectionDisposables))}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(ss(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}Mf([Hi],Xz.prototype,"onKeyDown",null);var Gg;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(Gg||(Gg={}));const Qz=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=93&&n.keyCode<=102||n.keyCode>=80&&n.keyCode<=90}};class Ope{constructor(e,t,i,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.delegate=s,this.enabled=!1,this.state=Gg.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new pe,this.disposables=new pe,this.updateOptions(e.options)}updateOptions(e){(typeof e.enableKeyboardNavigation>"u"?!0:!!e.enableKeyboardNavigation)?this.enable():this.disable(),typeof e.automaticKeyboardNavigation<"u"&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=De.chain(this.enabledDisposables.add(new $t(this.view.domNode,"keydown")).event).filter(s=>!mc(s.target)).filter(()=>this.automaticKeyboardNavigation||this.triggered).map(s=>new ci(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>{s.stopPropagation(),s.preventDefault()}).map(s=>s.browserEvent.key).event,t=De.debounce(e,()=>null,800);De.reduce(De.any(e,t),(s,r)=>r===null?null:(s||"")+r)(this.onInput,this,this.enabledDisposables),t(this.onClear,this,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){!this.enabled||(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));i&&wf(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=Gg.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===Gg.Idle?1:0;this.state=Gg.Typing;for(let r=0;r"u"||N2(e,l)){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Ppe{constructor(e,t){this.list=e,this.view=t,this.disposables=new pe,De.chain(this.disposables.add(new $t(t.domNode,"keydown")).event).filter(s=>!mc(s.target)).map(s=>new ci(s)).filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.altKey).on(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!(s instanceof HTMLElement)||s.tabIndex===-1)return;const r=window.getComputedStyle(s);r.visibility==="hidden"||r.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function Jz(n){return pt?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function eU(n){return n.browserEvent.shiftKey}function Fpe(n){return n instanceof MouseEvent&&n.button===2}const $3={isSelectionSingleChangeEvent:Jz,isSelectionRangeChangeEvent:eU};class tU{constructor(e){this.list=e,this.disposables=new pe,this._onPointer=new H,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||$3),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Tt.addTarget(e.getHTMLElement()))),De.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||$3))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){jg(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(jg(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||mc(e.browserEvent.target)||jg(e.browserEvent.target))return;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionRangeChangeEvent(e))return this.changeSelection(e);if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),Fpe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(mc(e.browserEvent.target)||jg(e.browserEvent.target)||this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){const h=this.list.getFocus()[0];i=h??t,this.list.setAnchor(i)}const s=Math.min(i,t),r=Math.max(i,t),o=ss(s,r+1),a=this.list.getSelection(),l=Vpe(hT(a,[i]),i);if(l.length===0)return;const u=hT(o,Hpe(a,l));this.list.setSelection(u,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),r=s.filter(o=>o!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}}class iU{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&(e.listBackground.isOpaque()?i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`):pt||console.warn(`List with id '${this.selectorSuffix}' was styled with a non-opaque background color. This will break sub-pixel antialiasing.`)),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` + .monaco-drag-image, + .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } + `),e.listFocusAndSelectionForeground&&i.push(` + .monaco-drag-image, + .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } + `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&i.push(` + .monaco-drag-image, + .monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } + `),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&i.push(` + .monaco-list${t}.drop-target, + .monaco-list${t} .monaco-list-rows.drop-target, + .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; } + `),e.listFilterWidgetBackground&&i.push(`.monaco-list-type-filter { background-color: ${e.listFilterWidgetBackground} }`),e.listFilterWidgetOutline&&i.push(`.monaco-list-type-filter { border: 1px solid ${e.listFilterWidgetOutline}; }`),e.listFilterWidgetNoMatchesOutline&&i.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${e.listFilterWidgetNoMatchesOutline}; }`),e.listMatchesShadow&&i.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${e.listMatchesShadow}; }`),e.tableColumnsBorder&&i.push(` + .monaco-table:hover > .monaco-split-view2, + .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { + border-color: ${e.tableColumnsBorder}; + }`),this.styleElement.textContent=i.join(` +`)}}const Bpe={listFocusBackground:q.fromHex("#7FB0D0"),listActiveSelectionBackground:q.fromHex("#0E639C"),listActiveSelectionForeground:q.fromHex("#FFFFFF"),listActiveSelectionIconForeground:q.fromHex("#FFFFFF"),listFocusAndSelectionBackground:q.fromHex("#094771"),listFocusAndSelectionForeground:q.fromHex("#FFFFFF"),listInactiveSelectionBackground:q.fromHex("#3F3F46"),listInactiveSelectionIconForeground:q.fromHex("#FFFFFF"),listHoverBackground:q.fromHex("#2A2D2E"),listDropBackground:q.fromHex("#383B3D"),treeIndentGuidesStroke:q.fromHex("#a9a9a9"),tableColumnsBorder:q.fromHex("#cccccc").transparent(.2)},Wpe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function Vpe(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class zpe{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let r=0;for(const o of this.renderers)o.renderElement(e,t,i[r++],s)}disposeElement(e,t,i,s){let r=0;for(const o of this.renderers)o.disposeElement&&o.disposeElement(e,t,i[r],s),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class Upe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e);s?i.setAttribute("aria-label",s):i.removeAttribute("aria-label");const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.setAttribute("aria-level",`${r}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class $pe{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(e,t)}onDragOver(e,t,i,s){return this.dnd.onDragOver(e,t,i,s)}onDragLeave(e,t,i,s){var r,o;(o=(r=this.dnd).onDragLeave)===null||o===void 0||o.call(r,e,t,i,s)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}drop(e,t,i,s){this.dnd.drop(e,t,i,s)}}class Vl{constructor(e,t,i,s,r=Wpe){var o;this.user=e,this._options=r,this.focus=new ty("focused"),this.anchor=new ty("anchor"),this.eventBufferer=new yR,this._ariaLabel="",this.disposables=new pe,this._onDidDispose=new H,this.onDidDispose=this._onDidDispose.event;const a=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(o=this._options.accessibilityProvider)===null||o===void 0?void 0:o.getWidgetRole():"list";this.selection=new Rpe(a!=="listbox"),Fa(r,Bpe,!1);const l=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=r.accessibilityProvider,this.accessibilityProvider&&(l.push(new Upe(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(h=>new zpe(h.templateId,[...l,h]));const u=Object.assign(Object.assign({},r),{dnd:r.dnd&&new $pe(this,r.dnd)});if(this.view=new Wa(t,i,s,u),this.view.domNode.setAttribute("role",a),r.styleController)this.styleController=r.styleController(this.view.domId);else{const h=Qr(this.view.domNode);this.styleController=new iU(h,this.view.domId)}if(this.spliceable=new Lpe([new oE(this.focus,this.view,r.identityProvider),new oE(this.selection,this.view,r.identityProvider),new oE(this.anchor,this.view,r.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new Ppe(this,this.view)),(typeof r.keyboardSupport!="boolean"||r.keyboardSupport)&&(this.keyboardController=new Xz(this,this.view,r),this.disposables.add(this.keyboardController)),r.keyboardNavigationLabelProvider){const h=r.keyboardNavigationDelegate||Qz;this.typeLabelController=new Ope(this,this.view,r.keyboardNavigationLabelProvider,h),this.disposables.add(this.typeLabelController)}this.mouseController=this.createMouseController(r),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return De.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e))}get onDidChangeSelection(){return De.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e))}get domId(){return this.view.domId}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=De.chain(this.disposables.add(new $t(this.view.domNode,"keydown")).event).map(r=>new ci(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(GB).filter(()=>!1).event,i=De.chain(this.disposables.add(new $t(this.view.domNode,"keyup")).event).forEach(()=>e=!1).map(r=>new ci(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(GB).map(({browserEvent:r})=>{const o=this.getFocus(),a=o.length?o[0]:void 0,l=typeof a<"u"?this.view.element(a):void 0,u=typeof a<"u"?this.view.domElement(a):this.view.domNode;return{index:a,element:l,anchor:u,browserEvent:r}}).event,s=De.chain(this.view.onContextMenu).filter(r=>!e).map(({element:r,index:o,browserEvent:a})=>({element:r,index:o,anchor:{x:a.pageX+1,y:a.pageY},browserEvent:a})).event;return De.any(t,i,s)}get onKeyDown(){return this.disposables.add(new $t(this.view.domNode,"keydown")).event}get onDidFocus(){return De.signal(this.disposables.add(new $t(this.view.domNode,"focus",!0)).event)}createMouseController(e){return new tU(this)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e),this.typeLabelController&&this.typeLabelController.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(t=this.keyboardController)===null||t===void 0||t.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new jc(this.user,`Invalid start index: ${e}`);if(t<0)throw new jc(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new jc(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new jc(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return SN(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new jc(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const r=this.focus.get(),o=this.findNextIndex(r.length>0?r[0]+e:0,t,s);o>-1&&this.setFocus([o],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const r=this.focus.get(),o=this.findPreviousIndex(r.length>0?r[0]-e:0,t,s);o>-1&&this.setFocus([o],i)}focusNextPage(e,t){return U3(this,void 0,void 0,function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.view.element(i),r=this.getFocusedElements()[0];if(r!==s){const o=this.findPreviousIndex(i,!1,t);o>-1&&r!==this.view.element(o)?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();this.view.setScrollTop(o+this.view.renderHeight-this.view.elementHeight(i)),this.view.getScrollTop()!==o&&(this.setFocus([]),yield $v(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return U3(this,void 0,void 0,function*(){let i;const s=this.view.getScrollTop();s===0?i=this.view.indexAt(s):i=this.view.indexAfter(s-1);const r=this.view.element(i),o=this.getFocusedElements()[0];if(o!==r){const a=this.findNextIndex(i,!1,t);a>-1&&o!==this.view.element(a)?this.setFocus([a],e):this.setFocus([i],e)}else{const a=s;this.view.setScrollTop(s-this.view.renderHeight),this.view.getScrollTop()!==a&&(this.setFocus([]),yield $v(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new jc(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),r=this.view.elementHeight(e);if(Gd(t)){const o=r-this.view.renderHeight;this.view.setScrollTop(o*Do(t,0,1)+s)}else{const o=s+r,a=i+this.view.renderHeight;s=a||(s=a&&r>=this.view.renderHeight?this.view.setScrollTop(s):o>=a&&this.view.setScrollTop(o-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new jc(this.user,`Invalid index ${e}`);const t=this.view.getScrollTop(),i=this.view.elementTop(e),s=this.view.elementHeight(e);if(it+this.view.renderHeight)return null;const r=s-this.view.renderHeight;return Math.abs((t-i)/r)}getHTMLElement(){return this.view.domNode}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Mf([Hi],Vl.prototype,"onDidChangeFocus",null);Mf([Hi],Vl.prototype,"onDidChangeSelection",null);Mf([Hi],Vl.prototype,"onContextMenu",null);Mf([Hi],Vl.prototype,"onKeyDown",null);Mf([Hi],Vl.prototype,"onDidFocus",null);class Kpe{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:ie.None}}renderElement(e,t,i,s){if(i.disposable&&i.disposable.dispose(),!i.data)return;const r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,s);const o=new Pa,a=r.resolve(e,o.token);i.disposable={dispose:()=>o.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(l=>this.renderer.renderElement(l,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class jpe{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function Gpe(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new jpe(n,e.accessibilityProvider)})}class qpe{constructor(e,t,i,s,r={}){const o=()=>this.model,a=s.map(l=>new Kpe(l,o));this.list=new Vl(e,t,i,a,Gpe(o,r))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return De.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return De.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return De.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,ss(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}const Zpe={separatorBorder:q.transparent};class nU{constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){e!==this.visible&&(e?(this.size=Do(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e),this.view.setVisible&&this.view.setVisible(e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){return this.disposable.dispose(),this.view}}class Ype extends nU{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Xpe extends nU{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var vu;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(vu||(vu={}));var iy;(function(n){n.Distribute={type:"distribute"};function e(i){return{type:"split",index:i}}n.Split=e;function t(i){return{type:"invisible",cachedVisibleSize:i}}n.Invisible=t})(iy||(iy={}));class sU extends ie{constructor(e,t={}){var i,s;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=vu.Idle,this._onDidSashChange=this._register(new H),this.onDidSashChange=this._onDidSashChange.event,this._onDidSashReset=this._register(new H),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.orientation=os(t.orientation)?0:t.orientation,this.inverseAltBehavior=!!t.inverseAltBehavior,this.proportionalLayout=os(t.proportionalLayout)?!0:!!t.proportionalLayout,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=le(this.el,ge(".sash-container")),this.viewContainer=ge(".split-view-container"),this.scrollable=new wL(125,Tl),this.scrollableElement=this._register(new I2(this.viewContainer,{vertical:this.orientation===0?(i=t.scrollbarVisibility)!==null&&i!==void 0?i:1:2,horizontal:this.orientation===1?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2},this.scrollable)),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(r=>{this.viewContainer.scrollTop=r.scrollTop,this.viewContainer.scrollLeft=r.scrollLeft})),le(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Zpe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((r,o)=>{const a=os(r.visible)||r.visible?r.size:{type:"invisible",cachedVisibleSize:r.size},l=r.view;this.doAddView(l,a,o,!0)}),this.contentSize=this.viewItems.reduce((r,o)=>r+o.size,0),this.saveProportions())}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions)for(let s=0;sthis.viewItems[a].priority===1),o=s.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,r,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.size/this.contentSize))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),r=Xh(ne(document.body,"keydown",a=>o(this.sashDragState.current,a.altKey)),ne(document.body,"keyup",()=>o(this.sashDragState.current,!1))),o=(a,l)=>{const u=this.viewItems.map(m=>m.size);let h=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(s===this.sashItems.length-1){const v=this.viewItems[s];h=(v.minimumSize-v.size)/2,c=(v.maximumSize-v.size)/2}else{const v=this.viewItems[s+1];h=(v.size-v.maximumSize)/2,c=(v.size-v.minimumSize)/2}let f,g;if(!l){const m=ss(s,-1),v=ss(s+1,this.viewItems.length),S=m.reduce((k,A)=>k+(this.viewItems[A].minimumSize-u[A]),0),w=m.reduce((k,A)=>k+(this.viewItems[A].viewMaximumSize-u[A]),0),b=v.length===0?Number.POSITIVE_INFINITY:v.reduce((k,A)=>k+(u[A]-this.viewItems[A].minimumSize),0),y=v.length===0?Number.NEGATIVE_INFINITY:v.reduce((k,A)=>k+(u[A]-this.viewItems[A].viewMaximumSize),0),L=Math.max(S,y),E=Math.min(b,w),I=this.findFirstSnapIndex(m),x=this.findFirstSnapIndex(v);if(typeof I=="number"){const k=this.viewItems[I],A=Math.floor(k.viewMinimumSize/2);f={index:I,limitDelta:k.visible?L-A:L+A,size:k.size}}if(typeof x=="number"){const k=this.viewItems[x],A=Math.floor(k.viewMinimumSize/2);g={index:x,limitDelta:k.visible?E+A:E-A,size:k.size}}}this.sashDragState={start:a,current:a,index:s,sizes:u,minDelta:h,maxDelta:c,alt:l,snapBefore:f,snapAfter:g,disposable:r}};o(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:r,minDelta:o,maxDelta:a,snapBefore:l,snapAfter:u}=this.sashDragState;this.sashDragState.current=e;const h=e-i,c=this.resize(t,h,s,void 0,void 0,o,a,l,u);if(r){const f=t===this.sashItems.length-1,g=this.viewItems.map(y=>y.size),m=f?t:t+1,v=this.viewItems[m],S=v.size-v.maximumSize,w=v.size-v.minimumSize,b=f?t-1:t+1;this.resize(b,-c,g,void 0,void 0,S,w)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=Do(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==vu.Idle)throw new Error("Cant modify splitview");if(this.state=vu.Busy,e<0||e>=this.viewItems.length)return;const i=ss(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===1),e],r=i.filter(a=>this.viewItems[a].priority===2),o=this.viewItems[e];t=Math.round(t),t=Do(t,o.minimumSize,Math.min(o.maximumSize,this.size)),o.size=t,this.relayout(s,r),this.state=vu.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=Do(i,a.minimumSize,a.maximumSize);const s=ss(this.viewItems.length),r=s.filter(a=>this.viewItems[a].priority===1),o=s.filter(a=>this.viewItems[a].priority===2);this.relayout(r,o)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==vu.Idle)throw new Error("Cant modify splitview");this.state=vu.Busy;const r=ge(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(r):this.viewContainer.insertBefore(r,this.viewContainer.children.item(i));const o=e.onDidChange(f=>this.onViewChange(h,f)),a=Ct(()=>this.viewContainer.removeChild(r)),l=Xh(o,a);let u;typeof t=="number"?u=t:t.type==="split"?u=this.getViewSize(t.index)/2:t.type==="invisible"?u={cachedVisibleSize:t.cachedVisibleSize}:u=e.minimumSize;const h=this.orientation===0?new Ype(r,e,u,l):new Xpe(r,e,u,l);if(this.viewItems.splice(i,0,h),this.viewItems.length>1){let f={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash};const g=this.orientation===0?new An(this.sashContainer,{getHorizontalSashTop:k=>this.getSashPosition(k),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},f),{orientation:1})):new An(this.sashContainer,{getVerticalSashLeft:k=>this.getSashPosition(k),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},f),{orientation:0})),m=this.orientation===0?k=>({sash:g,start:k.startY,current:k.currentY,alt:k.altKey}):k=>({sash:g,start:k.startX,current:k.currentX,alt:k.altKey}),S=De.map(g.onDidStart,m)(this.onSashStart,this),b=De.map(g.onDidChange,m)(this.onSashChange,this),L=De.map(g.onDidEnd,()=>this.sashItems.findIndex(k=>k.sash===g))(this.onSashEnd,this),E=g.onDidReset(()=>{const k=this.sashItems.findIndex(ee=>ee.sash===g),A=ss(k,-1),z=ss(k+1,this.viewItems.length),V=this.findFirstSnapIndex(A),Q=this.findFirstSnapIndex(z);typeof V=="number"&&!this.viewItems[V].visible||typeof Q=="number"&&!this.viewItems[Q].visible||this._onDidSashReset.fire(k)}),I=Xh(S,b,L,E,g),x={sash:g,disposable:I};this.sashItems.splice(i-1,0,x)}r.appendChild(e.element);let c;typeof t!="number"&&t.type==="split"&&(c=[t.index]),s||this.relayout([i],c),this.state=vu.Idle,!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((s,r)=>s+r.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(h=>h.size),s,r,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,u){if(e<0||e>=this.viewItems.length)return 0;const h=ss(e,-1),c=ss(e+1,this.viewItems.length);if(r)for(const x of r)vk(h,x),vk(c,x);if(s)for(const x of s)FC(h,x),FC(c,x);const f=h.map(x=>this.viewItems[x]),g=h.map(x=>i[x]),m=c.map(x=>this.viewItems[x]),v=c.map(x=>i[x]),S=h.reduce((x,k)=>x+(this.viewItems[k].minimumSize-i[k]),0),w=h.reduce((x,k)=>x+(this.viewItems[k].maximumSize-i[k]),0),b=c.length===0?Number.POSITIVE_INFINITY:c.reduce((x,k)=>x+(i[k]-this.viewItems[k].minimumSize),0),y=c.length===0?Number.NEGATIVE_INFINITY:c.reduce((x,k)=>x+(i[k]-this.viewItems[k].maximumSize),0),L=Math.max(S,y,o),E=Math.min(b,w,a);let I=!1;if(l){const x=this.viewItems[l.index],k=t>=l.limitDelta;I=k!==x.visible,x.setVisible(k,l.size)}if(!I&&u){const x=this.viewItems[u.index],k=ta+l.size,0);let i=this.size-t;const s=ss(this.viewItems.length-1,-1),r=s.filter(a=>this.viewItems[a].priority===1),o=s.filter(a=>this.viewItems[a].priority===2);for(const a of o)vk(s,a);for(const a of r)FC(s,a);typeof e=="number"&&FC(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),s=[...this.viewItems].reverse();e=!1;const r=s.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const o=s.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?u.state=1:b&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}dispose(){super.dispose(),this.viewItems.forEach(e=>e.dispose()),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[]}}class gb{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=gb.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(r=>[r.templateId,r]));this.renderers=[];for(const r of e){const o=s.get(r.templateId);if(!o)throw new Error(`Table cell renderer for template id ${r.templateId} not found.`);this.renderers.push(o)}}renderTemplate(e){const t=le(e,ge(".monaco-table-tr")),i=[],s=[];for(let o=0;onew Jpe(h,c)),l={size:a.reduce((h,c)=>h+c.column.weight,0),views:a.map(h=>({size:h.column.weight,view:h}))};this.splitview=new sU(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l}),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const u=new gb(s,r,h=>this.splitview.getViewSize(h));this.list=new Vl(e,this.domNode,Qpe(i),[u],o),this.columnLayoutDisposable=De.any(...a.map(h=>h.onDidLayout))(([h,c])=>u.layoutColumn(h,c)),this.styleElement=Qr(this.domNode),this.style({})}get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { + top: ${this.virtualDelegate.headerRowHeight+1}px; + height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); + }`),this.styleElement.textContent=t.join(` +`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.splitview.dispose(),this.list.dispose(),this.columnLayoutDisposable.dispose()}}FL.InstanceCount=0;var Cv;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element"})(Cv||(Cv={}));class Ur extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class lO{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}class Sh{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class j3{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new Sh(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class _l{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,r,o]=_l._getElements(e),[a,l,u]=_l._getElements(t);this._hasStrings=o&&u,this._originalStringElements=s,this._originalElementsOrHash=r,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(_l._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,r=t.length;s=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let c;return i<=s?(cg.Assert(e===t+1,"originalStart should only be one more than originalEnd"),c=[new Sh(e,0,i,s-i+1)]):e<=t?(cg.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),c=[new Sh(e,t-e+1,i,0)]):(cg.Assert(e===t+1,"originalStart should only be one more than originalEnd"),cg.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),c=[]),c}const o=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,s,o,a,r),u=o[0],h=a[0];if(l!==null)return l;if(!r[0]){const c=this.ComputeDiffRecursive(e,u,i,h,r);let f=[];return r[0]?f=[new Sh(u+1,t-(u+1)+1,h+1,s-(h+1)+1)]:f=this.ComputeDiffRecursive(u+1,t,h+1,s,r),this.ConcatenateChanges(c,f)}return[new Sh(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,r,o,a,l,u,h,c,f,g,m,v,S,w,b){let y=null,L=null,E=new G3,I=t,x=i,k=g[0]-S[0]-s,A=-1073741824,z=this.m_forwardHistory.length-1;do{const V=k+e;V===I||V=0&&(u=this.m_forwardHistory[z],e=u[0],I=1,x=u.length-1)}while(--z>=-1);if(y=E.getReverseChanges(),b[0]){let V=g[0]+1,Q=S[0]+1;if(y!==null&&y.length>0){const ee=y[y.length-1];V=Math.max(V,ee.getOriginalEnd()),Q=Math.max(Q,ee.getModifiedEnd())}L=[new Sh(V,f-V+1,Q,v-Q+1)]}else{E=new G3,I=o,x=a,k=g[0]-S[0]-l,A=1073741824,z=w?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const V=k+r;V===I||V=h[V+1]?(c=h[V+1]-1,m=c-k-l,c>A&&E.MarkNextChange(),A=c+1,E.AddOriginalElement(c+1,m+1),k=V+1-r):(c=h[V-1],m=c-k-l,c>A&&E.MarkNextChange(),A=c,E.AddModifiedElement(c+1,m+1),k=V-1-r),z>=0&&(h=this.m_reverseHistory[z],r=h[0],I=1,x=h.length-1)}while(--z>=-1);L=E.getChanges()}return this.ConcatenateChanges(y,L)}ComputeRecursionPoint(e,t,i,s,r,o,a){let l=0,u=0,h=0,c=0,f=0,g=0;e--,i--,r[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const m=t-e+(s-i),v=m+1,S=new Int32Array(v),w=new Int32Array(v),b=s-i,y=t-e,L=e-i,E=t-s,x=(y-b)%2===0;S[b]=e,w[y]=t,a[0]=!1;for(let k=1;k<=m/2+1;k++){let A=0,z=0;h=this.ClipDiagonalBound(b-k,k,b,v),c=this.ClipDiagonalBound(b+k,k,b,v);for(let Q=h;Q<=c;Q+=2){Q===h||QA+z&&(A=l,z=u),!x&&Math.abs(Q-y)<=k-1&&l>=w[Q])return r[0]=l,o[0]=u,ee<=w[Q]&&1447>0&&k<=1447+1?this.WALKTRACE(b,h,c,L,y,f,g,E,S,w,l,t,r,u,s,o,x,a):null}const V=(A-e+(z-i)-k)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(A,V))return a[0]=!0,r[0]=A,o[0]=z,V>0&&1447>0&&k<=1447+1?this.WALKTRACE(b,h,c,L,y,f,g,E,S,w,l,t,r,u,s,o,x,a):(e++,i++,[new Sh(e,t-e+1,i,s-i+1)]);f=this.ClipDiagonalBound(y-k,k,y,v),g=this.ClipDiagonalBound(y+k,k,y,v);for(let Q=f;Q<=g;Q+=2){Q===f||Q=w[Q+1]?l=w[Q+1]-1:l=w[Q-1],u=l-(Q-y)-E;const ee=l;for(;l>e&&u>i&&this.ElementsAreEqual(l,u);)l--,u--;if(w[Q]=l,x&&Math.abs(Q-b)<=k&&l<=S[Q])return r[0]=l,o[0]=u,ee>=S[Q]&&1447>0&&k<=1447+1?this.WALKTRACE(b,h,c,L,y,f,g,E,S,w,l,t,r,u,s,o,x,a):null}if(k<=1447){let Q=new Int32Array(c-h+2);Q[0]=b-h+1,dg.Copy2(S,h,Q,1,c-h+1),this.m_forwardHistory.push(Q),Q=new Int32Array(g-f+2),Q[0]=y-f+1,dg.Copy2(w,f,Q,1,g-f+1),this.m_reverseHistory.push(Q)}}return this.WALKTRACE(b,h,c,L,y,f,g,E,S,w,l,t,r,u,s,o,x,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let s=0,r=0;if(t>0){const c=e[t-1];s=c.originalStart+c.originalLength,r=c.modifiedStart+c.modifiedLength}const o=i.originalLength>0,a=i.modifiedLength>0;let l=0,u=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let c=1;;c++){const f=i.originalStart-c,g=i.modifiedStart-c;if(fu&&(u=v,l=c)}i.originalStart-=l,i.modifiedStart-=l;const h=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],h)){e[t-1]=h[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&g>l&&(l=g,u=c,h=f)}return l>0?[u,h]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let r=0;r=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const r=this._OriginalRegionIsBoundary(e,t)?1:0,o=this._ModifiedRegionIsBoundary(i,s)?1:0;return r+o}ConcatenateChanges(e,t){let i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return dg.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],dg.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return dg.Copy(e,0,s,0,e.length),dg.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(cg.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),cg.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){const s=e.originalStart;let r=e.originalLength;const o=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(r=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Sh(s,r,o,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e"u"?!1:s.collapseByDefault,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=gt.empty(),s={}){if(e.length===0)throw new Ur(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s,r,o){var a;s===void 0&&(s=gt.empty()),o===void 0&&(o=(a=r.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,s,r);const u=[...s],h=t[t.length-1],c=new _l({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,h),...u,...l.children.slice(h+i)].map(S=>e.getId(S.element).toString())}).ComputeDiff(!1);if(c.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,u,r);const f=t.slice(0,-1),g=(S,w,b)=>{if(o>0)for(let y=0;yb.originalStart-w.originalStart))g(m,v,m-(S.originalStart+S.originalLength)),m=S.originalStart,v=S.modifiedStart-h,this.spliceSimple([...f,m],S.originalLength,gt.slice(u,v,v+S.modifiedLength),r);g(m,v,m)}spliceSimple(e,t,i=gt.empty(),{onDidCreateNode:s,onDidDeleteNode:r,diffIdentityProvider:o}){const{parentNode:a,listIndex:l,revealed:u,visible:h}=this.getParentNodeWithListIndex(e),c=[],f=gt.map(i,x=>this.createTreeNode(x,a,a.visible?1:0,u,c,s)),g=e[e.length-1],m=a.children.length>0;let v=0;for(let x=g;x>=0&&xo.getId(x.element).toString())):a.lastDiffIds=a.children.map(x=>o.getId(x.element).toString()):a.lastDiffIds=void 0;let L=0;for(const x of y)x.visible&&L++;if(L!==0)for(let x=g+S.length;xk+(A.visible?A.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-x),this.list.splice(l,x,c)}if(y.length>0&&r){const x=k=>{r(k),k.children.forEach(x)};y.forEach(x)}const E=a.children.length>0;m!==E&&this.setCollapsible(e.slice(0,-1),E),this._onDidSplice.fire({insertedNodes:S,deletedNodes:y});let I=a;for(;I;){if(I.visibility===2){this.refilter();break}I=I.parent}}rerender(e){if(e.length===0)throw new Ur(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const r={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:r}=this.getTreeNodeWithListIndex(e),o=this._setListNodeCollapseState(i,s,r,t);if(i!==this.root&&this.autoExpandSingleChildren&&o&&!aE(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return o}_setListNodeCollapseState(e,t,i,s){const r=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!r)return r;const o=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=o-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),r}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(aE(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!aE(t)&&t.recursive)for(const r of e.children)s=this._setNodeCollapseState(r,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t)}createTreeNode(e,t,i,s,r,o){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,s&&r.push(a);const u=e.children||gt.empty(),h=s&&l!==0&&!a.collapsed,c=gt.map(u,m=>this.createTreeNode(m,a,l,h,r,o));let f=0,g=1;for(const m of c)a.children.push(m),g+=m.renderNodeCount,m.visible&&(m.visibleChildIndex=f++);return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=f,a.visible=l===2?f>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=g):(a.renderNodeCount=0,s&&r.pop()),o&&o(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let r;if(e!==this.root){if(r=this._filterNode(e,t),r===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const o=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||r!==0){let l=0;for(const u of e.children)a=this._updateNodeAfterFilterChange(u,r,i,s&&!e.collapsed)||a,u.visible&&(u.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=r===2?a:r===1,e.visibility=r),e.visible?e.collapsed||(e.renderNodeCount+=i.length-o):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):uO(i)?(e.filterData=i.data,x0(i.visibility)):(e.filterData=void 0,x0(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new Ur(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:r}=this.getParentNodeWithListIndex(e),o=e[e.length-1];if(o<0||o>t.children.length)throw new Ur(this.user,"Invalid tree location");const a=t.children[o];return{node:a,listIndex:i,revealed:s,visible:r&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,r=!0){const[o,...a]=e;if(o<0||o>t.children.length)throw new Ur(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function lE(n){return n instanceof fb?new nme(n):n}class sme{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=ie.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(lE(e),t)}onDragOver(e,t,i,s,r=!0){const o=this.dnd.onDragOver(lE(e),t&&t.element,i,s),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return o;if(a&&typeof o!="boolean"&&o.autoExpand&&(this.autoExpandDisposable=Np(()=>{const f=this.modelProvider(),g=f.getNodeLocation(t);f.isCollapsed(g)&&f.setCollapsed(g,!1),this.autoExpandNode=void 0},500)),typeof o=="boolean"||!o.accept||typeof o.bubble>"u"||o.feedback){if(!r){const f=typeof o=="boolean"?o:o.accept,g=typeof o=="boolean"?void 0:o.effect;return{accept:f,effect:g,feedback:[i]}}return o}if(o.bubble===1){const f=this.modelProvider(),g=f.getNodeLocation(t),m=f.getParentNodeLocation(g),v=f.getNode(m),S=m&&f.getListIndex(m);return this.onDragOver(e,v,S,s,!1)}const l=this.modelProvider(),u=l.getNodeLocation(t),h=l.getListIndex(u),c=l.getListRenderCount(u);return Object.assign(Object.assign({},o),{feedback:ss(h,h+c)})}drop(e,t,i,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(lE(e),t&&t.element,i,s)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function rme(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new sme(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const i=n(),s=i.getNodeLocation(t),r=i.getParentNodeLocation(s);return i.getNode(r).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}),enableKeyboardNavigation:e.simpleKeyboardNavigation})}class hO{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight&&this.delegate.setDynamicHeight(e.element,t)}}var k0;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(k0||(k0={}));class ome{constructor(e,t=[]){this._elements=t,this.onDidChange=De.forEach(e,i=>this._elements=i)}get elements(){return this._elements}}class E0{constructor(e,t,i,s,r={}){this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=E0.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new gde,this.activeIndentNodes=new Set,this.indentGuidesDisposable=ie.None,this.disposables=new pe,this.templateId=e.templateId,this.updateOptions(r),De.map(i,o=>o.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"&&(this.indent=Do(e.indent,0,40)),typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==k0.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const i=new pe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=le(e,ge(".monaco-tl-row")),i=le(t,ge(".monaco-tl-indent")),s=le(t,ge(".monaco-tl-twistie")),r=le(t,ge(".monaco-tl-contents")),o=this.renderer.renderTemplate(r);return{container:e,indent:i,twistie:s,indentGuidesDisposable:ie.None,templateData:o}}renderElement(e,t,i,s){typeof s=="number"&&(this.renderedNodes.set(e,{templateData:i,height:s}),this.renderedElements.set(e.element,e));const r=E0.DefaultIndent+(e.depth-1)*this.indent;i.twistie.style.paddingLeft=`${r}px`,i.indent.style.width=`${r+this.indent-16}px`,this.renderTwistie(e,i),typeof s=="number"&&this.renderIndentGuides(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);!t||this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);!t||(this.renderTwistie(e,t.templateData),this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderIndentGuides(e,t.templateData))}renderTwistie(e,t){t.twistie.classList.remove(...q3.classNamesArray);let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...q3.classNamesArray),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded")}renderIndentGuides(e,t){if(On(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new pe,s=this.modelProvider();let r=e;for(;;){const o=s.getNodeLocation(r),a=s.getParentNodeLocation(o);if(!a)break;const l=s.getNode(a),u=ge(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(l)&&u.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(u):t.indent.insertBefore(u,t.indent.firstElementChild),this.renderedIndentGuides.add(l,u),i.add(Ct(()=>this.renderedIndentGuides.delete(l,u))),r=l}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const r=i.getNodeLocation(s);try{const o=i.getParentNodeLocation(r);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):o&&t.add(i.getNode(o))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,r=>r.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,r=>r.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),ct(this.disposables)}}E0.DefaultIndent=8;class ame{constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new pe,e.onWillRefilter(this.reset,this,this.disposables)}get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}filter(e,t){if(this._filter){const r=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return r;let o;if(typeof r=="boolean"?o=r?1:0:uO(r)?o=x0(r.visibility):o=r,o===0)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:ka.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(i)?i:[i];for(const r of s){const o=r&&r.toString();if(typeof o>"u")return{data:ka.Default,visibility:!0};const a=h0(this._pattern,this._lowercasePattern,0,o,o.toLowerCase(),0,!0);if(a)return this._matchCount++,s.length===1?{data:a,visibility:!0}:{data:{label:o,score:a},visibility:!0}}return this.tree.options.filterOnType?2:{data:ka.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){ct(this.disposables)}}class lme{constructor(e,t,i,s,r){this.tree=e,this.view=i,this.filter=s,this.keyboardNavigationDelegate=r,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new H,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new H,this.enabledDisposables=new pe,this.disposables=new pe,this.domNode=ge(`.monaco-list-type-filter.${this.positionClassName}`),this.domNode.draggable=!0,this.disposables.add(ne(this.domNode,"dragstart",()=>this.onDragStart())),this.messageDomNode=le(i.getHTMLElement(),ge(".monaco-list-type-filter-message")),this.labelDomNode=le(this.domNode,ge("span.label"));const o=le(this.domNode,ge(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=le(o,ge("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),this.disposables.add(ne(this.filterOnTypeDomNode,"input",()=>this.onDidChangeFilterOnType())),this.clearDomNode=le(o,ge("button.clear"+ime.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=_("clear","Clear"),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}get enabled(){return this._enabled}get pattern(){return this._pattern}get filterOnType(){return this._filterOnType}updateOptions(e){e.simpleKeyboardNavigation?this.disable():this.enable(),typeof e.filterOnType<"u"&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType,this.updateFilterOnTypeTitleAndIcon()),typeof e.automaticKeyboardNavigation<"u"&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=this.enabledDisposables.add(new $t(this.view.getHTMLElement(),"keydown")),t=De.chain(e.event).filter(s=>!mc(s.target)||s.target===this.filterOnTypeDomNode).filter(s=>s.key!=="Dead"&&!/^Media/.test(s.key)).map(s=>new ci(s)).filter(this.keyboardNavigationEventFilter||(()=>!0)).filter(()=>this.automaticKeyboardNavigation||this.triggered).filter(s=>this.keyboardNavigationDelegate.mightProducePrintableCharacter(s)&&!(s.keyCode===18||s.keyCode===16||s.keyCode===15||s.keyCode===17)||(this.pattern.length>0||this.triggered)&&(s.keyCode===9||s.keyCode===1)&&!s.altKey&&!s.ctrlKey&&!s.metaKey||s.keyCode===1&&(pt?s.altKey&&!s.metaKey:s.ctrlKey)&&!s.shiftKey).forEach(s=>{s.stopPropagation(),s.preventDefault()}).event,i=this.enabledDisposables.add(new $t(this.clearDomNode,"click"));De.chain(De.any(t,i.event)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(),this.render(),this._enabled=!0,this.triggered=!1}disable(){!this._enabled||(this.domNode.remove(),this.enabledDisposables.clear(),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)}onEventOrInput(e){typeof e=="string"?this.onInput(e):e instanceof MouseEvent||e.keyCode===9||e.keyCode===1&&(pt?e.altKey:e.ctrlKey)?this.onInput(""):e.keyCode===1?this.onInput(this.pattern.length===0?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)}onInput(e){const t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,s=>!ka.isDefault(s.filterData));const i=this.tree.getFocus();if(i.length>0){const s=i[0];this.tree.getRelativeTop(s)===null&&this.tree.reveal(s,.5)}this.render(),e||(this.triggered=!1)}onDragStart(){const e=this.view.getHTMLElement(),{left:t}=bn(e),i=e.clientWidth,s=i/2,r=this.domNode.clientWidth,o=new pe;let a=this.positionClassName;const l=()=>{switch(a){case"nw":this.domNode.style.top="4px",this.domNode.style.left="4px";break;case"ne":this.domNode.style.top="4px",this.domNode.style.left=`${i-r-6}px`;break}},u=c=>{c.preventDefault();const f=c.clientX-t;c.dataTransfer&&(c.dataTransfer.dropEffect="none"),f{this.positionClassName=a,this.domNode.className=`monaco-list-type-filter ${this.positionClassName}`,this.domNode.style.top="",this.domNode.style.left="",ct(o)};l(),this.domNode.classList.remove(a),this.domNode.classList.add("dragging"),o.add(Ct(()=>this.domNode.classList.remove("dragging"))),o.add(ne(document,"dragover",c=>u(c))),o.add(ne(this.domNode,"dragend",()=>h())),_u.CurrentDragAndDropData=new Yle("vscode-ui"),o.add(Ct(()=>_u.CurrentDragAndDropData=void 0))}onDidSpliceModel(){!this._enabled||this.pattern.length===0||(this.tree.refilter(),this.render())}onDidChangeFilterOnType(){this.tree.updateOptions({filterOnType:this.filterOnTypeDomNode.checked}),this.tree.refilter(),this.tree.domFocus(),this.render(),this.updateFilterOnTypeTitleAndIcon()}updateFilterOnTypeTitleAndIcon(){this.filterOnType?(this.filterOnTypeDomNode.classList.remove(...Y3.classNamesArray),this.filterOnTypeDomNode.classList.add(...Z3.classNamesArray),this.filterOnTypeDomNode.title=_("disable filter on type","Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...Z3.classNamesArray),this.filterOnTypeDomNode.classList.add(...Y3.classNamesArray),this.filterOnTypeDomNode.title=_("enable filter on type","Enable Filter on Type"))}render(){const e=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=_("empty","No elements found"),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),this.domNode.classList.toggle("no-matches",e),this.domNode.title=_("found","Matched {0} out of {1} elements",this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"\u2026"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)}shouldAllowFocus(e){return!this.enabled||!this.pattern||this.filterOnType||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!ka.isDefault(e.filterData)}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),ct(this.disposables)}}function X3(n){let e=Cv.Unknown;return T5(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Cv.Twistie:T5(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(e=Cv.Element),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function _1(n,e){e(n),n.children.forEach(t=>_1(t,e))}class uE{constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new H,this.onDidChange=this._onDidChange.event}get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}set(e,t){var i;!(!((i=t)===null||i===void 0)&&i.__forceEvent)&&xl(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),u=h=>l.delete(h);t.forEach(h=>_1(h,u)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>_1(l,s));const r=new Map,o=l=>r.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>_1(l,o));const a=[];for(const l of this.nodes){const u=this.identityProvider.getId(l.element).toString();if(!i.has(u))a.push(l);else{const c=r.get(u);c&&a.push(c)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class ume extends tU{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(mc(e.browserEvent.target)||jg(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let r=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,r&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const o=this.tree.model,a=o.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),o.setCollapsed(a,void 0,l),r&&s)return}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||super.onDoubleClick(e)}}class hme extends Vl{constructor(e,t,i,s,r,o,a,l){super(e,t,i,s,l),this.focusTrait=r,this.selectionTrait=o,this.anchorTrait=a}createMouseController(e){return new ume(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],r=[];let o;i.forEach((a,l)=>{this.focusTrait.has(a)&&s.push(e+l),this.selectionTrait.has(a)&&r.push(e+l),this.anchorTrait.has(a)&&(o=e+l)}),s.length>0&&super.setFocus(wS([...super.getFocus(),...s])),r.length>0&&super.setSelection(wS([...super.getSelection(),...r])),typeof o=="number"&&super.setAnchor(o)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class rU{constructor(e,t,i,s,r={}){this._options=r,this.eventBufferer=new yR,this.disposables=new pe,this._onWillRefilter=new H,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new H;const o=new hO(i),a=new x5,l=new x5,u=new ome(l.event);this.renderers=s.map(f=>new E0(f,()=>this.model,a.event,u,r));for(let f of this.renderers)this.disposables.add(f);let h;r.keyboardNavigationLabelProvider&&(h=new ame(this,r.keyboardNavigationLabelProvider,r.filter),r=Object.assign(Object.assign({},r),{filter:h}),this.disposables.add(h)),this.focus=new uE(()=>this.view.getFocusedElements()[0],r.identityProvider),this.selection=new uE(()=>this.view.getSelectedElements()[0],r.identityProvider),this.anchor=new uE(()=>this.view.getAnchorElement(),r.identityProvider),this.view=new hme(e,t,o,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},rme(()=>this.model,r)),{tree:this})),this.model=this.createModel(e,this.view,r),a.input=this.model.onDidChangeCollapseState;const c=De.forEach(this.model.onDidSplice,f=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(f),this.selection.onDidModelSplice(f)})});if(c(()=>null,null,this.disposables),l.input=De.chain(De.any(c,this.focus.onDidChange,this.selection.onDidChange)).debounce(()=>null,0).map(()=>{const f=new Set;for(const g of this.focus.getNodes())f.add(g);for(const g of this.selection.getNodes())f.add(g);return[...f.values()]}).event,r.keyboardSupport!==!1){const f=De.chain(this.view.onKeyDown).filter(g=>!mc(g.target)).map(g=>new ci(g));f.filter(g=>g.keyCode===15).on(this.onLeftArrow,this,this.disposables),f.filter(g=>g.keyCode===17).on(this.onRightArrow,this,this.disposables),f.filter(g=>g.keyCode===10).on(this.onSpace,this,this.disposables)}if(r.keyboardNavigationLabelProvider){const f=r.keyboardNavigationDelegate||Qz;this.typeFilterController=new lme(this,this.model,this.view,h,f),this.focusNavigationFilter=g=>this.typeFilterController.shouldAllowFocus(g),this.disposables.add(this.typeFilterController)}this.styleElement=Qr(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===k0.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return De.map(this.view.onMouseDblClick,X3)}get onPointer(){return De.map(this.view.onPointer,X3)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(Object.assign(Object.assign({},this._options),{enableKeyboardNavigation:this._options.simpleKeyboardNavigation})),this.typeFilterController&&this.typeFilterController.updateOptions(this._options),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===k0.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeIndentGuidesStroke.transparent(.4)}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join(` +`),this.view.style(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(r=>this.model.getNode(r));this.selection.set(i,t);const s=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setSelection(s,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(r=>this.model.getNode(r));this.focus.set(i,t);const s=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setFocus(s,t,!0)}focusNext(e=1,t=!1,i,s=this.focusNavigationFilter){this.view.focusNext(e,t,i,s)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}getRelativeTop(e){const t=this.model.getListIndex(e);return t===-1?null:this.view.getRelativeTop(t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const o=this.model.getParentNodeLocation(s);if(!o)return;const a=this.model.getListIndex(o);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!1)){if(!i.children.some(l=>l.visible))return;const[o]=this.view.getFocus(),a=o+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i),r=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,r)}dispose(){ct(this.disposables),this.view.dispose()}}class cO{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new tme(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(s,r){return i.sorter.compare(s.element,r.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=gt.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=gt.empty(),i){const s=new Set,r=new Set,o=l=>{var u;if(l.element===null)return;const h=l;if(s.add(h.element),this.nodes.set(h.element,h),this.identityProvider){const c=this.identityProvider.getId(h.element).toString();r.add(c),this.nodesByIdentity.set(c,h)}(u=i.onDidCreateNode)===null||u===void 0||u.call(i,h)},a=l=>{var u;if(l.element===null)return;const h=l;if(s.has(h.element)||this.nodes.delete(h.element),this.identityProvider){const c=this.identityProvider.getId(h.element).toString();r.has(c)||this.nodesByIdentity.delete(c)}(u=i.onDidDeleteNode)===null||u===void 0||u.call(i,h)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:a}))}preserveCollapseState(e=gt.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),gt.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const o=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(o)}if(!i)return Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children)});const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible,r=typeof t.collapsed<"u"?t.collapsed:i.collapsed;return Object.assign(Object.assign({},t),{collapsible:s,collapsed:r,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Ur(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Ur(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Ur(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Ur(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function v1(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:gt.map(gt.from(n.children),v1),collapsible:n.collapsible,collapsed:n.collapsed}}function b1(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=gt.consume(gt.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:gt.map(gt.concat(s,i),b1),collapsible:n.collapsible,collapsed:n.collapsed}}function cT(n,e=0){let t;return ecT(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function Q3(n){return cT(n,0)}function oU(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:gt.map(gt.from(n.children),i=>oU(i,e,t))})}const cme=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class dme{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new cO(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}setChildren(e,t=gt.empty(),i){const s=i.diffIdentityProvider&&cme(i.diffIdentityProvider);if(e===null){const g=gt.map(t,this.enabled?b1:v1);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const r=this.nodes.get(e);if(!r)throw new Error("Unknown compressed tree node");const o=this.model.getNode(r),a=this.model.getParentNodeLocation(r),l=this.model.getNode(a),u=Q3(o),h=oU(u,e,t),c=(this.enabled?b1:v1)(h),f=l.children.map(g=>g===o?c:g);this._setChildren(l.element,f,{diffIdentityProvider:s,diffDepth:o.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=gt.map(i,Q3),r=gt.map(s,e?b1:v1);this._setChildren(null,r,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,r=a=>{for(const l of a.element.elements)s.add(l),this.nodes.set(l,a.element)},o=a=>{for(const l of a.element.elements)s.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:o}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Ur(this.user,`Tree element not found: ${e}`);return t}}const fme=n=>n[n.length-1];class dO{constructor(e,t){this.unwrapper=e,this.node=t}get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new dO(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}function gme(n,e){return{splice(t,i,s){e.splice(t,i,s.map(r=>n.map(r)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function pme(n,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}})}class mme{constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||fme;const s=r=>this.elementMapper(r.elements);this.nodeMapper=new lO(r=>new dO(s,r)),this.model=new dme(e,gme(this.nodeMapper,t),pme(s,i))}get onDidSplice(){return De.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return De.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return De.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}setChildren(e,t=gt.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var _me=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class fO extends rU{constructor(e,t,i,s,r={}){super(e,t,i,s,r)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=gt.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new cO(e,t,i)}}class aU{constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){const r=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);r.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=r,this.renderer.renderCompressedElements(r,t,i.data,s))}disposeElement(e,t,i,s){i.compressedTreeNode?this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(i.compressedTreeNode,t,i.data,s):this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}_me([Hi],aU.prototype,"compressedTreeNodeProvider",null);function vme(n,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let i;try{i=n().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return i.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}class lU extends fO{constructor(e,t,i,s,r={}){const o=()=>this,a=s.map(l=>new aU(o,l));super(e,t,i,a,vme(o,r))}setChildren(e,t=gt.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new mme(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var ph=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function hE(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function dT(n,e){return e.parent?e.parent===n?!0:dT(n,e.parent):!1}function bme(n,e){return n===e||dT(n,e)||dT(e,n)}class gO{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new gO(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class Cme{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...ny.classNamesArray),!0):(t.classList.remove(...ny.classNamesArray),!1)}disposeElement(e,t,i,s){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function J3(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function eW(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class wme extends fb{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function cE(n){return n instanceof fb?new wme(n):n}class Sme{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(cE(e),t)}onDragOver(e,t,i,s,r=!0){return this.dnd.onDragOver(cE(e),t&&t.element,i,s)}drop(e,t,i,s){this.dnd.drop(cE(e),t&&t.element,i,s)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function uU(n){return n&&Object.assign(Object.assign({},n),{collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new Sme(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:n.accessibilityProvider&&Object.assign(Object.assign({},n.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=n.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))}),filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},n.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),additionalScrollHeight:n.additionalScrollHeight})}function fT(n,e){e(n),n.children.forEach(t=>fT(t,e))}class hU{constructor(e,t,i,s,r,o={}){this.user=e,this.dataSource=r,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new H,this._onDidChangeNodeSlowState=new H,this.nodeMapper=new lO(a=>new gO(a)),this.disposables=new pe,this.identityProvider=o.identityProvider,this.autoExpandSingleChildren=typeof o.autoExpandSingleChildren>"u"?!1:o.autoExpandSingleChildren,this.sorter=o.sorter,this.collapseByDefault=o.collapseByDefault,this.tree=this.createTree(e,t,i,s,o),this.root=hE({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}get onDidChangeFocus(){return De.map(this.tree.onDidChangeFocus,J3)}get onDidChangeSelection(){return De.map(this.tree.onDidChangeSelection,J3)}get onMouseDblClick(){return De.map(this.tree.onMouseDblClick,eW)}get onPointer(){return De.map(this.tree.onPointer,eW)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,i,s,r){const o=new hO(i),a=s.map(u=>new Cme(u,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=uU(r)||{};return new fO(e,t,o,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return ph(this,void 0,void 0,function*(){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,i=!1,s,r){return ph(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Ur(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield De.toPromise(this._onDidRender.event));const o=this.getDataNode(e);if(yield this.refreshAndRenderNode(o,t,s,r),i)try{this.tree.rerender(o)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return ph(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Ur(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield De.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(yield this.root.refreshPromise,yield De.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield De.toPromise(this._onDidRender.event)),s})}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Ur(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,s){return ph(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,s)})}refreshNode(e,t,i){return ph(this,void 0,void 0,function*(){let s;return this.subTreeRefreshPromises.forEach((r,o)=>{!s&&bme(o,e)&&(s=r.then(()=>this.refreshNode(e,t,i)))}),s||this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return ph(this,void 0,void 0,function*(){let s;e.refreshPromise=new Promise(r=>s=r),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const r=yield this.doRefreshNode(e,t,i);e.stale=!1,yield sN.settled(r.map(o=>this.doRefreshSubTree(o,t,i)))}finally{s()}})}doRefreshNode(e,t,i){return ph(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(gt.empty());else{const r=$v(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},o=>null),s=this.doGetChildren(e).finally(()=>r.cancel())}try{const r=yield s;return this.setChildren(e,r,t,i)}catch(r){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),xc(r))return[];throw r}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);return t||(t=kr(()=>ph(this,void 0,void 0,function*(){const i=yield this.dataSource.getChildren(e.element);return this.processChildren(i)})),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Qe))}setChildren(e,t,i,s){const r=[...t];if(e.children.length===0&&r.length===0)return[];const o=new Map,a=new Map;for(const h of e.children)if(o.set(h.element,h),this.identityProvider){const c=this.tree.isCollapsed(h);a.set(h.id,{node:h,collapsed:c})}const l=[],u=r.map(h=>{const c=!!this.dataSource.hasChildren(h);if(!this.identityProvider){const v=hE({element:h,parent:e,hasChildren:c});return c&&this.collapseByDefault&&!this.collapseByDefault(h)&&(v.collapsedByDefault=!1,l.push(v)),v}const f=this.identityProvider.getId(h).toString(),g=a.get(f);if(g){const v=g.node;return o.delete(v.element),this.nodes.delete(v.element),this.nodes.set(h,v),v.element=h,v.hasChildren=c,i?g.collapsed?(v.children.forEach(S=>fT(S,w=>this.nodes.delete(w.element))),v.children.splice(0,v.children.length),v.stale=!0):l.push(v):c&&this.collapseByDefault&&!this.collapseByDefault(h)&&(v.collapsedByDefault=!1,l.push(v)),v}const m=hE({element:h,parent:e,id:f,hasChildren:c});return s&&s.viewState.focus&&s.viewState.focus.indexOf(f)>-1&&s.focus.push(m),s&&s.viewState.selection&&s.viewState.selection.indexOf(f)>-1&&s.selection.push(m),s&&s.viewState.expanded&&s.viewState.expanded.indexOf(f)>-1?l.push(m):c&&this.collapseByDefault&&!this.collapseByDefault(h)&&(m.collapsedByDefault=!1,l.push(m)),m});for(const h of o.values())fT(h,c=>this.nodes.delete(c.element));for(const h of u)this.nodes.set(h.element,h);return e.children.splice(0,e.children.length,...u),e!==this.root&&this.autoExpandSingleChildren&&u.length===1&&l.length===0&&(u[0].collapsedByDefault=!1,l.push(u[0])),l}render(e,t,i){const s=e.children.map(o=>this.asTreeElement(o,t)),r=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(o){return i.diffIdentityProvider.getId(o.element)}}});this.tree.setChildren(e===this.root?null:e,s,r),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:i=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?gt.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}class pO{constructor(e){this.node=e}get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new pO(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class yme{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...ny.classNamesArray),!0):(t.classList.remove(...ny.classNamesArray),!1)}disposeElement(e,t,i,s){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=ct(this.disposables)}}function Lme(n){const e=n&&uU(n);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}})})}class Dme extends hU{constructor(e,t,i,s,r,o,a={}){super(e,t,i,r,o,a),this.compressionDelegate=s,this.compressibleNodeMapper=new lO(l=>new pO(l)),this.filter=a.filter}createTree(e,t,i,s,r){const o=new hO(i),a=s.map(u=>new yme(u,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=Lme(r)||{};return new lU(e,t,o,a,l)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=f=>this.identityProvider.getId(f).toString(),s=f=>{const g=new Set;for(const m of f){const v=this.tree.getCompressedTreeNode(m===this.root?null:m);if(!!v.element)for(const S of v.element.elements)g.add(i(S.element))}return g},r=s(this.tree.getSelection()),o=s(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const u=this.getFocus();let h=!1;const c=f=>{const g=f.element;if(g)for(let m=0;m{const i=this.filter.filter(t,1),s=xme(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function xme(n){return typeof n=="boolean"?n?1:0:uO(n)?x0(n.visibility):x0(n)}class kme extends rU{constructor(e,t,i,s,r,o={}){super(e,t,i,s,o),this.user=e,this.dataSource=r,this.identityProvider=o.identityProvider}createModel(e,t,i){return new cO(e,t,i)}}new Le("isWindows",Pn,_("isWindows","Whether the operating system is Windows"));const Eme="inputFocus";function ca(n,e){const t=Object.create(null);for(let i in e){const s=e[i];s&&(t[i]=pu(s,n))}return t}function mO(n,e,t){function i(){const s=ca(n.getColorTheme(),e);typeof t=="function"?t(s):t.style(s)}return i(),n.onDidColorThemeChange(i)}function Ime(n,e,t){return mO(e,{badgeBackground:t?.badgeBackground||sv,badgeForeground:t?.badgeForeground||rv,badgeBorder:Pi},n)}function lf(n,e,t){return mO(e,Object.assign(Object.assign({},BL),t||{}),n)}const BL={listFocusBackground:$oe,listFocusForeground:Koe,listFocusOutline:joe,listActiveSelectionBackground:sc,listActiveSelectionForeground:rc,listActiveSelectionIconForeground:a1,listFocusAndSelectionBackground:sc,listFocusAndSelectionForeground:rc,listInactiveSelectionBackground:Goe,listInactiveSelectionIconForeground:Zoe,listInactiveSelectionForeground:qoe,listInactiveFocusBackground:Yoe,listInactiveFocusOutline:Xoe,listHoverBackground:Qoe,listHoverForeground:Joe,listDropBackground:eae,listSelectionOutline:As,listHoverOutline:As,listFilterWidgetBackground:tae,listFilterWidgetOutline:iae,listFilterWidgetNoMatchesOutline:nae,listMatchesShadow:Hp,treeIndentGuidesStroke:sae,tableColumnsBorder:rae},Nme={shadowColor:Hp,borderColor:oae,foregroundColor:aae,backgroundColor:lae,selectionForegroundColor:uae,selectionBackgroundColor:hae,selectionBorderColor:cae,separatorColor:dae};function Tme(n,e,t){return mO(e,Object.assign(Object.assign({},Nme),t),n)}var Hl=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},it=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const ro=wt("listService");let gT=class{constructor(e){this._themeService=e,this.disposables=new pe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}get lastFocusedList(){return this._lastFocusedWidget}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;const s=new iU(Qr(),"");this.disposables.add(lf(s,this._themeService))}if(this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&(this._lastFocusedWidget=e),Xh(e.onDidFocus(()=>this._lastFocusedWidget=e),Ct(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&(this._lastFocusedWidget=void 0)}))}dispose(){this.disposables.dispose()}};gT=Hl([it(0,ai)],gT);const cU=new Le("listFocus",!0),WL=new Le("listSupportsMultiselect",!0),dU=ye.and(cU,ye.not(Eme)),_O=new Le("listHasSelectionOrFocus",!1),vO=new Le("listDoubleSelection",!1),bO=new Le("listMultiSelection",!1),VL=new Le("listSelectionNavigation",!1),fU="listAutomaticKeyboardNavigation";function HL(n,e){const t=n.createScoped(e.getHTMLElement());return cU.bindTo(t),t}const Rf="workbench.list.multiSelectModifier",pT="workbench.list.openMode",Yr="workbench.list.horizontalScrolling",sy="workbench.list.keyboardNavigation",CO="workbench.list.automaticKeyboardNavigation",I0="workbench.tree.indent",ry="workbench.tree.renderIndentGuides",Ra="workbench.list.smoothScrolling",Fl="workbench.list.mouseWheelScrollSensitivity",Bl="workbench.list.fastScrollSensitivity",oy="workbench.tree.expandMode";function Wl(n){return n.getValue(Rf)==="alt"}class Ame extends ie{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Wl(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Rf)&&(this.useAltAsMultipleSelectionModifier=Wl(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Jz(e)}isSelectionRangeChangeEvent(e){return eU(e)}}function zL(n,e,t){var i;const s=new pe;return[Object.assign(Object.assign({},n),{keyboardNavigationDelegate:{mightProducePrintableCharacter(o){return t.mightProducePrintableCharacter(o)}},smoothScrolling:Boolean(e.getValue(Ra)),mouseWheelScrollSensitivity:e.getValue(Fl),fastScrollSensitivity:e.getValue(Bl),multipleSelectionController:(i=n.multipleSelectionController)!==null&&i!==void 0?i:s.add(new Ame(e))}),s]}let mT=class extends Vl{constructor(e,t,i,s,r,o,a,l,u,h){const c=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:Boolean(u.getValue(Yr)),[f,g]=zL(r,u,h);super(e,t,i,s,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},ca(l.getColorTheme(),BL)),f),{horizontalScrolling:c})),this.disposables.add(g),this.contextKeyService=HL(o,this),this.themeService=l,this.listSupportsMultiSelect=WL.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),VL.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this.listHasSelectionOrFocus=_O.bindTo(this.contextKeyService),this.listDoubleSelection=vO.bindTo(this.contextKeyService),this.listMultiSelection=bO.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Wl(u),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),r.overrideStyles&&this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const v=this.getSelection(),S=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(v.length>0||S.length>0),this.listMultiSelection.set(v.length>1),this.listDoubleSelection.set(v.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const v=this.getSelection(),S=this.getFocus();this.listHasSelectionOrFocus.set(v.length>0||S.length>0)})),this.disposables.add(u.onDidChangeConfiguration(v=>{v.affectsConfiguration(Rf)&&(this._useAltAsMultipleSelectionModifier=Wl(u));let S={};if(v.affectsConfiguration(Yr)&&this.horizontalScrolling===void 0){const w=Boolean(u.getValue(Yr));S=Object.assign(Object.assign({},S),{horizontalScrolling:w})}if(v.affectsConfiguration(Ra)){const w=Boolean(u.getValue(Ra));S=Object.assign(Object.assign({},S),{smoothScrolling:w})}if(v.affectsConfiguration(Fl)){const w=u.getValue(Fl);S=Object.assign(Object.assign({},S),{mouseWheelScrollSensitivity:w})}if(v.affectsConfiguration(Bl)){const w=u.getValue(Bl);S=Object.assign(Object.assign({},S),{fastScrollSensitivity:w})}Object.keys(S).length>0&&this.updateOptions(S)})),this.navigator=new gU(this,Object.assign({configurationService:u},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;(t=this._styler)===null||t===void 0||t.dispose(),this._styler=lf(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),super.dispose()}};mT=Hl([it(5,je),it(6,ro),it(7,ai),it(8,Fi),it(9,Ni)],mT);let tW=class extends qpe{constructor(e,t,i,s,r,o,a,l,u,h){const c=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:Boolean(u.getValue(Yr)),[f,g]=zL(r,u,h);super(e,t,i,s,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},ca(l.getColorTheme(),BL)),f),{horizontalScrolling:c})),this.disposables=new pe,this.disposables.add(g),this.contextKeyService=HL(o,this),this.themeService=l,this.horizontalScrolling=r.horizontalScrolling,this.listSupportsMultiSelect=WL.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),VL.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this._useAltAsMultipleSelectionModifier=Wl(u),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),r.overrideStyles&&this.updateStyles(r.overrideStyles),r.overrideStyles&&this.disposables.add(lf(this,l,r.overrideStyles)),this.disposables.add(u.onDidChangeConfiguration(v=>{v.affectsConfiguration(Rf)&&(this._useAltAsMultipleSelectionModifier=Wl(u));let S={};if(v.affectsConfiguration(Yr)&&this.horizontalScrolling===void 0){const w=Boolean(u.getValue(Yr));S=Object.assign(Object.assign({},S),{horizontalScrolling:w})}if(v.affectsConfiguration(Ra)){const w=Boolean(u.getValue(Ra));S=Object.assign(Object.assign({},S),{smoothScrolling:w})}if(v.affectsConfiguration(Fl)){const w=u.getValue(Fl);S=Object.assign(Object.assign({},S),{mouseWheelScrollSensitivity:w})}if(v.affectsConfiguration(Bl)){const w=u.getValue(Bl);S=Object.assign(Object.assign({},S),{fastScrollSensitivity:w})}Object.keys(S).length>0&&this.updateOptions(S)})),this.navigator=new gU(this,Object.assign({configurationService:u},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;(t=this._styler)===null||t===void 0||t.dispose(),this._styler=lf(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),this.disposables.dispose(),super.dispose()}};tW=Hl([it(5,je),it(6,ro),it(7,ai),it(8,Fi),it(9,Ni)],tW);let iW=class extends FL{constructor(e,t,i,s,r,o,a,l,u,h,c){const f=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:Boolean(h.getValue(Yr)),[g,m]=zL(o,h,c);super(e,t,i,s,r,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},ca(u.getColorTheme(),BL)),g),{horizontalScrolling:f})),this.disposables=new pe,this.disposables.add(m),this.contextKeyService=HL(a,this),this.themeService=u,this.listSupportsMultiSelect=WL.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),VL.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=_O.bindTo(this.contextKeyService),this.listDoubleSelection=vO.bindTo(this.contextKeyService),this.listMultiSelection=bO.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Wl(h),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const S=this.getSelection(),w=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(S.length>0||w.length>0),this.listMultiSelection.set(S.length>1),this.listDoubleSelection.set(S.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const S=this.getSelection(),w=this.getFocus();this.listHasSelectionOrFocus.set(S.length>0||w.length>0)})),this.disposables.add(h.onDidChangeConfiguration(S=>{S.affectsConfiguration(Rf)&&(this._useAltAsMultipleSelectionModifier=Wl(h));let w={};if(S.affectsConfiguration(Yr)&&this.horizontalScrolling===void 0){const b=Boolean(h.getValue(Yr));w=Object.assign(Object.assign({},w),{horizontalScrolling:b})}if(S.affectsConfiguration(Ra)){const b=Boolean(h.getValue(Ra));w=Object.assign(Object.assign({},w),{smoothScrolling:b})}if(S.affectsConfiguration(Fl)){const b=h.getValue(Fl);w=Object.assign(Object.assign({},w),{mouseWheelScrollSensitivity:b})}if(S.affectsConfiguration(Bl)){const b=h.getValue(Bl);w=Object.assign(Object.assign({},w),{fastScrollSensitivity:b})}Object.keys(w).length>0&&this.updateOptions(w)})),this.navigator=new Mme(this,Object.assign({configurationService:h},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;(t=this._styler)===null||t===void 0||t.dispose(),this._styler=lf(this,this.themeService,e)}dispose(){var e;(e=this._styler)===null||e===void 0||e.dispose(),this.disposables.dispose(),super.dispose()}};iW=Hl([it(6,je),it(7,ro),it(8,ai),it(9,Fi),it(10,Ni)],iW);class wO extends ie{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new H),this.onDidOpen=this._onDidOpen.event,this._register(De.filter(this.widget.onDidChangeSelection,s=>s.browserEvent instanceof KeyboardEvent)(s=>this.onSelectionFromKeyboard(s))),this._register(this.widget.onPointer(s=>this.onPointer(s.element,s.browserEvent))),this._register(this.widget.onMouseDblClick(s=>this.onMouseDblClick(s.element,s.browserEvent))),typeof t?.openOnSingleClick!="boolean"&&t?.configurationService?(this.openOnSingleClick=t?.configurationService.getValue(pT)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(()=>{this.openOnSingleClick=t?.configurationService.getValue(pT)!=="doubleClick"}))):this.openOnSingleClick=(i=t?.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i,r=!1;this._open(this.getSelectedElement(),i,s,r,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,r=!0,o=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,o,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const r=!1,o=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,o,a,t)}_open(e,t,i,s,r){!e||this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:r})}}class gU extends wO{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Mme extends wO{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Rme extends wO{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function Ome(n,e){let t=!1;return i=>{if(t)return t=!1,!1;const s=e.softDispatch(i,n);return s&&s.enterChord?(t=!0,!1):(t=!1,!0)}}let nW=class extends fO{constructor(e,t,i,s,r,o,a,l,u,h,c){const{options:f,getAutomaticKeyboardNavigation:g,disposable:m}=pb(t,r,o,u,h,c);super(e,t,i,s,f),this.disposables.add(m),this.internals=new uf(this,r,g,r.overrideStyles,o,a,l,u,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};nW=Hl([it(5,je),it(6,ro),it(7,ai),it(8,Fi),it(9,Ni),it(10,er)],nW);let sW=class extends lU{constructor(e,t,i,s,r,o,a,l,u,h,c){const{options:f,getAutomaticKeyboardNavigation:g,disposable:m}=pb(t,r,o,u,h,c);super(e,t,i,s,f),this.disposables.add(m),this.internals=new uf(this,r,g,r.overrideStyles,o,a,l,u,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};sW=Hl([it(5,je),it(6,ro),it(7,ai),it(8,Fi),it(9,Ni),it(10,er)],sW);let rW=class extends kme{constructor(e,t,i,s,r,o,a,l,u,h,c,f){const{options:g,getAutomaticKeyboardNavigation:m,disposable:v}=pb(t,o,a,h,c,f);super(e,t,i,s,r,g),this.disposables.add(v),this.internals=new uf(this,o,m,o.overrideStyles,a,l,u,h,f),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};rW=Hl([it(6,je),it(7,ro),it(8,ai),it(9,Fi),it(10,Ni),it(11,er)],rW);let _T=class extends hU{constructor(e,t,i,s,r,o,a,l,u,h,c,f){const{options:g,getAutomaticKeyboardNavigation:m,disposable:v}=pb(t,o,a,h,c,f);super(e,t,i,s,r,g),this.disposables.add(v),this.internals=new uf(this,o,m,o.overrideStyles,a,l,u,h,f),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};_T=Hl([it(6,je),it(7,ro),it(8,ai),it(9,Fi),it(10,Ni),it(11,er)],_T);let oW=class extends Dme{constructor(e,t,i,s,r,o,a,l,u,h,c,f,g){const{options:m,getAutomaticKeyboardNavigation:v,disposable:S}=pb(t,a,l,c,f,g);super(e,t,i,s,r,o,m),this.disposables.add(S),this.internals=new uf(this,a,v,a.overrideStyles,l,u,h,c,g),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};oW=Hl([it(7,je),it(8,ro),it(9,ai),it(10,Fi),it(11,Ni),it(12,er)],oW);function pb(n,e,t,i,s,r){var o;const a=()=>{let m=Boolean(t.getContextKeyValue(fU));return m&&(m=Boolean(i.getValue(CO))),m},l=r.isScreenReaderOptimized(),u=e.simpleKeyboardNavigation||l?"simple":i.getValue(sy),h=e.horizontalScrolling!==void 0?e.horizontalScrolling:Boolean(i.getValue(Yr)),[c,f]=zL(e,i,s),g=e.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:f,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(I0)=="number"?i.getValue(I0):void 0,renderIndentGuides:i.getValue(ry),smoothScrolling:Boolean(i.getValue(Ra)),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:u==="simple",filterOnType:u==="filter",horizontalScrolling:h,keyboardNavigationEventFilter:Ome(n,s),additionalScrollHeight:g,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(o=e.expandOnlyOnTwistieClick)!==null&&o!==void 0?o:i.getValue(oy)==="doubleClick"})}}let uf=class{constructor(e,t,i,s,r,o,a,l,u){this.tree=e,this.themeService=a,this.disposables=[],this.contextKeyService=HL(r,e),this.listSupportsMultiSelect=WL.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),VL.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.hasSelectionOrFocus=_O.bindTo(this.contextKeyService),this.hasDoubleSelection=vO.bindTo(this.contextKeyService),this.hasMultiSelection=bO.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Wl(l);const c=new Set;c.add(fU);const f=()=>{const m=u.isScreenReaderOptimized()?"simple":l.getValue(sy);e.updateOptions({simpleKeyboardNavigation:m==="simple",filterOnType:m==="filter"})};this.updateStyleOverrides(s),this.disposables.push(this.contextKeyService,o.register(e),e.onDidChangeSelection(()=>{const g=e.getSelection(),m=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(g.length>0||m.length>0),this.hasMultiSelection.set(g.length>1),this.hasDoubleSelection.set(g.length===2)})}),e.onDidChangeFocus(()=>{const g=e.getSelection(),m=e.getFocus();this.hasSelectionOrFocus.set(g.length>0||m.length>0)}),l.onDidChangeConfiguration(g=>{let m={};if(g.affectsConfiguration(Rf)&&(this._useAltAsMultipleSelectionModifier=Wl(l)),g.affectsConfiguration(I0)){const v=l.getValue(I0);m=Object.assign(Object.assign({},m),{indent:v})}if(g.affectsConfiguration(ry)){const v=l.getValue(ry);m=Object.assign(Object.assign({},m),{renderIndentGuides:v})}if(g.affectsConfiguration(Ra)){const v=Boolean(l.getValue(Ra));m=Object.assign(Object.assign({},m),{smoothScrolling:v})}if(g.affectsConfiguration(sy)&&f(),g.affectsConfiguration(CO)&&(m=Object.assign(Object.assign({},m),{automaticKeyboardNavigation:i()})),g.affectsConfiguration(Yr)&&t.horizontalScrolling===void 0){const v=Boolean(l.getValue(Yr));m=Object.assign(Object.assign({},m),{horizontalScrolling:v})}if(g.affectsConfiguration(oy)&&t.expandOnlyOnTwistieClick===void 0&&(m=Object.assign(Object.assign({},m),{expandOnlyOnTwistieClick:l.getValue(oy)==="doubleClick"})),g.affectsConfiguration(Fl)){const v=l.getValue(Fl);m=Object.assign(Object.assign({},m),{mouseWheelScrollSensitivity:v})}if(g.affectsConfiguration(Bl)){const v=l.getValue(Bl);m=Object.assign(Object.assign({},m),{fastScrollSensitivity:v})}Object.keys(m).length>0&&e.updateOptions(m)}),this.contextKeyService.onDidChangeContext(g=>{g.affectsSome(c)&&e.updateOptions({automaticKeyboardNavigation:i()})}),u.onDidChangeScreenReaderOptimized(()=>f())),this.navigator=new Rme(e,Object.assign({configurationService:l},t)),this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){ct(this.styler),this.styler=e?lf(this.tree,this.themeService,e):ie.None}dispose(){this.disposables=ct(this.disposables),ct(this.styler),this.styler=void 0}};uf=Hl([it(4,je),it(5,ro),it(6,ai),it(7,Fi),it(8,er)],uf);const Pme=yn.as(bm.Configuration);Pme.registerConfiguration({id:"workbench",order:7,title:_("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[Rf]:{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[_("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),_("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:_({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[pT]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:_({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Yr]:{type:"boolean",default:!1,description:_("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[I0]:{type:"number",default:8,minimum:0,maximum:40,description:_("tree indent setting","Controls tree indentation in pixels.")},[ry]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:_("render tree indent guides","Controls whether the tree should render indent guides.")},[Ra]:{type:"boolean",default:!1,description:_("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Fl]:{type:"number",default:1,description:_("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Bl]:{type:"number",default:5,description:_("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[sy]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[_("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),_("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),_("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:_("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},[CO]:{type:"boolean",default:!0,markdownDescription:_("automatic keyboard navigation setting","Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.")},[oy]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:_("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")}}});var Fme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class _c{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=zz.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?_({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"symbol in {0} on line {1} at column {2}, {3}",Ta(this.uri),this.range.startLineNumber,this.range.startColumn,t.value):_("aria.oneReference","symbol in {0} on line {1} at column {2}",Ta(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Bme{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:r,endLineNumber:o,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:s,column:r-t}),u=new M(s,l.startColumn,s,r),h=new M(o,a,o,1073741824),c=i.getValueInRange(u).replace(/^\s+/,""),f=i.getValueInRange(e),g=i.getValueInRange(h).replace(/\s+$/,"");return{value:c+f+g,highlight:{start:c.length,end:c.length+f.length}}}}class N0{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new rs}dispose(){ct(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?_("aria.fileReferences.1","1 symbol in {0}, full path {1}",Ta(this.uri),this.uri.fsPath):_("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Ta(this.uri),this.uri.fsPath)}resolve(e){return Fme(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(let t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new Bme(i))}catch(i){Qe(i)}return this})}}class qs{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new H,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(qs._compareReferences);let s;for(let r of e)if((!s||!Ts.isEqual(s.uri,r.uri,!0))&&(s=new N0(this,r.uri),this.groups.push(s)),s.children.length===0||qs._compareReferences(r,s.children[s.children.length-1])!==0){const o=new _c(i===r,s,r,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(o),s.children.push(o)}}dispose(){ct(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new qs(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?_("aria.result.0","No results found"):this.references.length===1?_("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?_("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):_("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,s=i.children.indexOf(e),r=i.children.length,o=i.parent.groups.length;return o===1||t&&s+10?(t?s=(s+1)%r:s=(s+r-1)%r,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%o,i.parent.groups[s].children[0]):(s=(s+o-1)%o,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,r)=>({idx:r,prefixLen:qv(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,r)=>s.prefixLen>r.prefixLen?-1:s.prefixLenr.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&M.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Ts.compare(e.uri,t.uri)||M.compareRangesUsingStarts(e.range,t.range)}}const Wme={badgeBackground:q.fromHex("#4D4D4D"),badgeForeground:q.fromHex("#FFFFFF")};class vT{constructor(e,t){this.count=0,this.options=t||Object.create(null),Fa(this.options,Wme,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=le(e,ge(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=Eo(this.countFormat,this.count),this.element.title=Eo(this.titleFormat,this.count),this.applyStyles()}style(e){this.badgeBackground=e.badgeBackground,this.badgeForeground=e.badgeForeground,this.badgeBorder=e.badgeBorder,this.applyStyles()}applyStyles(){if(this.element){const e=this.badgeBackground?this.badgeBackground.toString():"",t=this.badgeForeground?this.badgeForeground.toString():"",i=this.badgeBorder?this.badgeBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}}}const Vme=new RegExp(`(\\\\)?\\$\\((${Ks.iconNameExpression}(?:${Ks.iconModifierExpression})?)\\)`,"g");function mp(n){const e=new Array;let t,i=0,s=0;for(;(t=Vme.exec(n))!==null;){s=t.index||0,e.push(n.substring(i,s)),i=(t.index||0)+t[0].length;const[,r,o]=t;e.push(r?`$(${o})`:Hme({id:o}))}return i{s=r===`\r +`?-1:0,o+=i;for(const a of t)a.end<=o||(a.start>=o&&(a.start+=s),a.end>=o&&(a.end+=s));return i+=s,"\u23CE"})}}var bT=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function zme(n,e){Ia(e)?n.title=e:e?.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class Ume{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t){var i;return bT(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(e===void 0||Ia(e)||e instanceof HTMLElement)s=e;else if(!G_(e.markdown))s=(i=e.markdown)!==null&&i!==void 0?i:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(_("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Pa;const r=this._cancellationTokenSource.token;if(s=yield e.markdown(r),this.isDisposed||r.isCancellationRequested)return}this.show(s,t)})}show(e,t){const i=this._hoverWidget;if(this.hasContent(e)){const s={content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!i};this._hoverWidget=this.hoverDelegate.showHover(s,t)}i?.dispose()}hasContent(e){return e?Sz(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function $me(n,e,t){let i,s;const r=(h,c)=>{var f;h&&(s?.dispose(),s=void 0),c&&(i?.dispose(),i=void 0),(f=n.onDidHideHover)===null||f===void 0||f.call(n)},o=(h,c,f)=>new Ms(()=>bT(this,void 0,void 0,function*(){(!s||s.isDisposed)&&(s=new Ume(n,f||e,h>0),yield s.update(t,c))}),h),a=()=>{if(i)return;const h=new pe,c=m=>r(!1,m.fromElement===e);h.add(ne(e,xe.MOUSE_LEAVE,c,!0));const f=()=>r(!0,!0);h.add(ne(e,xe.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const m=v=>g.x=v.x+10;h.add(ne(e,xe.MOUSE_MOVE,m,!0))}h.add(o(n.delay,!1,g)),i=h},l=ne(e,xe.MOUSE_OVER,a,!0);return{show:h=>{r(!1,!0),o(0,h)},hide:()=>{r(!0,!0)},update:h=>bT(this,void 0,void 0,function*(){t=h,yield s?.update(t)}),dispose:()=>{l.dispose(),r(!0,!0)}}}class dE{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class SO extends ie{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new dE(le(e,ge(".monaco-icon-label")))),this.labelContainer=le(this.domNode.element,ge(".monaco-icon-label-container"));const i=le(this.labelContainer,ge("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new dE(le(this.labelContainer,ge("span.monaco-icon-description-container")))),t?.supportHighlights||t?.supportIcons?this.nameNode=new Gme(i,!!t.supportIcons):this.nameNode=new Kme(i),t?.supportDescriptionHighlights?this.descriptionNodeFactory=()=>new vc(le(this.descriptionContainer.element,ge("span.label-description")),!!t.supportIcons):this.descriptionNodeFactory=()=>this._register(new dE(le(this.descriptionContainer.element,ge("span.label-description")))),this.hoverDelegate=t?.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"];i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough")),this.domNode.className=s.join(" "),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof vc?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,i?.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,i?.descriptionTitle||""),this.descriptionNode.empty=!t))}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)zme(e,t);else{const s=$me(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}}class Kme{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&La(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=le(this.container,ge("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const r={start:i,end:i+s.length},o=t.map(a=>Tn.intersect(r,a)).filter(a=>!Tn.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=r.end+e.length,o})}class Gme{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&La(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new vc(le(this.container,ge("a.label-name",{id:t?.domId})),this.supportIcons)),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=t?.separator||"/",s=jme(e,i,t?.matches);for(let r=0;r=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},T0=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let wT=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof qs||e instanceof N0}getChildren(e){if(e instanceof qs)return e.groups;if(e instanceof N0)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};wT=UL([T0(0,Al)],wT);class qme{getHeight(){return 23}getTemplateId(e){return e instanceof N0?A0.id:_b.id}}let ST=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof _c){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Ta(e.uri)}};ST=UL([T0(0,Ni)],ST);class Zme{getId(e){return e instanceof _c?e.id:e.uri}}let yT=class extends ie{constructor(e,t,i){super(),this._uriLabel=t;const s=document.createElement("div");s.classList.add("reference-file"),this.file=this._register(new SO(s,{supportHighlights:!0})),this.badge=new vT(le(s,ge(".count"))),this._register(Ime(this.badge,i)),e.appendChild(s)}set(e,t){let i=GR(e.uri);this.file.setLabel(pU(e.uri),this._uriLabel.getUriLabel(i,{relative:!0}),{title:this._uriLabel.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(_("referencesCount","{0} references",s)):this.badge.setTitleFormat(_("referenceCount","{0} reference",s))}};yT=UL([T0(1,mb),T0(2,ai)],yT);let A0=class mU{constructor(e){this._instantiationService=e,this.templateId=mU.id}renderTemplate(e){return this._instantiationService.createInstance(yT,e)}renderElement(e,t,i){i.set(e.element,M2(e.filterData))}disposeTemplate(e){e.dispose()}};A0.id="FileReferencesRenderer";A0=UL([T0(0,jt)],A0);class Yme{constructor(e){this.label=new vc(e,!1)}set(e,t){var i;const s=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!s||!s.value)this.label.set(`${Ta(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:r,highlight:o}=s;t&&!ka.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(r,M2(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(r,[o]))}}}class _b{constructor(){this.templateId=_b.id}renderTemplate(e){return new Yme(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}_b.id="OneReferenceRenderer";class Xme{getWidgetAriaLabel(){return _("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var Qme=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},uu=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},aW=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class $L{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new pe,this._callOnModelChange=new pe,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(!!e){for(let t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let r=0,o=e.children.length;r{r.equals(9)&&(this._keybindingService.dispatchEvent(r,r.target),r.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(e_e,"ReferencesWidget",this._treeContainer,new qme,[this._instantiationService.createInstance(A0),this._instantiationService.createInstance(_b)],this._instantiationService.createInstance(wT),i),this._splitView.addView({onDidChange:De.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:r=>{this._preview.layout({height:this._dim.height,width:r})}},iy.Distribute),this._splitView.addView({onDidChange:De.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:r=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${r}px`,this._tree.layout(this._dim.height,r)}},iy.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));let s=(r,o)=>{r instanceof _c&&(o==="show"&&this._revealReference(r,!1),this._onDidSelectReference.fire({element:r,kind:o,source:"tree"}))};this._tree.onDidOpen(r=>{r.sideBySide?s(r.element,"side"):r.editorOptions.pinned?s(r.element,"goto"):s(r.element,"show")}),Ds(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Kt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{!this._model||(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=_("noResults","No results"),fr(this._messageContainer),Promise.resolve(void 0)):(Ds(this._messageContainer),this._decorationsManager=new $L(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();!s||this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),fr(this._treeContainer),fr(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof _c)return e;if(e instanceof N0&&e.children.length>0)return e.children[0]}revealReference(e){return aW(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return aW(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==lt.inMemory?this.setTitle(v9(e.uri),this._uriLabel.getUriLabel(GR(e.uri))):this.setTitle(_("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const s=yield i;if(!this._model){s.dispose();return}ct(this._previewModelReference);const r=s.object;if(r){const o=this._preview.getModel()===r.textEditorModel?0:1,a=M.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(r.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,o)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()})}};LT=Qme([uu(3,ai),uu(4,Al),uu(5,jt),uu(6,Gz),uu(7,mb),uu(8,ab),uu(9,Ni),uu(10,Rs),uu(11,ob)],LT);ni((n,e)=>{const t=n.getColor(wpe);t&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { background-color: ${t}; }`);const i=n.getColor(Spe);i&&e.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: ${i}; }`);const s=n.getColor(ype);s&&e.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid ${s}; box-sizing: border-box; }`);const r=n.getColor(As);r&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { border: 1px dotted ${r}; box-sizing: border-box; }`);const o=n.getColor(Yz);o&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree { background-color: ${o}; }`);const a=n.getColor(mpe);a&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree { color: ${a}; }`);const l=n.getColor(_pe);l&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .reference-file { color: ${l}; }`);const u=n.getColor(vpe);u&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { background-color: ${u}; }`);const h=n.getColor(bpe);h&&e.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: ${h} !important; }`);const c=n.getColor(m1);c&&e.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input { background-color: ${c};}`);const f=n.getColor(Cpe);f&&e.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .margin { background-color: ${f};}`)});var t_e=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},fg=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},lW=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const Of=new Le("referenceSearchVisible",!1,_("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Jp=class DT{constructor(e,t,i,s,r,o,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=r,this._instantiationService=o,this._storageService=a,this._configurationService=l,this._disposables=new pe,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Of.bindTo(i)}static get(e){return e.getContribution(DT.ID)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),!!s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const r="peekViewLayout",o=Jme.fromJSON(this._storageService.get(r,0,"{}"));this._widget=this._instantiationService.createInstance(LT,this._editor,this._defaultTreeKeyboardSupport,o),this._widget.setTitle(_("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(r,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{let{element:u,kind:h}=l;if(!!u)switch(h){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(u,!1,!1);break;case"side":this.openReference(u,!0,!1);break;case"goto":i?this._gotoReference(u):this.openReference(u,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var u;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(u=this._model)===null||u===void 0||u.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(_("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));let h=this._editor.getModel().uri,c=new G(e.startLineNumber,e.startColumn),f=this._model.nearestReference(h,c);if(f)return this._widget.setSelection(f).then(()=>{this._widget&&this._editor.getOption(76)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){!this._widget||(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return lW(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),r=this._editor.hasTextFocus(),o=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(s),yield this._gotoReference(s),r?this._editor.focus():this._widget&&o&&this._widget.focusOnPreviewEditor()})}revealReference(e){return lW(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e){this._widget&&this._widget.hide(),this._ignoreModelChangeEvent=!0;const t=M.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:t}},this._editor).then(i=>{var s;if(this._ignoreModelChangeEvent=!1,!i||!this._widget){this.closeWidget();return}if(this._editor===i)this._widget.show(t),this._widget.focusOnReferenceTree();else{const r=DT.get(i),o=this._model.clone();this.closeWidget(),i.focus(),r.toggleWidget(t,kr(a=>Promise.resolve(o)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},i=>{this._ignoreModelChangeEvent=!1,Qe(i)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:r}=e;this._editorService.openCodeEditor({resource:s,options:{selection:r,pinned:i}},this._editor,t)}};Jp.ID="editor.contrib.referencesController";Jp=t_e([fg(2,je),fg(3,ei),fg(4,Wn),fg(5,jt),fg(6,Nf),fg(7,Fi)],Jp);function Pf(n,e){const t=dpe(n);if(!t)return;let i=Jp.get(t);i&&e(i)}ds.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:qn(2089,60),when:ye.or(Of,Ys.inPeekEditor),handler(n){Pf(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});ds.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:ye.or(Of,Ys.inPeekEditor),handler(n){Pf(n,e=>{e.goToNextOrPreviousReference(!0)})}});ds.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:ye.or(Of,Ys.inPeekEditor),handler(n){Pf(n,e=>{e.goToNextOrPreviousReference(!1)})}});Ft.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Ft.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Ft.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Ft.registerCommand("closeReferenceSearch",n=>Pf(n,e=>e.closeWidget()));ds.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:ye.and(Ys.inPeekEditor,ye.not("config.editor.stablePeek"))});ds.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:ye.and(Of,ye.not("config.editor.stablePeek"))});ds.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ye.and(Of,dU),handler(n){var e;const i=(e=n.get(ro).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof _c&&Pf(n,s=>s.revealReference(i[0]))}});ds.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ye.and(Of,dU),handler(n){var e;const i=(e=n.get(ro).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof _c&&Pf(n,s=>s.openReference(i[0],!0,!0))}});Ft.registerCommand("openReference",n=>{var e;const i=(e=n.get(ro).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof _c&&Pf(n,s=>s.openReference(i[0],!1,!0))});var _U=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},M_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const yO=new Le("hasSymbols",!1,_("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),KL=wt("ISymbolNavigationService");let xT=class{constructor(e,t,i,s){this._editorService=t,this._notificationService=i,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=yO.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new kT(this._editorService),s=i.onDidChange(r=>{if(this._ignoreEditorChange)return;const o=this._editorService.getActiveCodeEditor();if(!o)return;const a=o.getModel(),l=o.getPosition();if(!a||!l)return;let u=!1,h=!1;for(const c of t.references)if(_9(c.uri,a.uri))u=!0,h=h||M.containsPosition(c.range,l);else if(u)break;(!u||!h)&&this.reset()});this._currentState=Xh(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:M.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?_("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):_("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};xT=_U([M_(0,je),M_(1,ei),M_(2,Wn),M_(3,Ni)],xT);xf(KL,xT,!0);_e(new class extends io{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:yO,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(KL).revealNext(e)}});ds.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:yO,primary:9,handler(n){n.get(KL).reset()}});let kT=class{constructor(e){this._listener=new Map,this._disposables=new pe,this._onDidChange=new H,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),ct(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Xh(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};kT=_U([M_(0,ei)],kT);var i_e=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},n_e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let jo=class ET{constructor(e,t){this._messageWidget=new xr,this._messageListeners=new pe,this._editor=e,this._visible=ET.MESSAGE_VISIBLE.bindTo(t),this._editorListener=this._editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit())}static get(e){return e.getContribution(ET.ID)}dispose(){this._editorListener.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){wf(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new uW(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(new Ms(()=>this.closeMessage(),3e3));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{!s.target.position||(i?i.containsPosition(s.target.position)||this.closeMessage():i=new M(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(uW.fadeOut(this._messageWidget.value))}_onDidAttemptReadOnlyEdit(){this._editor.hasModel()&&this.showMessage(_("editor.readonly","Cannot edit in read-only editor"),this._editor.getPosition())}};jo.ID="editor.contrib.messageController";jo.MESSAGE_VISIBLE=new Le("messageVisible",!1,_("messageVisible","Whether the editor is currently showing an inline message"));jo=i_e([n_e(1,je)],jo);const s_e=io.bindToContribution(jo.get);_e(new s_e({id:"leaveEditorMessage",precondition:jo.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));class uW{constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i-1},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage");const r=document.createElement("div");r.classList.add("anchor","top"),this._domNode.appendChild(r);const o=document.createElement("div");o.classList.add("message"),o.textContent=s,this._domNode.appendChild(o);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}static fadeOut(e){let t;const i=()=>{e.dispose(),clearTimeout(t),e.getDomNode().removeEventListener("animationend",i)};return t=setTimeout(i,110),e.getDomNode().addEventListener("animationend",i),e.getDomNode().classList.add("fadeOut"),{dispose:i}}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2]}}afterRender(e){this._domNode.classList.toggle("below",e===2)}}Ln(jo.ID,jo);ni((n,e)=>{const t=n.getColor(_2);if(t){let r=n.type===ya.HIGH_CONTRAST?2:1;e.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor.below { border-top-color: ${t}; }`),e.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor.top { border-bottom-color: ${t}; }`),e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { border: ${r}px solid ${t}; }`)}const i=n.getColor(p2);i&&e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${i}; }`);const s=n.getColor(m2);s&&e.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { color: ${s}; }`)});class jL{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}jL.None=Object.freeze({report(){}});const km=wt("editorProgressService");var vU=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function vb(n,e,t,i){const r=t.ordered(n).map(o=>Promise.resolve(i(o,n,e)).then(void 0,a=>{Go(a)}));return Promise.all(r).then(o=>{const a=[];for(let l of o)Array.isArray(l)?a.push(...l):l&&a.push(l);return a})}function LO(n,e,t){return vb(n,e,Qv,(i,s,r)=>i.provideDefinition(s,r,t))}function bU(n,e,t){return vb(n,e,LS,(i,s,r)=>i.provideDeclaration(s,r,t))}function CU(n,e,t){return vb(n,e,DS,(i,s,r)=>i.provideImplementation(s,r,t))}function wU(n,e,t){return vb(n,e,xS,(i,s,r)=>i.provideTypeDefinition(s,r,t))}function GL(n,e,t,i){return vb(n,e,SS,(s,r,o)=>vU(this,void 0,void 0,function*(){const a=yield s.provideReferences(r,o,{includeDeclaration:!0},i);if(!t||!a||a.length!==2)return a;const l=yield s.provideReferences(r,o,{includeDeclaration:!1},i);return l&&l.length===1?l:a}))}function bb(n){return vU(this,void 0,void 0,function*(){const e=yield n(),t=new qs(e,""),i=t.references.map(s=>s.link);return t.dispose(),i})}mm("_executeDefinitionProvider",(n,e)=>bb(()=>LO(n,e,ii.None)));mm("_executeDeclarationProvider",(n,e)=>bb(()=>bU(n,e,ii.None)));mm("_executeImplementationProvider",(n,e)=>bb(()=>CU(n,e,ii.None)));mm("_executeTypeDefinitionProvider",(n,e)=>bb(()=>wU(n,e,ii.None)));mm("_executeReferenceProvider",(n,e)=>bb(()=>GL(n,e,!1,ii.None)));var Uo=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},fE,gE,pE,mE,_E,vE,bE,CE;qr.appendMenuItem(ke.EditorContext,{submenu:ke.EditorContextPeek,title:_("peek.submenu","Peek"),group:"navigation",order:100});const SU=new Set;function Va(n){const e=new n;return o9(e),SU.add(e.id),e}class Em extends mt{constructor(e,t){super(t),this._configuration=e}run(e,t){if(!t.hasModel())return Promise.resolve(void 0);const i=e.get(Wn),s=e.get(ei),r=e.get(km),o=e.get(KL),a=t.getModel(),l=t.getPosition(),u=new rce(t,5),h=y6(this._getLocationModel(a,l,u.token),u.token).then(c=>Uo(this,void 0,void 0,function*(){if(!c||u.token.isCancellationRequested)return;wf(c.ariaMessage);let f;if(c.referenceAt(a.uri,l)){const m=this._getAlternativeCommand(t);m!==this.id&&SU.has(m)&&(f=t.getAction(m))}const g=c.references.length;if(g===0){if(!this._configuration.muteMessage){const m=a.getWordAtPosition(l);jo.get(t).showMessage(this._getNoResultFoundMessage(m),l)}}else if(g===1&&f)f.run();else return this._onResult(s,o,t,c)}),c=>{i.error(c)}).finally(()=>{u.dispose()});return r.showWhile(h,250),h}_onResult(e,t,i,s){return Uo(this,void 0,void 0,function*(){const r=this._getGoToPreference(i);if(!(i instanceof af)&&(this._configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s);else{const o=s.firstReference(),a=s.references.length>1&&r==="gotoAndPeek",l=yield this._openReference(i,e,o,this._configuration.openToSide,!a);a&&l?this._openInPeek(l,s):s.dispose(),r==="goto"&&t.put(o)}})}_openReference(e,t,i,s,r){return Uo(this,void 0,void 0,function*(){let o;if($se(i)&&(o=i.targetSelectionRange),o||(o=i.range),!o)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:M.collapseToStart(o),selectionRevealType:3}},e,s);if(!!a){if(r){const l=a.getModel(),u=a.deltaDecorations([],[{range:o,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&a.deltaDecorations(u,[])},350)}return a}})}_openInPeek(e,t){let i=Jp.get(e);i&&e.hasModel()?i.toggleWidget(e.getSelection(),kr(s=>Promise.resolve(t)),this._configuration.openInPeek):t.dispose()}}class qL extends Em{_getLocationModel(e,t,i){return Uo(this,void 0,void 0,function*(){return new qs(yield LO(e,t,i),_("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?_("noResultWord","No definition found for '{0}'",e.word):_("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(50).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(50).multipleDefinitions}}const yU=cm&&!v6?2118:70;Va((fE=class IT extends qL{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:IT.id,label:_("actions.goToDecl.label","Go to Definition"),alias:"Go to Definition",precondition:ye.and(K.hasDefinitionProvider,K.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:K.editorTextFocus,primary:yU,weight:100},contextMenuOpts:{group:"navigation",order:1.1}}),Ft.registerCommandAlias("editor.action.goToDeclaration",IT.id)}},fE.id="editor.action.revealDefinition",fE));Va((gE=class NT extends qL{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:NT.id,label:_("actions.goToDeclToSide.label","Open Definition to the Side"),alias:"Open Definition to the Side",precondition:ye.and(K.hasDefinitionProvider,K.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:K.editorTextFocus,primary:qn(2089,yU),weight:100}}),Ft.registerCommandAlias("editor.action.openDeclarationToTheSide",NT.id)}},gE.id="editor.action.revealDefinitionAside",gE));Va((pE=class TT extends qL{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:TT.id,label:_("actions.previewDecl.label","Peek Definition"),alias:"Peek Definition",precondition:ye.and(K.hasDefinitionProvider,Ys.notInPeekEditor,K.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:K.editorTextFocus,primary:582,linux:{primary:3140},weight:100},contextMenuOpts:{menuId:ke.EditorContextPeek,group:"peek",order:2}}),Ft.registerCommandAlias("editor.action.previewDeclaration",TT.id)}},pE.id="editor.action.peekDefinition",pE));class LU extends Em{_getLocationModel(e,t,i){return Uo(this,void 0,void 0,function*(){return new qs(yield bU(e,t,i),_("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?_("decl.noResultWord","No declaration found for '{0}'",e.word):_("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(50).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(50).multipleDeclarations}}Va((mE=class DU extends LU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:DU.id,label:_("actions.goToDeclaration.label","Go to Declaration"),alias:"Go to Declaration",precondition:ye.and(K.hasDeclarationProvider,K.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{group:"navigation",order:1.3}})}_getNoResultFoundMessage(e){return e&&e.word?_("decl.noResultWord","No declaration found for '{0}'",e.word):_("decl.generic.noResults","No declaration found")}},mE.id="editor.action.revealDeclaration",mE));Va(class extends LU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",label:_("actions.peekDecl.label","Peek Declaration"),alias:"Peek Declaration",precondition:ye.and(K.hasDeclarationProvider,Ys.notInPeekEditor,K.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:ke.EditorContextPeek,group:"peek",order:3}})}});class xU extends Em{_getLocationModel(e,t,i){return Uo(this,void 0,void 0,function*(){return new qs(yield wU(e,t,i),_("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?_("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):_("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(50).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(50).multipleTypeDefinitions}}Va((_E=class kU extends xU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:kU.ID,label:_("actions.goToTypeDefinition.label","Go to Type Definition"),alias:"Go to Type Definition",precondition:ye.and(K.hasTypeDefinitionProvider,K.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:K.editorTextFocus,primary:0,weight:100},contextMenuOpts:{group:"navigation",order:1.4}})}},_E.ID="editor.action.goToTypeDefinition",_E));Va((vE=class EU extends xU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:EU.ID,label:_("actions.peekTypeDefinition.label","Peek Type Definition"),alias:"Peek Type Definition",precondition:ye.and(K.hasTypeDefinitionProvider,Ys.notInPeekEditor,K.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:ke.EditorContextPeek,group:"peek",order:4}})}},vE.ID="editor.action.peekTypeDefinition",vE));class IU extends Em{_getLocationModel(e,t,i){return Uo(this,void 0,void 0,function*(){return new qs(yield CU(e,t,i),_("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?_("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):_("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(50).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(50).multipleImplementations}}Va((bE=class NU extends IU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:NU.ID,label:_("actions.goToImplementation.label","Go to Implementations"),alias:"Go to Implementations",precondition:ye.and(K.hasImplementationProvider,K.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:K.editorTextFocus,primary:2118,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}},bE.ID="editor.action.goToImplementation",bE));Va((CE=class TU extends IU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:TU.ID,label:_("actions.peekImplementation.label","Peek Implementations"),alias:"Peek Implementations",precondition:ye.and(K.hasImplementationProvider,Ys.notInPeekEditor,K.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:K.editorTextFocus,primary:3142,weight:100},contextMenuOpts:{menuId:ke.EditorContextPeek,group:"peek",order:5}})}},CE.ID="editor.action.peekImplementation",CE));class AU extends Em{_getNoResultFoundMessage(e){return e?_("references.no","No references found for '{0}'",e.word):_("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(50).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(50).multipleReferences}}Va(class extends AU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",label:_("goToReferences.label","Go to References"),alias:"Go to References",precondition:ye.and(K.hasReferenceProvider,Ys.notInPeekEditor,K.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:K.editorTextFocus,primary:1094,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}_getLocationModel(e,t,i){return Uo(this,void 0,void 0,function*(){return new qs(yield GL(e,t,!0,i),_("ref.title","References"))})}});Va(class extends AU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",label:_("references.action.label","Peek References"),alias:"Peek References",precondition:ye.and(K.hasReferenceProvider,Ys.notInPeekEditor,K.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:ke.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i){return Uo(this,void 0,void 0,function*(){return new qs(yield GL(e,t,!1,i),_("ref.title","References"))})}});class r_e extends Em{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",label:_("label.generic","Go to Any Symbol"),alias:"Go to Any Symbol",precondition:ye.and(Ys.notInPeekEditor,K.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i){return Uo(this,void 0,void 0,function*(){return new qs(this._references,_("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&_("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(50).multipleReferences}_getAlternativeCommand(){return""}}Ft.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:$e},{name:"position",description:"The position at which to start",constraint:G.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(n,e,t,i,s,r,o)=>Uo(void 0,void 0,void 0,function*(){Ri($e.isUri(e)),Ri(G.isIPosition(t)),Ri(Array.isArray(i)),Ri(typeof s>"u"||typeof s=="string"),Ri(typeof o>"u"||typeof o=="boolean");const a=n.get(ei),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(aO(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(u=>{const h=new class extends r_e{_getNoResultFoundMessage(c){return r||super._getNoResultFoundMessage(c)}}({muteMessage:!Boolean(r),openInPeek:Boolean(o),openToSide:!1},i,s);u.get(jt).invokeFunction(h.run.bind(h),l)})})});Ft.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:$e},{name:"position",description:"The position at which to start",constraint:G.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(n,e,t,i,s)=>Uo(void 0,void 0,void 0,function*(){n.get(mn).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)})});Ft.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Ri($e.isUri(e)),Ri(G.isIPosition(t));const i=n.get(ei);return i.openCodeEditor({resource:e},i.getFocusedCodeEditor()).then(s=>{if(!aO(s)||!s.hasModel())return;const r=Jp.get(s);if(!r)return;const o=kr(l=>GL(s.getModel(),G.lift(t),!1,l).then(u=>new qs(u,_("ref.title","References")))),a=new M(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(a,o,!1))})}});Ft.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");qr.appendMenuItems([{id:ke.MenubarGoMenu,item:{command:{id:"editor.action.revealDefinition",title:_({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},group:"4_symbol_nav",order:2}},{id:ke.MenubarGoMenu,item:{command:{id:"editor.action.revealDeclaration",title:_({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},group:"4_symbol_nav",order:3}},{id:ke.MenubarGoMenu,item:{command:{id:"editor.action.goToTypeDefinition",title:_({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},group:"4_symbol_nav",order:3}},{id:ke.MenubarGoMenu,item:{command:{id:"editor.action.goToImplementation",title:_({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},group:"4_symbol_nav",order:4}},{id:ke.MenubarGoMenu,item:{command:{id:"editor.action.goToReferences",title:_({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},group:"4_symbol_nav",order:5}}]);var o_e=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},hW=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let hf=class R_{constructor(e,t,i){this.textModelResolverService=t,this.modeService=i,this.toUnhook=new pe,this.toUnhookForKeyboard=new pe,this.linkDecorations=[],this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e;let s=new rde(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([r,o])=>{this.startFindDefinitionFromMouse(r,pd(o))})),this.toUnhook.add(s.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).then(()=>{this.removeLinkDecorations()},o=>{this.removeLinkDecorations(),Qe(o)})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(R_.ID)}startFindDefinitionFromCursor(e){return this.startFindDefinition(e).then(()=>{this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i)return this.currentWordAtPosition=null,this.removeLinkDecorations(),Promise.resolve(0);if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return Promise.resolve(0);this.currentWordAtPosition=i;let s=new zS(this.editor,15);return this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=kr(r=>this.findDefinition(e,r)),this.previousPromise.then(r=>{if(!r||!r.length||!s.validate(this.editor)){this.removeLinkDecorations();return}if(r.length>1)this.addDecoration(new M(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),new qp().appendText(_("multipleResults","Click to show {0} definitions.",r.length)));else{let o=r[0];if(!o.uri)return;this.textModelResolverService.createModelReference(o.uri).then(a=>{if(!a.object||!a.object.textEditorModel){a.dispose();return}const{object:{textEditorModel:l}}=a,{startLineNumber:u}=o.range;if(u<1||u>l.getLineCount()){a.dispose();return}const h=this.getPreviewValue(l,u,o);let c;o.originSelectionRange?c=M.lift(o.originSelectionRange):c=new M(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);const f=this.modeService.getModeIdByFilepathOrFirstLine(l.uri);this.addDecoration(c,new qp().appendCodeblock(f||"",h)),a.dispose()})}}).then(void 0,Qe)}getPreviewValue(e,t,i){let s=i.targetSelectionRange?i.range:this.getPreviewRangeBasedOnBrackets(e,t);return s.endLineNumber-s.startLineNumber>=R_.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;ai)return new M(t,1,i+1,1);o=e.findNextBracket(new G(l,u))}return new M(t,1,i+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[i])}removeLinkDecorations(){this.linkDecorations.length>0&&(this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[]))}isEnabled(e,t){return this.editor.hasModel()&&e.isNoneOrSingleMouseDown&&e.target.type===6&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&Qv.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?LO(i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const s=!t&&this.editor.getOption(77)&&!this.isInPeekEditor(i);return new qL({openToSide:t,openInPeek:s,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(i,this.editor)})}isInPeekEditor(e){const t=e.get(je);return Ys.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose()}};hf.ID="editor.contrib.gotodefinitionatposition";hf.MAX_SOURCE_PREVIEW_LINES=8;hf=o_e([hW(1,Al),hW(2,Rs)],hf);Ln(hf.ID,hf);ni((n,e)=>{const t=n.getColor(Foe);t&&e.addRule(`.monaco-editor .goto-definition-link { color: ${t} !important; }`)});const dw=ge;class MU extends ie{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this._scrollbar=this._register(new SL(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this._scrollbar.getDomNode())}onContentsChanged(){this._scrollbar.scanDomNode()}}class DO extends ie{constructor(e,t,i){super(),this.actionContainer=le(e,dw("div.action-container")),this.action=le(this.actionContainer,dw("a.action")),this.action.setAttribute("href","#"),this.action.setAttribute("role","button"),t.iconClass&&le(this.action,dw(`span.icon.${t.iconClass}`));const s=le(this.action,dw("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._register(ne(this.actionContainer,xe.MOUSE_DOWN,r=>{r.stopPropagation(),r.preventDefault(),t.run(this.actionContainer)})),this.setEnabled(!0)}static render(e,t,i){return new DO(e,t,i)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function a_e(n,e){const t=[],s=Pp.ordered(n).reverse().map(r=>Promise.resolve(r.provideDocumentColors(n,e)).then(o=>{if(Array.isArray(o))for(let a of o)t.push({colorInfo:a,provider:r})}));return Promise.all(s).then(()=>t)}function cW(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}Ft.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof $e))throw yl();const i=n.get(Zn).getModel(t);if(!i)throw yl();const s=[],o=Pp.ordered(i).reverse().map(a=>Promise.resolve(a.provideDocumentColors(i,ii.None)).then(l=>{if(Array.isArray(l))for(let u of l)s.push({range:u.range,color:[u.color.red,u.color.green,u.color.blue,u.color.alpha]})}));return Promise.all(o).then(()=>s)});Ft.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:s,range:r}=i;if(!(s instanceof $e)||!Array.isArray(t)||t.length!==4||!M.isIRange(r))throw yl();const[o,a,l,u]=t,h=n.get(Zn).getModel(s);if(!h)throw yl();const c={range:r,color:{red:o,green:a,blue:l,alpha:u}},f=[],m=Pp.ordered(h).reverse().map(v=>Promise.resolve(v.provideColorPresentations(h,c,ii.None)).then(S=>{Array.isArray(S)&&f.push(...S)}));return Promise.all(m).then(()=>f)});var l_e=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},dW=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const u_e=500;let cf=class RU extends ie{constructor(e,t,i){super(),this._editor=e,this._codeEditorService=t,this._configurationService=i,this._localToDispose=this._register(new pe),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=[],this._decorationsTypes=new Set,this._register(e.onDidChangeModel(()=>{this._isEnabled=this.isEnabled(),this.onModelChanged()})),this._register(e.onDidChangeModelLanguage(()=>this.onModelChanged())),this._register(Pp.onDidChange(()=>this.onModelChanged())),this._register(e.onDidChangeConfiguration(()=>{let s=this._isEnabled;this._isEnabled=this.isEnabled(),s!==this._isEnabled&&(this._isEnabled?this.onModelChanged():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isEnabled=this.isEnabled(),this.onModelChanged()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(17)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}onModelChanged(){if(this.stop(),!this._isEnabled)return;const e=this._editor.getModel();!e||!Pp.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Ms,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},RU.RECOMPUTE_TIME))})),this.beginCompute())}beginCompute(){this._computePromise=kr(e=>{const t=this._editor.getModel();return t?a_e(t,e):Promise.resolve([])}),this._computePromise.then(e=>{this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null},Qe)}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:ft.EMPTY}));this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((i,s)=>this._colorDatas.set(i,e[s]))}updateColorDecorators(e){let t=[],i={};for(let s=0;s{i[s]||this._codeEditorService.removeDecorationType(s)}),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,t)}removeAllDecorations(){this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,[]),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,[]),this._decorationsTypes.forEach(e=>{this._codeEditorService.removeDecorationType(e)})}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(M.fromPositions(e,e)).filter(s=>this._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}};cf.ID="editor.contrib.colorDetector";cf.RECOMPUTE_TIME=1e3;cf=l_e([dW(1,ei),dW(2,Fi)],cf);Ln(cf.ID,cf);class h_e{constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new H,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new H,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new H,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){for(let i=0;i{this.backgroundColor=o.getColor(i0)||q.white})),this._register(ne(this.pickedColorNode,xe.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ne(r,xe.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this.pickedColorNode.style.backgroundColor=q.Format.CSS.format(t.color)||"",this.pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter())}onDidChangeColor(e){this.pickedColorNode.style.backgroundColor=q.Format.CSS.format(e)||"",this.pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this.pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:"",this.pickedColorNode.prepend(va(".codicon.codicon-color-mode"))}}class d_e extends ie{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this.domNode=va(".colorpicker-body"),le(e,this.domNode),this.saturationBox=new f_e(this.domNode,this.model,this.pixelRatio),this._register(this.saturationBox),this._register(this.saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this.saturationBox.onColorFlushed(this.flushColor,this)),this.opacityStrip=new g_e(this.domNode,this.model),this._register(this.opacityStrip),this._register(this.opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this.opacityStrip.onColorFlushed(this.flushColor,this)),this.hueStrip=new p_e(this.domNode,this.model),this._register(this.hueStrip),this._register(this.hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this.hueStrip.onColorFlushed(this.flushColor,this))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new q(new bl(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new q(new bl(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new q(new bl(i===360?0:i,t.s,t.v,t.a))}layout(){this.saturationBox.layout(),this.opacityStrip.layout(),this.hueStrip.layout()}}class f_e extends ie{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new H,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new H,this.onColorFlushed=this._onColorFlushed.event,this.domNode=va(".saturation-wrap"),le(e,this.domNode),this.canvas=document.createElement("canvas"),this.canvas.className="saturation-box",le(this.domNode,this.canvas),this.selection=va(".saturation-selection"),le(this.domNode,this.selection),this.layout(),this._register(IR(this.domNode,s=>this.onMouseDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}onMouseDown(e){this.monitor=this._register(new If);const t=bn(this.domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.buttons,Sm,s=>this.onDidChangePosition(s.posx-t.left,s.posy-t.top),()=>null);const i=M6(document,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this.domNode.offsetWidth,this.height=this.domNode.offsetHeight,this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new q(new bl(e.h,1,1,1)),i=this.canvas.getContext("2d"),s=i.createLinearGradient(0,0,this.canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const r=i.createLinearGradient(0,0,0,this.canvas.height);r.addColorStop(0,"rgba(0, 0, 0, 0)"),r.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this.canvas.width,this.canvas.height),i.fillStyle=q.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=r,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class OU extends ie{constructor(e,t){super(),this.model=t,this._onDidChange=new H,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new H,this.onColorFlushed=this._onColorFlushed.event,this.domNode=le(e,va(".strip")),this.overlay=le(this.domNode,va(".overlay")),this.slider=le(this.domNode,va(".slider")),this.slider.style.top="0px",this._register(IR(this.domNode,i=>this.onMouseDown(i))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onMouseDown(e){const t=this._register(new If),i=bn(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.buttons,Sm,r=>this.onDidChangeTop(r.posy-i.top),()=>null);const s=M6(document,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class g_e extends OU{constructor(e,t){super(e,t),this.domNode.classList.add("opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:i,b:s}=e.rgba,r=new q(new ot(t,i,s,1)),o=new q(new ot(t,i,s,0));this.overlay.style.background=`linear-gradient(to bottom, ${r} 0%, ${o} 100%)`}getValue(e){return e.hsva.a}}class p_e extends OU{constructor(e,t){super(e,t),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class m_e extends no{constructor(e,t,i,s){super(),this.model=t,this.pixelRatio=i,this._register(_6(()=>this.layout()));const r=va(".colorpicker-widget");e.appendChild(r);const o=new c_e(r,this.model,s);this.body=new d_e(r,this.model,this.pixelRatio),this._register(o),this._register(this.body)}layout(){this.body.layout()}}var __e=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},v_e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},fW=globalThis&&globalThis.__awaiter||function(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{u(i.next(h))}catch(c){o(c)}}function l(h){try{u(i.throw(h))}catch(c){o(c)}}function u(h){h.done?r(h.value):s(h.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class b_e{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let AT=class{constructor(e,t,i){this._editor=e,this._hover=t,this._themeService=i}computeSync(e,t){return[]}computeAsync(e,t,i){return fW(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const s=cf.get(this._editor);for(const r of t){if(r.options.description!=="color-detector-color")continue;const o=s.getColorData(r.range.getStartPosition());if(o)return[yield this._createColorHover(this._editor.getModel(),o.colorInfo,o.provider)]}return[]})}_createColorHover(e,t,i){return fW(this,void 0,void 0,function*(){const s=e.getValueInRange(t.range),{red:r,green:o,blue:a,alpha:l}=t.color,u=new ot(Math.round(r*255),Math.round(o*255),Math.round(a*255),l),h=new q(u),c=yield cW(e,t,i,ii.None),f=new h_e(h,[],0);return f.colorPresentations=c||[],f.guessColorPresentation(h,s),new b_e(this,M.lift(t.range),f,i)})}renderHoverParts(e,t,i){if(e.length===0||!this._editor.hasModel())return ie.None;const s=new pe,r=e[0],o=this._editor.getModel(),a=r.model,l=s.add(new m_e(t,a,this._editor.getOption(127),this._themeService));let u=new M(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);const h=()=>{let f,g;if(a.presentation.textEdit){f=[a.presentation.textEdit],g=new M(a.presentation.textEdit.range.startLineNumber,a.presentation.textEdit.range.startColumn,a.presentation.textEdit.range.endLineNumber,a.presentation.textEdit.range.endColumn);const m=this._editor.getModel()._setTrackedRange(null,g,3);this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",f),g=this._editor.getModel()._getTrackedRange(m)||g}else f=[{identifier:null,range:u,text:a.presentation.label,forceMoveMarkers:!1}],g=u.setEndPosition(u.endLineNumber,u.startColumn+a.presentation.label.length),this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",f);a.presentation.additionalTextEdits&&(f=[...a.presentation.additionalTextEdits],this._editor.executeEdits("colorpicker",f),this._hover.hide()),this._editor.pushUndoStop(),u=g},c=f=>cW(o,{range:u,color:{red:f.rgba.r/255,green:f.rgba.g/255,blue:f.rgba.b/255,alpha:f.rgba.a}},r.provider,ii.None).then(g=>{a.colorPresentations=g||[]});return s.add(a.onColorFlushed(f=>{c(f).then(h)})),s.add(a.onDidChangeColor(c)),this._hover.setColorPicker(l),s}};AT=__e([v_e(2,ai)],AT);class PU{constructor(e,t,i,s,r){this._computer=e,this._state=0,this._hoverTime=r,this._firstWaitScheduler=new mi(()=>this._triggerAsyncComputation(),0),this._secondWaitScheduler=new mi(()=>this._triggerSyncComputation(),0),this._loadingMessageScheduler=new mi(()=>this._showLoadingMessage(),0),this._asyncComputationPromise=null,this._asyncComputationPromiseDone=!1,this._completeCallback=t,this._errorCallback=i,this._progressCallback=s}setHoverTime(e){this._hoverTime=e}_firstWaitTime(){return this._hoverTime/2}_secondWaitTime(){return this._hoverTime/2}_loadingMessageTime(){return 3*this._hoverTime}_triggerAsyncComputation(){this._state=2,this._secondWaitScheduler.schedule(this._secondWaitTime()),this._computer.computeAsync?(this._asyncComputationPromiseDone=!1,this._asyncComputationPromise=kr(e=>this._computer.computeAsync(e)),this._asyncComputationPromise.then(e=>{this._asyncComputationPromiseDone=!0,this._withAsyncResult(e)},e=>this._onError(e))):this._asyncComputationPromiseDone=!0}_triggerSyncComputation(){this._computer.computeSync&&this._computer.onResult(this._computer.computeSync(),!0),this._asyncComputationPromiseDone?(this._state=0,this._onComplete(this._computer.getResult())):(this._state=3,this._onProgress(this._computer.getResult()))}_showLoadingMessage(){this._state===3&&this._onProgress(this._computer.getResultWithLoadingMessage())}_withAsyncResult(e){e&&this._computer.onResult(e,!1),this._state===3&&(this._state=0,this._onComplete(this._computer.getResult()))}_onComplete(e){this._completeCallback(e)}_onError(e){this._errorCallback?this._errorCallback(e):Qe(e)}_onProgress(e){this._progressCallback(e)}start(e){if(e===0)this._state===0&&(this._state=1,this._firstWaitScheduler.schedule(this._firstWaitTime()),this._loadingMessageScheduler.schedule(this._loadingMessageTime()));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._loadingMessageScheduler.cancel(),this._state===1&&this._firstWaitScheduler.cancel(),this._state===2&&(this._secondWaitScheduler.cancel(),this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null)),this._state===3&&this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null),this._state=0}}class gW{constructor(e,t){this.priority=e,this.range=t,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class wE{constructor(e,t,i){this.priority=e,this.owner=t,this.range=i,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}/*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */function C_e(n){if(Array.isArray(n)){for(var e=0,t=Array(n.length);e1?t-1:0),s=1;s/gm),R_e=Xu(/^data-[\-\w.\u00B7-\uFFFF]/),O_e=Xu(/^aria-[\-\w]+$/),P_e=Xu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),F_e=Xu(/^(?:\w+script|data):/i),B_e=Xu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),O_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function tl(n){if(Array.isArray(n)){for(var e=0,t=Array(n.length);e"u"?null:window},V_e=function(e,t){if((typeof e>"u"?"undefined":O_(e))!=="object"||typeof e.createPolicy!="function")return null;var i=null,s="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(s)&&(i=t.currentScript.getAttribute(s));var r="dompurify"+(i?"#"+i:"");try{return e.createPolicy(r,{createHTML:function(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function BU(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W_e(),e=function(T){return BU(T)};if(e.version="2.3.1",e.removed=[],!n||!n.document||n.document.nodeType!==9)return e.isSupported=!1,e;var t=n.document,i=n.document,s=n.DocumentFragment,r=n.HTMLTemplateElement,o=n.Node,a=n.Element,l=n.NodeFilter,u=n.NamedNodeMap,h=u===void 0?n.NamedNodeMap||n.MozNamedAttrMap:u,c=n.Text,f=n.Comment,g=n.DOMParser,m=n.trustedTypes,v=a.prototype,S=fw(v,"cloneNode"),w=fw(v,"nextSibling"),b=fw(v,"childNodes"),y=fw(v,"parentNode");if(typeof r=="function"){var L=i.createElement("template");L.content&&L.content.ownerDocument&&(i=L.content.ownerDocument)}var E=V_e(m,t),I=E&&Ha?E.createHTML(""):"",x=i,k=x.implementation,A=x.createNodeIterator,z=x.createDocumentFragment,V=x.getElementsByTagName,Q=t.importNode,ee={};try{ee=Gc(i).documentMode?i.documentMode:{}}catch{}var Ce={};e.isSupported=typeof y=="function"&&k&&typeof k.createHTMLDocument<"u"&&ee!==9;var Se=A_e,Ie=M_e,Te=R_e,oe=O_e,fe=F_e,Me=B_e,We=P_e,Xe=null,Bt=It({},[].concat(tl(bW),tl(SE),tl(yE),tl(LE),tl(CW))),ut=null,Li=It({},[].concat(tl(wW),tl(DE),tl(SW),tl(gw))),zi=null,ps=null,Xn=!0,Wt=!0,ao=!1,Ze=!1,Re=!1,$l=!1,Qn=!1,ir=!1,Zo=!1,Vn=!0,Ha=!1,Ff=!0,lo=!0,Dn=!1,nr={},sr=null,Kl=It({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Yo=null,Tc=It({},["audio","video","img","source","image","track"]),uo=null,Xo=It({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jl="http://www.w3.org/1998/Math/MathML",Gl="http://www.w3.org/2000/svg",rr="http://www.w3.org/1999/xhtml",za=rr,ql=!1,ms=null,Qo=i.createElement("form"),Ua=function(T){ms&&ms===T||((!T||(typeof T>"u"?"undefined":O_(T))!=="object")&&(T={}),T=Gc(T),Xe="ALLOWED_TAGS"in T?It({},T.ALLOWED_TAGS):Bt,ut="ALLOWED_ATTR"in T?It({},T.ALLOWED_ATTR):Li,uo="ADD_URI_SAFE_ATTR"in T?It(Gc(Xo),T.ADD_URI_SAFE_ATTR):Xo,Yo="ADD_DATA_URI_TAGS"in T?It(Gc(Tc),T.ADD_DATA_URI_TAGS):Tc,sr="FORBID_CONTENTS"in T?It({},T.FORBID_CONTENTS):Kl,zi="FORBID_TAGS"in T?It({},T.FORBID_TAGS):{},ps="FORBID_ATTR"in T?It({},T.FORBID_ATTR):{},nr="USE_PROFILES"in T?T.USE_PROFILES:!1,Xn=T.ALLOW_ARIA_ATTR!==!1,Wt=T.ALLOW_DATA_ATTR!==!1,ao=T.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=T.SAFE_FOR_TEMPLATES||!1,Re=T.WHOLE_DOCUMENT||!1,ir=T.RETURN_DOM||!1,Zo=T.RETURN_DOM_FRAGMENT||!1,Vn=T.RETURN_DOM_IMPORT!==!1,Ha=T.RETURN_TRUSTED_TYPE||!1,Qn=T.FORCE_BODY||!1,Ff=T.SANITIZE_DOM!==!1,lo=T.KEEP_CONTENT!==!1,Dn=T.IN_PLACE||!1,We=T.ALLOWED_URI_REGEXP||We,za=T.NAMESPACE||rr,Ze&&(Wt=!1),Zo&&(ir=!0),nr&&(Xe=It({},[].concat(tl(CW))),ut=[],nr.html===!0&&(It(Xe,bW),It(ut,wW)),nr.svg===!0&&(It(Xe,SE),It(ut,DE),It(ut,gw)),nr.svgFilters===!0&&(It(Xe,yE),It(ut,DE),It(ut,gw)),nr.mathMl===!0&&(It(Xe,LE),It(ut,SW),It(ut,gw))),T.ADD_TAGS&&(Xe===Bt&&(Xe=Gc(Xe)),It(Xe,T.ADD_TAGS)),T.ADD_ATTR&&(ut===Li&&(ut=Gc(ut)),It(ut,T.ADD_ATTR)),T.ADD_URI_SAFE_ATTR&&It(uo,T.ADD_URI_SAFE_ATTR),T.FORBID_CONTENTS&&(sr===Kl&&(sr=Gc(sr)),It(sr,T.FORBID_CONTENTS)),lo&&(Xe["#text"]=!0),Re&&It(Xe,["html","head","body"]),Xe.table&&(It(Xe,["tbody"]),delete zi.tbody),Xs&&Xs(T),ms=T)},Zl=It({},["mi","mo","mn","ms","mtext"]),Bf=It({},["foreignobject","desc","title","annotation-xml"]),eh=It({},SE);It(eh,yE),It(eh,N_e);var $a=It({},LE);It($a,T_e);var Ac=function(T){var $=y(T);(!$||!$.tagName)&&($={namespaceURI:rr,tagName:"template"});var se=Jc(T.tagName),ae=Jc($.tagName);if(T.namespaceURI===Gl)return $.namespaceURI===rr?se==="svg":$.namespaceURI===jl?se==="svg"&&(ae==="annotation-xml"||Zl[ae]):Boolean(eh[se]);if(T.namespaceURI===jl)return $.namespaceURI===rr?se==="math":$.namespaceURI===Gl?se==="math"&&Bf[ae]:Boolean($a[se]);if(T.namespaceURI===rr){if($.namespaceURI===Gl&&!Bf[ae]||$.namespaceURI===jl&&!Zl[ae])return!1;var we=It({},["title","style","font","a","script"]);return!$a[se]&&(we[se]||!eh[se])}return!1},Ps=function(T){f_(e.removed,{element:T});try{T.parentNode.removeChild(T)}catch{try{T.outerHTML=I}catch{T.remove()}}},Wf=function(T,$){try{f_(e.removed,{attribute:$.getAttributeNode(T),from:$})}catch{f_(e.removed,{attribute:null,from:$})}if($.removeAttribute(T),T==="is"&&!ut[T])if(ir||Zo)try{Ps($)}catch{}else try{$.setAttribute(T,"")}catch{}},Vf=function(T){var $=void 0,se=void 0;if(Qn)T=""+T;else{var ae=_W(T,/^[\r\n\t ]+/);se=ae&&ae[0]}var we=E?E.createHTML(T):T;if(za===rr)try{$=new g().parseFromString(we,"text/html")}catch{}if(!$||!$.documentElement){$=k.createDocument(za,"template",null);try{$.documentElement.innerHTML=ql?"":we}catch{}}var Ue=$.body||$.documentElement;return T&&se&&Ue.insertBefore(i.createTextNode(se),Ue.childNodes[0]||null),za===rr?V.call($,Re?"html":"body")[0]:Re?$.documentElement:Ue},Hf=function(T){return A.call(T.ownerDocument||T,T,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},ht=function(T){return T instanceof c||T instanceof f?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||!(T.attributes instanceof h)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"},Ka=function(T){return(typeof o>"u"?"undefined":O_(o))==="object"?T instanceof o:T&&(typeof T>"u"?"undefined":O_(T))==="object"&&typeof T.nodeType=="number"&&typeof T.nodeName=="string"},te=function(T,$,se){!Ce[T]||x_e(Ce[T],function(ae){ae.call(e,$,se,ms)})},Y=function(T){var $=void 0;if(te("beforeSanitizeElements",T,null),ht(T)||_W(T.nodeName,/[\u0080-\uFFFF]/))return Ps(T),!0;var se=Jc(T.nodeName);if(te("uponSanitizeElement",T,{tagName:se,allowedTags:Xe}),!Ka(T.firstElementChild)&&(!Ka(T.content)||!Ka(T.content.firstElementChild))&&hu(/<[/\w]/g,T.innerHTML)&&hu(/<[/\w]/g,T.textContent)||se==="select"&&hu(/