const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./setupMonaco.features-Cu88WI8m.js","./index-CxlebU9W.js","./index-BD5rHN8m.css","./setupMonaco-PRM3u-9J.css"])))=>i.map(i=>d[i]); var r5=Object.defineProperty;var a5=(s,e,t)=>e in s?r5(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Zk=(s,e,t)=>a5(s,typeof e!="symbol"?e+"":e,t);import{p as l5,q as vu,_ as c5,M as d5}from"./index-CxlebU9W.js";function xs(s,e=0){return s[s.length-(1+e)]}function u5(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Wi(s,e,t=(i,n)=>i===n){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let i=0,n=s.length;it(s[i],e))}function g5(s,e){let t=0,i=s-1;for(;t<=i;){const n=(t+i)/2|0,o=e(n);if(o<0)t=n+1;else if(o>0)i=n-1;else return n}return-(t+1)}function Yk(s,e,t){if(s=s|0,s>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],o=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?o.push(a):r.push(a)}return s!!e)}function Qk(s){let e=0;for(let t=0;t0}function Nc(s,e=t=>t){const t=new Set;return s.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function fS(s,e){return s.length>0?s[0]:e}function Rn(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const i=[];if(t<=e)for(let n=t;ne;n--)i.push(n);return i}function k0(s,e,t){const i=s.slice(0,e),n=s.slice(e);return i.concat(t,n)}function V1(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function fm(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function Cb(s,e){for(const t of e)s.push(t)}function _5(s){return Array.isArray(s)?s:[s]}function v5(s,e,t){const i=IN(s,e),n=s.length,o=t.length;s.length=n+o;for(let r=n-1;r>=i;r--)s[r+o]=s[r];for(let r=0;r0}s.isGreaterThan=i;function n(o){return o===0}s.isNeitherLessOrGreaterThan=n,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})(Af||(Af={}));function oo(s,e){return(t,i)=>e(s(t),s(i))}function b5(...s){return(e,t)=>{for(const i of s){const n=i(e,t);if(!Af.isNeitherLessOrGreaterThan(n))return n}return Af.neitherLessOrGreaterThan}}const ul=(s,e)=>s-e,C5=(s,e)=>ul(s?1:0,e?1:0);function w5(s){return(e,t)=>-s(e,t)}class ba{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=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(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class _r{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new _r(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new _r(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||Af.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}}_r.empty=new _r(s=>{});class wb{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((n,o)=>t(e[n],e[o]));return new wb(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t"u"}function bu(s){return!gs(s)}function gs(s){return To(s)||s===null}function vr(s,e){if(!s)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function TN(s){if(gs(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function $p(s){return typeof s=="function"}function S5(s,e){const t=Math.min(s.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?Ha(i):i}),e}function k5(s){if(!s||typeof s!="object")return s;const e=[s];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(AN.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!y5(n)&&e.push(n)}}return s}const AN=Object.prototype.hasOwnProperty;function MN(s,e){return yb(s,e,new Set)}function yb(s,e,t){if(gs(s))return s;const i=e(s);if(typeof i<"u")return i;if(Array.isArray(s)){const n=[];for(const o of s)n.push(yb(o,e,t));return n}if(Yn(s)){if(t.has(s))throw new Error("Cannot clone recursive data-structure");t.add(s);const n={};for(const o in s)AN.call(s,o)&&(n[o]=yb(s[o],e,t));return t.delete(s),n}return s}function D5(s,e,t=!0){return Yn(s)?(Yn(e)&&Object.keys(e).forEach(i=>{i in s?t&&(Yn(s[i])&&Yn(e[i])?D5(s[i],e[i],t):s[i]=e[i]):s[i]=e[i]}),s):e}function bs(s,e){if(s===e)return!0;if(s==null||e===null||e===void 0||typeof s!=typeof e||typeof s!="object"||Array.isArray(s)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(s)){if(s.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(n,o)},i={};for(const n of s)i[n]=t(n);return i}let I5=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function RN(s,e){let t;return e.length===0?t=s:t=s.replace(/\{(\d+)\}/g,(i,n)=>{const o=n[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),I5&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function p(s,e,...t){return RN(e,t)}function fte(s,e,...t){const i=RN(e,t);return{value:i,original:i}}var H1,z1;const kd="en";let Kp=!1,jp=!1,hp=!1,PN=!1,mS=!1,pS=!1,FN=!1,gm,fp=kd,eD=kd,N5,vo;const fa=globalThis;let yn;typeof fa.vscode<"u"&&typeof fa.vscode.process<"u"?yn=fa.vscode.process:typeof process<"u"&&typeof((H1=process==null?void 0:process.versions)===null||H1===void 0?void 0:H1.node)=="string"&&(yn=process);const T5=typeof((z1=yn==null?void 0:yn.versions)===null||z1===void 0?void 0:z1.electron)=="string",A5=T5&&(yn==null?void 0:yn.type)==="renderer";if(typeof yn=="object"){Kp=yn.platform==="win32",jp=yn.platform==="darwin",hp=yn.platform==="linux",hp&&yn.env.SNAP&&yn.env.SNAP_REVISION,yn.env.CI||yn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,gm=kd,fp=kd;const s=yn.env.VSCODE_NLS_CONFIG;if(s)try{const e=JSON.parse(s),t=e.availableLanguages["*"];gm=e.locale,eD=e.osLocale,fp=t||kd,N5=e._translationsConfigFile}catch{}PN=!0}else typeof navigator=="object"&&!A5?(vo=navigator.userAgent,Kp=vo.indexOf("Windows")>=0,jp=vo.indexOf("Macintosh")>=0,pS=(vo.indexOf("Macintosh")>=0||vo.indexOf("iPad")>=0||vo.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,hp=vo.indexOf("Linux")>=0,FN=(vo==null?void 0:vo.indexOf("Mobi"))>=0,mS=!0,p({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),gm=kd,fp=gm,eD=navigator.language):console.error("Unable to resolve platform.");const Wn=Kp,Ye=jp,Vn=hp,nf=PN,Yu=mS,M5=mS&&typeof fa.importScripts=="function",R5=M5?fa.origin:void 0,Cl=pS,ON=FN,Sr=vo,gte=fp,P5=typeof fa.postMessage=="function"&&!fa.importScripts,BN=(()=>{if(P5){const s=[];fa.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=s.length;i{const i=++e;s.push({id:i,callback:t}),fa.postMessage({vscodeScheduleAsyncWork:i},"*")}}return s=>setTimeout(s)})(),to=jp||pS?2:Kp?1:3;let tD=!0,iD=!1;function F5(){if(!iD){iD=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,tD=new Uint16Array(s.buffer)[0]===513}return tD}const WN=!!(Sr&&Sr.indexOf("Chrome")>=0),O5=!!(Sr&&Sr.indexOf("Firefox")>=0),B5=!!(!WN&&Sr&&Sr.indexOf("Safari")>=0),W5=!!(Sr&&Sr.indexOf("Edg/")>=0),V5=!!(Sr&&Sr.indexOf("Android")>=0),en={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var ot;(function(s){function e(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}s.is=e;const t=Object.freeze([]);function i(){return t}s.empty=i;function*n(C){yield C}s.single=n;function o(C){return e(C)?C:n(C)}s.wrap=o;function r(C){return C||t}s.from=r;function*a(C){for(let w=C.length-1;w>=0;w--)yield C[w]}s.reverse=a;function l(C){return!C||C[Symbol.iterator]().next().done===!0}s.isEmpty=l;function c(C){return C[Symbol.iterator]().next().value}s.first=c;function d(C,w){for(const y of C)if(w(y))return!0;return!1}s.some=d;function u(C,w){for(const y of C)if(w(y))return y}s.find=u;function*h(C,w){for(const y of C)w(y)&&(yield y)}s.filter=h;function*f(C,w){let y=0;for(const L of C)yield w(L,y++)}s.map=f;function*g(...C){for(const w of C)yield*w}s.concat=g;function m(C,w,y){let L=y;for(const k of C)L=w(L,k);return L}s.reduce=m;function*_(C,w,y=C.length){for(w<0&&(w+=C.length),y<0?y+=C.length:y>C.length&&(y=C.length);w{n||(n=!0,this._remove(i))}}shift(){if(this._first!==di.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==di.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==di.Undefined&&e.next!==di.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===di.Undefined&&e.next===di.Undefined?(this._first=di.Undefined,this._last=di.Undefined):e.next===di.Undefined?(this._last=this._last.prev,this._last.next=di.Undefined):e.prev===di.Undefined&&(this._first=this._first.next,this._first.prev=di.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==di.Undefined;)yield e.element,e=e.next}}const VN="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function H5(s=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of VN)s.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const _S=H5();function vS(s){let e=_S;if(s&&s instanceof RegExp)if(s.global)e=s;else{let t="g";s.ignoreCase&&(t+="i"),s.multiline&&(t+="m"),s.unicode&&(t+="u"),e=new RegExp(s.source,t)}return e.lastIndex=0,e}const HN=new Qn;HN.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Mf(s,e,t,i,n){if(e=vS(e),n||(n=ot.first(HN)),t.length>n.maxLen){let c=s-n.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,s+n.maxLen/2),Mf(s,e,t,i,n)}const o=Date.now(),r=s-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=n.timeBudget);c++){const d=r-n.windowSize*c;e.lastIndex=Math.max(0,d);const u=z5(e,t,r,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function z5(s,e,t,i){let n;for(;n=s.exec(e);){const o=n.index||0;if(o<=t&&s.lastIndex>=t)return n;if(i>0&&o>i)return null}return null}const Xo=8;class zN{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class UN{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Bt{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return D0(e,t)}compute(e,t,i){return i}}class sf{constructor(e,t){this.newValue=e,this.didChange=t}}function D0(s,e){if(typeof s!="object"||typeof e!="object"||!s||!e)return new sf(e,s!==e);if(Array.isArray(s)||Array.isArray(e)){const i=Array.isArray(s)&&Array.isArray(e)&&Wi(s,e);return new sf(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=D0(s[i],e[i]);n.didChange&&(s[i]=n.newValue,t=!0)}return new sf(s,t)}class Ag{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return D0(e,t)}validate(e){return this.defaultValue}}class Qu{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return D0(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function le(s,e){return typeof s>"u"?e:s==="false"?!1:!!s}class qe extends Qu{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return le(e,this.defaultValue)}}function Gl(s,e,t,i){if(typeof s>"u")return e;let n=parseInt(s,10);return isNaN(n)?e:(n=Math.max(t,n),n=Math.min(i,n),n|0)}class Lt extends Qu{static clampedInt(e,t,i,n){return Gl(e,t,i,n)}constructor(e,t,i,n,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=n,r.maximum=o),super(e,t,i,r),this.minimum=n,this.maximum=o}validate(e){return Lt.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function U5(s,e,t,i){if(typeof s>"u")return e;const n=ps.float(s,e);return ps.clamp(n,t,i)}class ps extends Qu{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}constructor(e,t,i,n,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}validate(e){return this.validationFn(ps.float(e,this.defaultValue))}}class Sn extends Qu{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return Sn.string(e,this.defaultValue)}}function jt(s,e,t,i){return typeof s!="string"?e:i&&s in i?i[s]:t.indexOf(s)===-1?e:s}class $t extends Qu{constructor(e,t,i,n,o=void 0){typeof o<"u"&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return jt(e,this.defaultValue,this._allowedValues)}}class mm extends Bt{constructor(e,t,i,n,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=n),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function $5(s){switch(s){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class K5 extends Bt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[p("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),p("accessibilitySupport.on","Optimize for usage with a Screen Reader."),p("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:p("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}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 j5 extends Bt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:p("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:p("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:le(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:le(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function q5(s){switch(s){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Oi;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(Oi||(Oi={}));function G5(s){switch(s){case"line":return Oi.Line;case"block":return Oi.Block;case"underline":return Oi.Underline;case"line-thin":return Oi.LineThin;case"block-outline":return Oi.BlockOutline;case"underline-thin":return Oi.UnderlineThin}}class Z5 extends Ag{constructor(){super(142)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),t.get(74)==="default"?n.push("mouse-default"):t.get(74)==="copy"&&n.push("mouse-copy"),t.get(111)&&n.push("showUnused"),t.get(140)&&n.push("showDeprecated"),n.join(" ")}}class Y5 extends qe{constructor(){super(37,"emptySelectionClipboard",!0,{description:p("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class Q5 extends Bt{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:p("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:[p("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),p("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),p("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:p("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:[p("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),p("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),p("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:p("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:p("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Ye},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:p("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:p("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:le(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":jt(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":jt(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:le(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:le(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:le(t.loop,this.defaultValue.loop)}}}class Ns extends Bt{constructor(){super(51,"fontLigatures",Ns.OFF,{anyOf:[{type:"boolean",description:p("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:p("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:p("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"||e.length===0?Ns.OFF:e==="true"?Ns.ON:e:e?Ns.ON:Ns.OFF}}Ns.OFF='"liga" off, "calt" off';Ns.ON='"liga" on, "calt" on';class xo extends Bt{constructor(){super(54,"fontVariations",xo.OFF,{anyOf:[{type:"boolean",description:p("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:p("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:p("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?xo.OFF:e==="true"?xo.TRANSLATE:e:e?xo.TRANSLATE:xo.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}xo.OFF="normal";xo.TRANSLATE="translate";class X5 extends Ag{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class J5 extends Qu{constructor(){super(52,"fontSize",Cs.fontSize,{type:"number",minimum:6,maximum:100,default:Cs.fontSize,description:p("fontSize","Controls the font size in pixels.")})}validate(e){const t=ps.float(e,this.defaultValue);return t===0?Cs.fontSize:ps.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class ar extends Bt{constructor(){super(53,"fontWeight",Cs.fontWeight,{anyOf:[{type:"number",minimum:ar.MINIMUM_VALUE,maximum:ar.MAXIMUM_VALUE,errorMessage:p("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:ar.SUGGESTION_VALUES}],default:Cs.fontWeight,description:p("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(Lt.clampedInt(e,Cs.fontWeight,ar.MINIMUM_VALUE,ar.MAXIMUM_VALUE))}}ar.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];ar.MINIMUM_VALUE=1;ar.MAXIMUM_VALUE=1e3;class eP extends Bt{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:[p("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),p("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),p("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(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:p("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":{description:p("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:p("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:p("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:p("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:p("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:p("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:p("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:p("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:p("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:p("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,o,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:jt(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:jt(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:jt(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(n=a.multipleDeclarations)!==null&&n!==void 0?n:jt(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:jt(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:jt(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Sn.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Sn.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Sn.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Sn.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Sn.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class tP extends Bt{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:p("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:p("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:p("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:p("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:p("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:le(t.enabled,this.defaultValue.enabled),delay:Lt.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:le(t.sticky,this.defaultValue.sticky),hidingDelay:Lt.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:le(t.above,this.defaultValue.above)}}}class Gd extends Ag{constructor(){super(145)}compute(e,t,i){return Gd.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,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const o=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,o=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(o*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,_=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,C=e.isViewportWrapping,w=u?2:3;let y=Math.floor(o*n);const L=y/o;let k=!1,D=!1,N=w*h,W=h/o,R=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:ve,extraLinesBeforeFirstLine:se,extraLinesBeyondLastLine:Ce,desiredRatio:Ee,minimapLineCount:fe}=Gd.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:o});if(v/fe>1)k=!0,D=!0,h=1,N=1,W=h/o;else{let ie=!1,ut=h+1;if(g==="fit"){const Mt=Math.ceil((se+v+Ce)*N);C&&a&&b<=t.stableFitRemainingWidth?(ie=!0,ut=t.stableFitMaxMinimapScale):ie=Mt>y}if(g==="fill"||ie){k=!0;const Mt=h;N=Math.min(l*o,Math.max(1,Math.floor(1/Ee))),C&&a&&b<=t.stableFitRemainingWidth&&(ut=t.stableFitMaxMinimapScale),h=Math.min(ut,Math.max(1,Math.floor(N/w))),h>Mt&&(R=Math.min(2,h/Mt)),W=h/o/R,y=Math.ceil(Math.max(ve,se+v+Ce)*N),C?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const A=Math.floor(f*W),P=Math.min(A,Math.max(0,Math.floor((b-_-2)*W/(c+W)))+Xo);let H=Math.floor(o*P);const q=H/o;H=Math.floor(H*R);const re=u?1:2,de=m==="left"?0:i-P-_;return{renderMinimap:re,minimapLeft:de,minimapWidth:P,minimapHeightIsEditorHeight:k,minimapIsSampling:D,minimapScale:h,minimapLineHeight:N,minimapCanvasInnerWidth:H,minimapCanvasInnerHeight:y,minimapCanvasOuterWidth:q,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,u=e.get(137),h=u==="inherit"?e.get(136):u,f=h==="inherit"?e.get(132):h,g=e.get(135),m=t.isDominatedByLongLines,_=e.get(57),v=e.get(68).renderType!==0,b=e.get(69),C=e.get(105),w=e.get(84),y=e.get(73),L=e.get(103),k=L.verticalScrollbarSize,D=L.verticalHasArrows,N=L.arrowSize,W=L.horizontalScrollbarSize,R=e.get(43),A=e.get(110)!=="never";let P=e.get(66);R&&A&&(P+=16);let H=0;if(v){const ai=Math.max(r,b);H=Math.round(ai*l)}let q=0;_&&(q=o*t.glyphMarginDecorationLaneCount);let re=0,de=re+q,ve=de+H,se=ve+P;const Ce=i-q-H-P;let Ee=!1,fe=!1,X=-1;h==="inherit"&&m?(Ee=!0,fe=!0):f==="on"||f==="bounded"?fe=!0:f==="wordWrapColumn"&&(X=g);const ie=Gd._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:C,paddingTop:w.top,paddingBottom:w.bottom,minimap:y,verticalScrollbarWidth:k,viewLineCount:d,remainingWidth:Ce,isViewportWrapping:fe},t.memory||new UN);ie.renderMinimap!==0&&ie.minimapLeft===0&&(re+=ie.minimapWidth,de+=ie.minimapWidth,ve+=ie.minimapWidth,se+=ie.minimapWidth);const ut=Ce-ie.minimapWidth,Mt=Math.max(1,Math.floor((ut-k-2)/a)),it=D?N:0;return fe&&(X=Math.max(1,Mt),f==="bounded"&&(X=Math.min(X,g))),{width:i,height:n,glyphMarginLeft:re,glyphMarginWidth:q,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:de,lineNumbersWidth:H,decorationsLeft:ve,decorationsWidth:P,contentLeft:se,contentWidth:ut,minimap:ie,viewportColumn:Mt,isWordWrapMinified:Ee,isViewportWrapping:fe,wrappingColumn:X,verticalScrollbarWidth:k,horizontalScrollbarHeight:W,overviewRuler:{top:it,width:k,height:n-2*it,right:0}}}}class iP extends Bt{constructor(){super(139,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[p("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."),p("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.")],type:"string",enum:["simple","advanced"],default:"simple",description:p("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return jt(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var Hr;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(Hr||(Hr={}));class nP extends Bt{constructor(){const e={enabled:Hr.On};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[Hr.Off,Hr.OnCode,Hr.On],default:e.enabled,enumDescriptions:[p("editor.lightbulb.enabled.off","Disable the code action menu."),p("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),p("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:p("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:jt(e.enabled,this.defaultValue.enabled,[Hr.Off,Hr.OnCode,Hr.On])}}}class sP extends Bt{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(115,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:p("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:p("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:p("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:p("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:le(t.enabled,this.defaultValue.enabled),maxLineCount:Lt.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:jt(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:le(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class oP extends Bt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(141,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:p("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[p("editor.inlayHints.on","Inlay hints are enabled"),p("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Ye?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Ye?"Ctrl+Option":"Ctrl+Alt"),p("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:p("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:p("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:p("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:jt(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Lt.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Sn.string(t.fontFamily,this.defaultValue.fontFamily),padding:le(t.padding,this.defaultValue.padding)}}}class rP extends Bt{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Lt.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?Lt.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class aP extends ps{constructor(){super(67,"lineHeight",Cs.lineHeight,e=>ps.clamp(e,0,150),{markdownDescription:p("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 lP extends Bt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:p("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),p("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p("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:p("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:p("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:p("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:p("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:p("minimap.sectionHeaderLetterSpacing","Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){var t,i;if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:le(n.enabled,this.defaultValue.enabled),autohide:le(n.autohide,this.defaultValue.autohide),size:jt(n.size,this.defaultValue.size,["proportional","fill","fit"]),side:jt(n.side,this.defaultValue.side,["right","left"]),showSlider:jt(n.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:le(n.renderCharacters,this.defaultValue.renderCharacters),scale:Lt.clampedInt(n.scale,1,1,3),maxColumn:Lt.clampedInt(n.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:le(n.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:le(n.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:ps.clamp((t=n.sectionHeaderFontSize)!==null&&t!==void 0?t:this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:ps.clamp((i=n.sectionHeaderLetterSpacing)!==null&&i!==void 0?i:this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function cP(s){return s==="ctrlCmd"?Ye?"metaKey":"ctrlKey":"altKey"}class dP extends Bt{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:p("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:p("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:Lt.clampedInt(t.top,0,0,1e3),bottom:Lt.clampedInt(t.bottom,0,0,1e3)}}}class uP extends Bt{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:p("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:p("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:le(t.enabled,this.defaultValue.enabled),cycle:le(t.cycle,this.defaultValue.cycle)}}}class hP extends Ag{constructor(){super(143)}compute(e,t,i){return e.pixelRatio}}class fP extends Bt{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[p("on","Quick suggestions show inside the suggest widget"),p("inline","Quick suggestions show as ghost text"),p("off","Quick suggestions are disabled")]}];super(89,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:p("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:p("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:p("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:p("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:n}=e,o=["on","inline","off"];let r,a,l;return typeof t=="boolean"?r=t?"on":"off":r=jt(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=jt(i,this.defaultValue.comments,o),typeof n=="boolean"?l=n?"on":"off":l=jt(n,this.defaultValue.strings,o),{other:r,comments:a,strings:l}}}class gP extends Bt{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[p("lineNumbers.off","Line numbers are not rendered."),p("lineNumbers.on","Line numbers are rendered as absolute number."),p("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),p("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:p("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 qp(s){const e=s.get(98);return e==="editable"?s.get(91):e!=="on"}class mP extends Bt{constructor(){const e=[],t={type:"number",description:p("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(102,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:p("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:p("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)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:Lt.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const n=i;t.push({column:Lt.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}class pP extends Bt{constructor(){super(92,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function nD(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return 2;case"visible":return 3;default:return 1}}let _P=class extends Bt{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,ignoreHorizontalScrollbarInContentHeight:!1};super(103,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),p("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),p("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[p("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),p("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),p("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:p("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:p("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:p("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:p("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:p("scrollbar.ignoreHorizontalScrollbarInContentHeight","When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=Lt.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=Lt.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Lt.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:nD(t.vertical,this.defaultValue.vertical),horizontal:nD(t.horizontal,this.defaultValue.horizontal),useShadows:le(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:le(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:le(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:le(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:le(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Lt.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:Lt.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:le(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:le(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const mo="inUntrustedWorkspace",Wl={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class vP extends Bt{constructor(){const e={nonBasicASCII:mo,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:mo,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(125,"unicodeHighlight",e,{[Wl.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,mo],default:e.nonBasicASCII,description:p("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Wl.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:p("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Wl.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:p("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Wl.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,mo],default:e.includeComments,description:p("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Wl.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,mo],default:e.includeStrings,description:p("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Wl.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:p("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Wl.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:p("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(bs(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(bs(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new sf(n.newValue,!0):n}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:Zd(t.nonBasicASCII,mo,[!0,!1,mo]),invisibleCharacters:le(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:le(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Zd(t.includeComments,mo,[!0,!1,mo]),includeStrings:Zd(t.includeStrings,mo,[!0,!1,mo]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[n,o]of Object.entries(e))o===!0&&(i[n]=!0);return i}}class bP extends Bt{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:p("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[p("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),p("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),p("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:p("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:p("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:p("inlineSuggest.fontFamily","Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:le(t.enabled,this.defaultValue.enabled),mode:jt(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:jt(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:le(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:le(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Sn.string(t.fontFamily,this.defaultValue.fontFamily)}}}class CP extends Bt{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1,backgroundColoring:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:p("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[p("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),p("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),p("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:p("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:p("inlineEdit.fontFamily","Controls the font family of the inline edit.")},"editor.experimentalInlineEdit.backgroundColoring":{type:"boolean",default:e.backgroundColoring,description:p("inlineEdit.backgroundColoring","Controls whether to color the background of inline edits.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:le(t.enabled,this.defaultValue.enabled),showToolbar:jt(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:Sn.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:le(t.keepOnBlur,this.defaultValue.keepOnBlur),backgroundColoring:le(t.backgroundColoring,this.defaultValue.backgroundColoring)}}}class wP extends Bt{constructor(){const e={enabled:en.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:en.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:p("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:le(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:le(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class yP extends Bt{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairs.true","Enables bracket pair guides."),p("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),p("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:p("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[p("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),p("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),p("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:p("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:p("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:p("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[p("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),p("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),p("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:p("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:Zd(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Zd(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:le(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:le(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Zd(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function Zd(s,e,t){const i=t.indexOf(s);return i===-1?e:t[i]}class SP extends Bt{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!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(118,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[p("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),p("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:p("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:p("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:p("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:p("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[p("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),p("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),p("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),p("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:p("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:p("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:p("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:p("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:p("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:p("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:p("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:p("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:p("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:p("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:jt(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:le(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:le(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:le(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:le(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:jt(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:le(t.showIcons,this.defaultValue.showIcons),showStatusBar:le(t.showStatusBar,this.defaultValue.showStatusBar),preview:le(t.preview,this.defaultValue.preview),previewMode:jt(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:le(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:le(t.showMethods,this.defaultValue.showMethods),showFunctions:le(t.showFunctions,this.defaultValue.showFunctions),showConstructors:le(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:le(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:le(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:le(t.showFields,this.defaultValue.showFields),showVariables:le(t.showVariables,this.defaultValue.showVariables),showClasses:le(t.showClasses,this.defaultValue.showClasses),showStructs:le(t.showStructs,this.defaultValue.showStructs),showInterfaces:le(t.showInterfaces,this.defaultValue.showInterfaces),showModules:le(t.showModules,this.defaultValue.showModules),showProperties:le(t.showProperties,this.defaultValue.showProperties),showEvents:le(t.showEvents,this.defaultValue.showEvents),showOperators:le(t.showOperators,this.defaultValue.showOperators),showUnits:le(t.showUnits,this.defaultValue.showUnits),showValues:le(t.showValues,this.defaultValue.showValues),showConstants:le(t.showConstants,this.defaultValue.showConstants),showEnums:le(t.showEnums,this.defaultValue.showEnums),showEnumMembers:le(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:le(t.showKeywords,this.defaultValue.showKeywords),showWords:le(t.showWords,this.defaultValue.showWords),showColors:le(t.showColors,this.defaultValue.showColors),showFiles:le(t.showFiles,this.defaultValue.showFiles),showReferences:le(t.showReferences,this.defaultValue.showReferences),showFolders:le(t.showFolders,this.defaultValue.showFolders),showTypeParameters:le(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:le(t.showSnippets,this.defaultValue.showSnippets),showUsers:le(t.showUsers,this.defaultValue.showUsers),showIssues:le(t.showIssues,this.defaultValue.showIssues)}}}class LP extends Bt{constructor(){super(113,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:p("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:p("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:le(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:le(e.selectSubwords,this.defaultValue.selectSubwords)}}}class kP extends Bt{constructor(){const e=[];super(130,"wordSegmenterLocales",e,{anyOf:[{description:p("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:p("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}class DP extends Bt{constructor(){super(138,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[p("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),p("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),p("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),p("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:p("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class xP extends Ag{constructor(){super(146)}compute(e,t,i){const n=t.get(145);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}class EP extends Bt{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:p("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[p("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),p("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:le(t.enabled,this.defaultValue.enabled),showDropSelector:jt(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class IP extends Bt{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:p("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:p("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[p("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),p("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:le(t.enabled,this.defaultValue.enabled),showPasteSelector:jt(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const NP="Consolas, 'Courier New', monospace",TP="Menlo, Monaco, 'Courier New', monospace",AP="'Droid Sans Mono', 'monospace', monospace",Cs={fontFamily:Ye?TP:Vn?AP:NP,fontWeight:"normal",fontSize:Ye?12:14,lineHeight:0,letterSpacing:0},Dd=[];function Y(s){return Dd[s.id]=s,s}const jc={acceptSuggestionOnCommitCharacter:Y(new qe(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:p("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:Y(new $t(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",p("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:p("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:Y(new K5),accessibilityPageSize:Y(new Lt(3,"accessibilityPageSize",10,1,1073741824,{description:p("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."),tags:["accessibility"]})),ariaLabel:Y(new Sn(4,"ariaLabel",p("editorViewAccessibleLabel","Editor content"))),ariaRequired:Y(new qe(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Y(new qe(8,"screenReaderAnnounceInlineSuggestion",!0,{description:p("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Y(new $t(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),p("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:p("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Y(new $t(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),p("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:p("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Y(new $t(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Y(new $t(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",p("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:p("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Y(new $t(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",p("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),p("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:p("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Y(new mm(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],$5,{enumDescriptions:[p("editor.autoIndent.none","The editor will not insert indentation automatically."),p("editor.autoIndent.keep","The editor will keep the current line's indentation."),p("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),p("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),p("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:p("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Y(new qe(13,"automaticLayout",!1)),autoSurround:Y(new $t(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[p("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),p("editor.autoSurround.quotes","Surround with quotes but not brackets."),p("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:p("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Y(new wP),bracketPairGuides:Y(new yP),stickyTabStops:Y(new qe(116,"stickyTabStops",!1,{description:p("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Y(new qe(17,"codeLens",!0,{description:p("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Y(new Sn(18,"codeLensFontFamily","",{description:p("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Y(new Lt(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:p("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Y(new qe(20,"colorDecorators",!0,{description:p("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Y(new $t(148,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[p("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),p("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),p("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:p("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Y(new Lt(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:p("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Y(new qe(22,"columnSelection",!1,{description:p("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Y(new j5),contextmenu:Y(new qe(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Y(new qe(25,"copyWithSyntaxHighlighting",!0,{description:p("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Y(new mm(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],q5,{description:p("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Y(new $t(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[p("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),p("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),p("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:p("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Y(new mm(28,"cursorStyle",Oi.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],G5,{description:p("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Y(new Lt(29,"cursorSurroundingLines",0,0,1073741824,{description:p("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Y(new $t(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[p("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),p("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:p("cursorSurroundingLinesStyle","Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:Y(new Lt(31,"cursorWidth",0,0,1073741824,{markdownDescription:p("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Y(new qe(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Y(new qe(33,"disableMonospaceOptimizations",!1)),domReadOnly:Y(new qe(34,"domReadOnly",!1)),dragAndDrop:Y(new qe(35,"dragAndDrop",!0,{description:p("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Y(new Y5),dropIntoEditor:Y(new EP),stickyScroll:Y(new sP),experimentalWhitespaceRendering:Y(new $t(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[p("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),p("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),p("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:p("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Y(new Sn(39,"extraEditorClassName","")),fastScrollSensitivity:Y(new ps(40,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:p("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Y(new Q5),fixedOverflowWidgets:Y(new qe(42,"fixedOverflowWidgets",!1)),folding:Y(new qe(43,"folding",!0,{description:p("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Y(new $t(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[p("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),p("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:p("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Y(new qe(45,"foldingHighlight",!0,{description:p("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Y(new qe(46,"foldingImportsByDefault",!1,{description:p("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Y(new Lt(47,"foldingMaximumRegions",5e3,10,65e3,{description:p("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Y(new qe(48,"unfoldOnClickAfterEndOfLine",!1,{description:p("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Y(new Sn(49,"fontFamily",Cs.fontFamily,{description:p("fontFamily","Controls the font family.")})),fontInfo:Y(new X5),fontLigatures2:Y(new Ns),fontSize:Y(new J5),fontWeight:Y(new ar),fontVariations:Y(new xo),formatOnPaste:Y(new qe(55,"formatOnPaste",!1,{description:p("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:Y(new qe(56,"formatOnType",!1,{description:p("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Y(new qe(57,"glyphMargin",!0,{description:p("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Y(new eP),hideCursorInOverviewRuler:Y(new qe(59,"hideCursorInOverviewRuler",!1,{description:p("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Y(new tP),inDiffEditor:Y(new qe(61,"inDiffEditor",!1)),letterSpacing:Y(new ps(64,"letterSpacing",Cs.letterSpacing,s=>ps.clamp(s,-5,20),{description:p("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Y(new nP),lineDecorationsWidth:Y(new rP),lineHeight:Y(new aP),lineNumbers:Y(new gP),lineNumbersMinChars:Y(new Lt(69,"lineNumbersMinChars",5,1,300)),linkedEditing:Y(new qe(70,"linkedEditing",!1,{description:p("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Y(new qe(71,"links",!0,{description:p("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Y(new $t(72,"matchBrackets","always",["always","near","never"],{description:p("matchBrackets","Highlight matching brackets.")})),minimap:Y(new lP),mouseStyle:Y(new $t(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Y(new ps(75,"mouseWheelScrollSensitivity",1,s=>s===0?1:s,{markdownDescription:p("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Y(new qe(76,"mouseWheelZoom",!1,{markdownDescription:Ye?p("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):p("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Y(new qe(77,"multiCursorMergeOverlapping",!0,{description:p("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Y(new mm(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],cP,{markdownEnumDescriptions:[p("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),p("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:p({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](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Y(new $t(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[p("multiCursorPaste.spread","Each cursor pastes a single line of the text."),p("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:p("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Y(new Lt(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:p("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Y(new $t(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[p("occurrencesHighlight.off","Does not highlight occurrences."),p("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),p("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:p("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:Y(new qe(82,"overviewRulerBorder",!0,{description:p("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Y(new Lt(83,"overviewRulerLanes",3,0,3)),padding:Y(new dP),pasteAs:Y(new IP),parameterHints:Y(new uP),peekWidgetDefaultFocus:Y(new $t(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[p("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),p("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:p("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Y(new qe(88,"definitionLinkOpensInPeek",!1,{description:p("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Y(new fP),quickSuggestionsDelay:Y(new Lt(90,"quickSuggestionsDelay",10,0,1073741824,{description:p("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Y(new qe(91,"readOnly",!1)),readOnlyMessage:Y(new pP),renameOnType:Y(new qe(93,"renameOnType",!1,{description:p("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:p("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Y(new qe(94,"renderControlCharacters",!0,{description:p("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Y(new $t(95,"renderFinalNewline",Vn?"dimmed":"on",["off","on","dimmed"],{description:p("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Y(new $t(96,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",p("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:p("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Y(new qe(97,"renderLineHighlightOnlyWhenFocus",!1,{description:p("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Y(new $t(98,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Y(new $t(99,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",p("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),p("renderWhitespace.selection","Render whitespace characters only on selected text."),p("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:p("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Y(new Lt(100,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Y(new qe(101,"roundedSelection",!0,{description:p("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Y(new mP),scrollbar:Y(new _P),scrollBeyondLastColumn:Y(new Lt(104,"scrollBeyondLastColumn",4,0,1073741824,{description:p("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Y(new qe(105,"scrollBeyondLastLine",!0,{description:p("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Y(new qe(106,"scrollPredominantAxis",!0,{description:p("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:Y(new qe(107,"selectionClipboard",!0,{description:p("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Vn})),selectionHighlight:Y(new qe(108,"selectionHighlight",!0,{description:p("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Y(new qe(109,"selectOnLineNumbers",!0)),showFoldingControls:Y(new $t(110,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[p("showFoldingControls.always","Always show the folding controls."),p("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),p("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:p("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Y(new qe(111,"showUnused",!0,{description:p("showUnused","Controls fading out of unused code.")})),showDeprecated:Y(new qe(140,"showDeprecated",!0,{description:p("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Y(new oP),snippetSuggestions:Y(new $t(112,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[p("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),p("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),p("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),p("snippetSuggestions.none","Do not show snippet suggestions.")],description:p("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Y(new LP),smoothScrolling:Y(new qe(114,"smoothScrolling",!1,{description:p("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Y(new Lt(117,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Y(new SP),inlineSuggest:Y(new bP),inlineEdit:Y(new CP),inlineCompletionsAccessibilityVerbose:Y(new qe(149,"inlineCompletionsAccessibilityVerbose",!1,{description:p("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Y(new Lt(119,"suggestFontSize",0,0,1e3,{markdownDescription:p("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Y(new Lt(120,"suggestLineHeight",0,0,1e3,{markdownDescription:p("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Y(new qe(121,"suggestOnTriggerCharacters",!0,{description:p("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Y(new $t(122,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[p("suggestSelection.first","Always select the first suggestion."),p("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),p("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:p("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Y(new $t(123,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[p("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),p("tabCompletion.off","Disable tab completions."),p("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:p("tabCompletion","Enables tab completions.")})),tabIndex:Y(new Lt(124,"tabIndex",0,-1,1073741824)),unicodeHighlight:Y(new vP),unusualLineTerminators:Y(new $t(126,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[p("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),p("unusualLineTerminators.off","Unusual line terminators are ignored."),p("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:p("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Y(new qe(127,"useShadowDOM",!0)),useTabStops:Y(new qe(128,"useTabStops",!0,{description:p("useTabStops","Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:Y(new $t(129,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[p("wordBreak.normal","Use the default line break rule."),p("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:p("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:Y(new kP),wordSeparators:Y(new Sn(131,"wordSeparators",VN,{description:p("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Y(new $t(132,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),p({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:p({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:Y(new Sn(133,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Y(new Sn(134,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Y(new Lt(135,"wordWrapColumn",80,1,1073741824,{markdownDescription:p({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:Y(new $t(136,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Y(new $t(137,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Y(new Z5),defaultColorDecorators:Y(new qe(147,"defaultColorDecorators",!1,{markdownDescription:p("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Y(new hP),tabFocusMode:Y(new qe(144,"tabFocusMode",!1,{markdownDescription:p("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Y(new Gd),wrappingInfo:Y(new xP),wrappingIndent:Y(new DP),wrappingStrategy:Y(new iP)};class MP{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Cu.isErrorNoTelemetry(e)?new Cu(e.message+` `+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 $N=new MP;function At(s){Mg(s)||$N.onUnexpectedError(s)}function bS(s){Mg(s)||$N.onUnexpectedExternalError(s)}function sD(s){if(s instanceof Error){const{name:e,message:t}=s,i=s.stacktrace||s.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:Cu.isErrorNoTelemetry(s)}}return s}const Gp="Canceled";function Mg(s){return s instanceof wl?!0:s instanceof Error&&s.name===Gp&&s.message===Gp}class wl extends Error{constructor(){super(Gp),this.name=this.message}}function RP(){const s=new Error(Gp);return s.name=s.message,s}function x0(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")}function CS(s){return s?new Error(`Illegal state: ${s}`):new Error("Illegal state")}class PP extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Cu extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Cu)return e;const t=new Cu;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Dt extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Dt.prototype)}}function wu(s,e){const t=this;let i=!1,n;return function(){return i||(i=!0,n=s.apply(t,arguments)),n}}function KN(s){return typeof s=="object"&&s!==null&&typeof s.dispose=="function"&&s.dispose.length===0}function Hi(s){if(ot.is(s)){const e=[];for(const t of s)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function br(...s){return Be(()=>Hi(s))}function Be(s){return{dispose:wu(()=>{s()})}}class pe{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Hi(this._toDispose)}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}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}pe.DISABLE_DISPOSED_WARNING=!1;class G{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)}}G.None=Object.freeze({dispose(){}});class Ca{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}}class pte{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class FP{constructor(e){this.object=e}dispose(){}}class wS{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Hi(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(n=this._store.get(e))===null||n===void 0||n.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const OP=globalThis.performance&&typeof globalThis.performance.now=="function";class qc{static create(e){return new qc(e)}constructor(e){this._now=OP&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var te;(function(s){s.None=()=>G.None;function e(R,A){return u(R,()=>{},0,void 0,!0,void 0,A)}s.defer=e;function t(R){return(A,P=null,H)=>{let q=!1,re;return re=R(de=>{if(!q)return re?re.dispose():q=!0,A.call(P,de)},null,H),q&&re.dispose(),re}}s.once=t;function i(R,A,P){return c((H,q=null,re)=>R(de=>H.call(q,A(de)),null,re),P)}s.map=i;function n(R,A,P){return c((H,q=null,re)=>R(de=>{A(de),H.call(q,de)},null,re),P)}s.forEach=n;function o(R,A,P){return c((H,q=null,re)=>R(de=>A(de)&&H.call(q,de),null,re),P)}s.filter=o;function r(R){return R}s.signal=r;function a(...R){return(A,P=null,H)=>{const q=br(...R.map(re=>re(de=>A.call(P,de))));return d(q,H)}}s.any=a;function l(R,A,P,H){let q=P;return i(R,re=>(q=A(q,re),q),H)}s.reduce=l;function c(R,A){let P;const H={onWillAddFirstListener(){P=R(q.fire,q)},onDidRemoveLastListener(){P==null||P.dispose()}},q=new O(H);return A==null||A.add(q),q.event}function d(R,A){return A instanceof Array?A.push(R):A&&A.add(R),R}function u(R,A,P=100,H=!1,q=!1,re,de){let ve,se,Ce,Ee=0,fe;const X={leakWarningThreshold:re,onWillAddFirstListener(){ve=R(ut=>{Ee++,se=A(se,ut),H&&!Ce&&(ie.fire(se),se=void 0),fe=()=>{const Mt=se;se=void 0,Ce=void 0,(!H||Ee>1)&&ie.fire(Mt),Ee=0},typeof P=="number"?(clearTimeout(Ce),Ce=setTimeout(fe,P)):Ce===void 0&&(Ce=0,queueMicrotask(fe))})},onWillRemoveListener(){q&&Ee>0&&(fe==null||fe())},onDidRemoveLastListener(){fe=void 0,ve.dispose()}},ie=new O(X);return de==null||de.add(ie),ie.event}s.debounce=u;function h(R,A=0,P){return s.debounce(R,(H,q)=>H?(H.push(q),H):[q],A,void 0,!0,void 0,P)}s.accumulate=h;function f(R,A=(H,q)=>H===q,P){let H=!0,q;return o(R,re=>{const de=H||!A(re,q);return H=!1,q=re,de},P)}s.latch=f;function g(R,A,P){return[s.filter(R,A,P),s.filter(R,H=>!A(H),P)]}s.split=g;function m(R,A=!1,P=[],H){let q=P.slice(),re=R(se=>{q?q.push(se):ve.fire(se)});H&&H.add(re);const de=()=>{q==null||q.forEach(se=>ve.fire(se)),q=null},ve=new O({onWillAddFirstListener(){re||(re=R(se=>ve.fire(se)),H&&H.add(re))},onDidAddFirstListener(){q&&(A?setTimeout(de):de())},onDidRemoveLastListener(){re&&re.dispose(),re=null}});return H&&H.add(ve),ve.event}s.buffer=m;function _(R,A){return(H,q,re)=>{const de=A(new b);return R(function(ve){const se=de.evaluate(ve);se!==v&&H.call(q,se)},void 0,re)}}s.chain=_;const v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(A){return this.steps.push(A),this}forEach(A){return this.steps.push(P=>(A(P),P)),this}filter(A){return this.steps.push(P=>A(P)?P:v),this}reduce(A,P){let H=P;return this.steps.push(q=>(H=A(H,q),H)),this}latch(A=(P,H)=>P===H){let P=!0,H;return this.steps.push(q=>{const re=P||!A(q,H);return P=!1,H=q,re?q:v}),this}evaluate(A){for(const P of this.steps)if(A=P(A),A===v)break;return A}}function C(R,A,P=H=>H){const H=(...ve)=>de.fire(P(...ve)),q=()=>R.on(A,H),re=()=>R.removeListener(A,H),de=new O({onWillAddFirstListener:q,onDidRemoveLastListener:re});return de.event}s.fromNodeEventEmitter=C;function w(R,A,P=H=>H){const H=(...ve)=>de.fire(P(...ve)),q=()=>R.addEventListener(A,H),re=()=>R.removeEventListener(A,H),de=new O({onWillAddFirstListener:q,onDidRemoveLastListener:re});return de.event}s.fromDOMEventEmitter=w;function y(R){return new Promise(A=>t(R)(A))}s.toPromise=y;function L(R){const A=new O;return R.then(P=>{A.fire(P)},()=>{A.fire(void 0)}).finally(()=>{A.dispose()}),A.event}s.fromPromise=L;function k(R,A,P){return A(P),R(H=>A(H))}s.runAndSubscribe=k;class D{constructor(A,P){this._observable=A,this._counter=0,this._hasChanged=!1;const H={onWillAddFirstListener:()=>{A.addObserver(this)},onDidRemoveLastListener:()=>{A.removeObserver(this)}};this.emitter=new O(H),P&&P.add(this.emitter)}beginUpdate(A){this._counter++}handlePossibleChange(A){}handleChange(A,P){this._hasChanged=!0}endUpdate(A){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function N(R,A){return new D(R,A).emitter.event}s.fromObservable=N;function W(R){return(A,P,H)=>{let q=0,re=!1;const de={beginUpdate(){q++},endUpdate(){q--,q===0&&(R.reportChanges(),re&&(re=!1,A.call(P)))},handlePossibleChange(){},handleChange(){re=!0}};R.addObserver(de),R.reportChanges();const ve={dispose(){R.removeObserver(de)}};return H instanceof pe?H.add(ve):Array.isArray(H)&&H.push(ve),ve}}s.fromObservableLight=W})(te||(te={}));class yu{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${yu._idPool++}`,yu.all.add(this)}start(e){this._stopWatch=new qc,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}yu.all=new Set;yu._idPool=0;let BP=-1;class WP{constructor(e,t,i=Math.random().toString(18).slice(2,5)){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,n]of this._stacks)(!e||t{var o,r,a,l,c,d,u;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);const _=(o=this._leakageMon.getMostFrequentStack())!==null&&o!==void 0?o:["UNKNOWN stack",-1],v=new HP(`${m}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(((r=this._options)===null||r===void 0?void 0:r.onListenerError)||At)(v),G.None}if(this._disposed)return G.None;i&&(t=t.bind(i));const h=new U1(t);let f;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(h.stack=yS.create(),f=this._leakageMon.check(h.stack,this._size+1)),this._listeners?this._listeners instanceof U1?((u=this._deliveryQueue)!==null&&u!==void 0||(this._deliveryQueue=new jN),this._listeners=[this._listeners,h]):this._listeners.push(h):((l=(a=this._options)===null||a===void 0?void 0:a.onWillAddFirstListener)===null||l===void 0||l.call(a,this),this._listeners=h,(d=(c=this._options)===null||c===void 0?void 0:c.onDidAddFirstListener)===null||d===void 0||d.call(c,this)),this._size++;const g=Be(()=>{f==null||f(),this._removeListener(h)});return n instanceof pe?n.add(g):Array.isArray(n)&&n.push(g),g}),this._event}_removeListener(e){var t,i,n,o;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(n=this._options)===null||n===void 0?void 0:n.onDidRemoveLastListener)===null||o===void 0||o.call(n,this),this._size=0;return}const r=this._listeners,a=r.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*zP<=r.length){let c=0;for(let d=0;d0}};const UP=()=>new jN;class jN{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Rf extends O{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Qn,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){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._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class qN extends Rf{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 $P extends O{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class KP{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new O({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Be(wu(()=>{this.hasListeners&&this.unhook(t);const n=this.events.indexOf(t);this.events.splice(n,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){var t;(t=e.listener)===null||t===void 0||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)===null||e===void 0||e.dispose();this.events=[]}}class E0{constructor(){this.data=[]}wrapEvent(e,t,i){return(n,o,r)=>e(a=>{var l;const c=this.data[this.data.length-1];if(!t){c?c.buffers.push(()=>n.call(o,a)):n.call(o,a);return}const d=c;if(!d){n.call(o,t(i,a));return}(l=d.items)!==null&&l!==void 0||(d.items=[]),d.items.push(a),d.buffers.length===0&&c.buffers.push(()=>{var u;(u=d.reducedResult)!==null&&u!==void 0||(d.reducedResult=i?d.items.reduce(t,i):d.items.reduce(t)),n.call(o,d.reducedResult)})},void 0,r)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(n=>n()),i}}class oD{constructor(){this.listening=!1,this.inputEvent=te.None,this.inputEventListener=G.None,this.emitter=new O({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{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()}}const GN=Object.freeze(function(s,e){const t=setTimeout(s.bind(e),0);return{dispose(){clearTimeout(t)}}});var ao;(function(s){function e(t){return t===s.None||t===s.Cancelled||t instanceof gp?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}s.isCancellationToken=e,s.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:te.None}),s.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:GN})})(ao||(ao={}));class gp{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?GN:(this._emitter||(this._emitter=new O),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Ho=class{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 gp),this._token}cancel(){this._token?this._token instanceof gp&&this._token.cancel():this._token=ao.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof gp&&this._token.dispose():this._token=ao.None}};function bte(s){const e=new Ho;return s.add({dispose(){e.cancel()}}),e.token}class SS{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 mp=new SS,Lb=new SS,kb=new SS,ZN=new Array(230),jP=Object.create(null),qP=Object.create(null),LS=[];for(let s=0;s<=193;s++)LS[s]=-1;(function(){const s="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",s,s],[1,1,"Hyper",0,s,0,s,s,s],[1,2,"Super",0,s,0,s,s,s],[1,3,"Fn",0,s,0,s,s,s],[1,4,"FnLock",0,s,0,s,s,s],[1,5,"Suspend",0,s,0,s,s,s],[1,6,"Resume",0,s,0,s,s,s],[1,7,"Turbo",0,s,0,s,s,s],[1,8,"Sleep",0,s,0,"VK_SLEEP",s,s],[1,9,"WakeUp",0,s,0,s,s,s],[0,10,"KeyA",31,"A",65,"VK_A",s,s],[0,11,"KeyB",32,"B",66,"VK_B",s,s],[0,12,"KeyC",33,"C",67,"VK_C",s,s],[0,13,"KeyD",34,"D",68,"VK_D",s,s],[0,14,"KeyE",35,"E",69,"VK_E",s,s],[0,15,"KeyF",36,"F",70,"VK_F",s,s],[0,16,"KeyG",37,"G",71,"VK_G",s,s],[0,17,"KeyH",38,"H",72,"VK_H",s,s],[0,18,"KeyI",39,"I",73,"VK_I",s,s],[0,19,"KeyJ",40,"J",74,"VK_J",s,s],[0,20,"KeyK",41,"K",75,"VK_K",s,s],[0,21,"KeyL",42,"L",76,"VK_L",s,s],[0,22,"KeyM",43,"M",77,"VK_M",s,s],[0,23,"KeyN",44,"N",78,"VK_N",s,s],[0,24,"KeyO",45,"O",79,"VK_O",s,s],[0,25,"KeyP",46,"P",80,"VK_P",s,s],[0,26,"KeyQ",47,"Q",81,"VK_Q",s,s],[0,27,"KeyR",48,"R",82,"VK_R",s,s],[0,28,"KeyS",49,"S",83,"VK_S",s,s],[0,29,"KeyT",50,"T",84,"VK_T",s,s],[0,30,"KeyU",51,"U",85,"VK_U",s,s],[0,31,"KeyV",52,"V",86,"VK_V",s,s],[0,32,"KeyW",53,"W",87,"VK_W",s,s],[0,33,"KeyX",54,"X",88,"VK_X",s,s],[0,34,"KeyY",55,"Y",89,"VK_Y",s,s],[0,35,"KeyZ",56,"Z",90,"VK_Z",s,s],[0,36,"Digit1",22,"1",49,"VK_1",s,s],[0,37,"Digit2",23,"2",50,"VK_2",s,s],[0,38,"Digit3",24,"3",51,"VK_3",s,s],[0,39,"Digit4",25,"4",52,"VK_4",s,s],[0,40,"Digit5",26,"5",53,"VK_5",s,s],[0,41,"Digit6",27,"6",54,"VK_6",s,s],[0,42,"Digit7",28,"7",55,"VK_7",s,s],[0,43,"Digit8",29,"8",56,"VK_8",s,s],[0,44,"Digit9",30,"9",57,"VK_9",s,s],[0,45,"Digit0",21,"0",48,"VK_0",s,s],[1,46,"Enter",3,"Enter",13,"VK_RETURN",s,s],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",s,s],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",s,s],[1,49,"Tab",2,"Tab",9,"VK_TAB",s,s],[1,50,"Space",10,"Space",32,"VK_SPACE",s,s],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,s,0,s,s,s],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",s,s],[1,64,"F1",59,"F1",112,"VK_F1",s,s],[1,65,"F2",60,"F2",113,"VK_F2",s,s],[1,66,"F3",61,"F3",114,"VK_F3",s,s],[1,67,"F4",62,"F4",115,"VK_F4",s,s],[1,68,"F5",63,"F5",116,"VK_F5",s,s],[1,69,"F6",64,"F6",117,"VK_F6",s,s],[1,70,"F7",65,"F7",118,"VK_F7",s,s],[1,71,"F8",66,"F8",119,"VK_F8",s,s],[1,72,"F9",67,"F9",120,"VK_F9",s,s],[1,73,"F10",68,"F10",121,"VK_F10",s,s],[1,74,"F11",69,"F11",122,"VK_F11",s,s],[1,75,"F12",70,"F12",123,"VK_F12",s,s],[1,76,"PrintScreen",0,s,0,s,s,s],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",s,s],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",s,s],[1,79,"Insert",19,"Insert",45,"VK_INSERT",s,s],[1,80,"Home",14,"Home",36,"VK_HOME",s,s],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",s,s],[1,82,"Delete",20,"Delete",46,"VK_DELETE",s,s],[1,83,"End",13,"End",35,"VK_END",s,s],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",s,s],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",s],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",s],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",s],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",s],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",s,s],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",s,s],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",s,s],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",s,s],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",s,s],[1,94,"NumpadEnter",3,s,0,s,s,s],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",s,s],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",s,s],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",s,s],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",s,s],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",s,s],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",s,s],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",s,s],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",s,s],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",s,s],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",s,s],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",s,s],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",s,s],[1,107,"ContextMenu",58,"ContextMenu",93,s,s,s],[1,108,"Power",0,s,0,s,s,s],[1,109,"NumpadEqual",0,s,0,s,s,s],[1,110,"F13",71,"F13",124,"VK_F13",s,s],[1,111,"F14",72,"F14",125,"VK_F14",s,s],[1,112,"F15",73,"F15",126,"VK_F15",s,s],[1,113,"F16",74,"F16",127,"VK_F16",s,s],[1,114,"F17",75,"F17",128,"VK_F17",s,s],[1,115,"F18",76,"F18",129,"VK_F18",s,s],[1,116,"F19",77,"F19",130,"VK_F19",s,s],[1,117,"F20",78,"F20",131,"VK_F20",s,s],[1,118,"F21",79,"F21",132,"VK_F21",s,s],[1,119,"F22",80,"F22",133,"VK_F22",s,s],[1,120,"F23",81,"F23",134,"VK_F23",s,s],[1,121,"F24",82,"F24",135,"VK_F24",s,s],[1,122,"Open",0,s,0,s,s,s],[1,123,"Help",0,s,0,s,s,s],[1,124,"Select",0,s,0,s,s,s],[1,125,"Again",0,s,0,s,s,s],[1,126,"Undo",0,s,0,s,s,s],[1,127,"Cut",0,s,0,s,s,s],[1,128,"Copy",0,s,0,s,s,s],[1,129,"Paste",0,s,0,s,s,s],[1,130,"Find",0,s,0,s,s,s],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",s,s],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",s,s],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",s,s],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",s,s],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",s,s],[1,136,"KanaMode",0,s,0,s,s,s],[0,137,"IntlYen",0,s,0,s,s,s],[1,138,"Convert",0,s,0,s,s,s],[1,139,"NonConvert",0,s,0,s,s,s],[1,140,"Lang1",0,s,0,s,s,s],[1,141,"Lang2",0,s,0,s,s,s],[1,142,"Lang3",0,s,0,s,s,s],[1,143,"Lang4",0,s,0,s,s,s],[1,144,"Lang5",0,s,0,s,s,s],[1,145,"Abort",0,s,0,s,s,s],[1,146,"Props",0,s,0,s,s,s],[1,147,"NumpadParenLeft",0,s,0,s,s,s],[1,148,"NumpadParenRight",0,s,0,s,s,s],[1,149,"NumpadBackspace",0,s,0,s,s,s],[1,150,"NumpadMemoryStore",0,s,0,s,s,s],[1,151,"NumpadMemoryRecall",0,s,0,s,s,s],[1,152,"NumpadMemoryClear",0,s,0,s,s,s],[1,153,"NumpadMemoryAdd",0,s,0,s,s,s],[1,154,"NumpadMemorySubtract",0,s,0,s,s,s],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",s,s],[1,156,"NumpadClearEntry",0,s,0,s,s,s],[1,0,s,5,"Ctrl",17,"VK_CONTROL",s,s],[1,0,s,4,"Shift",16,"VK_SHIFT",s,s],[1,0,s,6,"Alt",18,"VK_MENU",s,s],[1,0,s,57,"Meta",91,"VK_COMMAND",s,s],[1,157,"ControlLeft",5,s,0,"VK_LCONTROL",s,s],[1,158,"ShiftLeft",4,s,0,"VK_LSHIFT",s,s],[1,159,"AltLeft",6,s,0,"VK_LMENU",s,s],[1,160,"MetaLeft",57,s,0,"VK_LWIN",s,s],[1,161,"ControlRight",5,s,0,"VK_RCONTROL",s,s],[1,162,"ShiftRight",4,s,0,"VK_RSHIFT",s,s],[1,163,"AltRight",6,s,0,"VK_RMENU",s,s],[1,164,"MetaRight",57,s,0,"VK_RWIN",s,s],[1,165,"BrightnessUp",0,s,0,s,s,s],[1,166,"BrightnessDown",0,s,0,s,s,s],[1,167,"MediaPlay",0,s,0,s,s,s],[1,168,"MediaRecord",0,s,0,s,s,s],[1,169,"MediaFastForward",0,s,0,s,s,s],[1,170,"MediaRewind",0,s,0,s,s,s],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",s,s],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",s,s],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",s,s],[1,174,"Eject",0,s,0,s,s,s],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",s,s],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",s,s],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",s,s],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",s,s],[1,179,"LaunchApp1",0,s,0,"VK_MEDIA_LAUNCH_APP1",s,s],[1,180,"SelectTask",0,s,0,s,s,s],[1,181,"LaunchScreenSaver",0,s,0,s,s,s],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",s,s],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",s,s],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",s,s],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",s,s],[1,186,"BrowserStop",0,s,0,"VK_BROWSER_STOP",s,s],[1,187,"BrowserRefresh",0,s,0,"VK_BROWSER_REFRESH",s,s],[1,188,"BrowserFavorites",0,s,0,"VK_BROWSER_FAVORITES",s,s],[1,189,"ZoomToggle",0,s,0,s,s,s],[1,190,"MailReply",0,s,0,s,s,s],[1,191,"MailForward",0,s,0,s,s,s],[1,192,"MailSend",0,s,0,s,s,s],[1,0,s,114,"KeyInComposition",229,s,s,s],[1,0,s,116,"ABNT_C2",194,"VK_ABNT_C2",s,s],[1,0,s,96,"OEM_8",223,"VK_OEM_8",s,s],[1,0,s,0,s,0,"VK_KANA",s,s],[1,0,s,0,s,0,"VK_HANGUL",s,s],[1,0,s,0,s,0,"VK_JUNJA",s,s],[1,0,s,0,s,0,"VK_FINAL",s,s],[1,0,s,0,s,0,"VK_HANJA",s,s],[1,0,s,0,s,0,"VK_KANJI",s,s],[1,0,s,0,s,0,"VK_CONVERT",s,s],[1,0,s,0,s,0,"VK_NONCONVERT",s,s],[1,0,s,0,s,0,"VK_ACCEPT",s,s],[1,0,s,0,s,0,"VK_MODECHANGE",s,s],[1,0,s,0,s,0,"VK_SELECT",s,s],[1,0,s,0,s,0,"VK_PRINT",s,s],[1,0,s,0,s,0,"VK_EXECUTE",s,s],[1,0,s,0,s,0,"VK_SNAPSHOT",s,s],[1,0,s,0,s,0,"VK_HELP",s,s],[1,0,s,0,s,0,"VK_APPS",s,s],[1,0,s,0,s,0,"VK_PROCESSKEY",s,s],[1,0,s,0,s,0,"VK_PACKET",s,s],[1,0,s,0,s,0,"VK_DBE_SBCSCHAR",s,s],[1,0,s,0,s,0,"VK_DBE_DBCSCHAR",s,s],[1,0,s,0,s,0,"VK_ATTN",s,s],[1,0,s,0,s,0,"VK_CRSEL",s,s],[1,0,s,0,s,0,"VK_EXSEL",s,s],[1,0,s,0,s,0,"VK_EREOF",s,s],[1,0,s,0,s,0,"VK_PLAY",s,s],[1,0,s,0,s,0,"VK_ZOOM",s,s],[1,0,s,0,s,0,"VK_NONAME",s,s],[1,0,s,0,s,0,"VK_PA1",s,s],[1,0,s,0,s,0,"VK_OEM_CLEAR",s,s]],t=[],i=[];for(const n of e){const[o,r,a,l,c,d,u,h,f]=n;if(i[r]||(i[r]=!0,jP[a]=r,qP[a.toLowerCase()]=r,o&&(LS[r]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);mp.define(l,c),Lb.define(l,h||c),kb.define(l,f||h||c)}d&&(ZN[d]=l)}})();var Yr;(function(s){function e(a){return mp.keyCodeToStr(a)}s.toString=e;function t(a){return mp.strToKeyCode(a)}s.fromString=t;function i(a){return Lb.keyCodeToStr(a)}s.toUserSettingsUS=i;function n(a){return kb.keyCodeToStr(a)}s.toUserSettingsGeneral=n;function o(a){return Lb.strToKeyCode(a)||kb.strToKeyCode(a)}s.fromUserSettings=o;function r(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return mp.keyCodeToStr(a)}s.toElectronAccelerator=r})(Yr||(Yr={}));function GP(s,e){const t=(e&65535)<<16>>>0;return(s|t)>>>0}var rD={};let Yd;const $1=globalThis.vscode;if(typeof $1<"u"&&typeof $1.process<"u"){const s=$1.process;Yd={get platform(){return s.platform},get arch(){return s.arch},get env(){return s.env},cwd(){return s.cwd()}}}else typeof process<"u"?Yd={get platform(){return process.platform},get arch(){return process.arch},get env(){return rD},cwd(){return rD.VSCODE_CWD||process.cwd()}}:Yd={get platform(){return Wn?"win32":Ye?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const Zp=Yd.cwd,Db=Yd.env,ZP=Yd.platform,YP=65,QP=97,XP=90,JP=122,hl=46,un=47,ds=92,Aa=58,eF=63;class YN extends Error{constructor(e,t,i){let n;typeof t=="string"&&t.indexOf("not ")===0?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${n} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function tF(s,e){if(s===null||typeof s!="object")throw new YN(e,"Object",s)}function ki(s,e){if(typeof s!="string")throw new YN(e,"string",s)}const Al=ZP==="win32";function ct(s){return s===un||s===ds}function xb(s){return s===un}function Ma(s){return s>=YP&&s<=XP||s>=QP&&s<=JP}function Yp(s,e,t,i){let n="",o=0,r=-1,a=0,l=0;for(let c=0;c<=s.length;++c){if(c2){const d=n.lastIndexOf(t);d===-1?(n="",o=0):(n=n.slice(0,d),o=n.length-1-n.lastIndexOf(t)),r=c,a=0;continue}else if(n.length!==0){n="",o=0,r=c,a=0;continue}}e&&(n+=n.length>0?`${t}..`:"..",o=2)}else n.length>0?n+=`${t}${s.slice(r+1,c)}`:n=s.slice(r+1,c),o=c-r-1;r=c,a=0}else l===hl&&a!==-1?++a:a=-1}return n}function QN(s,e){tF(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${s}${i}`:i}const Xn={resolve(...s){let e="",t="",i=!1;for(let n=s.length-1;n>=-1;n--){let o;if(n>=0){if(o=s[n],ki(o,"path"),o.length===0)continue}else e.length===0?o=Zp():(o=Db[`=${e}`]||Zp(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===ds)&&(o=`${e}\\`));const r=o.length;let a=0,l="",c=!1;const d=o.charCodeAt(0);if(r===1)ct(d)&&(a=1,c=!0);else if(ct(d))if(c=!0,ct(o.charCodeAt(1))){let u=2,h=u;for(;u2&&ct(o.charCodeAt(2))&&(c=!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=`${o.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=Yp(t,!i,"\\",ct),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(s){ki(s,"path");const e=s.length;if(e===0)return".";let t=0,i,n=!1;const o=s.charCodeAt(0);if(e===1)return xb(o)?"\\":s;if(ct(o))if(n=!0,ct(s.charCodeAt(1))){let a=2,l=a;for(;a2&&ct(s.charCodeAt(2))&&(n=!0,t=3));let r=t0&&ct(s.charCodeAt(e-1))&&(r+="\\"),i===void 0?n?`\\${r}`:r:n?`${i}\\${r}`:`${i}${r}`},isAbsolute(s){ki(s,"path");const e=s.length;if(e===0)return!1;const t=s.charCodeAt(0);return ct(t)||e>2&&Ma(t)&&s.charCodeAt(1)===Aa&&ct(s.charCodeAt(2))},join(...s){if(s.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,n=0;if(typeof t=="string"&&ct(t.charCodeAt(0))){++n;const o=t.length;o>1&&ct(t.charCodeAt(1))&&(++n,o>2&&(ct(t.charCodeAt(2))?++n:i=!1))}if(i){for(;n=2&&(e=`\\${e.slice(n)}`)}return Xn.normalize(e)},relative(s,e){if(ki(s,"from"),ki(e,"to"),s===e)return"";const t=Xn.resolve(s),i=Xn.resolve(e);if(t===i||(s=t.toLowerCase(),e=i.toLowerCase(),s===e))return"";let n=0;for(;nn&&s.charCodeAt(o-1)===ds;)o--;const r=o-n;let a=0;for(;aa&&e.charCodeAt(l-1)===ds;)l--;const c=l-a,d=rd){if(e.charCodeAt(a+h)===ds)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}r>d&&(s.charCodeAt(n+h)===ds?u=h:h===2&&(u=3)),u===-1&&(u=0)}let f="";for(h=n+u+1;h<=o;++h)(h===o||s.charCodeAt(h)===ds)&&(f+=f.length===0?"..":"\\..");return a+=u,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===ds&&++a,i.slice(a,l))},toNamespacedPath(s){if(typeof s!="string"||s.length===0)return s;const e=Xn.resolve(s);if(e.length<=2)return s;if(e.charCodeAt(0)===ds){if(e.charCodeAt(1)===ds){const t=e.charCodeAt(2);if(t!==eF&&t!==hl)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Ma(e.charCodeAt(0))&&e.charCodeAt(1)===Aa&&e.charCodeAt(2)===ds)return`\\\\?\\${e}`;return s},dirname(s){ki(s,"path");const e=s.length;if(e===0)return".";let t=-1,i=0;const n=s.charCodeAt(0);if(e===1)return ct(n)?s:".";if(ct(n)){if(t=i=1,ct(s.charCodeAt(1))){let a=2,l=a;for(;a2&&ct(s.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(ct(s.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return s.slice(0,o)},basename(s,e){e!==void 0&&ki(e,"ext"),ki(s,"path");let t=0,i=-1,n=!0,o;if(s.length>=2&&Ma(s.charCodeAt(0))&&s.charCodeAt(1)===Aa&&(t=2),e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=t;--o){const l=s.charCodeAt(o);if(ct(l)){if(!n){t=o+1;break}}else a===-1&&(n=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(o=s.length-1;o>=t;--o)if(ct(s.charCodeAt(o))){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){ki(s,"path");let e=0,t=-1,i=0,n=-1,o=!0,r=0;s.length>=2&&s.charCodeAt(1)===Aa&&Ma(s.charCodeAt(0))&&(e=i=2);for(let a=s.length-1;a>=e;--a){const l=s.charCodeAt(a);if(ct(l)){if(!o){i=a+1;break}continue}n===-1&&(o=!1,n=a+1),l===hl?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||n===-1||r===0||r===1&&t===n-1&&t===i+1?"":s.slice(t,n)},format:QN.bind(null,"\\"),parse(s){ki(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.length;let i=0,n=s.charCodeAt(0);if(t===1)return ct(n)?(e.root=e.dir=s,e):(e.base=e.name=s,e);if(ct(n)){if(i=1,ct(s.charCodeAt(1))){let u=2,h=u;for(;u0&&(e.root=s.slice(0,i));let o=-1,r=i,a=-1,l=!0,c=s.length-1,d=0;for(;c>=i;--c){if(n=s.charCodeAt(c),ct(n)){if(!l){r=c+1;break}continue}a===-1&&(l=!1,a=c+1),n===hl?o===-1?o=c:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===r+1?e.base=e.name=s.slice(r,a):(e.name=s.slice(r,o),e.base=s.slice(r,a),e.ext=s.slice(o,a))),r>0&&r!==i?e.dir=s.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},iF=(()=>{if(Al){const s=/\\/g;return()=>{const e=Zp().replace(s,"/");return e.slice(e.indexOf("/"))}}return()=>Zp()})(),ri={resolve(...s){let e="",t=!1;for(let i=s.length-1;i>=-1&&!t;i--){const n=i>=0?s[i]:iF();ki(n,"path"),n.length!==0&&(e=`${n}/${e}`,t=n.charCodeAt(0)===un)}return e=Yp(e,!t,"/",xb),t?`/${e}`:e.length>0?e:"."},normalize(s){if(ki(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===un,t=s.charCodeAt(s.length-1)===un;return s=Yp(s,!e,"/",xb),s.length===0?e?"/":t?"./":".":(t&&(s+="/"),e?`/${s}`:s)},isAbsolute(s){return ki(s,"path"),s.length>0&&s.charCodeAt(0)===un},join(...s){if(s.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":ri.normalize(e)},relative(s,e){if(ki(s,"from"),ki(e,"to"),s===e||(s=ri.resolve(s),e=ri.resolve(e),s===e))return"";const t=1,i=s.length,n=i-t,o=1,r=e.length-o,a=na){if(e.charCodeAt(o+c)===un)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else n>a&&(s.charCodeAt(t+c)===un?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||s.charCodeAt(c)===un)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+l)}`},toNamespacedPath(s){return s},dirname(s){if(ki(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===un;let t=-1,i=!0;for(let n=s.length-1;n>=1;--n)if(s.charCodeAt(n)===un){if(!i){t=n;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":s.slice(0,t)},basename(s,e){e!==void 0&&ki(e,"ext"),ki(s,"path");let t=0,i=-1,n=!0,o;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let r=e.length-1,a=-1;for(o=s.length-1;o>=0;--o){const l=s.charCodeAt(o);if(l===un){if(!n){t=o+1;break}}else a===-1&&(n=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(o=s.length-1;o>=0;--o)if(s.charCodeAt(o)===un){if(!n){t=o+1;break}}else i===-1&&(n=!1,i=o+1);return i===-1?"":s.slice(t,i)},extname(s){ki(s,"path");let e=-1,t=0,i=-1,n=!0,o=0;for(let r=s.length-1;r>=0;--r){const a=s.charCodeAt(r);if(a===un){if(!n){t=r+1;break}continue}i===-1&&(n=!1,i=r+1),a===hl?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":s.slice(e,i)},format:QN.bind(null,"/"),parse(s){ki(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.charCodeAt(0)===un;let i;t?(e.root="/",i=1):i=0;let n=-1,o=0,r=-1,a=!0,l=s.length-1,c=0;for(;l>=i;--l){const d=s.charCodeAt(l);if(d===un){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),d===hl?n===-1?n=l:c!==1&&(c=1):n!==-1&&(c=-1)}if(r!==-1){const d=o===0&&t?1:o;n===-1||c===0||c===1&&n===r-1&&n===o+1?e.base=e.name=s.slice(d,r):(e.name=s.slice(d,n),e.base=s.slice(d,r),e.ext=s.slice(n,r))}return o>0?e.dir=s.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};ri.win32=Xn.win32=Xn;ri.posix=Xn.posix=ri;const XN=Al?Xn.normalize:ri.normalize,nF=Al?Xn.resolve:ri.resolve,sF=Al?Xn.relative:ri.relative,oF=Al?Xn.dirname:ri.dirname,kS=Al?Xn.basename:ri.basename,rF=Al?Xn.extname:ri.extname,fl=Al?Xn.sep:ri.sep,aF=/^\w[\w\d+.-]*$/,lF=/^\//,cF=/^\/\//;function dF(s,e){if(!s.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${s.authority}", path: "${s.path}", query: "${s.query}", fragment: "${s.fragment}"}`);if(s.scheme&&!aF.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!lF.test(s.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(cF.test(s.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function uF(s,e){return!s&&!e?"file":s}function hF(s,e){switch(s){case"https":case"http":case"file":e?e[0]!==Lo&&(e=Lo+e):e=Lo;break}return e}const ti="",Lo="/",fF=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class $e{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}constructor(e,t,i,n,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||ti,this.authority=e.authority||ti,this.path=e.path||ti,this.query=e.query||ti,this.fragment=e.fragment||ti):(this.scheme=uF(e,r),this.authority=t||ti,this.path=hF(this.scheme,i||ti),this.query=n||ti,this.fragment=o||ti,dF(this,r))}get fsPath(){return Qp(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=ti),i===void 0?i=this.authority:i===null&&(i=ti),n===void 0?n=this.path:n===null&&(n=ti),o===void 0?o=this.query:o===null&&(o=ti),r===void 0?r=this.fragment:r===null&&(r=ti),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&r===this.fragment?this:new dd(t,i,n,o,r)}static parse(e,t=!1){const i=fF.exec(e);return i?new dd(i[2]||ti,pm(i[4]||ti),pm(i[5]||ti),pm(i[7]||ti),pm(i[9]||ti),t):new dd(ti,ti,ti,ti,ti)}static file(e){let t=ti;if(Wn&&(e=e.replace(/\\/g,Lo)),e[0]===Lo&&e[1]===Lo){const i=e.indexOf(Lo,2);i===-1?(t=e.substring(2),e=Lo):(t=e.substring(2,i),e=e.substring(i)||Lo)}return new dd("file",t,e,ti,ti)}static from(e,t){return new dd(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Wn&&e.scheme==="file"?i=$e.file(Xn.join(Qp(e,!0),...t)).path:i=ri.join(e.path,...t),e.with({path:i})}toString(e=!1){return Eb(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof $e)return e;{const n=new dd(e);return n._formatted=(t=e.external)!==null&&t!==void 0?t:null,n._fsPath=e._sep===JN&&(i=e.fsPath)!==null&&i!==void 0?i:null,n}}else return e}}const JN=Wn?1:void 0;let dd=class extends $e{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Qp(this,!1)),this._fsPath}toString(e=!1){return e?Eb(this,!0):(this._formatted||(this._formatted=Eb(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=JN),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 eT={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 aD(s,e,t){let i,n=-1;for(let o=0;o=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===46||r===95||r===126||e&&r===47||t&&r===91||t&&r===93||t&&r===58)n!==-1&&(i+=encodeURIComponent(s.substring(n,o)),n=-1),i!==void 0&&(i+=s.charAt(o));else{i===void 0&&(i=s.substr(0,o));const a=eT[r];a!==void 0?(n!==-1&&(i+=encodeURIComponent(s.substring(n,o)),n=-1),i+=a):n===-1&&(n=o)}}return n!==-1&&(i+=encodeURIComponent(s.substring(n))),i!==void 0?i:s}function gF(s){let e;for(let t=0;t1&&s.scheme==="file"?t=`//${s.authority}${s.path}`:s.path.charCodeAt(0)===47&&(s.path.charCodeAt(1)>=65&&s.path.charCodeAt(1)<=90||s.path.charCodeAt(1)>=97&&s.path.charCodeAt(1)<=122)&&s.path.charCodeAt(2)===58?e?t=s.path.substr(1):t=s.path[1].toLowerCase()+s.path.substr(2):t=s.path,Wn&&(t=t.replace(/\//g,"\\")),t}function Eb(s,e){const t=e?gF:aD;let i="",{scheme:n,authority:o,path:r,query:a,fragment:l}=s;if(n&&(i+=n,i+=":"),(o||n==="file")&&(i+=Lo,i+=Lo),o){let c=o.indexOf("@");if(c!==-1){const d=o.substr(0,c);o=o.substr(c+1),c=d.lastIndexOf(":"),c===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,c),!1,!1),i+=":",i+=t(d.substr(c+1),!1,!0)),i+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,c),!1,!0),i+=o.substr(c))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const c=r.charCodeAt(1);c>=65&&c<=90&&(r=`/${String.fromCharCode(c+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const c=r.charCodeAt(0);c>=65&&c<=90&&(r=`${String.fromCharCode(c+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:aD(l,!1,!1)),i}function tT(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+tT(s.substr(3)):s}}const lD=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function pm(s){return s.match(lD)?s.replace(lD,e=>tT(e)):s}let V=class Zl{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 Zl(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Zl.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Zl.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return Ri.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Ri.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return Ri.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 Ri.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 Ri.plusRange(this,e)}static plusRange(e,t){let i,n,o,r;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new Ri(i,n,o,r)}intersectRanges(e){return Ri.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return ic?(o=c,r=d):o===c&&(r=Math.min(r,d)),i>o||i===o&&n>r?null:new Ri(i,n,o,r)}equalsRange(e){return Ri.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Ri.getEndPosition(this)}static getEndPosition(e){return new V(e.endLineNumber,e.endColumn)}getStartPosition(){return Ri.getStartPosition(this)}static getStartPosition(e){return new V(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Ri(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Ri(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Ri.collapseToStart(this)}static collapseToStart(e){return new Ri(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Ri.collapseToEnd(this)}static collapseToEnd(e){return new Ri(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Ri(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Ri(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Ri(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}toJSON(){return this}},yt=class Zs extends M{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Zs.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 Zs(this.startLineNumber,this.startColumn,e,t):new Zs(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new V(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new V(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Zs(e,t,this.endLineNumber,this.endColumn):new Zs(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Zs(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Zs(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Zs(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Zs(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,n=e.length;i{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;(i=this._factories.get(e))===null||i===void 0||i.dispose();const n=new vF(this,e,t);return this._factories.set(e,n),Be(()=>{const o=this._factories.get(e);!o||o!==n||(this._factories.delete(e),o.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class vF extends G{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}let Pf=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class DS{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class I0{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var cD;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(cD||(cD={}));var dD;(function(s){const e=new Map;e.set(0,ce.symbolMethod),e.set(1,ce.symbolFunction),e.set(2,ce.symbolConstructor),e.set(3,ce.symbolField),e.set(4,ce.symbolVariable),e.set(5,ce.symbolClass),e.set(6,ce.symbolStruct),e.set(7,ce.symbolInterface),e.set(8,ce.symbolModule),e.set(9,ce.symbolProperty),e.set(10,ce.symbolEvent),e.set(11,ce.symbolOperator),e.set(12,ce.symbolUnit),e.set(13,ce.symbolValue),e.set(15,ce.symbolEnum),e.set(14,ce.symbolConstant),e.set(15,ce.symbolEnum),e.set(16,ce.symbolEnumMember),e.set(17,ce.symbolKeyword),e.set(27,ce.symbolSnippet),e.set(18,ce.symbolText),e.set(19,ce.symbolColor),e.set(20,ce.symbolFile),e.set(21,ce.symbolReference),e.set(22,ce.symbolCustomColor),e.set(23,ce.symbolFolder),e.set(24,ce.symbolTypeParameter),e.set(25,ce.account),e.set(26,ce.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=ce.symbolProperty),r}s.toIcon=t;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26);function n(o,r){let a=i.get(o);return typeof a>"u"&&!r&&(a=9),a}s.fromString=n})(dD||(dD={}));var uD;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(uD||(uD={}));class bF{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return M.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var hD;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(hD||(hD={}));var fD;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(fD||(fD={}));var gD;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(gD||(gD={}));function Ste(s){return s&&$e.isUri(s.uri)&&M.isIRange(s.range)&&(M.isIRange(s.originSelectionRange)||M.isIRange(s.targetSelectionRange))}p("Array","array"),p("Boolean","boolean"),p("Class","class"),p("Constant","constant"),p("Constructor","constructor"),p("Enum","enumeration"),p("EnumMember","enumeration member"),p("Event","event"),p("Field","field"),p("File","file"),p("Function","function"),p("Interface","interface"),p("Key","key"),p("Method","method"),p("Module","module"),p("Namespace","namespace"),p("Null","null"),p("Number","number"),p("Object","object"),p("Operator","operator"),p("Package","package"),p("Property","property"),p("String","string"),p("Struct","struct"),p("TypeParameter","type parameter"),p("Variable","variable");var Nb;(function(s){const e=new Map;e.set(0,ce.symbolFile),e.set(1,ce.symbolModule),e.set(2,ce.symbolNamespace),e.set(3,ce.symbolPackage),e.set(4,ce.symbolClass),e.set(5,ce.symbolMethod),e.set(6,ce.symbolProperty),e.set(7,ce.symbolField),e.set(8,ce.symbolConstructor),e.set(9,ce.symbolEnum),e.set(10,ce.symbolInterface),e.set(11,ce.symbolFunction),e.set(12,ce.symbolVariable),e.set(13,ce.symbolConstant),e.set(14,ce.symbolString),e.set(15,ce.symbolNumber),e.set(16,ce.symbolBoolean),e.set(17,ce.symbolArray),e.set(18,ce.symbolObject),e.set(19,ce.symbolKey),e.set(20,ce.symbolNull),e.set(21,ce.symbolEnumMember),e.set(22,ce.symbolStruct),e.set(23,ce.symbolEvent),e.set(24,ce.symbolOperator),e.set(25,ce.symbolTypeParameter);function t(i){let n=e.get(i);return n||(console.info("No codicon found for SymbolKind "+i),n=ce.symbolProperty),n}s.toIcon=t})(Nb||(Nb={}));class io{static fromValue(e){switch(e){case"comment":return io.Comment;case"imports":return io.Imports;case"region":return io.Region}return new io(e)}constructor(e){this.value=e}}io.Comment=new io("comment");io.Imports=new io("imports");io.Region=new io("region");var mD;(function(s){s[s.AIGenerated=1]="AIGenerated"})(mD||(mD={}));var pD;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(pD||(pD={}));var _D;(function(s){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}s.is=e})(_D||(_D={}));var vD;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(vD||(vD={}));class CF{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const oi=new _F;var bD;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(bD||(bD={}));var Tb;(function(s){s[s.Unknown=0]="Unknown",s[s.Disabled=1]="Disabled",s[s.Enabled=2]="Enabled"})(Tb||(Tb={}));var Ab;(function(s){s[s.Invoke=1]="Invoke",s[s.Auto=2]="Auto"})(Ab||(Ab={}));var Mb;(function(s){s[s.None=0]="None",s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(Mb||(Mb={}));var Rb;(function(s){s[s.Method=0]="Method",s[s.Function=1]="Function",s[s.Constructor=2]="Constructor",s[s.Field=3]="Field",s[s.Variable=4]="Variable",s[s.Class=5]="Class",s[s.Struct=6]="Struct",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Event=10]="Event",s[s.Operator=11]="Operator",s[s.Unit=12]="Unit",s[s.Value=13]="Value",s[s.Constant=14]="Constant",s[s.Enum=15]="Enum",s[s.EnumMember=16]="EnumMember",s[s.Keyword=17]="Keyword",s[s.Text=18]="Text",s[s.Color=19]="Color",s[s.File=20]="File",s[s.Reference=21]="Reference",s[s.Customcolor=22]="Customcolor",s[s.Folder=23]="Folder",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue",s[s.Snippet=27]="Snippet"})(Rb||(Rb={}));var Pb;(function(s){s[s.Deprecated=1]="Deprecated"})(Pb||(Pb={}));var Fb;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(Fb||(Fb={}));var Ob;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(Ob||(Ob={}));var Bb;(function(s){s[s.NotSet=0]="NotSet",s[s.ContentFlush=1]="ContentFlush",s[s.RecoverFromMarkers=2]="RecoverFromMarkers",s[s.Explicit=3]="Explicit",s[s.Paste=4]="Paste",s[s.Undo=5]="Undo",s[s.Redo=6]="Redo"})(Bb||(Bb={}));var Wb;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(Wb||(Wb={}));var Vb;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(Vb||(Vb={}));var Hb;(function(s){s[s.None=0]="None",s[s.Keep=1]="Keep",s[s.Brackets=2]="Brackets",s[s.Advanced=3]="Advanced",s[s.Full=4]="Full"})(Hb||(Hb={}));var zb;(function(s){s[s.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",s[s.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",s[s.accessibilitySupport=2]="accessibilitySupport",s[s.accessibilityPageSize=3]="accessibilityPageSize",s[s.ariaLabel=4]="ariaLabel",s[s.ariaRequired=5]="ariaRequired",s[s.autoClosingBrackets=6]="autoClosingBrackets",s[s.autoClosingComments=7]="autoClosingComments",s[s.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",s[s.autoClosingDelete=9]="autoClosingDelete",s[s.autoClosingOvertype=10]="autoClosingOvertype",s[s.autoClosingQuotes=11]="autoClosingQuotes",s[s.autoIndent=12]="autoIndent",s[s.automaticLayout=13]="automaticLayout",s[s.autoSurround=14]="autoSurround",s[s.bracketPairColorization=15]="bracketPairColorization",s[s.guides=16]="guides",s[s.codeLens=17]="codeLens",s[s.codeLensFontFamily=18]="codeLensFontFamily",s[s.codeLensFontSize=19]="codeLensFontSize",s[s.colorDecorators=20]="colorDecorators",s[s.colorDecoratorsLimit=21]="colorDecoratorsLimit",s[s.columnSelection=22]="columnSelection",s[s.comments=23]="comments",s[s.contextmenu=24]="contextmenu",s[s.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",s[s.cursorBlinking=26]="cursorBlinking",s[s.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",s[s.cursorStyle=28]="cursorStyle",s[s.cursorSurroundingLines=29]="cursorSurroundingLines",s[s.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",s[s.cursorWidth=31]="cursorWidth",s[s.disableLayerHinting=32]="disableLayerHinting",s[s.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",s[s.domReadOnly=34]="domReadOnly",s[s.dragAndDrop=35]="dragAndDrop",s[s.dropIntoEditor=36]="dropIntoEditor",s[s.emptySelectionClipboard=37]="emptySelectionClipboard",s[s.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",s[s.extraEditorClassName=39]="extraEditorClassName",s[s.fastScrollSensitivity=40]="fastScrollSensitivity",s[s.find=41]="find",s[s.fixedOverflowWidgets=42]="fixedOverflowWidgets",s[s.folding=43]="folding",s[s.foldingStrategy=44]="foldingStrategy",s[s.foldingHighlight=45]="foldingHighlight",s[s.foldingImportsByDefault=46]="foldingImportsByDefault",s[s.foldingMaximumRegions=47]="foldingMaximumRegions",s[s.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",s[s.fontFamily=49]="fontFamily",s[s.fontInfo=50]="fontInfo",s[s.fontLigatures=51]="fontLigatures",s[s.fontSize=52]="fontSize",s[s.fontWeight=53]="fontWeight",s[s.fontVariations=54]="fontVariations",s[s.formatOnPaste=55]="formatOnPaste",s[s.formatOnType=56]="formatOnType",s[s.glyphMargin=57]="glyphMargin",s[s.gotoLocation=58]="gotoLocation",s[s.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",s[s.hover=60]="hover",s[s.inDiffEditor=61]="inDiffEditor",s[s.inlineSuggest=62]="inlineSuggest",s[s.inlineEdit=63]="inlineEdit",s[s.letterSpacing=64]="letterSpacing",s[s.lightbulb=65]="lightbulb",s[s.lineDecorationsWidth=66]="lineDecorationsWidth",s[s.lineHeight=67]="lineHeight",s[s.lineNumbers=68]="lineNumbers",s[s.lineNumbersMinChars=69]="lineNumbersMinChars",s[s.linkedEditing=70]="linkedEditing",s[s.links=71]="links",s[s.matchBrackets=72]="matchBrackets",s[s.minimap=73]="minimap",s[s.mouseStyle=74]="mouseStyle",s[s.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",s[s.mouseWheelZoom=76]="mouseWheelZoom",s[s.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",s[s.multiCursorModifier=78]="multiCursorModifier",s[s.multiCursorPaste=79]="multiCursorPaste",s[s.multiCursorLimit=80]="multiCursorLimit",s[s.occurrencesHighlight=81]="occurrencesHighlight",s[s.overviewRulerBorder=82]="overviewRulerBorder",s[s.overviewRulerLanes=83]="overviewRulerLanes",s[s.padding=84]="padding",s[s.pasteAs=85]="pasteAs",s[s.parameterHints=86]="parameterHints",s[s.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",s[s.definitionLinkOpensInPeek=88]="definitionLinkOpensInPeek",s[s.quickSuggestions=89]="quickSuggestions",s[s.quickSuggestionsDelay=90]="quickSuggestionsDelay",s[s.readOnly=91]="readOnly",s[s.readOnlyMessage=92]="readOnlyMessage",s[s.renameOnType=93]="renameOnType",s[s.renderControlCharacters=94]="renderControlCharacters",s[s.renderFinalNewline=95]="renderFinalNewline",s[s.renderLineHighlight=96]="renderLineHighlight",s[s.renderLineHighlightOnlyWhenFocus=97]="renderLineHighlightOnlyWhenFocus",s[s.renderValidationDecorations=98]="renderValidationDecorations",s[s.renderWhitespace=99]="renderWhitespace",s[s.revealHorizontalRightPadding=100]="revealHorizontalRightPadding",s[s.roundedSelection=101]="roundedSelection",s[s.rulers=102]="rulers",s[s.scrollbar=103]="scrollbar",s[s.scrollBeyondLastColumn=104]="scrollBeyondLastColumn",s[s.scrollBeyondLastLine=105]="scrollBeyondLastLine",s[s.scrollPredominantAxis=106]="scrollPredominantAxis",s[s.selectionClipboard=107]="selectionClipboard",s[s.selectionHighlight=108]="selectionHighlight",s[s.selectOnLineNumbers=109]="selectOnLineNumbers",s[s.showFoldingControls=110]="showFoldingControls",s[s.showUnused=111]="showUnused",s[s.snippetSuggestions=112]="snippetSuggestions",s[s.smartSelect=113]="smartSelect",s[s.smoothScrolling=114]="smoothScrolling",s[s.stickyScroll=115]="stickyScroll",s[s.stickyTabStops=116]="stickyTabStops",s[s.stopRenderingLineAfter=117]="stopRenderingLineAfter",s[s.suggest=118]="suggest",s[s.suggestFontSize=119]="suggestFontSize",s[s.suggestLineHeight=120]="suggestLineHeight",s[s.suggestOnTriggerCharacters=121]="suggestOnTriggerCharacters",s[s.suggestSelection=122]="suggestSelection",s[s.tabCompletion=123]="tabCompletion",s[s.tabIndex=124]="tabIndex",s[s.unicodeHighlighting=125]="unicodeHighlighting",s[s.unusualLineTerminators=126]="unusualLineTerminators",s[s.useShadowDOM=127]="useShadowDOM",s[s.useTabStops=128]="useTabStops",s[s.wordBreak=129]="wordBreak",s[s.wordSegmenterLocales=130]="wordSegmenterLocales",s[s.wordSeparators=131]="wordSeparators",s[s.wordWrap=132]="wordWrap",s[s.wordWrapBreakAfterCharacters=133]="wordWrapBreakAfterCharacters",s[s.wordWrapBreakBeforeCharacters=134]="wordWrapBreakBeforeCharacters",s[s.wordWrapColumn=135]="wordWrapColumn",s[s.wordWrapOverride1=136]="wordWrapOverride1",s[s.wordWrapOverride2=137]="wordWrapOverride2",s[s.wrappingIndent=138]="wrappingIndent",s[s.wrappingStrategy=139]="wrappingStrategy",s[s.showDeprecated=140]="showDeprecated",s[s.inlayHints=141]="inlayHints",s[s.editorClassName=142]="editorClassName",s[s.pixelRatio=143]="pixelRatio",s[s.tabFocusMode=144]="tabFocusMode",s[s.layoutInfo=145]="layoutInfo",s[s.wrappingInfo=146]="wrappingInfo",s[s.defaultColorDecorators=147]="defaultColorDecorators",s[s.colorDecoratorsActivatedOn=148]="colorDecoratorsActivatedOn",s[s.inlineCompletionsAccessibilityVerbose=149]="inlineCompletionsAccessibilityVerbose"})(zb||(zb={}));var Ub;(function(s){s[s.TextDefined=0]="TextDefined",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(Ub||(Ub={}));var $b;(function(s){s[s.LF=0]="LF",s[s.CRLF=1]="CRLF"})($b||($b={}));var Kb;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=3]="Right"})(Kb||(Kb={}));var jb;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(jb||(jb={}));var qb;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(qb||(qb={}));var Gb;(function(s){s[s.Both=0]="Both",s[s.Right=1]="Right",s[s.Left=2]="Left",s[s.None=3]="None"})(Gb||(Gb={}));var Zb;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(Zb||(Zb={}));var Yb;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(Yb||(Yb={}));var Qb;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(Qb||(Qb={}));var Xb;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.Unknown=0]="Unknown",s[s.Backspace=1]="Backspace",s[s.Tab=2]="Tab",s[s.Enter=3]="Enter",s[s.Shift=4]="Shift",s[s.Ctrl=5]="Ctrl",s[s.Alt=6]="Alt",s[s.PauseBreak=7]="PauseBreak",s[s.CapsLock=8]="CapsLock",s[s.Escape=9]="Escape",s[s.Space=10]="Space",s[s.PageUp=11]="PageUp",s[s.PageDown=12]="PageDown",s[s.End=13]="End",s[s.Home=14]="Home",s[s.LeftArrow=15]="LeftArrow",s[s.UpArrow=16]="UpArrow",s[s.RightArrow=17]="RightArrow",s[s.DownArrow=18]="DownArrow",s[s.Insert=19]="Insert",s[s.Delete=20]="Delete",s[s.Digit0=21]="Digit0",s[s.Digit1=22]="Digit1",s[s.Digit2=23]="Digit2",s[s.Digit3=24]="Digit3",s[s.Digit4=25]="Digit4",s[s.Digit5=26]="Digit5",s[s.Digit6=27]="Digit6",s[s.Digit7=28]="Digit7",s[s.Digit8=29]="Digit8",s[s.Digit9=30]="Digit9",s[s.KeyA=31]="KeyA",s[s.KeyB=32]="KeyB",s[s.KeyC=33]="KeyC",s[s.KeyD=34]="KeyD",s[s.KeyE=35]="KeyE",s[s.KeyF=36]="KeyF",s[s.KeyG=37]="KeyG",s[s.KeyH=38]="KeyH",s[s.KeyI=39]="KeyI",s[s.KeyJ=40]="KeyJ",s[s.KeyK=41]="KeyK",s[s.KeyL=42]="KeyL",s[s.KeyM=43]="KeyM",s[s.KeyN=44]="KeyN",s[s.KeyO=45]="KeyO",s[s.KeyP=46]="KeyP",s[s.KeyQ=47]="KeyQ",s[s.KeyR=48]="KeyR",s[s.KeyS=49]="KeyS",s[s.KeyT=50]="KeyT",s[s.KeyU=51]="KeyU",s[s.KeyV=52]="KeyV",s[s.KeyW=53]="KeyW",s[s.KeyX=54]="KeyX",s[s.KeyY=55]="KeyY",s[s.KeyZ=56]="KeyZ",s[s.Meta=57]="Meta",s[s.ContextMenu=58]="ContextMenu",s[s.F1=59]="F1",s[s.F2=60]="F2",s[s.F3=61]="F3",s[s.F4=62]="F4",s[s.F5=63]="F5",s[s.F6=64]="F6",s[s.F7=65]="F7",s[s.F8=66]="F8",s[s.F9=67]="F9",s[s.F10=68]="F10",s[s.F11=69]="F11",s[s.F12=70]="F12",s[s.F13=71]="F13",s[s.F14=72]="F14",s[s.F15=73]="F15",s[s.F16=74]="F16",s[s.F17=75]="F17",s[s.F18=76]="F18",s[s.F19=77]="F19",s[s.F20=78]="F20",s[s.F21=79]="F21",s[s.F22=80]="F22",s[s.F23=81]="F23",s[s.F24=82]="F24",s[s.NumLock=83]="NumLock",s[s.ScrollLock=84]="ScrollLock",s[s.Semicolon=85]="Semicolon",s[s.Equal=86]="Equal",s[s.Comma=87]="Comma",s[s.Minus=88]="Minus",s[s.Period=89]="Period",s[s.Slash=90]="Slash",s[s.Backquote=91]="Backquote",s[s.BracketLeft=92]="BracketLeft",s[s.Backslash=93]="Backslash",s[s.BracketRight=94]="BracketRight",s[s.Quote=95]="Quote",s[s.OEM_8=96]="OEM_8",s[s.IntlBackslash=97]="IntlBackslash",s[s.Numpad0=98]="Numpad0",s[s.Numpad1=99]="Numpad1",s[s.Numpad2=100]="Numpad2",s[s.Numpad3=101]="Numpad3",s[s.Numpad4=102]="Numpad4",s[s.Numpad5=103]="Numpad5",s[s.Numpad6=104]="Numpad6",s[s.Numpad7=105]="Numpad7",s[s.Numpad8=106]="Numpad8",s[s.Numpad9=107]="Numpad9",s[s.NumpadMultiply=108]="NumpadMultiply",s[s.NumpadAdd=109]="NumpadAdd",s[s.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",s[s.NumpadSubtract=111]="NumpadSubtract",s[s.NumpadDecimal=112]="NumpadDecimal",s[s.NumpadDivide=113]="NumpadDivide",s[s.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",s[s.ABNT_C1=115]="ABNT_C1",s[s.ABNT_C2=116]="ABNT_C2",s[s.AudioVolumeMute=117]="AudioVolumeMute",s[s.AudioVolumeUp=118]="AudioVolumeUp",s[s.AudioVolumeDown=119]="AudioVolumeDown",s[s.BrowserSearch=120]="BrowserSearch",s[s.BrowserHome=121]="BrowserHome",s[s.BrowserBack=122]="BrowserBack",s[s.BrowserForward=123]="BrowserForward",s[s.MediaTrackNext=124]="MediaTrackNext",s[s.MediaTrackPrevious=125]="MediaTrackPrevious",s[s.MediaStop=126]="MediaStop",s[s.MediaPlayPause=127]="MediaPlayPause",s[s.LaunchMediaPlayer=128]="LaunchMediaPlayer",s[s.LaunchMail=129]="LaunchMail",s[s.LaunchApp2=130]="LaunchApp2",s[s.Clear=131]="Clear",s[s.MAX_VALUE=132]="MAX_VALUE"})(Xb||(Xb={}));var Jb;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Jb||(Jb={}));var eC;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(eC||(eC={}));var tC;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(tC||(tC={}));var iC;(function(s){s[s.Normal=1]="Normal",s[s.Underlined=2]="Underlined"})(iC||(iC={}));var nC;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.TEXTAREA=1]="TEXTAREA",s[s.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",s[s.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",s[s.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",s[s.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",s[s.CONTENT_TEXT=6]="CONTENT_TEXT",s[s.CONTENT_EMPTY=7]="CONTENT_EMPTY",s[s.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",s[s.CONTENT_WIDGET=9]="CONTENT_WIDGET",s[s.OVERVIEW_RULER=10]="OVERVIEW_RULER",s[s.SCROLLBAR=11]="SCROLLBAR",s[s.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",s[s.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(nC||(nC={}));var sC;(function(s){s[s.AIGenerated=1]="AIGenerated"})(sC||(sC={}));var oC;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(oC||(oC={}));var rC;(function(s){s[s.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",s[s.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",s[s.TOP_CENTER=2]="TOP_CENTER"})(rC||(rC={}));var aC;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(aC||(aC={}));var lC;(function(s){s[s.Word=0]="Word",s[s.Line=1]="Line",s[s.Suggest=2]="Suggest"})(lC||(lC={}));var cC;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.None=2]="None",s[s.LeftOfInjectedText=3]="LeftOfInjectedText",s[s.RightOfInjectedText=4]="RightOfInjectedText"})(cC||(cC={}));var dC;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval",s[s.Custom=4]="Custom"})(dC||(dC={}));var uC;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Blocks=2]="Blocks"})(uC||(uC={}));var hC;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(hC||(hC={}));var fC;(function(s){s[s.Auto=1]="Auto",s[s.Hidden=2]="Hidden",s[s.Visible=3]="Visible"})(fC||(fC={}));var gC;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(gC||(gC={}));var mC;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(mC||(mC={}));var pC;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(pC||(pC={}));var _C;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(_C||(_C={}));var vC;(function(s){s[s.Deprecated=1]="Deprecated"})(vC||(vC={}));var bC;(function(s){s[s.Hidden=0]="Hidden",s[s.Blink=1]="Blink",s[s.Smooth=2]="Smooth",s[s.Phase=3]="Phase",s[s.Expand=4]="Expand",s[s.Solid=5]="Solid"})(bC||(bC={}));var CC;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(CC||(CC={}));var wC;(function(s){s[s.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",s[s.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",s[s.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",s[s.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(wC||(wC={}));var yC;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(yC||(yC={}));let Rg=class{static chord(e,t){return GP(e,t)}};Rg.CtrlCmd=2048;Rg.Shift=1024;Rg.Alt=512;Rg.WinCtrl=256;function nT(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ho,Emitter:O,KeyCode:Xb,KeyMod:Rg,Position:V,Range:M,Selection:yt,SelectionDirection:gC,MarkerSeverity:Jb,MarkerTag:eC,Uri:$e,Token:Pf}}function wF(s,e){const t=s;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const wt=window;function sT(s){return s}class yF{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=sT):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}}class CD{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=sT):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);const i=this._fn(e);return this._map.set(e,i),this._map2.set(t,i),i}}class Ml{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var Su;function SF(s){return!s||typeof s!="string"?!0:s.trim().length===0}const LF=/{(\d+)}/g;function Xp(s,...e){return e.length===0?s:s.replace(LF,function(t,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=e.length?t:e[n]})}function kF(s){return s.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function of(s){return s.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function wa(s){return s.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function N0(s,e){if(!s||!e)return s;const t=e.length;if(t===0||s.length===0)return s;let i=0;for(;s.indexOf(e,i)===i;)i=i+t;return s.substring(i)}function DF(s,e){if(!s||!e)return s;const t=e.length,i=s.length;if(t===0||i===0)return s;let n=i,o=-1;for(;o=s.lastIndexOf(e,n-1),!(o===-1||o+t!==n);){if(o===0)return"";n=o}return s.substring(0,n)}function xF(s){return s.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function oT(s,e,t={}){if(!s)throw new Error("Cannot create regex from empty string");e||(s=wa(s)),t.wholeWord&&(/\B/.test(s.charAt(0))||(s="\\b"+s),/\B/.test(s.charAt(s.length-1))||(s=s+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(s,i)}function EF(s){return s.source==="^"||s.source==="^$"||s.source==="$"||s.source==="^\\s*$"?!1:!!(s.exec("")&&s.lastIndex===0)}function Xu(s){return s.split(/\r\n|\r|\n/)}function kte(s){var e;const t=[],i=s.split(/(\r\n|\r|\n)/);for(let n=0;n=0;t--){const i=s.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function SC(s,e){return se?1:0}function xS(s,e,t=0,i=s.length,n=0,o=e.length){for(;tc)return 1}const r=i-t,a=o-n;return ra?1:0}function wD(s,e){return Pg(s,e,0,s.length,0,e.length)}function Pg(s,e,t=0,i=s.length,n=0,o=e.length){for(;t=128||c>=128)return xS(s.toLowerCase(),e.toLowerCase(),t,i,n,o);xd(l)&&(l-=32),xd(c)&&(c-=32);const d=l-c;if(d!==0)return d}const r=i-t,a=o-n;return ra?1:0}function _m(s){return s>=48&&s<=57}function xd(s){return s>=97&&s<=122}function za(s){return s>=65&&s<=90}function Ed(s,e){return s.length===e.length&&Pg(s,e)===0}function ES(s,e){const t=e.length;return e.length>s.length?!1:Pg(s,e,0,t)===0}function LC(s,e){const t=Math.min(s.length,e.length);let i;for(i=0;i1){const i=s.charCodeAt(e-2);if(Di(i))return IS(i,t)}return t}class NS{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=IF(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=Jp(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class e_{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new NS(e,t)}nextGraphemeLength(){const e=Xa.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());if(yD(n,r)){t.setOffset(o);break}n=r}return t.offset-i}prevGraphemeLength(){const e=Xa.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());if(yD(r,n)){t.setOffset(o);break}n=r}return i-t.offset}eol(){return this._iterator.eol()}}function TS(s,e){return new e_(s,e).nextGraphemeLength()}function rT(s,e){return new e_(s,e).prevGraphemeLength()}function NF(s,e){e>0&&Lu(s.charCodeAt(e))&&e--;const t=e+TS(s,e);return[t-rT(s,t),t]}let K1;function TF(){return/(?:[\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\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function Ff(s){return K1||(K1=TF()),K1.test(s)}const AF=/^[\t\n\r\x20-\x7E]*$/;function AS(s){return AF.test(s)}const aT=/[\u2028\u2029]/;function lT(s){return aT.test(s)}function yl(s){return s>=11904&&s<=55215||s>=63744&&s<=64255||s>=65281&&s<=65374}function MS(s){return s>=127462&&s<=127487||s===8986||s===8987||s===9200||s===9203||s>=9728&&s<=10175||s===11088||s===11093||s>=127744&&s<=128591||s>=128640&&s<=128764||s>=128992&&s<=129008||s>=129280&&s<=129535||s>=129648&&s<=129782}const MF="\uFEFF";function RS(s){return!!(s&&s.length>0&&s.charCodeAt(0)===65279)}function Dte(s,e=!1){return s?(e&&(s=s.replace(/\\./g,"")),s.toLowerCase()!==s):!1}function cT(s){return s=s%(2*26),s<26?String.fromCharCode(97+s):String.fromCharCode(65+s-26)}function yD(s,e){return s===0?e!==5&&e!==7:s===2&&e===3?!1:s===4||s===2||s===3||e===4||e===2||e===3?!0:!(s===8&&(e===8||e===9||e===11||e===12)||(s===11||s===9)&&(e===9||e===10)||(s===12||s===10)&&e===10||e===5||e===13||e===7||s===1||s===13&&e===14||s===6&&e===6)}class Xa{static getInstance(){return Xa._INSTANCE||(Xa._INSTANCE=new Xa),Xa._INSTANCE}constructor(){this._data=RF()}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 n=1;for(;n<=i;)if(et[3*n+1])n=2*n+1;else return t[3*n+2];return 0}}Xa._INSTANCE=null;function RF(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,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,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,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,129008,129008,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,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,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,2192,2193,1,2250,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,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,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,6862,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,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,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,9775,9775,14,9784,9785,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,9874,14,9876,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,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,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,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,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,118528,118573,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,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function PF(s,e){if(s===0)return 0;const t=FF(s,e);if(t!==void 0)return t;const i=new NS(e,s);return i.prevCodePoint(),i.offset}function FF(s,e){const t=new NS(e,s);let i=t.prevCodePoint();for(;OF(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!MS(i))return;let n=t.offset;return n>0&&t.prevCodePoint()===8205&&(n=t.offset),n}function OF(s){return 127995<=s&&s<=127999}const xte=" ";class Tc{static getInstance(e){return Su.cache.get(Array.from(e))}static getLocales(){return Su._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}Su=Tc;Tc.ambiguousCharacterData=new Ml(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));Tc.cache=new yF({getCacheKey:JSON.stringify},s=>{function e(c){const d=new Map;for(let u=0;u!c.startsWith("_")&&c in n);o.length===0&&(o=["_default"]);let r;for(const c of o){const d=e(n[c]);r=i(r,d)}const a=e(n._common),l=t(a,r);return new Su(l)});Tc._locales=new Ml(()=>Object.keys(Su.ambiguousCharacterData.value).filter(s=>!s.startsWith("_")));class gl{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(gl.getRawData())),this._data}static isInvisibleCharacter(e){return gl.getData().has(e)}static get codePoints(){return gl.getData()}}gl._data=void 0;class DC{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){var t;return(t=this.mapWindowIdToZoomFactor.get(this.getWindowId(e)))!==null&&t!==void 0?t:1}getWindowId(e){return e.vscodeWindowId}}DC.INSTANCE=new DC;function dT(s,e,t){typeof e=="string"&&(e=s.matchMedia(e)),e.addEventListener("change",t)}function BF(s){return DC.INSTANCE.getZoomFactor(s)}const Ju=navigator.userAgent,lo=Ju.indexOf("Firefox")>=0,Cc=Ju.indexOf("AppleWebKit")>=0,Fg=Ju.indexOf("Chrome")>=0,ya=!Fg&&Ju.indexOf("Safari")>=0,uT=!Fg&&!ya&&Cc;Ju.indexOf("Electron/")>=0;const SD=Ju.indexOf("Android")>=0;let pp=!1;if(typeof wt.matchMedia=="function"){const s=wt.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=wt.matchMedia("(display-mode: fullscreen)");pp=s.matches,dT(wt,s,({matches:t})=>{pp&&e.matches||(pp=t)})}function WF(){return pp}const PS={clipboard:{writeText:nf||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:nf||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:nf||WF()?0:navigator.keyboard||ya?1:2,touch:"ontouchstart"in wt||navigator.maxTouchPoints>0,pointerEvents:wt.PointerEvent&&("ontouchstart"in wt||navigator.maxTouchPoints>0)};function xC(s,e){if(typeof s=="number"){if(s===0)return null;const t=(s&65535)>>>0,i=(s&4294901760)>>>16;return i!==0?new j1([vm(t,e),vm(i,e)]):new j1([vm(t,e)])}else{const t=[];for(let i=0;i{const r=e.token.onCancellationRequested(()=>{r.dispose(),o(new wl)});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),n(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(n,o){return i.then(n,o)}catch(n){return this.then(void 0,n)}finally(n){return i.finally(n)}}}function Ete(s,e,t){return new Promise((i,n)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});s.then(i,n).finally(()=>o.dispose())})}class ZF{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;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(n=>{this.activePromise=null,t(n)},n=>{this.activePromise=null,i(n)})})}dispose(){this.isDisposed=!0}}const YF=(s,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},s);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},QF=s=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,s())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Og{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((n,o)=>{this.doResolve=n,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const n=this.task;return this.task=null,n()}}));const i=()=>{var n;this.deferred=null,(n=this.doResolve)===null||n===void 0||n.call(this,null)};return this.deferred=t===hT?QF(i):YF(t,i),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new wl),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class gT{constructor(e){this.delayer=new Og(e),this.throttler=new ZF}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function Of(s,e){return e?new Promise((t,i)=>{const n=setTimeout(()=>{o.dispose(),t()},s),o=e.onCancellationRequested(()=>{clearTimeout(n),o.dispose(),i(new wl)})}):fT(t=>Of(s,t))}function IC(s,e=0,t){const i=setTimeout(()=>{s(),t&&n.dispose()},e),n=Be(()=>{clearTimeout(i),t==null||t.deleteAndLeak(n)});return t==null||t.add(n),n}function Ite(s,e=i=>!!i,t=null){let i=0;const n=s.length,o=()=>{if(i>=n)return Promise.resolve(t);const r=s[i++];return Promise.resolve(r()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class Zc{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Dt("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Dt("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class OS{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)===null||e===void 0||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new Dt("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const n=i.setInterval(()=>{e()},t);this.disposable=Be(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class _n{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(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let mT,rf;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?rf=(s,e)=>{BN(()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:rf=(s,e,t)=>{const i=s.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,s.cancelIdleCallback(i))}}},mT=s=>rf(globalThis,s)})();class pT{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=rf(e,()=>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}}class XF extends pT{constructor(e){super(globalThis,e)}}class _T{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new wl)}}var NC;(function(s){async function e(i){let n;const o=await Promise.all(i.map(r=>r.then(a=>a,a=>{n||(n=a)})));if(typeof n<"u")throw n;return o}s.settled=e;function t(i){return new Promise(async(n,o)=>{try{await i(n,o)}catch(r){o(r)}})}s.withAsyncBody=t})(NC||(NC={}));class jn{static fromArray(e){return new jn(t=>{t.emitMany(e)})}static fromPromise(e){return new jn(async t=>{t.emitMany(await e)})}static fromPromises(e){return new jn(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new jn(async t=>{await Promise.all(e.map(async i=>{for await(const n of i)t.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new O,queueMicrotask(async()=>{const i={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{await Promise.resolve(e(i)),this.resolve()}catch(n){this.reject(n)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e{var t;return(t=this._onReturn)===null||t===void 0||t.call(this),{done:!0,value:void 0}}}}static map(e,t){return new jn(async i=>{for await(const n of e)i.emitOne(t(n))})}map(e){return jn.map(this,e)}static filter(e,t){return new jn(async i=>{for await(const n of e)t(n)&&i.emitOne(n)})}filter(e){return jn.filter(this,e)}static coalesce(e){return jn.filter(e,t=>!!t)}coalesce(){return jn.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return jn.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}jn.EMPTY=jn.fromArray([]);class JF extends jn{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function Nte(s){const e=new Ho,t=s(e.token);return new JF(e,async i=>{const n=e.token.onCancellationRequested(()=>{n.dispose(),e.dispose(),i.reject(new wl)});try{for await(const o of t){if(e.token.isCancellationRequested)return;i.emitOne(o)}n.dispose(),e.dispose()}catch(o){n.dispose(),e.dispose(),i.reject(o)}})}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:vT,setPrototypeOf:kD,isFrozen:eO,getPrototypeOf:tO,getOwnPropertyDescriptor:iO}=Object;let{freeze:ts,seal:Ro,create:nO}=Object,{apply:TC,construct:AC}=typeof Reflect<"u"&&Reflect;TC||(TC=function(e,t,i){return e.apply(t,i)});ts||(ts=function(e){return e});Ro||(Ro=function(e){return e});AC||(AC=function(e,t){return new e(...t)});const sO=co(Array.prototype.forEach),DD=co(Array.prototype.pop),uh=co(Array.prototype.push),_p=co(String.prototype.toLowerCase),q1=co(String.prototype.toString),oO=co(String.prototype.match),po=co(String.prototype.replace),rO=co(String.prototype.indexOf),aO=co(String.prototype.trim),Es=co(RegExp.prototype.test),hh=lO(TypeError);function co(s){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n/gm),fO=Ro(/\${[\w\W]*}/gm),gO=Ro(/^data-[\-\w.\u00B7-\uFFFF]/),mO=Ro(/^aria-[\-\w]+$/),bT=Ro(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pO=Ro(/^(?:\w+script|data):/i),_O=Ro(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),CT=Ro(/^html$/i);var TD=Object.freeze({__proto__:null,MUSTACHE_EXPR:uO,ERB_EXPR:hO,TMPLIT_EXPR:fO,DATA_ATTR:gO,ARIA_ATTR:mO,IS_ALLOWED_URI:bT,IS_SCRIPT_OR_DATA:pO,ATTR_WHITESPACE:_O,DOCTYPE_NAME:CT});const vO=()=>typeof window>"u"?null:window,bO=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function wT(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vO();const e=Ve=>wT(Ve);if(e.version="3.0.5",e.removed=[],!s||!s.document||s.document.nodeType!==9)return e.isSupported=!1,e;const t=s.document,i=t.currentScript;let{document:n}=s;const{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:f}=s,g=l.prototype,m=bm(g,"cloneNode"),_=bm(g,"nextSibling"),v=bm(g,"childNodes"),b=bm(g,"parentNode");if(typeof r=="function"){const Ve=n.createElement("template");Ve.content&&Ve.content.ownerDocument&&(n=Ve.content.ownerDocument)}let C,w="";const{implementation:y,createNodeIterator:L,createDocumentFragment:k,getElementsByTagName:D}=n,{importNode:N}=t;let W={};e.isSupported=typeof vT=="function"&&typeof b=="function"&&y&&y.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:R,ERB_EXPR:A,TMPLIT_EXPR:P,DATA_ATTR:H,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:re,ATTR_WHITESPACE:de}=TD;let{IS_ALLOWED_URI:ve}=TD,se=null;const Ce=gt({},[...xD,...G1,...Z1,...Y1,...ED]);let Ee=null;const fe=gt({},[...ID,...Q1,...ND,...Cm]);let X=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,ut=null,Mt=!0,it=!0,ai=!1,Yi=!0,mi=!1,ke=!1,rn=!1,rs=!1,Tn=!1,Cn=!1,li=!1,as=!0,ks=!1;const cd="user-content-";let Q=!0,U=!1,z={},E=null;const I=gt({},["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"]);let B=null;const F=gt({},["audio","video","img","source","image","track"]);let Z=null;const ee=gt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_e="http://www.w3.org/1998/Math/MathML",we="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml";let Ae=Oe,St=!1,ht=null;const Ie=gt({},[_e,we,Oe],q1);let Ut;const zt=["application/xhtml+xml","text/html"],ls="text/html";let Ze,qt=null;const oe=n.createElement("form"),ge=function($){return $ instanceof RegExp||$ instanceof Function},Pe=function($){if(!(qt&&qt===$)){if((!$||typeof $!="object")&&($={}),$=ud($),Ut=zt.indexOf($.PARSER_MEDIA_TYPE)===-1?Ut=ls:Ut=$.PARSER_MEDIA_TYPE,Ze=Ut==="application/xhtml+xml"?q1:_p,se="ALLOWED_TAGS"in $?gt({},$.ALLOWED_TAGS,Ze):Ce,Ee="ALLOWED_ATTR"in $?gt({},$.ALLOWED_ATTR,Ze):fe,ht="ALLOWED_NAMESPACES"in $?gt({},$.ALLOWED_NAMESPACES,q1):Ie,Z="ADD_URI_SAFE_ATTR"in $?gt(ud(ee),$.ADD_URI_SAFE_ATTR,Ze):ee,B="ADD_DATA_URI_TAGS"in $?gt(ud(F),$.ADD_DATA_URI_TAGS,Ze):F,E="FORBID_CONTENTS"in $?gt({},$.FORBID_CONTENTS,Ze):I,ie="FORBID_TAGS"in $?gt({},$.FORBID_TAGS,Ze):{},ut="FORBID_ATTR"in $?gt({},$.FORBID_ATTR,Ze):{},z="USE_PROFILES"in $?$.USE_PROFILES:!1,Mt=$.ALLOW_ARIA_ATTR!==!1,it=$.ALLOW_DATA_ATTR!==!1,ai=$.ALLOW_UNKNOWN_PROTOCOLS||!1,Yi=$.ALLOW_SELF_CLOSE_IN_ATTR!==!1,mi=$.SAFE_FOR_TEMPLATES||!1,ke=$.WHOLE_DOCUMENT||!1,Tn=$.RETURN_DOM||!1,Cn=$.RETURN_DOM_FRAGMENT||!1,li=$.RETURN_TRUSTED_TYPE||!1,rs=$.FORCE_BODY||!1,as=$.SANITIZE_DOM!==!1,ks=$.SANITIZE_NAMED_PROPS||!1,Q=$.KEEP_CONTENT!==!1,U=$.IN_PLACE||!1,ve=$.ALLOWED_URI_REGEXP||bT,Ae=$.NAMESPACE||Oe,X=$.CUSTOM_ELEMENT_HANDLING||{},$.CUSTOM_ELEMENT_HANDLING&&ge($.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=$.CUSTOM_ELEMENT_HANDLING.tagNameCheck),$.CUSTOM_ELEMENT_HANDLING&&ge($.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=$.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),$.CUSTOM_ELEMENT_HANDLING&&typeof $.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=$.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),mi&&(it=!1),Cn&&(Tn=!0),z&&(se=gt({},[...ED]),Ee=[],z.html===!0&&(gt(se,xD),gt(Ee,ID)),z.svg===!0&&(gt(se,G1),gt(Ee,Q1),gt(Ee,Cm)),z.svgFilters===!0&&(gt(se,Z1),gt(Ee,Q1),gt(Ee,Cm)),z.mathMl===!0&&(gt(se,Y1),gt(Ee,ND),gt(Ee,Cm))),$.ADD_TAGS&&(se===Ce&&(se=ud(se)),gt(se,$.ADD_TAGS,Ze)),$.ADD_ATTR&&(Ee===fe&&(Ee=ud(Ee)),gt(Ee,$.ADD_ATTR,Ze)),$.ADD_URI_SAFE_ATTR&>(Z,$.ADD_URI_SAFE_ATTR,Ze),$.FORBID_CONTENTS&&(E===I&&(E=ud(E)),gt(E,$.FORBID_CONTENTS,Ze)),Q&&(se["#text"]=!0),ke&>(se,["html","head","body"]),se.table&&(gt(se,["tbody"]),delete ie.tbody),$.TRUSTED_TYPES_POLICY){if(typeof $.TRUSTED_TYPES_POLICY.createHTML!="function")throw hh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof $.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=$.TRUSTED_TYPES_POLICY,w=C.createHTML("")}else C===void 0&&(C=bO(f,i)),C!==null&&typeof w=="string"&&(w=C.createHTML(""));ts&&ts($),qt=$}},ei=gt({},["mi","mo","mn","ms","mtext"]),ci=gt({},["foreignobject","desc","title","annotation-xml"]),Ct=gt({},["title","style","font","a","script"]),ft=gt({},G1);gt(ft,Z1),gt(ft,cO);const at=gt({},Y1);gt(at,dO);const Ui=function($){let ue=b($);(!ue||!ue.tagName)&&(ue={namespaceURI:Ae,tagName:"template"});const xe=_p($.tagName),Gt=_p(ue.tagName);return ht[$.namespaceURI]?$.namespaceURI===we?ue.namespaceURI===Oe?xe==="svg":ue.namespaceURI===_e?xe==="svg"&&(Gt==="annotation-xml"||ei[Gt]):!!ft[xe]:$.namespaceURI===_e?ue.namespaceURI===Oe?xe==="math":ue.namespaceURI===we?xe==="math"&&ci[Gt]:!!at[xe]:$.namespaceURI===Oe?ue.namespaceURI===we&&!ci[Gt]||ue.namespaceURI===_e&&!ei[Gt]?!1:!at[xe]&&(Ct[xe]||!ft[xe]):!!(Ut==="application/xhtml+xml"&&ht[$.namespaceURI]):!1},yi=function($){uh(e.removed,{element:$});try{$.parentNode.removeChild($)}catch{$.remove()}},Ds=function($,ue){try{uh(e.removed,{attribute:ue.getAttributeNode($),from:ue})}catch{uh(e.removed,{attribute:null,from:ue})}if(ue.removeAttribute($),$==="is"&&!Ee[$])if(Tn||Cn)try{yi(ue)}catch{}else try{ue.setAttribute($,"")}catch{}},Na=function($){let ue,xe;if(rs)$=""+$;else{const Gs=oO($,/^[\r\n\t ]+/);xe=Gs&&Gs[0]}Ut==="application/xhtml+xml"&&Ae===Oe&&($=''+$+"");const Gt=C?C.createHTML($):$;if(Ae===Oe)try{ue=new h().parseFromString(Gt,Ut)}catch{}if(!ue||!ue.documentElement){ue=y.createDocument(Ae,"template",null);try{ue.documentElement.innerHTML=St?w:Gt}catch{}}const an=ue.body||ue.documentElement;return $&&xe&&an.insertBefore(n.createTextNode(xe),an.childNodes[0]||null),Ae===Oe?D.call(ue,ke?"html":"body")[0]:ke?ue.documentElement:an},Ta=function($){return L.call($.ownerDocument||$,$,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},cs=function($){return $ instanceof u&&(typeof $.nodeName!="string"||typeof $.textContent!="string"||typeof $.removeChild!="function"||!($.attributes instanceof d)||typeof $.removeAttribute!="function"||typeof $.setAttribute!="function"||typeof $.namespaceURI!="string"||typeof $.insertBefore!="function"||typeof $.hasChildNodes!="function")},go=function($){return typeof a=="object"?$ instanceof a:$&&typeof $=="object"&&typeof $.nodeType=="number"&&typeof $.nodeName=="string"},qs=function($,ue,xe){W[$]&&sO(W[$],Gt=>{Gt.call(e,ue,xe,qt)})},$k=function($){let ue;if(qs("beforeSanitizeElements",$,null),cs($))return yi($),!0;const xe=Ze($.nodeName);if(qs("uponSanitizeElement",$,{tagName:xe,allowedTags:se}),$.hasChildNodes()&&!go($.firstElementChild)&&(!go($.content)||!go($.content.firstElementChild))&&Es(/<[/\w]/g,$.innerHTML)&&Es(/<[/\w]/g,$.textContent))return yi($),!0;if(!se[xe]||ie[xe]){if(!ie[xe]&&jk(xe)&&(X.tagNameCheck instanceof RegExp&&Es(X.tagNameCheck,xe)||X.tagNameCheck instanceof Function&&X.tagNameCheck(xe)))return!1;if(Q&&!E[xe]){const Gt=b($)||$.parentNode,an=v($)||$.childNodes;if(an&&Gt){const Gs=an.length;for(let pi=Gs-1;pi>=0;--pi)Gt.insertBefore(m(an[pi],!0),_($))}}return yi($),!0}return $ instanceof l&&!Ui($)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Es(/<\/no(script|embed|frames)/i,$.innerHTML)?(yi($),!0):(mi&&$.nodeType===3&&(ue=$.textContent,ue=po(ue,R," "),ue=po(ue,A," "),ue=po(ue,P," "),$.textContent!==ue&&(uh(e.removed,{element:$.cloneNode()}),$.textContent=ue)),qs("afterSanitizeElements",$,null),!1)},Kk=function($,ue,xe){if(as&&(ue==="id"||ue==="name")&&(xe in n||xe in oe))return!1;if(!(it&&!ut[ue]&&Es(H,ue))){if(!(Mt&&Es(q,ue))){if(!Ee[ue]||ut[ue]){if(!(jk($)&&(X.tagNameCheck instanceof RegExp&&Es(X.tagNameCheck,$)||X.tagNameCheck instanceof Function&&X.tagNameCheck($))&&(X.attributeNameCheck instanceof RegExp&&Es(X.attributeNameCheck,ue)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(ue))||ue==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&Es(X.tagNameCheck,xe)||X.tagNameCheck instanceof Function&&X.tagNameCheck(xe))))return!1}else if(!Z[ue]){if(!Es(ve,po(xe,de,""))){if(!((ue==="src"||ue==="xlink:href"||ue==="href")&&$!=="script"&&rO(xe,"data:")===0&&B[$])){if(!(ai&&!Es(re,po(xe,de,"")))){if(xe)return!1}}}}}}return!0},jk=function($){return $.indexOf("-")>0},qk=function($){let ue,xe,Gt,an;qs("beforeSanitizeAttributes",$,null);const{attributes:Gs}=$;if(!Gs)return;const pi={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee};for(an=Gs.length;an--;){ue=Gs[an];const{name:qo,namespaceURI:W1}=ue;if(xe=qo==="value"?ue.value:aO(ue.value),Gt=Ze(qo),pi.attrName=Gt,pi.attrValue=xe,pi.keepAttr=!0,pi.forceKeepAttr=void 0,qs("uponSanitizeAttribute",$,pi),xe=pi.attrValue,pi.forceKeepAttr||(Ds(qo,$),!pi.keepAttr))continue;if(!Yi&&Es(/\/>/i,xe)){Ds(qo,$);continue}mi&&(xe=po(xe,R," "),xe=po(xe,A," "),xe=po(xe,P," "));const Gk=Ze($.nodeName);if(Kk(Gk,Gt,xe)){if(ks&&(Gt==="id"||Gt==="name")&&(Ds(qo,$),xe=cd+xe),C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!W1)switch(f.getAttributeType(Gk,Gt)){case"TrustedHTML":{xe=C.createHTML(xe);break}case"TrustedScriptURL":{xe=C.createScriptURL(xe);break}}try{W1?$.setAttributeNS(W1,qo,xe):$.setAttribute(qo,xe),DD(e.removed)}catch{}}}qs("afterSanitizeAttributes",$,null)},o5=function Ve($){let ue;const xe=Ta($);for(qs("beforeSanitizeShadowDOM",$,null);ue=xe.nextNode();)qs("uponSanitizeShadowNode",ue,null),!$k(ue)&&(ue.content instanceof o&&Ve(ue.content),qk(ue));qs("afterSanitizeShadowDOM",$,null)};return e.sanitize=function(Ve){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ue,xe,Gt,an;if(St=!Ve,St&&(Ve=""),typeof Ve!="string"&&!go(Ve))if(typeof Ve.toString=="function"){if(Ve=Ve.toString(),typeof Ve!="string")throw hh("dirty is not a string, aborting")}else throw hh("toString is not a function");if(!e.isSupported)return Ve;if(rn||Pe($),e.removed=[],typeof Ve=="string"&&(U=!1),U){if(Ve.nodeName){const qo=Ze(Ve.nodeName);if(!se[qo]||ie[qo])throw hh("root node is forbidden and cannot be sanitized in-place")}}else if(Ve instanceof a)ue=Na(""),xe=ue.ownerDocument.importNode(Ve,!0),xe.nodeType===1&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?ue=xe:ue.appendChild(xe);else{if(!Tn&&!mi&&!ke&&Ve.indexOf("<")===-1)return C&&li?C.createHTML(Ve):Ve;if(ue=Na(Ve),!ue)return Tn?null:li?w:""}ue&&rs&&yi(ue.firstChild);const Gs=Ta(U?Ve:ue);for(;Gt=Gs.nextNode();)$k(Gt)||(Gt.content instanceof o&&o5(Gt.content),qk(Gt));if(U)return Ve;if(Tn){if(Cn)for(an=k.call(ue.ownerDocument);ue.firstChild;)an.appendChild(ue.firstChild);else an=ue;return(Ee.shadowroot||Ee.shadowrootmode)&&(an=N.call(t,an,!0)),an}let pi=ke?ue.outerHTML:ue.innerHTML;return ke&&se["!doctype"]&&ue.ownerDocument&&ue.ownerDocument.doctype&&ue.ownerDocument.doctype.name&&Es(CT,ue.ownerDocument.doctype.name)&&(pi=" `+pi),mi&&(pi=po(pi,R," "),pi=po(pi,A," "),pi=po(pi,P," ")),C&&li?C.createHTML(pi):pi},e.setConfig=function(Ve){Pe(Ve),rn=!0},e.clearConfig=function(){qt=null,rn=!1},e.isValidAttribute=function(Ve,$,ue){qt||Pe({});const xe=Ze(Ve),Gt=Ze($);return Kk(xe,Gt,ue)},e.addHook=function(Ve,$){typeof $=="function"&&(W[Ve]=W[Ve]||[],uh(W[Ve],$))},e.removeHook=function(Ve){if(W[Ve])return DD(W[Ve])},e.removeHooks=function(Ve){W[Ve]&&(W[Ve]=[])},e.removeAllHooks=function(){W={}},e}var Ir=wT();Ir.version;Ir.isSupported;const yT=Ir.sanitize;Ir.setConfig;Ir.clearConfig;Ir.isValidAttribute;const ST=Ir.addHook,LT=Ir.removeHook;Ir.removeHooks;Ir.removeAllHooks;var ze;(function(s){s.inMemory="inmemory",s.vscode="vscode",s.internal="private",s.walkThrough="walkThrough",s.walkThroughSnippet="walkThroughSnippet",s.http="http",s.https="https",s.file="file",s.mailto="mailto",s.untitled="untitled",s.data="data",s.command="command",s.vscodeRemote="vscode-remote",s.vscodeRemoteResource="vscode-remote-resource",s.vscodeManagedRemoteResource="vscode-managed-remote-resource",s.vscodeUserData="vscode-userdata",s.vscodeCustomEditor="vscode-custom-editor",s.vscodeNotebookCell="vscode-notebook-cell",s.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",s.vscodeNotebookCellOutput="vscode-notebook-cell-output",s.vscodeInteractiveInput="vscode-interactive-input",s.vscodeSettings="vscode-settings",s.vscodeWorkspaceTrust="vscode-workspace-trust",s.vscodeTerminal="vscode-terminal",s.vscodeChatCodeBlock="vscode-chat-code-block",s.vscodeCopilotBackingChatCodeBlock="vscode-copilot-chat-code-block",s.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",s.vscodeChatSesssion="vscode-chat-editor",s.webviewPanel="webview-panel",s.vscodeWebview="vscode-webview",s.extension="extension",s.vscodeFileResource="vscode-file",s.tmp="tmp",s.vsls="vsls",s.vscodeSourceControl="vscode-scm",s.commentsInput="comment",s.codeSetting="code-setting"})(ze||(ze={}));function BS(s,e){return $e.isUri(s)?Ed(s.scheme,e):ES(s,e+":")}function AD(s,...e){return e.some(t=>BS(s,t))}const CO="tkn";class wO{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return ri.join(this._serverRootPath,ze.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return At(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${CO}=${encodeURIComponent(o)}`),$e.from({scheme:Yu?this._preferredWebSchema:ze.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}const kT=new wO,yO="vscode-app";class Bf{uriToBrowserUri(e){return e.scheme===ze.vscodeRemote?kT.rewrite(e):e.scheme===ze.file&&(nf||R5===`${ze.vscodeFileResource}://${Bf.FALLBACK_AUTHORITY}`)?e.with({scheme:ze.vscodeFileResource,authority:e.authority||Bf.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}Bf.FALLBACK_AUTHORITY=yO;const DT=new Bf;var MD;(function(s){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);s.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let r;typeof o=="string"?r=new URL(o).searchParams:o instanceof URL?r=o.searchParams:$e.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r==null?void 0:r.get(t);if(a)return e.get(a)}s.getHeadersFromQuery=i;function n(o,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}s.addSearchParam=n})(MD||(MD={}));function xT(s){return T0(s,0)}function T0(s,e){switch(typeof s){case"object":return s===null?na(349,e):Array.isArray(s)?LO(s,e):kO(s,e);case"string":return WS(s,e);case"boolean":return SO(s,e);case"number":return na(s,e);case"undefined":return na(937,e);default:return na(617,e)}}function na(s,e){return(e<<5)-e+s|0}function SO(s,e){return na(s?433:863,e)}function WS(s,e){e=na(149417,e);for(let t=0,i=s.length;tT0(i,t),e)}function kO(s,e){return e=na(181387,e),Object.keys(s).sort().reduce((t,i)=>(t=WS(i,t),T0(s[i],t)),e)}function X1(s,e,t=32){const i=t-e,n=~((1<>>i)>>>0}function RD(s,e=0,t=s.byteLength,i=0){for(let n=0;nt.toString(16).padStart(2,"0")).join(""):DO((s>>>0).toString(16),e/4)}class A0{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),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 n=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(Di(r))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],e[1]=e[65],e[2]=e[66]),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()),fh(this._h0)+fh(this._h1)+fh(this._h2)+fh(this._h3)+fh(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,RD(this._buff,this._buffLen),this._buffLen>56&&(this._step(),RD(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=A0._bigBlock32,t=this._buffDV;for(let u=0;u<64;u+=4)e.setUint32(u,t.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)e.setUint32(u,X1(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let i=this._h0,n=this._h1,o=this._h2,r=this._h3,a=this._h4,l,c,d;for(let u=0;u<80;u++)u<20?(l=n&o|~n&r,c=1518500249):u<40?(l=n^o^r,c=1859775393):u<60?(l=n&o|n&r|o&r,c=2400959708):(l=n^o^r,c=3395469782),d=X1(i,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=r,r=o,o=X1(n,30),n=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+n&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}A0._bigBlock32=new DataView(new ArrayBuffer(320));const{registerWindow:Tte,getWindow:be,getDocument:Ate,getWindows:ET,getWindowsCount:xO,getWindowId:t_,getWindowById:PD,hasWindow:Mte,onDidRegisterWindow:M0,onWillUnregisterWindow:EO,onDidUnregisterWindow:IO}=function(){const s=new Map;wF(wt,1);const e={window:wt,disposables:new pe};s.set(wt.vscodeWindowId,e);const t=new O,i=new O,n=new O;function o(r,a){const l=typeof r=="number"?s.get(r):void 0;return l??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:i.event,registerWindow(r){if(s.has(r.vscodeWindowId))return G.None;const a=new pe,l={window:r,disposables:a.add(new pe)};return s.set(r.vscodeWindowId,l),a.add(Be(()=>{s.delete(r.vscodeWindowId),i.fire(r)})),a.add(j(r,J.BEFORE_UNLOAD,()=>{n.fire(r)})),t.fire(l),a},getWindows(){return s.values()},getWindowsCount(){return s.size},getWindowId(r){return r.vscodeWindowId},hasWindow(r){return s.has(r)},getWindowById:o,getWindow(r){var a;const l=r;if(!((a=l==null?void 0:l.ownerDocument)===null||a===void 0)&&a.defaultView)return l.ownerDocument.defaultView.window;const c=r;return c!=null&&c.view?c.view.window:wt},getDocument(r){return be(r).document}}}();function Po(s){for(;s.firstChild;)s.firstChild.remove()}class NO{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!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 j(s,e,t,i){return new NO(s,e,t,i)}function IT(s,e){return function(t){return e(new Io(s,t))}}function TO(s){return function(e){return s(new Ot(e))}}const Ai=function(e,t,i,n){let o=i;return t==="click"||t==="mousedown"||t==="contextmenu"?o=IT(be(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=TO(i)),j(e,t,o,n)},Rte=function(e,t,i){const n=IT(be(e),t);return AO(e,n,i)};function AO(s,e,t){return j(s,Cl&&PS.pointerEvents?J.POINTER_DOWN:J.MOUSE_DOWN,e,t)}function wm(s,e,t){return rf(s,e,t)}class Pte extends pT{constructor(e,t){super(e,t)}}let NT,is;class VS extends OS{constructor(e){super(),this.defaultTarget=e&&be(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class J1{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){At(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const s=new Map,e=new Map,t=new Map,i=new Map,n=o=>{var r;t.set(o,!1);const a=(r=s.get(o))!==null&&r!==void 0?r:[];for(e.set(o,a),s.set(o,[]),i.set(o,!0);a.length>0;)a.sort(J1.sort),a.shift().execute();i.set(o,!1)};is=(o,r,a=0)=>{const l=t_(o),c=new J1(r,a);let d=s.get(l);return d||(d=[],s.set(l,d)),d.push(c),t.get(l)||(t.set(l,!0),o.requestAnimationFrame(()=>n(l))),c},NT=(o,r,a)=>{const l=t_(o);if(i.get(l)){const c=new J1(r,a);let d=e.get(l);return d||(d=[],e.set(l,d)),d.push(c),c}else return is(o,r,a)}})();function HS(s){return be(s).getComputedStyle(s,null)}function MC(s,e){const t=be(s),i=t.document;if(s!==i.body)return new Ts(s.clientWidth,s.clientHeight);if(Cl&&(t!=null&&t.visualViewport))return new Ts(t.visualViewport.width,t.visualViewport.height);if(t!=null&&t.innerWidth&&t.innerHeight)return new Ts(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Ts(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Ts(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class Qt{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=HS(e),o=n?n.getPropertyValue(t):"0";return Qt.convertToPixels(e,o)}static getBorderLeftWidth(e){return Qt.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Qt.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Qt.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Qt.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Qt.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Qt.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Qt.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Qt.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Qt.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Qt.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Qt.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Qt.getDimension(e,"margin-bottom","marginBottom")}}class Ts{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Ts(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Ts?e:new Ts(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Ts.None=new Ts(0,0);function MO(s){let e=s.offsetParent,t=s.offsetTop,i=s.offsetLeft;for(;(s=s.parentNode)!==null&&s!==s.ownerDocument.body&&s!==s.ownerDocument.documentElement;){t-=s.scrollTop;const n=AT(s)?null:HS(s);n&&(i-=n.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(i+=Qt.getBorderLeftWidth(s),t+=Qt.getBorderTopWidth(s),t+=s.offsetTop,i+=s.offsetLeft,e=s.offsetParent)}return{left:i,top:t}}function Fte(s,e,t){typeof e=="number"&&(s.style.width=`${e}px`),typeof t=="number"&&(s.style.height=`${t}px`)}function Fs(s){const e=s.getBoundingClientRect(),t=be(s);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function TT(s){let e=s,t=1;do{const i=HS(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function zS(s){const e=Qt.getMarginLeft(s)+Qt.getMarginRight(s);return s.offsetWidth+e}function ev(s){const e=Qt.getBorderLeftWidth(s)+Qt.getBorderRightWidth(s),t=Qt.getPaddingLeft(s)+Qt.getPaddingRight(s);return s.offsetWidth-e-t}function RO(s){const e=Qt.getBorderTopWidth(s)+Qt.getBorderBottomWidth(s),t=Qt.getPaddingTop(s)+Qt.getPaddingBottom(s);return s.offsetHeight-e-t}function RC(s){const e=Qt.getMarginTop(s)+Qt.getMarginBottom(s);return s.offsetHeight+e}function Ni(s,e){return!!(e!=null&&e.contains(s))}function PO(s,e,t){for(;s&&s.nodeType===s.ELEMENT_NODE;){if(s.classList.contains(e))return s;if(t){if(typeof t=="string"){if(s.classList.contains(t))return null}else if(s===t)return null}s=s.parentNode}return null}function tv(s,e,t){return!!PO(s,e,t)}function AT(s){return s&&!!s.host&&!!s.mode}function i_(s){return!!ku(s)}function ku(s){for(var e;s.parentNode;){if(s===((e=s.ownerDocument)===null||e===void 0?void 0:e.body))return null;s=s.parentNode}return AT(s)?s:null}function vn(){let s=$S().activeElement;for(;s!=null&&s.shadowRoot;)s=s.shadowRoot.activeElement;return s}function US(s){return vn()===s}function MT(s){return Ni(vn(),s)}function $S(){var s;return xO()<=1?wt.document:(s=Array.from(ET()).map(({window:t})=>t.document).find(t=>t.hasFocus()))!==null&&s!==void 0?s:wt.document}function vp(){var s,e;return(e=(s=$S().defaultView)===null||s===void 0?void 0:s.window)!==null&&e!==void 0?e:wt}const KS=new Map;function Ote(){return new FO}class FO{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=ys(wt.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function ys(s=wt.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e==null||e(i),s.appendChild(i),t&&t.add(Be(()=>s.removeChild(i))),s===wt.document.head){const n=new Set;KS.set(i,n);for(const{window:o,disposables:r}of ET()){if(o===wt)continue;const a=r.add(OO(i,n,o));t==null||t.add(a)}}return i}function OO(s,e,t){var i,n;const o=new pe,r=s.cloneNode(!0);t.document.head.appendChild(r),o.add(Be(()=>t.document.head.removeChild(r)));for(const a of PT(s))(i=r.sheet)===null||i===void 0||i.insertRule(a.cssText,(n=r.sheet)===null||n===void 0?void 0:n.cssRules.length);return o.add(BO.observe(s,o,{childList:!0})(()=>{r.textContent=s.textContent})),e.add(r),o.add(Be(()=>e.delete(r))),o}const BO=new class{constructor(){this.mutationObservers=new Map}observe(s,e,t){let i=this.mutationObservers.get(s);i||(i=new Map,this.mutationObservers.set(s,i));const n=xT(t);let o=i.get(n);if(o)o.users+=1;else{const r=new O,a=new MutationObserver(c=>r.fire(c));a.observe(s,t);const l=o={users:1,observer:a,onDidMutate:r.event};e.add(Be(()=>{l.users-=1,l.users===0&&(r.dispose(),a.disconnect(),i==null||i.delete(n),(i==null?void 0:i.size)===0&&this.mutationObservers.delete(s))})),i.set(n,o)}return o.onDidMutate}};let iv=null;function RT(){return iv||(iv=ys()),iv}function PT(s){var e,t;return!((e=s==null?void 0:s.sheet)===null||e===void 0)&&e.rules?s.sheet.rules:!((t=s==null?void 0:s.sheet)===null||t===void 0)&&t.cssRules?s.sheet.cssRules:[]}function PC(s,e,t=RT()){var i,n;if(!(!t||!e)){(i=t.sheet)===null||i===void 0||i.insertRule(`${s} {${e}}`,0);for(const o of(n=KS.get(t))!==null&&n!==void 0?n:[])PC(s,e,o)}}function WO(s,e=RT()){var t,i;if(!e)return;const n=PT(e),o=[];for(let r=0;r=0;r--)(t=e.sheet)===null||t===void 0||t.deleteRule(o[r]);for(const r of(i=KS.get(e))!==null&&i!==void 0?i:[])WO(s,r)}function VO(s){return typeof s.selectorText=="string"}function Vi(s){return s instanceof HTMLElement||s instanceof be(s).HTMLElement}function FD(s){return s instanceof HTMLAnchorElement||s instanceof be(s).HTMLAnchorElement}function jS(s){return s instanceof MouseEvent||s instanceof be(s).MouseEvent}function $a(s){return s instanceof KeyboardEvent||s instanceof be(s).KeyboardEvent}const J={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",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",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:Cc?"webkitAnimationStart":"animationstart",ANIMATION_END:Cc?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Cc?"webkitAnimationIteration":"animationiteration"};function HO(s){const e=s;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const Ge={stop:(s,e)=>(s.preventDefault(),e&&s.stopPropagation(),s)};function zO(s){const e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function UO(s,e){for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)s.scrollTop!==e[t]&&(s.scrollTop=e[t]),s=s.parentNode}class n_ extends G{static hasFocusWithin(e){if(Vi(e)){const t=ku(e),i=t?t.activeElement:e.ownerDocument.activeElement;return Ni(i,e)}else{const t=e;return Ni(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new O),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new O),this.onDidBlur=this._onDidBlur.event;let t=n_.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,(Vi(e)?be(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{n_.hasFocusWithin(e)!==t&&(t?o():n())},this._register(j(e,J.FOCUS,n,!0)),this._register(j(e,J.BLUR,o,!0)),Vi(e)&&(this._register(j(e,J.FOCUS_IN,()=>this._refreshStateHandler())),this._register(j(e,J.FOCUS_OUT,()=>this._refreshStateHandler())))}}function Wf(s){return new n_(s)}function $O(s,e){return s.after(e),e}function he(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function qS(s,e){return s.insertBefore(e,s.firstChild),e}function xn(s,...e){s.innerText="",he(s,...e)}const KO=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Vf;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(Vf||(Vf={}));function FT(s,e,t,...i){const n=KO.exec(e);if(!n)throw new Error("Bad use of emmet");const o=n[1]||"div";let r;return s!==Vf.HTML?r=document.createElementNS(s,o):r=document.createElement(o),n[3]&&(r.id=n[3]),n[4]&&(r.className=n[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?r[a]=l:a==="selected"?l&&r.setAttribute(a,"true"):r.setAttribute(a,l))}),r.append(...i),r}function De(s,e,...t){return FT(Vf.HTML,s,e,...t)}De.SVG=function(s,e,...t){return FT(Vf.SVG,s,e,...t)};function Bte(s,...e){s?GS(...e):FC(...e)}function GS(...s){for(const e of s)e.style.display="",e.removeAttribute("aria-hidden")}function FC(...s){for(const e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function OD(s,e){const t=s.devicePixelRatio*e;return Math.max(1,Math.floor(t))/s.devicePixelRatio}function OT(s){wt.open(s,"_blank","noopener")}function jO(s,e){const t=()=>{e(),i=is(s,t)};let i=is(s,t);return Be(()=>i.dispose())}kT.setPreferredWebSchema(/^https:/.test(wt.location.href)?"https":"http");function Sa(s){return s?`url('${DT.uriToBrowserUri(s).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function nv(s){return`'${s.replace(/'/g,"%27")}'`}function ga(s,e){if(s!==void 0){const t=s.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=ga(i[1].trim(),e)),`var(${i[0]}, ${e})`}return s}return e}function qO(s,e=!1){const t=document.createElement("a");return ST("afterSanitizeAttributes",i=>{for(const n of["href","src"])if(i.hasAttribute(n)){const o=i.getAttribute(n);if(n==="href"&&o.startsWith("#"))continue;if(t.href=o,!s.includes(t.protocol.replace(/:$/,""))){if(e&&n==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(n)}}}),Be(()=>{LT("afterSanitizeAttributes")})}const GO=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class Ja extends O{constructor(){super(),this._subscriptions=new pe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(te.runAndSubscribe(M0,({window:e,disposables:t})=>this.registerListeners(e,t),{window:wt,disposables:this._subscriptions}))}registerListeners(e,t){t.add(j(e,"keydown",i=>{if(i.defaultPrevented)return;const n=new Ot(i);if(!(n.keyCode===6&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(n.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add(j(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.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=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add(j(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(j(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(j(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(j(e,"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 Ja.instance||(Ja.instance=new Ja),Ja.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class ZO extends G{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(j(this.element,J.DRAG_START,e=>{var t,i;(i=(t=this.callbacks).onDragStart)===null||i===void 0||i.call(t,e)})),this.callbacks.onDrag&&this._register(j(this.element,J.DRAG,e=>{var t,i;(i=(t=this.callbacks).onDrag)===null||i===void 0||i.call(t,e)})),this._register(j(this.element,J.DRAG_ENTER,e=>{var t,i;this.counter++,this.dragStartTime=e.timeStamp,(i=(t=this.callbacks).onDragEnter)===null||i===void 0||i.call(t,e)})),this._register(j(this.element,J.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)===null||i===void 0||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(j(this.element,J.DRAG_LEAVE,e=>{var t,i;this.counter--,this.counter===0&&(this.dragStartTime=0,(i=(t=this.callbacks).onDragLeave)===null||i===void 0||i.call(t,e))})),this._register(j(this.element,J.DRAG_END,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDragEnd)===null||i===void 0||i.call(t,e)})),this._register(j(this.element,J.DROP,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDrop)===null||i===void 0||i.call(t,e)}))}}const YO=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function dt(s,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const n=YO.exec(s);if(!n||!n.groups)throw new Error("Bad use of h");const o=n.groups.tag||"div",r=document.createElement(o);n.groups.id&&(r.id=n.groups.id);const a=[];if(n.groups.class)for(const c of n.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(r.className=a.join(" "));const l={};if(n.groups.name&&(l[n.groups.name]=r),i)for(const c of i)Vi(c)?r.appendChild(c):typeof c=="string"?r.append(c):"root"in c&&(Object.assign(l,c),r.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[u,h]of Object.entries(d))r.style.setProperty(BD(u),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(BD(c),d.toString());return l.root=r,l}function BD(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class QO extends G{constructor(e){super(),this._onDidChange=this._register(new O),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var i;(i=this._mediaQueryList)===null||i===void 0||i.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class XO extends G{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new O),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new QO(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/n}}class JO{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=t_(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=new XO(e),this.mapWindowIdToPixelRatioMonitor.set(t,i),te.once(IO)(({vscodeWindowId:n})=>{n===t&&(i==null||i.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const s_=new JO;class BT{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=_o(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=_o(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=_o(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=_o(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=_o(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=_o(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=_o(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=_o(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}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){const t=_o(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=_o(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=_o(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}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)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}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 _o(s){return typeof s=="number"?`${s}px`:s}function nt(s){return new BT(s)}function nn(s,e){s instanceof BT?(s.setFontFamily(e.getMassagedFontFamily()),s.setFontWeight(e.fontWeight),s.setFontSize(e.fontSize),s.setFontFeatureSettings(e.fontFeatureSettings),s.setFontVariationSettings(e.fontVariationSettings),s.setLineHeight(e.lineHeight),s.setLetterSpacing(e.letterSpacing)):(s.style.fontFamily=e.getMassagedFontFamily(),s.style.fontWeight=e.fontWeight,s.style.fontSize=e.fontSize+"px",s.style.fontFeatureSettings=e.fontFeatureSettings,s.style.fontVariationSettings=e.fontVariationSettings,s.style.lineHeight=e.lineHeight+"px",s.style.letterSpacing=e.letterSpacing+"px")}class e7{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class ZS{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),e.document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");nn(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");nn(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");nn(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const r of this._requests){let a;r.type===0&&(a=t),r.type===2&&(a=i),r.type===1&&(a=n),a.appendChild(document.createElement("br"));const l=document.createElement("span");ZS._render(l,r),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let n=0;n<8;n++)i+=i;e.innerText=i}else{let i=t.chr;for(let n=0;n<8;n++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let n=!1;for(const o of i)o.isTrusted||(n=!0,t.remove(o));n&&this._onDidChange.fire()}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let n=this._actualReadFontInfo(e,t);(n.typicalHalfwidthCharacterWidth<=2||n.typicalFullwidthCharacterWidth<=2||n.spaceWidth<=2||n.maxDigitWidth<=2)&&(n=new OC({pixelRatio:s_.getInstance(e).value,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontSize:n.fontSize,fontFeatureSettings:n.fontFeatureSettings,fontVariationSettings:n.fontVariationSettings,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,isMonospace:n.isMonospace,typicalHalfwidthCharacterWidth:Math.max(n.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(n.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:n.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(n.spaceWidth,5),middotWidth:Math.max(n.middotWidth,5),wsmiddotWidth:Math.max(n.wsmiddotWidth,5),maxDigitWidth:Math.max(n.maxDigitWidth,5)},!1)),this._writeToCache(e,t,n)}return i.get(t)}_createRequest(e,t,i,n){const o=new e7(e,t);return i.push(o),n==null||n.push(o),o}_actualReadFontInfo(e,t){const i=[],n=[],o=this._createRequest("n",0,i,n),r=this._createRequest("m",0,i,null),a=this._createRequest(" ",0,i,n),l=this._createRequest("0",0,i,n),c=this._createRequest("1",0,i,n),d=this._createRequest("2",0,i,n),u=this._createRequest("3",0,i,n),h=this._createRequest("4",0,i,n),f=this._createRequest("5",0,i,n),g=this._createRequest("6",0,i,n),m=this._createRequest("7",0,i,n),_=this._createRequest("8",0,i,n),v=this._createRequest("9",0,i,n),b=this._createRequest("→",0,i,n),C=this._createRequest("→",0,i,null),w=this._createRequest("·",0,i,n),y=this._createRequest("⸱",0,i,null),L="|/-_ilm%";for(let R=0,A=L.length;R.001){D=!1;break}}let W=!0;return D&&C.width!==N&&(W=!1),C.width>b.width&&(W=!1),new OC({pixelRatio:s_.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:D,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:W,spaceWidth:a.width,middotWidth:w.width,wsmiddotWidth:y.width,maxDigitWidth:k},!0)}}class o7{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])}}const BC=new s7;var No;(function(s){s.serviceIds=new Map,s.DI_TARGET="$di$target",s.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[s.DI_DEPENDENCIES]||[]}s.getServiceDependencies=e})(No||(No={}));const vt=Qe("instantiationService");function r7(s,e,t){e[No.DI_TARGET]===e?e[No.DI_DEPENDENCIES].push({id:s,index:t}):(e[No.DI_DEPENDENCIES]=[{id:s,index:t}],e[No.DI_TARGET]=e)}function Qe(s){if(No.serviceIds.has(s))return No.serviceIds.get(s);const e=function(t,i,n){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");r7(e,t,n)};return e.toString=()=>s,No.serviceIds.set(s,e),e}const gi=Qe("codeEditorService"),ns=Qe("modelService"),Bg=Qe("textModelService");class ma extends G{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new O),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class Rc extends G{constructor(){super(...arguments),this._onWillRun=this._register(new O),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new O),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{await this.runAction(e,t)}catch(n){i=n}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}class qi{constructor(){this.id=qi.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new qi,...i]:t=i);return t}async run(){}}qi.ID="vs.actions.separator";class R0{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}}class P0 extends ma{constructor(){super(P0.ID,p("submenu.empty","(empty)"),void 0,!1)}}P0.ID="vs.actions.empty";function Qd(s){var e,t;return{id:s.id,label:s.label,tooltip:(e=s.tooltip)!==null&&e!==void 0?e:s.label,class:s.class,enabled:(t=s.enabled)!==null&&t!==void 0?t:!0,checked:s.checked,run:async(...i)=>s.run(...i)}}var WC;(function(s){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})(WC||(WC={}));var et;(function(s){s.iconNameSegment="[A-Za-z0-9]+",s.iconNameExpression="[A-Za-z0-9-]+",s.iconModifierExpression="~[A-Za-z]+",s.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${s.iconNameExpression})(${s.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(ce.error);const[,g,m]=f,_=["codicon","codicon-"+g];return m&&_.push("codicon-modifier-"+m.substring(1)),_}s.asClassNameArray=t;function i(h){return t(h).join(" ")}s.asClassName=i;function n(h){return"."+t(h).join(".")}s.asCSSSelector=n;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||WC.isThemeColor(h.color))}s.isThemeIcon=o;const r=new RegExp(`^\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)$`);function a(h){const f=r.exec(h);if(!f)return;const[,g]=f;return{id:g}}s.fromString=a;function l(h){return{id:h}}s.fromId=l;function c(h,f){let g=h.id;const m=g.lastIndexOf("~");return m!==-1&&(g=g.substring(0,m)),f&&(g=`${g}~${f}`),{id:g}}s.modify=c;function d(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}s.getModifier=d;function u(h,f){var g,m;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((m=f.color)===null||m===void 0?void 0:m.id)}s.isEqual=u})(et||(et={}));const Ls=Qe("commandService"),sn=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new O,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(s,e){if(!s)throw new Error("invalid command");if(typeof s=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:s,handler:e})}if(s.metadata&&Array.isArray(s.metadata.args)){const r=[];for(const l of s.metadata.args)r.push(l.constraint);const a=s.handler;s.handler=function(l,...c){return S5(c,r),a(l,...c)}}const{id:t}=s;let i=this._commands.get(t);i||(i=new Qn,this._commands.set(t,i));const n=i.unshift(s),o=Be(()=>{n();const r=this._commands.get(t);r!=null&&r.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(s,e){return sn.registerCommand(s,(t,...i)=>t.get(Ls).executeCommand(e,...i))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return ot.first(e)}getCommands(){const s=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&s.set(e,t)}return s}};sn.registerCommand("noop",()=>{});function ov(...s){switch(s.length){case 1:return p("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",s[0]);case 2:return p("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",s[0],s[1]);case 3:return p("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",s[0],s[1],s[2]);default:return}}const a7=p("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),l7=p("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class lr{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw CS(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(ov("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(ov("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(ov("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=lr._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(a7);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(l7);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!i){e++;break}else o===91?i=!0:o===92?t=!0:o===93&&(i=!1);e++}for(;e=this._input.length}}lr._regexFlags=new Set(["i","g","s","m","y","u"].map(s=>s.charCodeAt(0)));lr._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const on=new Map;on.set("false",!1);on.set("true",!0);on.set("isMac",Ye);on.set("isLinux",Vn);on.set("isWindows",Wn);on.set("isWeb",Yu);on.set("isMacNative",Ye&&!Yu);on.set("isEdge",W5);on.set("isFirefox",O5);on.set("isChrome",WN);on.set("isSafari",B5);const c7=Object.prototype.hasOwnProperty,d7={regexParsingWithErrorRecovery:!0},u7=p("contextkey.parser.error.emptyString","Empty context key expression"),h7=p("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),f7=p("contextkey.parser.error.noInAfterNot","'in' after 'not'."),WD=p("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),g7=p("contextkey.parser.error.unexpectedToken","Unexpected token"),m7=p("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),p7=p("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),_7=p("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let WT=class Fh{constructor(e=d7){this._config=e,this._scanner=new lr,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:u7,offset:0,lexeme:"",additionalInfo:h7});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),n=i.type===17?m7:void 0;throw this._parsingErrors.push({message:g7,offset:i.offset,lexeme:lr.getLexeme(i),additionalInfo:n}),Fh._parseError}return t}catch(t){if(t!==Fh._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:st.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:st.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),En.INSTANCE;case 12:return this._advance(),Hn.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,WD),t==null?void 0:t.negate()}case 17:return this._advance(),Qc.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),st.true();case 12:return this._advance(),st.false();case 0:{this._advance();const t=this._expr();return this._consume(1,WD),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const n=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),n.type!==10)throw this._errExpectedButGot("REGEX",n);const o=n.lexeme,r=o.lastIndexOf("/"),a=r===o.length-1?void 0:this._removeFlagsGY(o.substring(r+1));let l;try{l=new RegExp(o.substring(1,r),a)}catch{throw this._errExpectedButGot("REGEX",n)}return Hf.create(t,l)}switch(n.type){case 10:case 19:{const o=[n.lexeme];this._advance();let r=this._peek(),a=0;for(let h=0;h=0){const c=o.slice(a+1,l),d=o[l+1]==="i"?"i":"";try{r=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",n)}}}if(r===null)throw this._errExpectedButGot("REGEX",n);return Hf.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,f7);const n=this._value();return st.notIn(t,n)}switch(this._peek().type){case 3:{this._advance();const n=this._value();if(this._previous().type===18)return st.equals(t,n);switch(n){case"true":return st.has(t);case"false":return st.not(t);default:return st.equals(t,n)}}case 4:{this._advance();const n=this._value();if(this._previous().type===18)return st.notEquals(t,n);switch(n){case"true":return st.not(t);case"false":return st.has(t);default:return st.notEquals(t,n)}}case 5:return this._advance(),z0.create(t,this._value());case 6:return this._advance(),U0.create(t,this._value());case 7:return this._advance(),V0.create(t,this._value());case 8:return this._advance(),H0.create(t,this._value());case 13:return this._advance(),st.in(t,this._value());default:return st.has(t)}}case 20:throw this._parsingErrors.push({message:p7,offset:e.offset,lexeme:"",additionalInfo:_7}),Fh._parseError;default:throw this._errExpectedButGot(`true | false | KEY | KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=p("contextkey.parser.error.expectedButGot",`Expected: {0} Received: '{1}'.`,e,lr.getLexeme(t)),o=t.offset,r=lr.getLexeme(t);return this._parsingErrors.push({message:n,offset:o,lexeme:r,additionalInfo:i}),Fh._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};WT._parseError=new Error;class st{static false(){return En.INSTANCE}static true(){return Hn.INSTANCE}static has(e){return Yc.create(e)}static equals(e,t){return Wg.create(e,t)}static notEquals(e,t){return B0.create(e,t)}static regex(e,t){return Hf.create(e,t)}static in(e,t){return F0.create(e,t)}static notIn(e,t){return O0.create(e,t)}static not(e){return Qc.create(e)}static and(...e){return uc.create(e,null,!0)}static or(...e){return Qr.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}st._parser=new WT({regexParsingWithErrorRecovery:!1});function v7(s,e){const t=s?s.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function af(s,e){return s.cmp(e)}class En{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 Hn.INSTANCE}}En.INSTANCE=new En;class Hn{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 En.INSTANCE}}Hn.INSTANCE=new Hn;class Yc{static create(e,t=null){const i=on.get(e);return typeof i=="boolean"?i?Hn.INSTANCE:En.INSTANCE:new Yc(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:HT(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=on.get(this.key);return typeof e=="boolean"?e?Hn.INSTANCE:En.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Qc.create(this.key,this)),this.negated}}class Wg{static create(e,t,i=null){if(typeof t=="boolean")return t?Yc.create(e,i):Qc.create(e,i);const n=on.get(e);return typeof n=="boolean"?t===(n?"true":"false")?Hn.INSTANCE:En.INSTANCE:new Wg(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Xc(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=on.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Hn.INSTANCE:En.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=B0.create(this.key,this.value,this)),this.negated}}class F0{static create(e,t){return new F0(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Xc(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.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?c7.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=O0.create(this.key,this.valueKey)),this.negated}}class O0{static create(e,t){return new O0(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=F0.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class B0{static create(e,t,i=null){if(typeof t=="boolean")return t?Qc.create(e,i):Yc.create(e,i);const n=on.get(e);return typeof n=="boolean"?t===(n?"true":"false")?En.INSTANCE:Hn.INSTANCE:new B0(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Xc(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=on.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?En.INSTANCE:Hn.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=Wg.create(this.key,this.value,this)),this.negated}}class Qc{static create(e,t=null){const i=on.get(e);return typeof i=="boolean"?i?En.INSTANCE:Hn.INSTANCE:new Qc(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:HT(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=on.get(this.key);return typeof e=="boolean"?e?En.INSTANCE:Hn.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Yc.create(this.key,this)),this.negated}}function W0(s,e){if(typeof s=="string"){const t=parseFloat(s);isNaN(t)||(s=t)}return typeof s=="string"||typeof s=="number"?e(s):En.INSTANCE}class V0{static create(e,t,i=null){return W0(t,n=>new V0(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Xc(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=U0.create(this.key,this.value,this)),this.negated}}class H0{static create(e,t,i=null){return W0(t,n=>new H0(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Xc(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=z0.create(this.key,this.value,this)),this.negated}}class z0{static create(e,t,i=null){return W0(t,n=>new z0(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Xc(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 U0(e,n,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Xc(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=V0.create(this.key,this.value,this)),this.negated}}class Hf{static create(e,t){return new Hf(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}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){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=YS.create(this)),this.negated}}class YS{static create(e){return new YS(e)}constructor(e){this._actual=e,this.type=8}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(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function VT(s){let e=null;for(let t=0,i=s.length;te.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const r=n[n.length-1];if(r.type!==9)break;n.pop();const a=n.pop(),l=n.length===0,c=Qr.create(r.expr.map(d=>uc.create([d,a],null,i)),null,l);c&&(n.push(c),n.sort(af))}if(n.length===1)return n[0];if(i){for(let r=0;re.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Qr.create(e,this,!0)}return this.negated}}class Qr{static create(e,t,i){return Qr._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}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(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const o of HD(t))for(const r of HD(i))n.push(uc.create([o,r],null,!1));e.unshift(Qr.create(n,null,!1))}this.negated=Qr.create(e,this,!0)}return this.negated}}class me extends Yc{static all(){return me._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?me._info.push({...i,key:e}):i!==!0&&me._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Wg.create(this.key,e)}}me._info=[];const bt=Qe("contextKeyService");function HT(s,e){return se?1:0}function Xc(s,e,t,i){return st?1:ei?1:0}function VC(s,e){if(s.type===0||e.type===1)return!0;if(s.type===9)return e.type===9?VD(s.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(VC(s,t))return!0;return!1}if(s.type===6){if(e.type===6)return VD(e.expr,s.expr);for(const t of s.expr)if(VC(t,e))return!0;return!1}return s.equals(e)}function VD(s,e){let t=0,i=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(w7)),this._cachedMergedKeybindings.slice(0)}}const Fc=new JS,C7={EditorModes:"platform.keybindingsRegistry"};zi.add(C7.EditorModes,Fc);function w7(s,e){if(s.weight1!==e.weight1)return s.weight1-e.weight1;if(s.command&&e.command){if(s.commande.command)return 1}return s.weight2-e.weight2}var y7=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},UD=function(s,e){return function(t,i){e(t,i,s)}},bp;function Oh(s){return s.command!==void 0}function S7(s){return s.submenu!==void 0}class x{constructor(e){if(x._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);x._instances.set(e,this),this.id=e}}x._instances=new Map;x.CommandPalette=new x("CommandPalette");x.DebugBreakpointsContext=new x("DebugBreakpointsContext");x.DebugCallStackContext=new x("DebugCallStackContext");x.DebugConsoleContext=new x("DebugConsoleContext");x.DebugVariablesContext=new x("DebugVariablesContext");x.NotebookVariablesContext=new x("NotebookVariablesContext");x.DebugHoverContext=new x("DebugHoverContext");x.DebugWatchContext=new x("DebugWatchContext");x.DebugToolBar=new x("DebugToolBar");x.DebugToolBarStop=new x("DebugToolBarStop");x.EditorContext=new x("EditorContext");x.SimpleEditorContext=new x("SimpleEditorContext");x.EditorContent=new x("EditorContent");x.EditorLineNumberContext=new x("EditorLineNumberContext");x.EditorContextCopy=new x("EditorContextCopy");x.EditorContextPeek=new x("EditorContextPeek");x.EditorContextShare=new x("EditorContextShare");x.EditorTitle=new x("EditorTitle");x.EditorTitleRun=new x("EditorTitleRun");x.EditorTitleContext=new x("EditorTitleContext");x.EditorTitleContextShare=new x("EditorTitleContextShare");x.EmptyEditorGroup=new x("EmptyEditorGroup");x.EmptyEditorGroupContext=new x("EmptyEditorGroupContext");x.EditorTabsBarContext=new x("EditorTabsBarContext");x.EditorTabsBarShowTabsSubmenu=new x("EditorTabsBarShowTabsSubmenu");x.EditorTabsBarShowTabsZenModeSubmenu=new x("EditorTabsBarShowTabsZenModeSubmenu");x.EditorActionsPositionSubmenu=new x("EditorActionsPositionSubmenu");x.ExplorerContext=new x("ExplorerContext");x.ExplorerContextShare=new x("ExplorerContextShare");x.ExtensionContext=new x("ExtensionContext");x.GlobalActivity=new x("GlobalActivity");x.CommandCenter=new x("CommandCenter");x.CommandCenterCenter=new x("CommandCenterCenter");x.LayoutControlMenuSubmenu=new x("LayoutControlMenuSubmenu");x.LayoutControlMenu=new x("LayoutControlMenu");x.MenubarMainMenu=new x("MenubarMainMenu");x.MenubarAppearanceMenu=new x("MenubarAppearanceMenu");x.MenubarDebugMenu=new x("MenubarDebugMenu");x.MenubarEditMenu=new x("MenubarEditMenu");x.MenubarCopy=new x("MenubarCopy");x.MenubarFileMenu=new x("MenubarFileMenu");x.MenubarGoMenu=new x("MenubarGoMenu");x.MenubarHelpMenu=new x("MenubarHelpMenu");x.MenubarLayoutMenu=new x("MenubarLayoutMenu");x.MenubarNewBreakpointMenu=new x("MenubarNewBreakpointMenu");x.PanelAlignmentMenu=new x("PanelAlignmentMenu");x.PanelPositionMenu=new x("PanelPositionMenu");x.ActivityBarPositionMenu=new x("ActivityBarPositionMenu");x.MenubarPreferencesMenu=new x("MenubarPreferencesMenu");x.MenubarRecentMenu=new x("MenubarRecentMenu");x.MenubarSelectionMenu=new x("MenubarSelectionMenu");x.MenubarShare=new x("MenubarShare");x.MenubarSwitchEditorMenu=new x("MenubarSwitchEditorMenu");x.MenubarSwitchGroupMenu=new x("MenubarSwitchGroupMenu");x.MenubarTerminalMenu=new x("MenubarTerminalMenu");x.MenubarViewMenu=new x("MenubarViewMenu");x.MenubarHomeMenu=new x("MenubarHomeMenu");x.OpenEditorsContext=new x("OpenEditorsContext");x.OpenEditorsContextShare=new x("OpenEditorsContextShare");x.ProblemsPanelContext=new x("ProblemsPanelContext");x.SCMInputBox=new x("SCMInputBox");x.SCMChangesSeparator=new x("SCMChangesSeparator");x.SCMIncomingChanges=new x("SCMIncomingChanges");x.SCMIncomingChangesContext=new x("SCMIncomingChangesContext");x.SCMIncomingChangesSetting=new x("SCMIncomingChangesSetting");x.SCMOutgoingChanges=new x("SCMOutgoingChanges");x.SCMOutgoingChangesContext=new x("SCMOutgoingChangesContext");x.SCMOutgoingChangesSetting=new x("SCMOutgoingChangesSetting");x.SCMIncomingChangesAllChangesContext=new x("SCMIncomingChangesAllChangesContext");x.SCMIncomingChangesHistoryItemContext=new x("SCMIncomingChangesHistoryItemContext");x.SCMOutgoingChangesAllChangesContext=new x("SCMOutgoingChangesAllChangesContext");x.SCMOutgoingChangesHistoryItemContext=new x("SCMOutgoingChangesHistoryItemContext");x.SCMChangeContext=new x("SCMChangeContext");x.SCMResourceContext=new x("SCMResourceContext");x.SCMResourceContextShare=new x("SCMResourceContextShare");x.SCMResourceFolderContext=new x("SCMResourceFolderContext");x.SCMResourceGroupContext=new x("SCMResourceGroupContext");x.SCMSourceControl=new x("SCMSourceControl");x.SCMSourceControlInline=new x("SCMSourceControlInline");x.SCMSourceControlTitle=new x("SCMSourceControlTitle");x.SCMTitle=new x("SCMTitle");x.SearchContext=new x("SearchContext");x.SearchActionMenu=new x("SearchActionContext");x.StatusBarWindowIndicatorMenu=new x("StatusBarWindowIndicatorMenu");x.StatusBarRemoteIndicatorMenu=new x("StatusBarRemoteIndicatorMenu");x.StickyScrollContext=new x("StickyScrollContext");x.TestItem=new x("TestItem");x.TestItemGutter=new x("TestItemGutter");x.TestMessageContext=new x("TestMessageContext");x.TestMessageContent=new x("TestMessageContent");x.TestPeekElement=new x("TestPeekElement");x.TestPeekTitle=new x("TestPeekTitle");x.TouchBarContext=new x("TouchBarContext");x.TitleBarContext=new x("TitleBarContext");x.TitleBarTitleContext=new x("TitleBarTitleContext");x.TunnelContext=new x("TunnelContext");x.TunnelPrivacy=new x("TunnelPrivacy");x.TunnelProtocol=new x("TunnelProtocol");x.TunnelPortInline=new x("TunnelInline");x.TunnelTitle=new x("TunnelTitle");x.TunnelLocalAddressInline=new x("TunnelLocalAddressInline");x.TunnelOriginInline=new x("TunnelOriginInline");x.ViewItemContext=new x("ViewItemContext");x.ViewContainerTitle=new x("ViewContainerTitle");x.ViewContainerTitleContext=new x("ViewContainerTitleContext");x.ViewTitle=new x("ViewTitle");x.ViewTitleContext=new x("ViewTitleContext");x.CommentEditorActions=new x("CommentEditorActions");x.CommentThreadTitle=new x("CommentThreadTitle");x.CommentThreadActions=new x("CommentThreadActions");x.CommentThreadAdditionalActions=new x("CommentThreadAdditionalActions");x.CommentThreadTitleContext=new x("CommentThreadTitleContext");x.CommentThreadCommentContext=new x("CommentThreadCommentContext");x.CommentTitle=new x("CommentTitle");x.CommentActions=new x("CommentActions");x.CommentsViewThreadActions=new x("CommentsViewThreadActions");x.InteractiveToolbar=new x("InteractiveToolbar");x.InteractiveCellTitle=new x("InteractiveCellTitle");x.InteractiveCellDelete=new x("InteractiveCellDelete");x.InteractiveCellExecute=new x("InteractiveCellExecute");x.InteractiveInputExecute=new x("InteractiveInputExecute");x.IssueReporter=new x("IssueReporter");x.NotebookToolbar=new x("NotebookToolbar");x.NotebookStickyScrollContext=new x("NotebookStickyScrollContext");x.NotebookCellTitle=new x("NotebookCellTitle");x.NotebookCellDelete=new x("NotebookCellDelete");x.NotebookCellInsert=new x("NotebookCellInsert");x.NotebookCellBetween=new x("NotebookCellBetween");x.NotebookCellListTop=new x("NotebookCellTop");x.NotebookCellExecute=new x("NotebookCellExecute");x.NotebookCellExecuteGoTo=new x("NotebookCellExecuteGoTo");x.NotebookCellExecutePrimary=new x("NotebookCellExecutePrimary");x.NotebookDiffCellInputTitle=new x("NotebookDiffCellInputTitle");x.NotebookDiffCellMetadataTitle=new x("NotebookDiffCellMetadataTitle");x.NotebookDiffCellOutputsTitle=new x("NotebookDiffCellOutputsTitle");x.NotebookOutputToolbar=new x("NotebookOutputToolbar");x.NotebookOutlineFilter=new x("NotebookOutlineFilter");x.NotebookOutlineActionMenu=new x("NotebookOutlineActionMenu");x.NotebookEditorLayoutConfigure=new x("NotebookEditorLayoutConfigure");x.NotebookKernelSource=new x("NotebookKernelSource");x.BulkEditTitle=new x("BulkEditTitle");x.BulkEditContext=new x("BulkEditContext");x.TimelineItemContext=new x("TimelineItemContext");x.TimelineTitle=new x("TimelineTitle");x.TimelineTitleContext=new x("TimelineTitleContext");x.TimelineFilterSubMenu=new x("TimelineFilterSubMenu");x.AccountsContext=new x("AccountsContext");x.SidebarTitle=new x("SidebarTitle");x.PanelTitle=new x("PanelTitle");x.AuxiliaryBarTitle=new x("AuxiliaryBarTitle");x.AuxiliaryBarHeader=new x("AuxiliaryBarHeader");x.TerminalInstanceContext=new x("TerminalInstanceContext");x.TerminalEditorInstanceContext=new x("TerminalEditorInstanceContext");x.TerminalNewDropdownContext=new x("TerminalNewDropdownContext");x.TerminalTabContext=new x("TerminalTabContext");x.TerminalTabEmptyAreaContext=new x("TerminalTabEmptyAreaContext");x.TerminalStickyScrollContext=new x("TerminalStickyScrollContext");x.WebviewContext=new x("WebviewContext");x.InlineCompletionsActions=new x("InlineCompletionsActions");x.InlineEditActions=new x("InlineEditActions");x.NewFile=new x("NewFile");x.MergeInput1Toolbar=new x("MergeToolbar1Toolbar");x.MergeInput2Toolbar=new x("MergeToolbar2Toolbar");x.MergeBaseToolbar=new x("MergeBaseToolbar");x.MergeInputResultToolbar=new x("MergeToolbarResultToolbar");x.InlineSuggestionToolbar=new x("InlineSuggestionToolbar");x.InlineEditToolbar=new x("InlineEditToolbar");x.ChatContext=new x("ChatContext");x.ChatCodeBlock=new x("ChatCodeblock");x.ChatCompareBlock=new x("ChatCompareBlock");x.ChatMessageTitle=new x("ChatMessageTitle");x.ChatExecute=new x("ChatExecute");x.ChatExecuteSecondary=new x("ChatExecuteSecondary");x.ChatInputSide=new x("ChatInputSide");x.AccessibleView=new x("AccessibleView");x.MultiDiffEditorFileToolbar=new x("MultiDiffEditorFileToolbar");x.DiffEditorHunkToolbar=new x("DiffEditorHunkToolbar");x.DiffEditorSelectionToolbar=new x("DiffEditorSelectionToolbar");const Jc=Qe("menuService");class Xr{static for(e){let t=this._all.get(e);return t||(t=new Xr(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Xr&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}Xr._all=new Map;const fr=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new $P({merge:Xr.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(s){return this._commands.set(s.id,s),this._onDidChangeMenu.fire(Xr.for(x.CommandPalette)),Be(()=>{this._commands.delete(s.id)&&this._onDidChangeMenu.fire(Xr.for(x.CommandPalette))})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((e,t)=>s.set(t,e)),s}appendMenuItem(s,e){let t=this._menuItems.get(s);t||(t=new Qn,this._menuItems.set(s,t));const i=t.push(e);return this._onDidChangeMenu.fire(Xr.for(s)),Be(()=>{i(),this._onDidChangeMenu.fire(Xr.for(s))})}appendMenuItems(s){const e=new pe;for(const{id:t,item:i}of s)e.add(this.appendMenuItem(t,i));return e}getMenuItems(s){let e;return this._menuItems.has(s)?e=[...this._menuItems.get(s)]:e=[],s===x.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(s){const e=new Set;for(const t of s)Oh(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||s.push({command:t})})}};class lf extends R0{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let pa=bp=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,n,o,r,a){var l,c;this.hideActions=n,this.menuKeybinding=o,this._commandService=a,this.id=e.id,this.label=bp.label(e,i),this.tooltip=(c=typeof e.tooltip=="string"?e.tooltip:(l=e.tooltip)===null||l===void 0?void 0:l.value)!==null&&c!==void 0?c:"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0;let d;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&et.isThemeIcon(u.icon)&&(d=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}d||(d=et.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new bp(t,void 0,i,n,void 0,r,a):void 0,this._options=i,this.class=d&&et.asClassName(d)}run(...e){var t,i;let n=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(n=[...n,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};pa=bp=y7([UD(5,bt),UD(6,Ls)],pa);class L7{constructor(e){this.desc=e}}function Vte(s){const e=[],t=new s,{f1:i,menu:n,keybinding:o,...r}=t.desc;if(sn.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(e.push(sn.registerCommand({id:r.id,handler:(a,...l)=>t.run(a,...l),metadata:r.metadata})),Array.isArray(n))for(const a of n)e.push(fr.appendMenuItem(a.id,{command:{...r,precondition:a.precondition===null?void 0:r.precondition},...a}));else n&&e.push(fr.appendMenuItem(n.id,{command:{...r,precondition:n.precondition===null?void 0:r.precondition},...n}));if(i&&(e.push(fr.appendMenuItem(x.CommandPalette,{command:r,when:r.precondition})),e.push(fr.addCommand(r))),Array.isArray(o))for(const a of o)e.push(Fc.registerKeybindingRule({...a,id:r.id,when:r.precondition?st.and(r.precondition,a.when):a.when}));else o&&e.push(Fc.registerKeybindingRule({...o,id:r.id,when:r.precondition?st.and(r.precondition,o.when):o.when}));return{dispose(){Hi(e)}}}const Rl=Qe("telemetryService"),uo=Qe("logService");var ji;(function(s){s[s.Off=0]="Off",s[s.Trace=1]="Trace",s[s.Debug=2]="Debug",s[s.Info=3]="Info",s[s.Warning=4]="Warning",s[s.Error=5]="Error"})(ji||(ji={}));const zT=ji.Info;class UT extends G{constructor(){super(...arguments),this.level=zT,this._onDidChangeLogLevel=this._register(new O),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==ji.Off&&this.level<=e}}class k7 extends UT{constructor(e=zT,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(ji.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(ji.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(ji.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(ji.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(ji.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class D7 extends UT{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}function x7(s){switch(s){case ji.Trace:return"trace";case ji.Debug:return"debug";case ji.Info:return"info";case ji.Warning:return"warn";case ji.Error:return"error";case ji.Off:return"off"}}new me("logLevel",x7(ji.Info));class $0{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}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=st.and(i,this.precondition):i=this.precondition);const n={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};Fc.registerKeybindingRule(n)}}sn.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){fr.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 eL extends $0{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(bt).contextMatchesRules(i??void 0))return n(a,r,t)})}runCommand(e,t){return Sl.runEditorCommand(e,t,this.precondition,(i,n,o)=>this.runEditorCommand(i,n,o))}}class tL extends Sl{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(n){return n.menuId||(n.menuId=x.EditorContext),n.title||(n.title=e.label),n.when=st.and(e.precondition,n.when),n}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(tL.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(Rl).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class zte extends tL{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,n)=>n[0]-i[0]),{dispose:()=>{for(let i=0;i{var r,a;const l=o.get(bt),c=o.get(uo);if(!l.contextMatchesRules((r=this.desc.precondition)!==null&&r!==void 0?r:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,n,...t)})}}function $te(s,e){sn.registerCommand(s,function(t,...i){const n=t.get(vt),[o,r]=i;vr($e.isUri(o)),vr(V.isIPosition(r));const a=t.get(ns).getModel(o);if(a){const l=V.lift(r);return n.invokeFunction(e,a,l,...i.slice(2))}return t.get(Bg).createModelReference(o).then(l=>new Promise((c,d)=>{try{const u=n.invokeFunction(e,l.object.textEditorModel,V.lift(r),i.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function Fe(s){return As.INSTANCE.registerEditorCommand(s),s}function Kte(s){const e=new s;return As.INSTANCE.registerEditorAction(e),e}function jte(s){return As.INSTANCE.registerEditorAction(s),s}function qte(s){As.INSTANCE.registerEditorAction(s)}function KT(s,e,t){As.INSTANCE.registerEditorContribution(s,e,t)}var Xd;(function(s){function e(r){return As.INSTANCE.getEditorCommand(r)}s.getEditorCommand=e;function t(){return As.INSTANCE.getEditorActions()}s.getEditorActions=t;function i(){return As.INSTANCE.getEditorContributions()}s.getEditorContributions=i;function n(r){return As.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}s.getSomeEditorContributions=n;function o(){return As.INSTANCE.getDiffEditorContributions()}s.getDiffEditorContributions=o})(Xd||(Xd={}));const E7={EditorCommonContributions:"editor.contributions"};class As{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}As.INSTANCE=new As;zi.add(E7.EditorCommonContributions,As.INSTANCE);function Vg(s){return s.register(),s}const jT=Vg(new eL({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:x.MenubarEditMenu,group:"1_do",title:p({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:x.CommandPalette,group:"",title:p("undo","Undo"),order:1}]}));Vg(new $T(jT,{id:"default:undo",precondition:void 0}));const qT=Vg(new eL({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:x.MenubarEditMenu,group:"1_do",title:p({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:x.CommandPalette,group:"",title:p("redo","Redo"),order:1}]}));Vg(new $T(qT,{id:"default:redo",precondition:void 0}));const I7=Vg(new eL({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:x.MenubarSelectionMenu,group:"1_basic",title:p({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:x.CommandPalette,group:"",title:p("selectAll","Select All"),order:1}]})),N7="$initialize";let $D=!1;function HC(s){Yu&&($D||($D=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(s.message))}class T7{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class KD{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class A7{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class M7{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class R7{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class P7{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send(new T7(this._workerId,i,e,t))})}listen(e,t){let i=null;const n=new O({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new A7(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new R7(this._workerId,i)),i=null}});return n.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(n=>{this._send(new KD(this._workerId,t,n,void 0))},n=>{n.detail instanceof Error&&(n.detail=sD(n.detail)),this._send(new KD(this._workerId,t,void 0,sD(n)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(n=>{this._send(new M7(this._workerId,t,n))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i{this._protocol.handleMessage(d)},d=>{n==null||n(d)})),this._protocol=new P7({sendMessage:(d,u)=>{this._worker.postMessage(d,u)},handleMessage:(d,u)=>{if(typeof i[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(i[d].apply(i,u))}catch(h){return Promise.reject(h)}},handleEvent:(d,u)=>{if(ZT(d)){const h=i[d].call(i,u);if(typeof h!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return h}if(GT(d)){const h=i[d];if(typeof h!="function")throw new Error(`Missing event ${d} on main thread host.`);return h}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const r=globalThis.require;typeof r<"u"&&typeof r.getConfig=="function"?o=r.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=gS(i);this._onModuleLoaded=this._protocol.sendMessage(N7,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(d,u)=>this._request(d,u),c=(d,u)=>this._protocol.listen(d,u);this._lazyProxy=new Promise((d,u)=>{n=u,this._onModuleLoaded.then(h=>{d(O7(h,l,c))},h=>{u(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,n)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,n)},n)})}_onError(e,t){console.error(e),console.info(t)}}function GT(s){return s[0]==="o"&&s[1]==="n"&&za(s.charCodeAt(2))}function ZT(s){return/^onDynamic/.test(s)&&za(s.charCodeAt(9))}function O7(s,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},n=r=>function(a){return t(r,a)},o={};for(const r of s){if(ZT(r)){o[r]=n(r);continue}if(GT(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function ed(s,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(s,e)}catch(n){At(n);return}try{return(t=wt.trustedTypes)===null||t===void 0?void 0:t.createPolicy(s,e)}catch(n){At(n);return}}const jD=ed("defaultWorkerFactory",{createScriptURL:s=>s});function B7(s){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",s);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",s);return new Worker(jD?jD.createScriptURL(t):t,{name:s})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function W7(s){return typeof s.then=="function"}class V7 extends G{constructor(e,t,i,n,o){super(),this.id=t,this.label=i;const r=B7(i);W7(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){n(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)}),this._register(Be(()=>{var a;(a=this.worker)===null||a===void 0||a.then(l=>{l.onmessage=null,l.onmessageerror=null,l.removeEventListener("error",o),l.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)===null||i===void 0||i.then(n=>{try{n.postMessage(e,t)}catch(o){At(o),At(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}}class K0{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++K0.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new V7(e,n,this._label||"anonymous"+n,t,o=>{HC(o),this._webWorkerFailedBeforeError=o,i(o)})}}K0.LAST_WORKER_ID=0;var xi;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(xi||(xi={}));class av{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;tnew av(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new av({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new av({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Du.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Du.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}Du.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> `;Du.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> `;function hc(s,e){const t=s.getCount(),i=s.findTokenIndexAtOffset(e),n=s.getLanguageId(i);let o=i;for(;o+10&&s.getLanguageId(r-1)===n;)r--;return new z7(s,n,r,o+1,s.getStartOffset(r),s.getEndOffset(o))}class z7{constructor(e,t,i,n,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}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)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function Jo(s){return(s&3)!==0}const qD=typeof Buffer<"u";let lv;class iL{static wrap(e){return qD&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new iL(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return qD?this.buffer.toString():(lv||(lv=new TextDecoder),lv.decode(this.buffer))}}function U7(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0}function $7(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function yo(s,e){return s[e]*2**24+s[e+1]*2**16+s[e+2]*2**8+s[e+3]}function So(s,e,t){s[t+3]=e,e=e>>>8,s[t+2]=e,e=e>>>8,s[t+1]=e,e=e>>>8,s[t]=e}function GD(s,e){return s[e]}function ZD(s,e,t){s[t]=e}let cv;function YT(){return cv||(cv=new TextDecoder("UTF-16LE")),cv}let dv;function K7(){return dv||(dv=new TextDecoder("UTF-16BE")),dv}let uv;function QT(){return uv||(uv=F5()?YT():K7()),uv}function j7(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?q7(s,e,t):YT().decode(i)}function q7(s,e,t){const i=[];let n=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[l,c]=r,[d,u]=a;return l===d||l===u||c===d||c===u},n=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d0&&o.push({open:a,close:l})}return o}class Z7{constructor(e,t){this._richEditBracketsBrand=void 0;const i=G7(t);this.brackets=i.map((n,o)=>new o_(e,o,n.open,n.close,Y7(n.open,n.close,i,o),Q7(n.open,n.close,i,o))),this.forwardRegex=X7(this.brackets),this.reversedRegex=J7(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const o of n.open)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of n.close)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function XT(s,e,t,i){for(let n=0,o=e.length;n=0&&i.push(a);for(const a of r.close)a.indexOf(s)>=0&&i.push(a)}}function JT(s,e){return s.length-e.length}function q0(s){if(s.length<=1)return s;const e=[],t=new Set;for(const i of s)t.has(i)||(e.push(i),t.add(i));return e}function Y7(s,e,t,i){let n=[];n=n.concat(s),n=n.concat(e);for(let o=0,r=n.length;o=0;r--)n[o++]=i.charCodeAt(r);return QT().decode(n)}let e=null,t=null;return function(n){return e!==n&&(e=n,t=s(e)),t}}();class Ys{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,l=n+r;return new M(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,n,o){const a=nL(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,a,n)}static findNextBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const l=n+r;return new M(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,n,o){const r=i.substring(n,o);return this.findNextBracketInText(e,t,r,n)}}class t9{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const n=i.charAt(i.length-1);e.push(n)}return Nc(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const n=t.findTokenIndexAtOffset(i-1);if(Jo(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=Ys.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const l=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}function ym(s){return s.global&&(s.lastIndex=0),!0}class i9{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&ym(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&ym(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&ym(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&ym(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 Id{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=Id._createOpenBracketRegExp(t[0]),n=Id._createCloseBracketRegExp(t[1]);i&&n&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:n})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let o=0,r=this._regExpRules.length;oc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&n.length>0)for(let o=0,r=this._brackets.length;o=2&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function s9(s){return s.replace(/[\[\]]/g,"")}const Mi=Qe("languageService");class or{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const iA=[];function rt(s,e,t){e instanceof or||(e=new or(e,[],!!t)),iA.push([s,e])}function QD(){return iA}const Jr=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),G0={JSONContribution:"base.contributions.json"};function o9(s){return s.length>0&&s.charAt(s.length-1)==="#"?s.substring(0,s.length-1):s}class r9{constructor(){this._onDidChangeSchema=new O,this.schemasById={}}registerSchema(e,t){this.schemasById[o9(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const a9=new r9;zi.add(G0.JSONContribution,a9);const td={Configuration:"base.contributions.configuration"},mh="vscode://schemas/settings/resourceLanguage",XD=zi.as(G0.JSONContribution);class l9{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new O,this._onDidUpdateConfiguration=new O,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:p("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},XD.registerSchema(mh,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),XD.registerSchema(mh,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const n=[];for(const{overrides:o,source:r}of e)for(const a in o)if(t.add(a),Ll.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(i=l==null?void 0:l.valuesSources)!==null&&i!==void 0?i:new Map;if(r)for(const f of Object.keys(o[a]))c.set(f,r);const d={...(l==null?void 0:l.value)||{},...o[a]};this.configurationDefaultsOverrides.set(a,{source:r,value:d,valuesSources:c});const u=s9(a),h={type:"object",default:d,description:p("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:mh,defaultDefaultValue:d,source:Jn(r)?void 0:r,defaultValueSource:r};n.push(...r_(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:r});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(n)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(n=>{this.validateAndRegisterProperties(n,t,n.extensionInfo,n.restrictedProperties,void 0,i),this.configurationContributors.push(n),this.registerJSONConfiguration(n)})}validateAndRegisterProperties(e,t=!0,i,n,o=3,r){var a;o=gs(e.scope)?o:e.scope;const l=e.properties;if(l)for(const d in l){const u=l[d];if(t&&u9(d,u)){delete l[d];continue}if(u.source=i,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),Ll.test(d)?u.scope=void 0:(u.scope=gs(u.scope)?o:u.scope,u.restricted=gs(u.restricted)?!!(n!=null&&n.includes(d)):u.restricted),l[d].hasOwnProperty("included")&&!l[d].included){this.excludedConfigurationProperties[d]=l[d],delete l[d];continue}else this.configurationProperties[d]=l[d],!((a=l[d].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[d].policy.name,d);!l[d].deprecationMessage&&l[d].markdownDeprecationMessage&&(l[d].deprecationMessage=l[d].markdownDeprecationMessage),r.add(d)}const c=e.allOf;if(c)for(const d of c)this.validateAndRegisterProperties(d,t,i,n,o,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const n=i.properties;if(n)for(const r in n)this.updateSchema(r,n[r]);const o=i.allOf;o==null||o.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:p("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:p("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:mh};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){p("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),p("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let n=i==null?void 0:i.value,o=i==null?void 0:i.source;To(n)&&(n=t.defaultDefaultValue,o=void 0),To(n)&&(n=d9(t.type)),t.default=n,t.defaultValueSource=o}}const nA="\\[([^\\]]+)\\]",JD=new RegExp(nA,"g"),c9=`^(${nA})+$`,Ll=new RegExp(c9);function r_(s){const e=[];if(Ll.test(s)){let t=JD.exec(s);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=JD.exec(s)}}return Nc(e)}function d9(s){switch(Array.isArray(s)?s[0]:s){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const Cp=new l9;zi.add(td.Configuration,Cp);function u9(s,e){var t,i,n,o;return s.trim()?Ll.test(s)?p("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",s):Cp.getConfigurationProperties()[s]!==void 0?p("config.property.duplicate","Cannot register '{0}'. This property is already registered.",s):!((t=e.policy)===null||t===void 0)&&t.name&&Cp.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?p("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",s,(n=e.policy)===null||n===void 0?void 0:n.name,Cp.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:p("config.property.empty","Cannot register an empty property")}const h9={ModesRegistry:"editor.modesRegistry"};class f9{constructor(){this._onDidChangeLanguages=new O,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const l=new Set;return{info:new p9(this,a,l),closing:l}}),o=new CD(a=>{const l=new Set,c=new Set;return{info:new _9(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=n.get(a),d=o.get(l);c.closing.add(d.info),d.opening.add(c.info)}const r=t.colorizedBracketPairs?ex(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of r){const c=n.get(a),d=o.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...n.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return Hg(t,e)}}function ex(s){return s.filter(([e,t])=>e!==""&&t!=="")}class sA{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class p9 extends sA{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class _9 extends sA{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var v9=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},tx=function(s,e){return function(t,i){e(t,i,s)}};class hv{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const Nr=Qe("languageConfigurationService");let UC=class extends G{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new y9),this.onDidChangeEmitter=this._register(new O),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values($C));this._register(this.configurationService.onDidChangeConfiguration(n=>{const o=n.change.keys.some(a=>i.has(a)),r=n.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new hv(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new hv(a)))})),this._register(this._registry.onDidChange(n=>{this.configurations.delete(n.languageId),this.onDidChangeEmitter.fire(new hv(n.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=b9(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};UC=v9([tx(0,Xt),tx(1,Mi)],UC);function b9(s,e,t,i){let n=e.getLanguageConfiguration(s);if(!n){if(!i.isRegisteredLanguageId(s))return new Jd(s,{});n=new Jd(s,{})}const o=C9(n.languageId,t),r=rA([n.underlyingConfig,o]);return new Jd(n.languageId,r)}const $C={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function C9(s,e){const t=e.getValue($C.brackets,{overrideIdentifier:s}),i=e.getValue($C.colorizedBracketPairs,{overrideIdentifier:s});return{brackets:ix(t),colorizedBracketPairs:ix(i)}}function ix(s){if(Array.isArray(s))return s.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function oA(s,e,t){const i=s.getLineContent(e);let n=gn(i);return n.length>t-1&&(n=n.substring(0,t-1)),n}class w9{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new nx(e,t,++this._order);return this._entries.push(i),this._resolved=null,Be(()=>{for(let n=0;ne.configuration)))}}function rA(s){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 s)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 nx{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 sx{constructor(e){this.languageId=e}}class y9 extends G{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new O),this.onDidChange=this._onDidChange.event,this._register(this.register(ro,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new w9(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new sx(e)),Be(()=>{o.dispose(),this._onDidChange.fire(new sx(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class Jd{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 Id(this.underlyingConfig):null,this.comments=Jd._handleComments(this.underlyingConfig),this.characterPair=new Du(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||_S,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new i9(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new m9(e,this.underlyingConfig)}getWordDefinition(){return vS(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new Z7(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new t9(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new H7(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[n,o]=t.blockComment;i.blockCommentStartToken=n,i.blockCommentEndToken=o}return i}}rt(Nr,UC,1);class Pa{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class ox{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new Pa(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 ea{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,o,r]=ea._getElements(e),[a,l,c]=ea._getElements(t);this._hasStrings=r&&c,this._originalStringElements=n,this._originalElementsOrHash=o,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(ea._isStringArray(t)){const i=new Int32Array(t.length);for(let n=0,o=t.length;n=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let u;return i<=n?(hd.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new Pa(e,0,i,n-i+1)]):e<=t?(hd.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),u=[new Pa(e,t-e+1,i,0)]):(hd.Assert(e===t+1,"originalStart should only be one more than originalEnd"),hd.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,n,r,a,o),c=r[0],d=a[0];if(l!==null)return l;if(!o[0]){const u=this.ComputeDiffRecursive(e,c,i,d,o);let h=[];return o[0]?h=[new Pa(c+1,t-(c+1)+1,d+1,n-(d+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,d+1,n,o),this.ConcatenateChanges(u,h)}return[new Pa(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,r,a,l,c,d,u,h,f,g,m,_,v,b){let C=null,w=null,y=new rx,L=t,k=i,D=f[0]-_[0]-n,N=-1073741824,W=this.m_forwardHistory.length-1;do{const R=D+e;R===L||R=0&&(c=this.m_forwardHistory[W],e=c[0],L=1,k=c.length-1)}while(--W>=-1);if(C=y.getReverseChanges(),b[0]){let R=f[0]+1,A=_[0]+1;if(C!==null&&C.length>0){const P=C[C.length-1];R=Math.max(R,P.getOriginalEnd()),A=Math.max(A,P.getModifiedEnd())}w=[new Pa(R,h-R+1,A,m-A+1)]}else{y=new rx,L=r,k=a,D=f[0]-_[0]-l,N=1073741824,W=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const R=D+o;R===L||R=d[R+1]?(u=d[R+1]-1,g=u-D-l,u>N&&y.MarkNextChange(),N=u+1,y.AddOriginalElement(u+1,g+1),D=R+1-o):(u=d[R-1],g=u-D-l,u>N&&y.MarkNextChange(),N=u,y.AddModifiedElement(u+1,g+1),D=R-1-o),W>=0&&(d=this.m_reverseHistory[W],o=d[0],L=1,k=d.length-1)}while(--W>=-1);w=y.getChanges()}return this.ConcatenateChanges(C,w)}ComputeRecursionPoint(e,t,i,n,o,r,a){let l=0,c=0,d=0,u=0,h=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),m=g+1,_=new Int32Array(m),v=new Int32Array(m),b=n-i,C=t-e,w=e-i,y=t-n,k=(C-b)%2===0;_[b]=e,v[C]=t,a[0]=!1;for(let D=1;D<=g/2+1;D++){let N=0,W=0;d=this.ClipDiagonalBound(b-D,D,b,m),u=this.ClipDiagonalBound(b+D,D,b,m);for(let A=d;A<=u;A+=2){A===d||AN+W&&(N=l,W=c),!k&&Math.abs(A-C)<=D-1&&l>=v[A])return o[0]=l,r[0]=c,P<=v[A]&&D<=1448?this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,n,r,k,a):null}const R=(N-e+(W-i)-D)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(N,R))return a[0]=!0,o[0]=N,r[0]=W,R>0&&D<=1448?this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,n,r,k,a):(e++,i++,[new Pa(e,t-e+1,i,n-i+1)]);h=this.ClipDiagonalBound(C-D,D,C,m),f=this.ClipDiagonalBound(C+D,D,C,m);for(let A=h;A<=f;A+=2){A===h||A=v[A+1]?l=v[A+1]-1:l=v[A-1],c=l-(A-C)-y;const P=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(v[A]=l,k&&Math.abs(A-b)<=D&&l<=_[A])return o[0]=l,r[0]=c,P>=_[A]&&D<=1448?this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,n,r,k,a):null}if(D<=1447){let A=new Int32Array(u-d+2);A[0]=b-d+1,fd.Copy2(_,d,A,1,u-d+1),this.m_forwardHistory.push(A),A=new Int32Array(f-h+2),A[0]=C-h+1,fd.Copy2(v,h,A,1,f-h+1),this.m_reverseHistory.push(A)}}return this.WALKTRACE(b,d,u,w,C,h,f,y,_,v,l,t,o,c,n,r,k,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,o=0;if(t>0){const u=e[t-1];n=u.originalStart+u.originalLength,o=u.modifiedStart+u.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let u=1;;u++){const h=i.originalStart-u,f=i.modifiedStart-u;if(hc&&(c=m,l=u)}i.originalStart-=l,i.modifiedStart-=l;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>l&&(l=f,c=u,d=h)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o=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,n){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,n)?1:0;return o+r}ConcatenateChanges(e,t){const 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 n=new Array(e.length+t.length-1);return fd.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],fd.Copy(t,1,n,e.length,t.length-1),n}else{const n=new Array(e.length+t.length);return fd.Copy(e,0,n,0,e.length),fd.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,i){if(hd.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),hd.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 n=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Pa(n,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e255?255:s|0}function gd(s){return s<0?0:s>4294967295?4294967295:s|0}class L9{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=gd(e);const i=this.values,n=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=gd(e),t=gd(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),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(n.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=gd(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,n=0,o=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],r=o-this.values[n],e=o)t=n+1;else break;return new aA(n,e-r)}}class k9{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new aA(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=k0(this._values,e,t),this._invalidate(e)}_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._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=n+i;for(let o=0;o=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}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class Zte{constructor(){this._actual=new eh(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class x9{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const n=new x9(i,t,0);for(let o=0,r=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let fv=null;function I9(){return fv===null&&(fv=new E9([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),fv}let ph=null;function N9(){if(ph===null){ph=new eh(0);const s=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;tn);if(n>0){const a=t.charCodeAt(n-1),l=t.charCodeAt(r);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&r--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:r+2},url:t.substring(n,r+1)}}static computeLinks(e,t=I9()){const i=N9(),n=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),l=a.length;let c=0,d=0,u=0,h=1,f=!1,g=!1,m=!1,_=!1;for(;c=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}KC.INSTANCE=new KC;var ax,lx;class A9{constructor(e,t){this.uri=e,this.value=t}}function M9(s){return Array.isArray(s)}class pn{constructor(e,t){if(this[ax]="ResourceMap",e instanceof pn)this.map=new Map(e.map),this.toKey=t??pn.defaultToKey;else if(M9(e)){this.map=new Map,this.toKey=t??pn.defaultToKey;for(const[i,n]of e)this.set(i,n)}else this.map=new Map,this.toKey=e??pn.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new A9(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(const[i,n]of this.map)e(n.value,n.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(ax=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}pn.defaultToKey=s=>s.toString();class R9{constructor(){this[lx]="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 n=this._map.get(e);if(n)n.value=t,i!==0&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(n);break;case 1:this.addItemFirst(n);break;case 2:this.addItemLast(n);break;default:this.addItemLast(n);break}this._map.set(e,n),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 n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator](){return n},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return n}[(lx=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++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.previous,i--;this._tail=t,this._size=i,t&&(t.next=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,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(i.previous=n,n.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,n=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=n,n.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 P9 extends R9{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.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}let zg=class extends P9{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}};class F9{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class lA{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class O9 extends eh{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,n=e.length;it)break;i=n}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;let t=null;try{t=oT(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 W9(t,this.wordSeparators?Eu(this.wordSeparators,[]):null,i?this.searchString:null)}}function U9(s){if(!s||s.length===0)return!1;for(let e=0,t=s.length;e=t)break;const n=s.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function ec(s,e,t){if(!t)return new zf(s,null);const i=[];for(let n=0,o=e.length;n>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class Sm{static findMatches(e,t,i,n,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Nd(r.wordSeparators,r.regex),n,o):this._doFindMatchesLineByLine(e,i,r,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(n){const f=n.findLineFeedCountBeforeOffset(o+r.length)-l;c=a+r.length+f}else c=a+r.length;const d=e.getPositionAt(a),u=e.getPositionAt(c);return new M(d.lineNumber,d.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,i,n,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r `?new dx(a):null,c=[];let d=0,u;for(i.reset(0);u=i.next(a);)if(c[d++]=ec(this._getMultilineMatchRange(e,r,a,l,u.index,u[0]),u,n),d>=o)return c;return c}static _doFindMatchesLineByLine(e,t,i,n,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,o),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,o);for(let c=t.startLineNumber+1;c=l))return o;return o}const d=new Nd(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(r[o++]=ec(new M(i,u.index+1+n,i,u.index+1+u[0].length+n),u,a),o>=l))return o;while(u);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new Nd(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new V(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new M(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r `?new dx(l):null;i.reset(t.column-1);const d=i.next(l);return d?ec(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new V(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let c=1;c<=o;c++){const d=(r+c-1)%o,u=e.getLineContent(d+1),h=this._findFirstMatchInLine(i,u,d+1,1,n);if(h)return h}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const r=e.next(t);return r?ec(new M(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new Nd(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new M(1,1,t.lineNumber,t.column),i,n,10*z9);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new V(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,n);if(l)return l;for(let c=1;c<=o;c++){const d=(o+r-c-1)%o,u=e.getLineContent(d+1),h=this._findLastMatchInLine(i,u,d+1,n);if(h)return h}return null}static _findLastMatchInLine(e,t,i,n){let o=null,r;for(e.reset(0);r=e.next(t);)o=ec(new M(i,r.index+1,i,r.index+1+r[0].length),r,n);return o}}function $9(s,e,t,i,n){if(i===0)return!0;const o=e.charCodeAt(i-1);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i);if(s.get(r)!==0)return!0}return!1}function K9(s,e,t,i,n){if(i+n===t)return!0;const o=e.charCodeAt(i+n);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(s.get(r)!==0)return!0}return!1}function sL(s,e,t,i,n){return $9(s,e,t,i,n)&&K9(s,e,t,i,n)}class Nd{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 n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){Jp(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||sL(this._wordSeparators,e,t,n,o))return i}while(i);return null}}class j9{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new ux(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${q9(Array.from(a))}`,"g");const c=new Nd(null,l),d=[];let u=!1,h,f=0,g=0,m=0;e:for(let _=n,v=o;_<=v;_++){const b=e.getLineContent(_),C=b.length;c.reset(0);do if(h=c.next(b),h){let w=h.index,y=h.index+h[0].length;if(w>0){const N=b.charCodeAt(w-1);Di(N)&&w--}if(y+1=1e3){u=!0;break e}d.push(new M(_,w+1,_,y+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new ux(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=Tc.getLocales().filter(l=>!Tc.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function q9(s,e){return`[${wa(s.map(i=>String.fromCodePoint(i)).join(""))}]`}class ux{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Tc.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of gl.codePoints)hx(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),l=AS(r);n=n||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!gl.isInvisibleCharacter(a)&&(o=!0)}return!n&&o?0:this.options.invisibleCharacters&&!hx(e)&&gl.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function hx(s){return s===" "||s===` `||s===" "}class yp{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class cA{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Re{static addRange(e,t){let i=0;for(;it))return new Re(e,t)}static ofLength(e){return new Re(0,e)}static ofStartAndLength(e,t){return new Re(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Dt(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Re(this.start+e,this.endExclusive+e)}deltaStart(e){return new Re(this.start+e,this.endExclusive)}deltaEnd(e){return new Re(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Dt(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Dt(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function d_(s,e){const t=G9(s,e);if(t!==-1)return s[t]}function G9(s,e,t=s.length-1){for(let i=t;i>=0;i--){const n=s[i];if(e(n))return i}return-1}function Nu(s,e){const t=Uf(s,e);return t===-1?void 0:s[t]}function Uf(s,e,t=0,i=s.length){let n=t,o=i;for(;n0&&(t=n)}return t}function Y9(s,e){if(s.length===0)return;let t=s[0];for(let i=1;i=0&&(t=n)}return t}function Q9(s,e){return dA(s,(t,i)=>-e(t,i))}function X9(s,e){if(s.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}function Qte(s,e){for(const t of s){const i=e(t);if(i!==void 0)return i}}let Me=class Wr{static fromRangeInclusive(e){return new Wr(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new Ms(e[0].slice());for(let i=1;it)throw new Dt(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&en.endLineNumberExclusive>=e.startLineNumber),i=Uf(this._normalizedRanges,n=>n.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const n=this._normalizedRanges[t];this._normalizedRanges[t]=n.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=Nu(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=Nu(this._normalizedRanges,i=>i.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,n=0,o=null;for(;i=r.startLineNumber?o=new Me(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new Ms(t)}subtractFrom(e){const t=jC(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=Uf(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new Ms([e]);const n=[];let o=e.startLineNumber;for(let r=t;ro&&n.push(new Me(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;it.delta(e)))}}class Os{static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new Os(0,t.column-e.column):new Os(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return Os.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const n of e)n===` `?(t++,i=0):i++;return new Os(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}createRange(e){return this.lineCount===0?new M(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new M(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new V(e.lineNumber,e.column+this.columnCount):new V(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}Os.zero=new Os(0,0);class J9{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tXS(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}apply(e){let t="",i=new V(1,1);for(const o of this.edits){const r=o.range,a=r.getStartPosition(),l=r.getEndPosition(),c=fx(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=o.text,i=l}const n=fx(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new i3(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const o of this.edits){const r=Os.ofText(o.text),a=V.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?n:0)}),l=r.createRange(a);e.push(l),i=l.endLineNumber-o.range.endLineNumber,n=l.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}}class t3{constructor(e,t){this.range=e,this.text=t}}function fx(s,e){if(s.lineNumber===e.lineNumber&&s.column===Number.MAX_SAFE_INTEGER)return M.fromPositions(e,e);if(!s.isBeforeOrEqual(e))throw new Dt("start must be before end");return new M(s.lineNumber,s.column,e.lineNumber,e.column)}class uA{get endPositionExclusive(){return this.length.addToPosition(new V(1,1))}}class i3 extends uA{constructor(e){super(),this.value=e,this._t=new J9(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}class kn{static inverse(e,t,i){const n=[];let o=1,r=1;for(const l of e){const c=new kn(new Me(o,l.original.startLineNumber),new Me(r,l.modified.startLineNumber));c.modified.isEmpty||n.push(c),o=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new kn(new Me(o,t+1),new Me(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const o of e){const r=o.original.intersect(t),a=o.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new kn(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new kn(this.modified,this.original)}join(e){return new kn(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new Ao(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Dt("not a valid diff");return new Ao(new M(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new M(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Ao(new M(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new M(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}}class ws extends kn{static fromRangeMappings(e){const t=Me.join(e.map(n=>Me.fromRangeInclusive(n.originalRange))),i=Me.join(e.map(n=>Me.fromRangeInclusive(n.modifiedRange)));return new ws(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new ws(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}withInnerChangesFromLineRanges(){return new ws(this.original,this.modified,[this.toRangeMapping()])}}class Ao{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Ao(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new t3(this.originalRange,t)}}const n3=3;class s3{computeDiff(e,t,i){var n;const r=new a3(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of r.changes){let d;c.originalEndLineNumber===0?d=new Me(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new Me(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new Me(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new Me(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new ws(d,u,(n=c.charChanges)===null||n===void 0?void 0:n.map(f=>new Ao(new M(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new M(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new ws(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return Pc(()=>XS(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class eu{constructor(e,t,i,n,o,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new eu(n,o,r,a,l,c,d,u)}}function r3(s){if(s.length<=1)return s;const e=[s[0]];let t=e[0];for(let i=1,n=s.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let m=hA(f,g,o,!0).changes;a&&(m=r3(m)),h=[];for(let _=0,v=m.length;_1&&m>1;){const _=h.charCodeAt(g-2),v=f.charCodeAt(m-2);if(_!==v)break;g--,m--}(g>1||m>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,g,r+1,1,m)}{let g=GC(h,1),m=GC(f,1);const _=h.length+1,v=f.length+1;for(;g<_&&m!0;const e=Date.now();return()=>Date.now()-e{i.push(_i.fromOffsetPairs(n?n.getEndExclusives():Bs.zero,o?o.getStarts():new Bs(t,(n?n.seq2Range.endExclusive-n.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new _i(new Re(e.offset1,t.offset1),new Re(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new _i(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new _i(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new _i(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new _i(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new _i(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new _i(t,i)}getStarts(){return new Bs(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Bs(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Bs{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new Bs(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}Bs.zero=new Bs(0,0);Bs.max=new Bs(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class $f{isValid(){return!0}}$f.instance=new $f;class l3{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Dt("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&m>0&&r.get(g-1,m-1)===3&&(b+=a.get(g-1,m-1)),b+=n?n(g,m):1):b=-1;const C=Math.max(_,v,b);if(C===b){const w=g>0&&m>0?a.get(g-1,m-1):0;a.set(g,m,w+1),r.set(g,m,3)}else C===_?(a.set(g,m,0),r.set(g,m,1)):C===v&&(a.set(g,m,0),r.set(g,m,2));o.set(g,m,C)}const l=[];let c=e.length,d=t.length;function u(g,m){(g+1!==c||m+1!==d)&&l.push(new _i(new Re(g+1,c),new Re(m+1,d))),c=g,d=m}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)r.get(h,f)===3?(u(h,f),h--,f--):r.get(h,f)===1?h--:f--;return u(-1,-1),l.reverse(),new _a(l,!1)}}class fA{compute(e,t,i=$f.instance){if(e.length===0||t.length===0)return _a.trivial(e,t);const n=e,o=t;function r(m,_){for(;mn.length||w>o.length)continue;const y=r(C,w);l.set(d,y);const L=C===v?c.get(d+1):c.get(d-1);if(c.set(d,y!==C?new px(L,C,w,y-C):L),l.get(d)===n.length&&l.get(d)-d===o.length)break e}}let u=c.get(d);const h=[];let f=n.length,g=o.length;for(;;){const m=u?u.x+u.length:0,_=u?u.y+u.length:0;if((m!==f||_!==g)&&h.push(new _i(new Re(m,f),new Re(_,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new _a(h,!1)}}class px{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class d3{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class u3{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class u_{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let n=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Re(t.start-1,t.endExclusive),n=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=vx(e>0?this.elements[e-1]:-1),i=vx(ei<=e);return new V(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return M.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!pv(this.elements[e]))return;let t=e;for(;t>0&&pv(this.elements[t-1]);)t--;let i=e;for(;ir<=e.start))!==null&&t!==void 0?t:0,o=(i=Z9(this.firstCharOffsetByLine,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new Re(n,o)}}function pv(s){return s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57}const h3={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function _x(s){return h3[s]}function vx(s){return s===10?8:s===13?7:ZC(s)?6:s>=97&&s<=122?0:s>=65&&s<=90?1:s>=48&&s<=57?2:s===-1?3:s===44||s===59?5:4}function f3(s,e,t,i,n,o){let{moves:r,excludedChanges:a}=m3(s,e,t,o);if(!o.isValid())return[];const l=s.filter(d=>!a.has(d)),c=p3(l,i,n,e,t,o);return Cb(r,c),r=_3(r),r=r.filter(d=>{const u=d.original.toOffsetRange().slice(e).map(f=>f.trim());return u.join(` `).length>=15&&g3(u,f=>f.length>=2)>=2}),r=v3(s,r),r}function g3(s,e){let t=0;for(const i of s)e(i)&&t++;return t}function m3(s,e,t,i){const n=[],o=s.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Tu(l.original,e,l)),r=new Set(s.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Tu(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,d;for(const u of r){const h=l.computeSimilarity(u);h>c&&(c=h,d=u)}if(c>.9&&d&&(r.delete(d),n.push(new kn(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function p3(s,e,t,i,n,o){const r=[],a=new lA;for(const h of s)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,ul));for(const h of s){let f=[];for(let g=h.modified.startLineNumber;g{for(const w of f)if(w.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){w.originalLineRange=new Me(w.originalLineRange.startLineNumber,b.endLineNumberExclusive),w.modifiedLineRange=new Me(w.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(w);return}const C={modifiedLineRange:_,originalLineRange:b};l.push(C),v.push(C)}),f=v}if(!o.isValid())return[]}l.sort(w5(oo(h=>h.modifiedLineRange.length,ul)));const c=new Ms,d=new Ms;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),m=d.subtractFrom(h.originalLineRange).getWithDelta(f),_=g.getIntersection(m);for(const v of _.ranges){if(v.length<3)continue;const b=v,C=v.delta(-f);r.push(new kn(C,b)),c.addRange(b),d.addRange(C)}}r.sort(oo(h=>h.original.startLineNumber,ul));const u=new Ug(s);for(let h=0;hL.original.startLineNumber<=f.original.startLineNumber),m=Nu(s,L=>L.modified.startLineNumber<=f.modified.startLineNumber),_=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),v=u.findLastMonotonous(L=>L.original.startLineNumberL.modified.startLineNumberi.length||k>n.length||c.contains(k)||d.contains(L)||!bx(i[L-1],n[k-1],o))break}w>0&&(d.addRange(new Me(f.original.startLineNumber-w,f.original.startLineNumber)),c.addRange(new Me(f.modified.startLineNumber-w,f.modified.startLineNumber)));let y;for(y=0;yi.length||k>n.length||c.contains(k)||d.contains(L)||!bx(i[L-1],n[k-1],o))break}y>0&&(d.addRange(new Me(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+y)),c.addRange(new Me(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+y))),(w>0||y>0)&&(r[h]=new kn(new Me(f.original.startLineNumber-w,f.original.endLineNumberExclusive+y),new Me(f.modified.startLineNumber-w,f.modified.endLineNumberExclusive+y)))}return r}function bx(s,e,t){if(s.trim()===e.trim())return!0;if(s.length>300&&e.length>300)return!1;const n=new fA().compute(new u_([s],new Re(0,1),!1),new u_([e],new Re(0,1),!1),t);let o=0;const r=_i.invert(n.diffs,s.length);for(const d of r)d.seq1Range.forEach(u=>{ZC(s.charCodeAt(u))||o++});function a(d){let u=0;for(let h=0;he.length?s:e);return o/l>.6&&l>10}function _3(s){if(s.length===0)return s;s.sort(oo(t=>t.original.startLineNumber,ul));const e=[s[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(n);continue}e.push(n)}return e}function v3(s,e){const t=new Ug(s);return e=e.filter(i=>{const n=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(c))}n.push(a)}return i.length>0&&n.push(i[i.length-1]),n}function b3(s,e,t){if(!s.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&s.seq2Range.start-r>=n.start&&t.isStronglyEqual(s.seq2Range.start-r,s.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;s.seq1Range.start+ac&&(c=g,l=d)}return s.delta(l)}function C3(s,e,t){const i=[];for(const n of t){const o=i[i.length-1];if(!o){i.push(n);continue}n.seq1Range.start-o.seq1Range.endExclusive<=2||n.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new _i(o.seq1Range.join(n.seq1Range),o.seq2Range.join(n.seq2Range)):i.push(n)}return i}function w3(s,e,t){const i=_i.invert(t,s.length),n=[];let o=new Bs(0,0);function r(l,c){if(l.offset10;){const _=i[0];if(!(_.seq1Range.intersects(h.seq1Range)||_.seq2Range.intersects(h.seq2Range)))break;const b=s.findWordContaining(_.seq1Range.start),C=e.findWordContaining(_.seq2Range.start),w=new _i(b,C),y=w.intersect(_);if(g+=y.seq1Range.length,m+=y.seq2Range.length,h=h.join(w),h.seq1Range.endExclusive>=_.seq1Range.endExclusive)i.shift();else break}g+m<(h.seq1Range.length+h.seq2Range.length)*2/3&&n.push(h),o=h.getEndExclusives()}for(;i.length>0;){const l=i.shift();l.seq1Range.isEmpty||(r(l.getStarts(),l),r(l.getEndExclusives().delta(-1),l))}return y3(t,n)}function y3(s,e){const t=[];for(;s.length>0||e.length>0;){const i=s[0],n=e[0];let o;i&&(!n||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function S3(s,e,t){let i=t;if(i.length===0)return i;let n=0,o;do{o=!1;const r=[i[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=i[a],c=r[r.length-1];d(c,l)?(o=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}i=r}while(n++<10&&o);return i}function L3(s,e,t){let i=t;if(i.length===0)return i;let n=0,o;do{o=!1;const a=[i[0]];for(let l=1;l5||m.length>500)return!1;const v=s.getText(m).trim();if(v.length>20||v.split(/\r\n|\r|\n/).length>1)return!1;const b=s.countLinesIn(f.seq1Range),C=f.seq1Range.length,w=e.countLinesIn(f.seq2Range),y=f.seq2Range.length,L=s.countLinesIn(g.seq1Range),k=g.seq1Range.length,D=e.countLinesIn(g.seq2Range),N=g.seq2Range.length,W=2*40+50;function R(A){return Math.min(A,W)}return Math.pow(Math.pow(R(b*40+C),1.5)+Math.pow(R(w*40+y),1.5),1.5)+Math.pow(Math.pow(R(L*40+k),1.5)+Math.pow(R(D*40+N),1.5),1.5)>(W**1.5)**1.5*1.3};const c=i[l],d=a[a.length-1];u(d,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(n++<10&&o);const r=[];return m5(i,(a,l,c)=>{let d=l;function u(v){return v.length>0&&v.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=s.extendToFullLines(l.seq1Range),f=s.getText(new Re(h.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=s.getText(new Re(l.seq1Range.endExclusive,h.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const m=_i.fromOffsetPairs(a?a.getEndExclusives():Bs.zero,c?c.getStarts():Bs.max),_=d.intersect(m);r.length>0&&_.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(_):r.push(_)}),r}class yx{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:Sx(this.lines[e-1]),i=e===this.lines.length?0:Sx(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` `)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function Sx(s){let e=0;for(;ey===L))return new yp([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new yp([new ws(new Me(1,e.length+1),new Me(1,t.length+1),[new Ao(new M(1,1,e.length,e[e.length-1].length+1),new M(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?$f.instance:new l3(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(y){let L=r.get(y);return L===void 0&&(L=r.size,r.set(y,L)),L}const l=e.map(y=>a(y.trim())),c=t.map(y=>a(y.trim())),d=new yx(l,e),u=new yx(c,t),h=d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,n,(y,L)=>e[y]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,u,n);let f=h.diffs,g=h.hitTimeout;f=YC(d,u,f),f=S3(d,u,f);const m=[],_=y=>{if(o)for(let L=0;Ly.seq1Range.start-v===y.seq2Range.start-b);const L=y.seq1Range.start-v;_(L),v=y.seq1Range.endExclusive,b=y.seq2Range.endExclusive;const k=this.refineDiff(e,t,y,n,o);k.hitTimeout&&(g=!0);for(const D of k.mappings)m.push(D)}_(e.length-v);const C=Lx(m,e,t);let w=[];return i.computeMoves&&(w=this.computeMoves(C,e,t,l,c,n,o)),Pc(()=>{function y(k,D){if(k.lineNumber<1||k.lineNumber>D.length)return!1;const N=D[k.lineNumber-1];return!(k.column<1||k.column>N.length+1)}function L(k,D){return!(k.startLineNumber<1||k.startLineNumber>D.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>D.length+1)}for(const k of C){if(!k.innerChanges)return!1;for(const D of k.innerChanges)if(!(y(D.modifiedRange.getStartPosition(),t)&&y(D.modifiedRange.getEndPosition(),t)&&y(D.originalRange.getStartPosition(),e)&&y(D.originalRange.getEndPosition(),e)))return!1;if(!L(k.modified,t)||!L(k.original,e))return!1}return!0}),new yp(C,w,g)}computeMoves(e,t,i,n,o,r,a){return f3(e,t,i,n,o,r).map(d=>{const u=this.refineDiff(t,i,new _i(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),h=Lx(u.mappings,t,i,!0);return new cA(d,h)})}refineDiff(e,t,i,n,o){const r=new u_(e,i.seq1Range,o),a=new u_(t,i.seq2Range,o),l=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,n):this.myersDiffingAlgorithm.compute(r,a,n);let c=l.diffs;return c=YC(r,a,c),c=w3(r,a,c),c=C3(r,a,c),c=L3(r,a,c),{mappings:c.map(u=>new Ao(r.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function Lx(s,e,t,i=!1){const n=[];for(const o of hS(s.map(r=>k3(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];n.push(new ws(r.original.join(a.original),r.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Pc(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length-n[n.length-1].modified.endLineNumberExclusive!==e.length-n[n.length-1].original.endLineNumberExclusive)?!1:XS(n,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[s.modifiedRange.startLineNumber-1].length&&s.originalRange.startColumn-1>=e[s.originalRange.startLineNumber-1].length&&s.originalRange.startLineNumber<=s.originalRange.endLineNumber+n&&s.modifiedRange.startLineNumber<=s.modifiedRange.endLineNumber+n&&(i=1);const o=new Me(s.originalRange.startLineNumber+i,s.originalRange.endLineNumber+1+n),r=new Me(s.modifiedRange.startLineNumber+i,s.modifiedRange.endLineNumber+1+n);return new ws(o,r,[s])}const kx={getLegacy:()=>new s3,getDefault:()=>new gA};function ml(s,e){const t=Math.pow(10,e);return Math.round(s*t)/t}class Je{constructor(e,t,i,n=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=ml(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class Js{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=ml(Math.max(Math.min(1,t),0),3),this.l=ml(Math.max(Math.min(1,i),0),3),this.a=ml(Math.max(Math.min(1,n),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,n=e.b/255,o=e.a,r=Math.max(t,i,n),a=Math.min(t,i,n);let l=0,c=0;const d=(a+r)/2,u=r-a;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),r){case t:l=(i-n)/u+(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:n,a:o}=e;let r,a,l;if(i===0)r=a=l=n;else{const c=n<.5?n*(1+i):n+i-n*i,d=2*n-c;r=Js._hue2rgb(d,c,t+1/3),a=Js._hue2rgb(d,c,t),l=Js._hue2rgb(d,c,t-1/3)}return new Je(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class Td{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=ml(Math.max(Math.min(1,t),0),3),this.v=ml(Math.max(Math.min(1,i),0),3),this.a=ml(Math.max(Math.min(1,n),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,n=e.b/255,o=Math.max(t,i,n),r=Math.min(t,i,n),a=o-r,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((i-n)/a%6+6)%6:o===i?c=(n-t)/a+2:c=(t-i)/a+4,new Td(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,r=n*i,a=r*(1-Math.abs(t/60%2-1)),l=n-r;let[c,d,u]=[0,0,0];return t<60?(c=r,d=a):t<120?(c=a,d=r):t<180?(d=r,u=a):t<240?(d=a,u=r):t<300?(c=a,u=r):t<=360&&(c=r,u=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new Je(c,d,u,o)}}class K{static fromHex(e){return K.Format.CSS.parseHex(e)||K.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:Js.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Td.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Je)this.rgba=e;else if(e instanceof Js)this._hsla=e,this.rgba=Js.toRGBA(e);else if(e instanceof Td)this._hsva=e,this.rgba=Td.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Je.equals(this.rgba,e.rgba)&&Js.equals(this.hsla,e.hsla)&&Td.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=K._relativeLuminanceForComponent(this.rgba.r),t=K._relativeLuminanceForComponent(this.rgba.g),i=K._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return ml(n,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 t0)for(const n of i){const o=n.filter(c=>c!==void 0),r=o[1],a=o[2];if(!a)continue;let l;if(r==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=Dx(_h(s,n),vh(a,c),!1)}else if(r==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=Dx(_h(s,n),vh(a,c),!0)}else if(r==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=xx(_h(s,n),vh(a,c),!1)}else if(r==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=xx(_h(s,n),vh(a,c),!0)}else r==="#"&&(l=D3(_h(s,n),r+a));l&&e.push(l)}return e}function E3(s){return!s||typeof s.getValue!="function"||typeof s.positionAt!="function"?[]:x3(s)}const Ex=new RegExp("\\bMARK:\\s*(.*)$","d"),I3=/^-+|-+$/g;function N3(s,e){var t;let i=[];if(e.findRegionSectionHeaders&&(!((t=e.foldingRules)===null||t===void 0)&&t.markers)){const n=T3(s,e);i=i.concat(n)}if(e.findMarkSectionHeaders){const n=A3(s);i=i.concat(n)}return i}function T3(s,e){const t=[],i=s.getLineCount();for(let n=1;n<=i;n++){const o=s.getLineContent(n),r=o.match(e.foldingRules.markers.start);if(r){const a={startLineNumber:n,startColumn:r[0].length+1,endLineNumber:n,endColumn:o.length+1};if(a.endColumn>a.startColumn){const l={range:a,...pA(o.substring(r[0].length)),shouldBeInComments:!1};(l.text||l.hasSeparatorLine)&&t.push(l)}}}return t}function A3(s){const e=[],t=s.getLineCount();for(let i=1;i<=t;i++){const n=s.getLineContent(i);M3(n,i,e)}return e}function M3(s,e,t){Ex.lastIndex=0;const i=Ex.exec(s);if(i){const n=i.indices[1][0]+1,o=i.indices[1][1]+1,r={startLineNumber:e,startColumn:n,endLineNumber:e,endColumn:o};if(r.endColumn>r.startColumn){const a={range:r,...pA(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function pA(s){s=s.trim();const e=s.startsWith("-");return s=s.replace(I3,""),{text:s,hasSeparatorLine:e}}class R3 extends D9{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>o&&(i=o,n=!0)}return n?{lineNumber:t,column:i}:e}}class pl{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new R3($e.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}async computeUnicodeHighlights(e,t,i){const n=this._getModel(e);return n?j9.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async findSectionHeaders(e,t){const i=this._getModel(e);return i?N3(i,t):[]}async computeDiff(e,t,i,n){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:pl.computeDiff(o,r,i,n)}static computeDiff(e,t,i,n){const o=n==="advanced"?kx.getDefault():kx.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(r,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(u){return u.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(u=>[u.lineRangeMapping.original.startLineNumber,u.lineRangeMapping.original.endLineNumberExclusive,u.lineRangeMapping.modified.startLineNumber,u.lineRangeMapping.modified.endLineNumberExclusive,d(u.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLineCount();if(i!==n)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}async computeMoreMinimalEdits(e,t,i){const n=this._getModel(e);if(!n)return t;const o=[];let r;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return M.compareRangesUsingStarts(l.range,c.range);const d=l.range?0:1,u=c.range?0:1;return d-u});let a=0;for(let l=1;lpl._diffLimit){o.push({range:l,text:c});continue}const h=S9(u,c,i),f=n.offsetAt(M.lift(l).getStartPosition());for(const g of h){const m=n.positionAt(f+g.originalStart),_=n.positionAt(f+g.originalStart+g.originalLength),v={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:_.lineNumber,endColumn:_.column}};n.getValueInRange(v.range)!==v.text&&o.push(v)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o}async computeLinks(e){const t=this._getModel(e);return t?T9(t):null}async computeDefaultDocumentColors(e){const t=this._getModel(e);return t?E3(t):null}async textualSuggest(e,t,i,n){const o=new qc,r=new RegExp(i,n),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const d of c.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>pl._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}}async computeWordRanges(e,t,i,n){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,n),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(gS(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}pl._diffLimit=1e5;pl._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=nT());const _A=Qe("textResourceConfigurationService"),vA=Qe("textResourcePropertiesService"),kt=Qe("ILanguageFeaturesService");var P3=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},bh=function(s,e){return function(t,i){e(t,i,s)}};const Ix=60*1e3,Nx=5*60*1e3;function tc(s,e){const t=s.getModel(e);return!(!t||t.isTooLargeForSyncing())}let QC=class extends G{constructor(e,t,i,n,o){super(),this._modelService=e,this._workerManager=this._register(new O3(this._modelService,n)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>tc(this._modelService,r.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(r.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new F3(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return tc(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(n=>n.computedUnicodeHighlights(e,t,i))}async computeDiff(e,t,i,n){const o=await this._workerManager.withWorker().then(l=>l.computeDiff(e,t,i,n));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new cA(new kn(new Me(l[0],l[1]),new Me(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new ws(new Me(c[0],c[1]),new Me(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(u=>new Ao(new M(u[0],u[1],u[2],u[3]),new M(u[4],u[5],u[6],u[7]))))})}}computeMoreMinimalEdits(e,t,i=!1){if(L0(t)){if(!tc(this._modelService,e))return Promise.resolve(t);const n=qc.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([o,Of(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return tc(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return tc(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}findSectionHeaders(e,t){return this._workerManager.withWorker().then(i=>i.findSectionHeaders(e,t))}};QC=P3([bh(0,ns),bh(1,_A),bh(2,uo),bh(3,Nr),bh(4,kt)],QC);class F3{constructor(e,t,i,n){this.languageConfigurationService=n,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;const n=[];if(i.wordBasedSuggestions==="currentDocument")tc(this._modelService,e.uri)&&n.push(e.uri);else for(const u of this._modelService.getModels())tc(this._modelService,u.uri)&&(u===e?n.unshift(u.uri):(i.wordBasedSuggestions==="allDocuments"||u.getLanguageId()===e.getLanguageId())&&n.push(u.uri));if(n.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new M(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):M.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(n,r==null?void 0:r.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(u=>({kind:18,label:u,insertText:u,range:{insert:l,replace:a}}))}}}class O3 extends G{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new VS).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(Nx/2),wt),this._register(this._modelService.onModelRemoved(n=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>Nx&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new bA(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class B3 extends G{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const n=new OS;n.cancelAndSet(()=>this._checkStopModelSync(),Math.round(Ix/2)),this._register(n)}}dispose(){for(const e in this._syncedModels)Hi(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const n=i.toString();this._syncedModels[n]||this._beginModelSync(i,t),this._syncedModels[n]&&(this._syncedModelsLastUsedTime[n]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>Ix&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new pe;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(n.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(n)})),o.add(Be(()=>{this._proxy.acceptRemovedModel(n)})),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Hi(t)}}class Tx{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class _v{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class bA extends G{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new K0(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new F7(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new _v(this)))}catch(e){HC(e),this._worker=new Tx(new pl(new _v(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(HC(e),this._worker=new Tx(new pl(new _v(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new B3(e,this._modelService,this._keepIdleModels))),this._modelManager}async _withSyncedResources(e,t=!1){return this._disposed?Promise.reject(RP()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,n))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(n=>n.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}async textualSuggest(e,t,i){const n=await this._withSyncedResources(e),o=i.source,r=i.flags;return n.textualSuggest(e.map(a=>a.toString()),t,o,r)}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(n=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,l=r.flags;return n.navigateValueSet(e.toString(),t,i,a,l)})}findSectionHeaders(e,t){return this._withSyncedResources([e]).then(i=>i.findSectionHeaders(e.toString(),t))}dispose(){super.dispose(),this._disposed=!0}}function W3(s,e,t){return new V3(s,e,t)}class V3 extends bA{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?gS(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const n=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},r={};for(const a of i)r[a]=o(a,n);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const $g={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Kf=new class{clone(){return this}equals(s){return this===s}};function CA(s,e){return new DS([new Pf(0,"",s)],e)}function aL(s,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(s<<0|0|0|32768|2<<24)>>>0,new I0(t,e===null?Kf:e)}class Zn{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const n=this.getFontStyle(e);return n&1&&(i+=" mtki"),n&2&&(i+=" mtkb"),n&4&&(i+=" mtku"),n&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;n&1&&(o+="font-style: italic;"),n&2&&(o+="font-weight: bold;");let r="";return n&4&&(r+=" underline"),n&8&&(r+=" line-through"),r&&(o+=`text-decoration:${r};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}let bn=class Yl{static createEmpty(e,t){const i=Yl.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new Yl(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="";const o=new Array;for(const{text:r,metadata:a}of e)o.push(i+r.length,a),i+=r.length,n+=r;return new Yl(new Uint32Array(o),n,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}equals(e){return e instanceof Yl?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let r=n;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Zn.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Zn.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Zn.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Zn.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Zn.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Zn.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return Yl.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new lL(this,e,t,i)}static convertToEndOffset(e,t){const n=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(n=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,n="";const o=new Array;let r=0;for(;;){const a=tr){n+=this._text.substring(r,l.offset);const c=this._tokens[(t<<1)+1];o.push(n.length,c),r=l.offset}n+=l.text,o.push(n.length,l.tokenMetadata),i++}else break}return new Yl(new Uint32Array(o),n,this.languageIdCodec)}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i>>0;class lL{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof lL?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}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}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)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),n=this._source.getEndOffset(t);let o=this._source.getTokenText(t);return ithis._endOffset&&(o=o.substring(0,o.length-(n-this._endOffset))),o}forEach(e){for(let t=0;t=o||(a[l++]=new no(Math.max(1,c.startColumn-n+1),Math.min(r+1,c.endColumn-n+1),c.className,c.type));return a}static filter(e,t,i,n){if(e.length===0)return[];const o=[];let r=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;const u=d.startLineNumber===t?d.startColumn:i,h=d.endLineNumber===t?d.endColumn:n;o[r++]=new no(u,h,c.inlineClassName,c.type)}return o}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=no._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class H3{static normalize(e,t){if(t.length===0)return[];const i=[],n=new h_;let o=0;for(let r=0,a=t.length;r1){const m=e.charCodeAt(c-2);Di(m)&&c--}if(d>1){const m=e.charCodeAt(d-2);Di(m)&&d--}const f=c-1,g=d-2;o=n.consumeLowerThan(f,o,i),n.count===0&&(o=f),n.insert(g,u,h)}return n.consumeLowerThan(1073741824,o,i),i}}class Ei{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class wA{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class th{constructor(e,t,i,n,o,r,a,l,c,d,u,h,f,g,m,_,v,b,C){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(no.compare),this.tabSize=d,this.startVisibleColumn=u,this.spaceWidth=h,this.stopRenderingLineAfter=m,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=b,this.selectionsOnLine=C&&C.sort((L,k)=>L.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[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=rr.getPartIndex(t),n=rr.getCharIndex(t);return new yA(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const n=(e<<16|i<<0)>>>0;let o=0,r=this.length-1;for(;o+1>>1,_=this._data[m];if(_===n)return m;_>n?r=m:o=m}if(o===r)return o;const a=this._data[o],l=this._data[r];if(a===n)return o;if(l===n)return r;const c=rr.getPartIndex(a),d=rr.getCharIndex(a),u=rr.getPartIndex(l);let h;c!==u?h=t:h=rr.getCharIndex(l);const f=i-d,g=h-i;return f<=g?o:r}}class XC{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function cL(s,e){if(s.lineContent.length===0){if(s.lineDecorations.length>0){e.appendString("");let t=0,i=0,n=0;for(const r of s.lineDecorations)(r.type===1||r.type===2)&&(e.appendString(''),r.type===1&&(n|=1,t++),r.type===2&&(n|=2,i++));e.appendString("");const o=new rr(1,t+i);return o.setColumnInfo(1,t,0,0),new XC(o,!1,n)}return e.appendString(""),new XC(new rr(0,0),!1,0)}return Y3($3(s),e)}class z3{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function Z0(s){const e=new j0(1e4),t=cL(s,e);return new z3(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class U3{constructor(e,t,i,n,o,r,a,l,c,d,u,h,f,g,m,_){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=u,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=m,this.renderControlCharacters=_}}function $3(s){const e=s.lineContent;let t,i,n;s.stopRenderingLineAfter!==-1&&s.stopRenderingLineAfter0){for(let a=0,l=s.lineDecorations.length;a0&&(o[r++]=new Ei(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=n){const f=e?Ff(s.substring(a,n)):!1;o[r++]=new Ei(n,u,0,f);break}const h=e?Ff(s.substring(a,d)):!1;o[r++]=new Ei(d,u,0,h),a=d}return o}function j3(s,e,t){let i=0;const n=[];let o=0;if(t)for(let r=0,a=e.length;r=50&&(n[o++]=new Ei(f+1,d,u,h),g=f+1,f=-1);g!==c&&(n[o++]=new Ei(c,d,u,h))}else n[o++]=l;i=c}else for(let r=0,a=e.length;r50){const u=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(d/50);for(let m=1;m=8234&&s<=8238||s>=8294&&s<=8297||s>=8206&&s<=8207||s===1564}function q3(s,e){const t=[];let i=new Ei(0,"",0,!1),n=0;for(const o of e){const r=o.endIndex;for(;ni.endIndex&&(i=new Ei(n,o.type,o.metadata,o.containsRTL),t.push(i)),i=new Ei(n+1,"mtkcontrol",o.metadata,!1),t.push(i))}n>i.endIndex&&(i=new Ei(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function G3(s,e,t,i){const n=s.continuesWithWrappedLine,o=s.fauxIndentLength,r=s.tabSize,a=s.startVisibleColumn,l=s.useMonospaceOptimizations,c=s.selectionsOnLine,d=s.renderWhitespace===1,u=s.renderWhitespace===3,h=s.renderSpaceWidth!==s.spaceWidth,f=[];let g=0,m=0,_=i[m].type,v=i[m].containsRTL,b=i[m].endIndex;const C=i.length;let w=!1,y=es(e),L;y===-1?(w=!0,y=t,L=t):L=Gc(e);let k=!1,D=0,N=c&&c[D],W=a%r;for(let A=o;A=N.endOffset&&(D++,N=c&&c[D]);let H;if(AL)H=!0;else if(P===9)H=!0;else if(P===32)if(d)if(k)H=!0;else{const q=A+1A),H&&u&&(H=w||A>L),H&&v&&A>=y&&A<=L&&(H=!1),k){if(!H||!l&&W>=r){if(h){const q=g>0?f[g-1].endIndex:o;for(let re=q+1;re<=A;re++)f[g++]=new Ei(re,"mtkw",1,!1)}else f[g++]=new Ei(A,"mtkw",1,!1);W=W%r}}else(A===b||H&&A>o)&&(f[g++]=new Ei(A,_,0,v),W=W%r);for(P===9?W=r:yl(P)?W+=2:W++,k=H;A===b&&(m++,m0?e.charCodeAt(t-1):0,P=t>1?e.charCodeAt(t-2):0;A===32&&P!==32&&P!==9||(R=!0)}else R=!0;if(R)if(h){const A=g>0?f[g-1].endIndex:o;for(let P=A+1;P<=t;P++)f[g++]=new Ei(P,"mtkw",1,!1)}else f[g++]=new Ei(t,"mtkw",1,!1);else f[g++]=new Ei(t,_,0,v);return f}function Z3(s,e,t,i){i.sort(no.compare);const n=H3.normalize(s,i),o=n.length;let r=0;const a=[];let l=0,c=0;for(let u=0,h=t.length;uc&&(c=b.startOffset,a[l++]=new Ei(c,m,_,v)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new Ei(c,m+" "+b.className,_|b.metadata,v),r++;else{c=g,a[l++]=new Ei(c,m+" "+b.className,_|b.metadata,v);break}}g>c&&(c=g,a[l++]=new Ei(c,m,_,v))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let N=0,W=c.length;N=d&&(Ce+=fe)}}for(re&&(e.appendString(' style="width:'),e.appendString(String(g*ve)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let fe=2;fe<=Ee;fe++)e.appendCharCode(160)}else Ce=2,Ee=1,e.appendCharCode(m),e.appendCharCode(8204);L+=Ce,k+=Ee,w>=d&&(y+=Ee)}}else for(e.appendASCIICharCode(62);w=d&&(y+=Ce)}de?D++:D=0,w>=r&&!C&&R.isPseudoAfter()&&(C=!0,b.setColumnInfo(w+1,N,L,k)),e.appendString("")}return C||b.setColumnInfo(r+1,c.length-1,L,k),a&&(e.appendString(''),e.appendString(p("showMore","Show more ({0})",X3(l))),e.appendString("")),e.appendString(""),new XC(b,f,n)}function Q3(s){return s.toString(16).toUpperCase().padStart(4,"0")}function X3(s){return s<1024?p("overflow.chars","{0} chars",s):s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`}class Mx{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=n|0}}class J3{constructor(e,t){this.tabSize=e,this.data=t}}class dL{constructor(e,t,i,n,o,r,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=a}}class Ss{constructor(e,t,i,n,o,r,a,l,c,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=Ss.isBasicASCII(i,r),this.containsRTL=Ss.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?AS(e):!0}static containsRTL(e,t,i){return!t&&i?Ff(e):!1}}class df{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class e8{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new df(new M(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class LA{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class jf{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Wi(e.data,t.data)}static equalsArr(e,t){return Wi(e,t,jf.equals)}}function t8(s){return Array.isArray(s)}function i8(s){return!t8(s)}function kA(s){return typeof s=="string"}function Rx(s){return!kA(s)}function ic(s){return!s}function va(s,e){return s.ignoreCase&&e?e.toLowerCase():e}function Px(s){return s.replace(/[&<>'"_]/g,"-")}function n8(s,e){console.log(`${s.languageId}: ${e}`)}function Pt(s,e){return new Error(`${s.languageId}: ${e}`)}function ja(s,e,t,i,n){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,l,c,d,u,h,f,g,m){return ic(c)?ic(d)?!ic(u)&&u0;){const i=s.tokenizer[t];if(i)return i;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return null}function o8(s,e){let t=e;for(;t&&t.length>0;){if(s.stateNames[t])return!0;const n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return!1}var r8=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},a8=function(s,e){return function(t,i){e(t,i,s)}},JC;const DA=5;class qf{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new tu(e,t);let i=tu.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new tu(e,t),this._entries[i]=n,n)}}qf._INSTANCE=new qf(DA);class tu{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return tu._equals(this,e)}push(e){return qf.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return qf.create(this.parent,e)}}class Ad{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new Ad(this.languageId,this.state)}}class qa{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new uf(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new uf(e,t);const i=tu.getStackElementId(e);let n=this._entries[i];return n||(n=new uf(e,null),this._entries[i]=n,n)}}qa._INSTANCE=new qa(DA);class uf{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:qa.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof uf)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class l8{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new Pf(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,r=i.state,a=oi.get(o);if(!a)return this.enterLanguage(o),this.emit(n,""),r;const l=a.tokenize(e,t,r);if(n!==0)for(const c of l.tokens)this._tokens.push(new Pf(c.offset+n,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new DS(this._tokens,e)}}class f_{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(n===0&&o===0&&r===0)return new Uint32Array(0);if(n===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(n+o+r);e!==null&&a.set(e);for(let l=0;l{if(r)return;let l=!1;for(let c=0,d=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=oi.get(t);if(i){if(i instanceof JC){const n=i.getLoadStatus();n.loaded===!1&&e.push(n.promise)}continue}oi.isResolved(t)||e.push(oi.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=qf.create(null,this._lexer.start);return qa.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return CA(this._languageId,i);const n=new l8,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return aL(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new f_(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=Lm(this._lexer,t.stack.state),!i))throw Pt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const r of i){if(!Rx(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.resolveRegex(t.stack.state);const l=a.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),d)}const c=e.search(a);c===-1||c!==0&&r.matchOnlyAtLineStart||(n===-1||c0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,n);const l=e.substring(r);return this._myTokenize(l,t,i,n+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` `:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,u=0,h=null,f=!0;for(;f||u=l)break;f=!1;let N=this._lexer.tokenizer[v];if(!N&&(N=Lm(this._lexer,v),!N))throw Pt(this._lexer,"tokenizer state is not defined: "+v);const W=a.substr(u);for(const R of N)if((u===0||!R.matchOnlyAtLineStart)&&(b=W.match(R.resolveRegex(v)),b)){C=b[0],w=R.action;break}}if(b||(b=[""],C=""),w||(u=this._lexer.maxStack)throw Pt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(w.next==="@pop"){if(d.depth<=1)throw Pt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(y));d=d.pop()}else if(w.next==="@popall")d=d.popall();else{let N=ja(this._lexer,w.next,C,b,v);if(N[0]==="@"&&(N=N.substr(1)),Lm(this._lexer,N))d=d.push(N);else throw Pt(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(y))}}w.log&&typeof w.log=="string"&&n8(this._lexer,this._lexer.languageId+": "+ja(this._lexer,w.log,C,b,v))}if(k===null)throw Pt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(y));const D=N=>{const W=this._languageService.getLanguageIdByLanguageName(N)||this._languageService.getLanguageIdByMimeType(N)||N,R=this._getNestedEmbeddedLanguageData(W);if(u0)throw Pt(this._lexer,"groups cannot be nested: "+this._safeRuleName(y));if(b.length!==k.length+1)throw Pt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(y));let N=0;for(let W=1;Ws});class uL{static colorizeElement(e,t,i,n){n=n||{};const o=n.theme||"vs",r=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const c=d=>{var u;const h=(u=vv==null?void 0:vv.createHTML(d))!==null&&u!==void 0?u:d;i.innerHTML=h};return this.colorize(t,l||"",a,n).then(c,d=>console.error(d))}static async colorize(e,t,i,n){const o=e.languageIdCodec;let r=4;n&&typeof n.tabSize=="number"&&(r=n.tabSize),RS(t)&&(t=t.substr(1));const a=Xu(t);if(!e.isRegisteredLanguageId(i))return Fx(a,r,o);const l=await oi.getOrCreate(i);return l?d8(a,r,l,o):Fx(a,r,o)}static colorizeLine(e,t,i,n,o=4){const r=Ss.isBasicASCII(e,t),a=Ss.containsRTL(e,r,i);return Z0(new th(!1,!0,e,!1,r,a,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function d8(s,e,t,i){return new Promise((n,o)=>{const r=()=>{const a=u8(s,e,t,i);if(t instanceof Gf){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,o);return}}n(a)};r()})}function Fx(s,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let r=0,a=s.length;r")}return i.join("")}function u8(s,e,t,i){let n=[],o=t.getInitialState();for(let r=0,a=s.length;r"),o=c.endState}return n.join("")}const Ox=2e4;let nc,Sp,ew,Lp,tw;function h8(s){nc=document.createElement("div"),nc.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"),nc.appendChild(i),i};Sp=e(),ew=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),nc.appendChild(i),i};Lp=t(),tw=t(),s.appendChild(nc)}function iw(s){nc&&(Sp.textContent!==s?(Po(ew),m_(Sp,s)):(Po(Sp),m_(ew,s)))}function g_(s){nc&&(Lp.textContent!==s?(Po(tw),m_(Lp,s)):(Po(Lp),m_(tw,s)))}function m_(s,e){Po(s),e.length>Ox&&(e=e.substr(0,Ox)),s.textContent=e,s.style.visibility="hidden",s.style.visibility="visible"}const xA=Qe("markerDecorationsService");var f8=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},g8=function(s,e){return function(t,i){e(t,i,s)}};let Zf=class{constructor(e,t){}dispose(){}};Zf.ID="editor.contrib.markerDecorations";Zf=f8([g8(1,xA)],Zf);KT(Zf.ID,Zf,0);class EA extends G{constructor(e,t){super(),this._onDidChange=this._register(new O),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,n=!1;const o=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{is(be(this._referenceDomElement),()=>{n=!1,o()})}};this._resizeObserver=new ResizeObserver(r=>{r&&r[0]&&r[0].contentRect?e={width:r[0].contentRect.width,height:r[0].contentRect.height}:e=null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),(this._width!==i||this._height!==n)&&(this._width=i,this._height=n,e&&this._onDidChange.fire())}}class _l{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=_l._read(e,this.key),i=o=>_l._read(e,o),n=(o,r)=>_l._write(e,o,r);this.migrate(t,i,n)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);e[o]=e[o]||{},this._write(e[o],t.substring(n+1),i);return}e[t]=i}}_l.items=[];function zo(s,e){_l.items.push(new _l(s,e))}function ss(s,e){zo(s,(t,i,n)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){n(s,r);return}}})}function m8(s){_l.items.forEach(e=>e.apply(s))}ss("wordWrap",[[!0,"on"],[!1,"off"]]);ss("lineNumbers",[[!0,"on"],[!1,"off"]]);ss("cursorBlinking",[["visible","solid"]]);ss("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);ss("renderLineHighlight",[[!0,"line"],[!1,"none"]]);ss("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);ss("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);ss("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);ss("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);ss("autoIndent",[[!1,"advanced"],[!0,"full"]]);ss("matchBrackets",[[!0,"always"],[!1,"never"]]);ss("renderFinalNewline",[[!0,"on"],[!1,"off"]]);ss("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);ss("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);ss("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);zo("autoClosingBrackets",(s,e,t)=>{s===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});zo("renderIndentGuides",(s,e,t)=>{typeof s<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!s))});zo("highlightActiveIndentGuide",(s,e,t)=>{typeof s<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!s))});const p8={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};zo("suggest.filteredTypes",(s,e,t)=>{if(s&&typeof s=="object"){for(const i of Object.entries(p8))s[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});zo("quickSuggestions",(s,e,t)=>{if(typeof s=="boolean"){const i=s?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});zo("experimental.stickyScroll.enabled",(s,e,t)=>{typeof s=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",s))});zo("experimental.stickyScroll.maxLineCount",(s,e,t)=>{typeof s=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",s))});zo("codeActionsOnSave",(s,e,t)=>{if(s&&typeof s=="object"){let i=!1;const n={};for(const o of Object.entries(s))typeof o[1]=="boolean"?(i=!0,n[o[0]]=o[1]?"explicit":"never"):n[o[0]]=o[1];i&&t("codeActionsOnSave",n)}});zo("codeActionWidget.includeNearbyQuickfixes",(s,e,t)=>{typeof s=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",s))});zo("lightbulb.enabled",(s,e,t)=>{typeof s=="boolean"&&t("lightbulb.enabled",s?void 0:"off")});class _8{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new O,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const p_=new _8,Uo=Qe("accessibilityService"),v8=new me("accessibilityModeEnabled",!1);var b8=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},C8=function(s,e){return function(t,i){e(t,i,s)}};let nw=class extends G{constructor(e,t,i,n,o){super(),this._accessibilityService=o,this._onDidChange=this._register(new O),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new O),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new UN,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new EA(n,i.dimension)),this._targetWindowId=be(n).vscodeWindowId,this._rawOptions=Bx(i),this._validatedOptions=Ga.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Ka.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(p_.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(BC.onDidChange(()=>this._recomputeOptions())),this._register(s_.getInstance(be(n)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Ga.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=wc.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:p_.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return Ga.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:y8(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:Cc||lo,pixelRatio:s_.getInstance(PD(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return BC.readFontInfo(PD(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=Bx(e);Ga.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Ga.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=w8(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};nw=b8([C8(4,Uo)],nw);function w8(s){let e=0;for(;s;)s=Math.floor(s/10),e++;return e||1}function y8(){let s="";return!ya&&!uT&&(s+="no-user-select "),ya&&(s+="no-minimap-shadow ",s+="enable-user-select "),Ye&&(s+="mac "),s}class S8{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class L8{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class Ga{static validateOptions(e){const t=new S8;for(const i of Dd){const n=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new L8;for(const n of Dd)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Wi(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Ga._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of Dd){const r=!Ga._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(n=!0)}return n?new zN(i):null}static applyUpdate(e,t){let i=!1;for(const n of Dd)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}}function Bx(s){const e=Ha(s);return m8(e),e}var el;(function(s){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},n={...e};let o=0;const r={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(l)}s.onKeyDown=a;function l(){r.keydown===1&&(performance.mark("keydown/end"),r.keydown=2)}function c(){performance.mark("input/start"),r.input=1,_()}s.onBeforeInput=c;function d(){r.input===0&&c(),queueMicrotask(u)}s.onInput=d;function u(){r.input===1&&(performance.mark("input/end"),r.input=2)}function h(){v()}s.onKeyUp=h;function f(){v()}s.onSelectionChange=f;function g(){r.keydown===2&&r.input===2&&r.render===0&&(performance.mark("render/start"),r.render=1,queueMicrotask(m),_())}s.onRenderStart=g;function m(){r.render===1&&(performance.mark("render/end"),r.render=2)}function _(){setTimeout(v)}function v(){r.keydown===2&&r.input===2&&r.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),b("keydown",e),b("input",t),b("render",i),b("inputlatency",n),o++,C())}function b(k,D){const N=performance.getEntriesByName(k)[0].duration;D.total+=N,D.min=Math.min(D.min,N),D.max=Math.max(D.max,N)}function C(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0}function w(){if(o===0)return;const k={keydown:y(e),input:y(t),render:y(i),total:y(n),sampleCount:o};return L(e),L(t),L(i),L(n),o=0,k}s.getAndClearMeasurements=w;function y(k){return{average:k.total/o,max:k.max,min:k.min}}function L(k){k.total=0,k.min=Number.MAX_VALUE,k.max=0}})(el||(el={}));class Y0{constructor(){this._hooks=new pe,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Be(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=be(e)}this._hooks.add(j(r,J.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(j(r,J.POINTER_UP,a=>this.stopMonitoring(!0)))}}function hL(s){return`--vscode-${s.replace(/\./g,"-")}`}function ne(s){return`var(${hL(s)})`}function k8(s,e){return`var(${hL(s)}, ${e})`}const IA={ColorContribution:"base.contributions.colors"};class D8{constructor(){this._onDidChangeSchema=new O,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),n&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage="This color must be transparent or it will obscure content"),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const n=i.defaults[t.type];return bo(n,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const n=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return n!==o?n-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` `)}}const Q0=new D8;zi.add(IA.ColorContribution,Q0);function T(s,e,t,i,n){return Q0.registerColor(s,e,t,i,n)}function x8(s,e){var t,i,n,o;switch(s.op){case 0:return(t=bo(s.value,e))===null||t===void 0?void 0:t.darken(s.factor);case 1:return(i=bo(s.value,e))===null||i===void 0?void 0:i.lighten(s.factor);case 2:return(n=bo(s.value,e))===null||n===void 0?void 0:n.transparent(s.factor);case 3:{const r=bo(s.background,e);return r?(o=bo(s.value,e))===null||o===void 0?void 0:o.makeOpaque(r):bo(s.value,e)}case 4:for(const r of s.values){const a=bo(r,e);if(a)return a}return;case 6:return bo(e.defines(s.if)?s.then:s.else,e);case 5:{const r=bo(s.value,e);if(!r)return;const a=bo(s.background,e);return a?r.isDarkerThan(a)?K.getLighterColor(r,a,s.factor).transparent(s.transparency):K.getDarkerColor(r,a,s.factor).transparent(s.transparency):r.transparent(s.factor*s.transparency)}default:throw QS()}}function id(s,e){return{op:0,value:s,factor:e}}function Mo(s,e){return{op:1,value:s,factor:e}}function Le(s,e){return{op:2,value:s,factor:e}}function Wx(...s){return{op:4,values:s}}function E8(s,e,t){return{op:6,if:s,then:e,else:t}}function Vx(s,e,t,i){return{op:5,value:s,background:e,factor:t,transparency:i}}function bo(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?K.fromHex(s):e.getColor(s);if(s instanceof K)return s;if(typeof s=="object")return x8(s,e)}}const NA="vscode://schemas/workbench-colors",TA=zi.as(G0.JSONContribution);TA.registerSchema(NA,Q0.getColorSchema());const Hx=new _n(()=>TA.notifySchemaChanged(NA),200);Q0.onDidChangeSchema(()=>{Hx.isScheduled()||Hx.schedule()});const Ke=T("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},p("foreground","Overall foreground color. This color is only used if not overridden by a component."));T("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},p("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));T("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},p("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));T("descriptionForeground",{light:"#717171",dark:Le(Ke,.7),hcDark:Le(Ke,.7),hcLight:Le(Ke,.7)},p("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Md=T("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},p("iconForeground","The default color for icons in the workbench.")),Ws=T("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},p("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),tt=T("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),si=T("contrastActiveBorder",{light:null,dark:null,hcDark:Ws,hcLight:Ws},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));T("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},p("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const I8=T("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkForeground","Foreground color for links in text."));T("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));T("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:K.black,hcLight:"#292929"},p("textSeparatorForeground","Color for text separators."));T("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},p("textPreformatForeground","Foreground color for preformatted text segments."));T("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},p("textPreformatBackground","Background color for preformatted text segments."));T("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},p("textBlockQuoteBackground","Background color for block quotes in text."));T("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:K.white,hcLight:"#292929"},p("textBlockQuoteBorder","Border color for block quotes in text."));T("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:K.black,hcLight:"#F2F2F2"},p("textCodeBlockBackground","Background color for code blocks in text."));T("sash.hoverBorder",{dark:Ws,light:Ws,hcDark:Ws,hcLight:Ws},p("sashActiveBorder","Border color of active sashes."));const kp=T("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:K.black,hcLight:"#0F4A85"},p("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),N8=T("badge.foreground",{dark:K.white,light:"#333",hcDark:K.white,hcLight:K.white},p("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Bh=T("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},p("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),Wh=T("scrollbarSlider.background",{dark:K.fromHex("#797979").transparent(.4),light:K.fromHex("#646464").transparent(.4),hcDark:Le(tt,.6),hcLight:Le(tt,.4)},p("scrollbarSliderBackground","Scrollbar slider background color.")),Vh=T("scrollbarSlider.hoverBackground",{dark:K.fromHex("#646464").transparent(.7),light:K.fromHex("#646464").transparent(.7),hcDark:Le(tt,.8),hcLight:Le(tt,.8)},p("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),Hh=T("scrollbarSlider.activeBackground",{dark:K.fromHex("#BFBFBF").transparent(.4),light:K.fromHex("#000000").transparent(.6),hcDark:tt,hcLight:tt},p("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),T8=T("progressBar.background",{dark:K.fromHex("#0E70C0"),light:K.fromHex("#0E70C0"),hcDark:tt,hcLight:tt},p("progressBarBackground","Background color of the progress bar that can show for long running operations.")),tn=T("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:K.black,hcLight:K.white},p("editorBackground","Editor background color.")),Kg=T("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:K.white,hcLight:Ke},p("editorForeground","Editor default foreground color."));T("editorStickyScroll.background",{light:tn,dark:tn,hcDark:tn,hcLight:tn},p("editorStickyScrollBackground","Background color of sticky scroll in the editor"));T("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:K.fromHex("#0F4A85").transparent(.1)},p("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));T("editorStickyScroll.border",{dark:null,light:null,hcDark:tt,hcLight:tt},p("editorStickyScrollBorder","Border color of sticky scroll in the editor"));T("editorStickyScroll.shadow",{dark:Bh,light:Bh,hcDark:Bh,hcLight:Bh},p("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const bi=T("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:K.white},p("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),sa=T("editorWidget.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},p("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),zh=T("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:tt,hcLight:tt},p("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."));T("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},p("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."));T("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const oa=T("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},p("editorError.foreground","Foreground color of error squigglies in the editor.")),sie=T("editorError.border",{dark:null,light:null,hcDark:K.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},p("errorBorder","If set, color of double underlines for errors in the editor.")),km=T("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Dn=T("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},p("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),__=T("editorWarning.border",{dark:null,light:null,hcDark:K.fromHex("#FFCC00").transparent(.8),hcLight:K.fromHex("#FFCC00").transparent(.8)},p("warningBorder","If set, color of double underlines for warnings in the editor."));T("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Vs=T("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},p("editorInfo.foreground","Foreground color of info squigglies in the editor.")),v_=T("editorInfo.border",{dark:null,light:null,hcDark:K.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},p("infoBorder","If set, color of double underlines for infos in the editor.")),A8=T("editorHint.foreground",{dark:K.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},p("editorHint.foreground","Foreground color of hint squigglies in the editor."));T("editorHint.border",{dark:null,light:null,hcDark:K.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},p("hintBorder","If set, color of double underlines for hints in the editor."));const oie=T("editorLink.activeForeground",{dark:"#4E94CE",light:K.blue,hcDark:K.cyan,hcLight:"#292929"},p("activeLinkForeground","Color of active links.")),Rd=T("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},p("editorSelectionBackground","Color of the editor selection.")),M8=T("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:K.white},p("editorSelectionForeground","Color of the selected text for high contrast.")),AA=T("editor.inactiveSelectionBackground",{light:Le(Rd,.5),dark:Le(Rd,.5),hcDark:Le(Rd,.7),hcLight:Le(Rd,.5)},p("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),MA=T("editor.selectionHighlightBackground",{light:Vx(Rd,tn,.3,.6),dark:Vx(Rd,tn,.3,.6),hcDark:null,hcLight:null},p("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);T("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:si,hcLight:si},p("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));T("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},p("editorFindMatch","Color of the current search match."));const rie=T("editor.findMatchForeground",{light:null,dark:null,hcDark:null,hcLight:null},p("editorFindMatchForeground","Text color of the current search match.")),tl=T("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},p("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),aie=T("editor.findMatchHighlightForeground",{light:null,dark:null,hcDark:null,hcLight:null},p("findMatchHighlightForeground","Foreground color of the other search matches."),!0);T("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},p("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);T("editor.findMatchBorder",{light:null,dark:null,hcDark:si,hcLight:si},p("editorFindMatchBorder","Border color of the current search match."));const Pd=T("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:si,hcLight:si},p("findMatchHighlightBorder","Border color of the other search matches.")),lie=T("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:Le(si,.4),hcLight:Le(si,.4)},p("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);T("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},p("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);const zx=T("editorHoverWidget.background",{light:bi,dark:bi,hcDark:bi,hcLight:bi},p("hoverBackground","Background color of the editor hover."));T("editorHoverWidget.foreground",{light:sa,dark:sa,hcDark:sa,hcLight:sa},p("hoverForeground","Foreground color of the editor hover."));const R8=T("editorHoverWidget.border",{light:zh,dark:zh,hcDark:zh,hcLight:zh},p("hoverBorder","Border color of the editor hover."));T("editorHoverWidget.statusBarBackground",{dark:Mo(zx,.2),light:id(zx,.05),hcDark:bi,hcLight:bi},p("statusBarBackground","Background color of the editor hover status bar."));const il=T("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:K.white,hcLight:K.black},p("editorInlayHintForeground","Foreground color of inline hints")),nl=T("editorInlayHint.background",{dark:Le(kp,.1),light:Le(kp,.1),hcDark:Le(K.white,.1),hcLight:Le(kp,.1)},p("editorInlayHintBackground","Background color of inline hints")),cie=T("editorInlayHint.typeForeground",{dark:il,light:il,hcDark:il,hcLight:il},p("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),die=T("editorInlayHint.typeBackground",{dark:nl,light:nl,hcDark:nl,hcLight:nl},p("editorInlayHintBackgroundTypes","Background color of inline hints for types")),uie=T("editorInlayHint.parameterForeground",{dark:il,light:il,hcDark:il,hcLight:il},p("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),hie=T("editorInlayHint.parameterBackground",{dark:nl,light:nl,hcDark:nl,hcLight:nl},p("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),Dm=T("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},p("editorLightBulbForeground","The color used for the lightbulb actions icon."));T("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));T("editorLightBulbAi.foreground",{dark:Dm,light:Dm,hcDark:Dm,hcLight:Dm},p("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));T("editor.snippetTabstopHighlightBackground",{dark:new K(new Je(124,124,124,.3)),light:new K(new Je(10,50,100,.2)),hcDark:new K(new Je(124,124,124,.3)),hcLight:new K(new Je(10,50,100,.2))},p("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));T("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},p("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));T("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));T("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new K(new Je(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},p("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const sw=new K(new Je(155,185,85,.2)),ow=new K(new Je(255,0,0,.2)),P8=T("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},p("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),F8=T("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},p("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);T("diffEditor.insertedLineBackground",{dark:sw,light:sw,hcDark:null,hcLight:null},p("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);T("diffEditor.removedLineBackground",{dark:ow,light:ow,hcDark:null,hcLight:null},p("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);T("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));T("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const O8=T("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),B8=T("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));T("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},p("diffEditorInsertedOutline","Outline color for the text that got inserted."));T("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},p("diffEditorRemovedOutline","Outline color for text that got removed."));T("diffEditor.border",{dark:null,light:null,hcDark:tt,hcLight:tt},p("diffEditorBorder","Border color between the two text editors."));T("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},p("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));T("diffEditor.unchangedRegionBackground",{dark:"sideBar.background",light:"sideBar.background",hcDark:"sideBar.background",hcLight:"sideBar.background"},p("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));T("diffEditor.unchangedRegionForeground",{dark:"foreground",light:"foreground",hcDark:"foreground",hcLight:"foreground"},p("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));T("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},p("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const sl=T("widget.shadow",{dark:Le(K.black,.36),light:Le(K.black,.16),hcDark:null,hcLight:null},p("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),W8=T("widget.border",{dark:null,light:null,hcDark:tt,hcLight:tt},p("widgetBorder","Border color of widgets such as find/replace inside the editor.")),Ux=T("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},p("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));T("toolbar.hoverOutline",{dark:null,light:null,hcDark:si,hcLight:si},p("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));T("toolbar.activeBackground",{dark:Mo(Ux,.1),light:id(Ux,.1),hcDark:null,hcLight:null},p("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));const V8=T("breadcrumb.foreground",{light:Le(Ke,.8),dark:Le(Ke,.8),hcDark:Le(Ke,.8),hcLight:Le(Ke,.8)},p("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),H8=T("breadcrumb.background",{light:tn,dark:tn,hcDark:tn,hcLight:tn},p("breadcrumbsBackground","Background color of breadcrumb items.")),$x=T("breadcrumb.focusForeground",{light:id(Ke,.2),dark:Mo(Ke,.1),hcDark:Mo(Ke,.1),hcLight:Mo(Ke,.1)},p("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),z8=T("breadcrumb.activeSelectionForeground",{light:id(Ke,.2),dark:Mo(Ke,.1),hcDark:Mo(Ke,.1),hcLight:Mo(Ke,.1)},p("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));T("breadcrumbPicker.background",{light:bi,dark:bi,hcDark:bi,hcLight:bi},p("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const RA=.5,Kx=K.fromHex("#40C8AE").transparent(RA),jx=K.fromHex("#40A6FF").transparent(RA),qx=K.fromHex("#606060").transparent(.4),so=.4,Au=1,Fd=T("merge.currentHeaderBackground",{dark:Kx,light:Kx,hcDark:null,hcLight:null},p("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);T("merge.currentContentBackground",{dark:Le(Fd,so),light:Le(Fd,so),hcDark:Le(Fd,so),hcLight:Le(Fd,so)},p("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Od=T("merge.incomingHeaderBackground",{dark:jx,light:jx,hcDark:null,hcLight:null},p("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);T("merge.incomingContentBackground",{dark:Le(Od,so),light:Le(Od,so),hcDark:Le(Od,so),hcLight:Le(Od,so)},p("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Bd=T("merge.commonHeaderBackground",{dark:qx,light:qx,hcDark:null,hcLight:null},p("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);T("merge.commonContentBackground",{dark:Le(Bd,so),light:Le(Bd,so),hcDark:Le(Bd,so),hcLight:Le(Bd,so)},p("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Mu=T("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},p("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));T("editorOverviewRuler.currentContentForeground",{dark:Le(Fd,Au),light:Le(Fd,Au),hcDark:Mu,hcLight:Mu},p("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));T("editorOverviewRuler.incomingContentForeground",{dark:Le(Od,Au),light:Le(Od,Au),hcDark:Mu,hcLight:Mu},p("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));T("editorOverviewRuler.commonContentForeground",{dark:Le(Bd,Au),light:Le(Bd,Au),hcDark:Mu,hcLight:Mu},p("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const fie=T("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},p("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),gie=T("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},p("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),U8=T("problemsErrorIcon.foreground",{dark:oa,light:oa,hcDark:oa,hcLight:oa},p("problemsErrorIconForeground","The color used for the problems error icon.")),$8=T("problemsWarningIcon.foreground",{dark:Dn,light:Dn,hcDark:Dn,hcLight:Dn},p("problemsWarningIconForeground","The color used for the problems warning icon.")),K8=T("problemsInfoIcon.foreground",{dark:Vs,light:Vs,hcDark:Vs,hcLight:Vs},p("problemsInfoIconForeground","The color used for the problems info icon.")),xm=T("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},p("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),mie=T("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},p("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),Gx=T("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},p("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),j8=T("minimap.infoHighlight",{dark:Vs,light:Vs,hcDark:v_,hcLight:v_},p("minimapInfo","Minimap marker color for infos.")),q8=T("minimap.warningHighlight",{dark:Dn,light:Dn,hcDark:__,hcLight:__},p("overviewRuleWarning","Minimap marker color for warnings.")),G8=T("minimap.errorHighlight",{dark:new K(new Je(255,18,18,.7)),light:new K(new Je(255,18,18,.7)),hcDark:new K(new Je(255,50,50,1)),hcLight:"#B5200D"},p("minimapError","Minimap marker color for errors.")),Z8=T("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},p("minimapBackground","Minimap background color.")),Y8=T("minimap.foregroundOpacity",{dark:K.fromHex("#000f"),light:K.fromHex("#000f"),hcDark:K.fromHex("#000f"),hcLight:K.fromHex("#000f")},p("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));T("minimapSlider.background",{light:Le(Wh,.5),dark:Le(Wh,.5),hcDark:Le(Wh,.5),hcLight:Le(Wh,.5)},p("minimapSliderBackground","Minimap slider background color."));T("minimapSlider.hoverBackground",{light:Le(Vh,.5),dark:Le(Vh,.5),hcDark:Le(Vh,.5),hcLight:Le(Vh,.5)},p("minimapSliderHoverBackground","Minimap slider background color when hovering."));T("minimapSlider.activeBackground",{light:Le(Hh,.5),dark:Le(Hh,.5),hcDark:Le(Hh,.5),hcLight:Le(Hh,.5)},p("minimapSliderActiveBackground","Minimap slider background color when clicked on."));T("charts.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},p("chartsForeground","The foreground color used in charts."));T("charts.lines",{dark:Le(Ke,.5),light:Le(Ke,.5),hcDark:Le(Ke,.5),hcLight:Le(Ke,.5)},p("chartsLines","The color used for horizontal lines in charts."));T("charts.red",{dark:oa,light:oa,hcDark:oa,hcLight:oa},p("chartsRed","The red color used in chart visualizations."));T("charts.blue",{dark:Vs,light:Vs,hcDark:Vs,hcLight:Vs},p("chartsBlue","The blue color used in chart visualizations."));T("charts.yellow",{dark:Dn,light:Dn,hcDark:Dn,hcLight:Dn},p("chartsYellow","The yellow color used in chart visualizations."));T("charts.orange",{dark:xm,light:xm,hcDark:xm,hcLight:xm},p("chartsOrange","The orange color used in chart visualizations."));T("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},p("chartsGreen","The green color used in chart visualizations."));T("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("chartsPurple","The purple color used in chart visualizations."));const Q8=T("input.background",{dark:"#3C3C3C",light:K.white,hcDark:K.black,hcLight:K.white},p("inputBoxBackground","Input box background.")),X8=T("input.foreground",{dark:Ke,light:Ke,hcDark:Ke,hcLight:Ke},p("inputBoxForeground","Input box foreground.")),J8=T("input.border",{dark:null,light:null,hcDark:tt,hcLight:tt},p("inputBoxBorder","Input box border.")),e6=T("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:tt,hcLight:tt},p("inputBoxActiveOptionBorder","Border color of activated options in input fields."));T("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},p("inputOption.hoverBackground","Background color of activated options in input fields."));const t6=T("inputOption.activeBackground",{dark:Le(Ws,.4),light:Le(Ws,.2),hcDark:K.transparent,hcLight:K.transparent},p("inputOption.activeBackground","Background hover color of options in input fields.")),i6=T("inputOption.activeForeground",{dark:K.white,light:K.black,hcDark:Ke,hcLight:Ke},p("inputOption.activeForeground","Foreground color of activated options in input fields."));T("input.placeholderForeground",{light:Le(Ke,.5),dark:Le(Ke,.5),hcDark:Le(Ke,.7),hcLight:Le(Ke,.7)},p("inputPlaceholderForeground","Input box foreground color for placeholder text."));const n6=T("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:K.black,hcLight:K.white},p("inputValidationInfoBackground","Input validation background color for information severity.")),s6=T("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},p("inputValidationInfoForeground","Input validation foreground color for information severity.")),o6=T("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:tt,hcLight:tt},p("inputValidationInfoBorder","Input validation border color for information severity.")),r6=T("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:K.black,hcLight:K.white},p("inputValidationWarningBackground","Input validation background color for warning severity.")),a6=T("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},p("inputValidationWarningForeground","Input validation foreground color for warning severity.")),l6=T("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:tt,hcLight:tt},p("inputValidationWarningBorder","Input validation border color for warning severity.")),c6=T("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:K.black,hcLight:K.white},p("inputValidationErrorBackground","Input validation background color for error severity.")),d6=T("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:Ke},p("inputValidationErrorForeground","Input validation foreground color for error severity.")),u6=T("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:tt,hcLight:tt},p("inputValidationErrorBorder","Input validation border color for error severity.")),gr=T("dropdown.background",{dark:"#3C3C3C",light:K.white,hcDark:K.black,hcLight:K.white},p("dropdownBackground","Dropdown background.")),h6=T("dropdown.listBackground",{dark:null,light:null,hcDark:K.black,hcLight:K.white},p("dropdownListBackground","Dropdown list background.")),ra=T("dropdown.foreground",{dark:"#F0F0F0",light:Ke,hcDark:K.white,hcLight:Ke},p("dropdownForeground","Dropdown foreground.")),Wd=T("dropdown.border",{dark:gr,light:"#CECECE",hcDark:tt,hcLight:tt},p("dropdownBorder","Dropdown border.")),Uh=T("button.foreground",{dark:K.white,light:K.white,hcDark:K.white,hcLight:K.white},p("buttonForeground","Button foreground color.")),f6=T("button.separator",{dark:Le(Uh,.4),light:Le(Uh,.4),hcDark:Le(Uh,.4),hcLight:Le(Uh,.4)},p("buttonSeparator","Button separator color.")),$h=T("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},p("buttonBackground","Button background color.")),g6=T("button.hoverBackground",{dark:Mo($h,.2),light:id($h,.2),hcDark:$h,hcLight:$h},p("buttonHoverBackground","Button background color when hovering.")),m6=T("button.border",{dark:tt,light:tt,hcDark:tt,hcLight:tt},p("buttonBorder","Button border color.")),p6=T("button.secondaryForeground",{dark:K.white,light:K.white,hcDark:K.white,hcLight:Ke},p("buttonSecondaryForeground","Secondary button foreground color.")),rw=T("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:K.white},p("buttonSecondaryBackground","Secondary button background color.")),_6=T("button.secondaryHoverBackground",{dark:Mo(rw,.2),light:id(rw,.2),hcDark:null,hcLight:null},p("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),v6=T("checkbox.background",{dark:gr,light:gr,hcDark:gr,hcLight:gr},p("checkbox.background","Background color of checkbox widget."));T("checkbox.selectBackground",{dark:bi,light:bi,hcDark:bi,hcLight:bi},p("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const b6=T("checkbox.foreground",{dark:ra,light:ra,hcDark:ra,hcLight:ra},p("checkbox.foreground","Foreground color of checkbox widget.")),C6=T("checkbox.border",{dark:Wd,light:Wd,hcDark:Wd,hcLight:Wd},p("checkbox.border","Border color of checkbox widget."));T("checkbox.selectBorder",{dark:Md,light:Md,hcDark:Md,hcLight:Md},p("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const w6=T("keybindingLabel.background",{dark:new K(new Je(128,128,128,.17)),light:new K(new Je(221,221,221,.4)),hcDark:K.transparent,hcLight:K.transparent},p("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),y6=T("keybindingLabel.foreground",{dark:K.fromHex("#CCCCCC"),light:K.fromHex("#555555"),hcDark:K.white,hcLight:Ke},p("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),S6=T("keybindingLabel.border",{dark:new K(new Je(51,51,51,.6)),light:new K(new Je(204,204,204,.4)),hcDark:new K(new Je(111,195,223)),hcLight:tt},p("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),L6=T("keybindingLabel.bottomBorder",{dark:new K(new Je(68,68,68,.6)),light:new K(new Je(187,187,187,.4)),hcDark:new K(new Je(111,195,223)),hcLight:Ke},p("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),k6=T("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("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.")),D6=T("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("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.")),x6=T("list.focusOutline",{dark:Ws,light:Ws,hcDark:si,hcLight:si},p("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.")),E6=T("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},p("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),aa=T("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:K.fromHex("#0F4A85").transparent(.1)},p("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.")),mr=T("list.activeSelectionForeground",{dark:K.white,light:K.white,hcDark:null,hcLight:null},p("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.")),Kh=T("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("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.")),I6=T("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:K.fromHex("#0F4A85").transparent(.1)},p("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.")),N6=T("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("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.")),T6=T("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("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.")),A6=T("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("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.")),M6=T("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},p("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.")),PA=T("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:K.white.transparent(.1),hcLight:K.fromHex("#0F4A85").transparent(.1)},p("listHoverBackground","List/Tree background when hovering over items using the mouse.")),FA=T("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),R6=T("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},p("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),P6=T("list.dropBetweenBackground",{dark:Md,light:Md,hcDark:null,hcLight:null},p("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),Em=T("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Ws,hcLight:Ws},p("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),pie=T("list.focusHighlightForeground",{dark:Em,light:E8(aa,Em,"#BBE7FF"),hcDark:Em,hcLight:Em},p("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));T("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},p("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));T("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},p("listErrorForeground","Foreground color of list items containing errors."));T("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},p("listWarningForeground","Foreground color of list items containing warnings."));const F6=T("listFilterWidget.background",{light:id(bi,0),dark:Mo(bi,0),hcDark:bi,hcLight:bi},p("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),O6=T("listFilterWidget.outline",{dark:K.transparent,light:K.transparent,hcDark:"#f38518",hcLight:"#007ACC"},p("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),B6=T("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:tt,hcLight:tt},p("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),W6=T("listFilterWidget.shadow",{dark:sl,light:sl,hcDark:sl,hcLight:sl},p("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));T("list.filterMatchBackground",{dark:tl,light:tl,hcDark:null,hcLight:null},p("listFilterMatchHighlight","Background color of the filtered match."));T("list.filterMatchBorder",{dark:Pd,light:Pd,hcDark:tt,hcLight:si},p("listFilterMatchHighlightBorder","Border color of the filtered match."));T("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},p("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized."));const jh=T("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},p("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),V6=T("tree.inactiveIndentGuidesStroke",{dark:Le(jh,.4),light:Le(jh,.4),hcDark:Le(jh,.4),hcLight:Le(jh,.4)},p("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),H6=T("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},p("tableColumnsBorder","Table border color between columns.")),z6=T("tree.tableOddRowsBackground",{dark:Le(Ke,.04),light:Le(Ke,.04),hcDark:null,hcLight:null},p("tableOddRowsBackgroundColor","Background color for odd table rows.")),U6=T("menu.border",{dark:null,light:null,hcDark:tt,hcLight:tt},p("menuBorder","Border color of menus.")),$6=T("menu.foreground",{dark:ra,light:ra,hcDark:ra,hcLight:ra},p("menuForeground","Foreground color of menu items.")),K6=T("menu.background",{dark:gr,light:gr,hcDark:gr,hcLight:gr},p("menuBackground","Background color of menu items.")),j6=T("menu.selectionForeground",{dark:mr,light:mr,hcDark:mr,hcLight:mr},p("menuSelectionForeground","Foreground color of the selected menu item in menus.")),q6=T("menu.selectionBackground",{dark:aa,light:aa,hcDark:aa,hcLight:aa},p("menuSelectionBackground","Background color of the selected menu item in menus.")),G6=T("menu.selectionBorder",{dark:null,light:null,hcDark:si,hcLight:si},p("menuSelectionBorder","Border color of the selected menu item in menus.")),Z6=T("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:tt,hcLight:tt},p("menuSeparatorBackground","Color of a separator menu item in menus.")),Zx=T("quickInput.background",{dark:bi,light:bi,hcDark:bi,hcLight:bi},p("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Y6=T("quickInput.foreground",{dark:sa,light:sa,hcDark:sa,hcLight:sa},p("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Q6=T("quickInputTitle.background",{dark:new K(new Je(255,255,255,.105)),light:new K(new Je(0,0,0,.06)),hcDark:"#000000",hcLight:K.white},p("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),OA=T("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:K.white,hcLight:"#0F4A85"},p("pickerGroupForeground","Quick picker color for grouping labels.")),X6=T("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:K.white,hcLight:"#0F4A85"},p("pickerGroupBorder","Quick picker color for grouping borders.")),Yx=T("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,p("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),aw=T("quickInputList.focusForeground",{dark:mr,light:mr,hcDark:mr,hcLight:mr},p("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),BA=T("quickInputList.focusIconForeground",{dark:Kh,light:Kh,hcDark:Kh,hcLight:Kh},p("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),lw=T("quickInputList.focusBackground",{dark:Wx(Yx,aa),light:Wx(Yx,aa),hcDark:null,hcLight:null},p("quickInput.listFocusBackground","Quick picker background color for the focused item."));T("search.resultsInfoForeground",{light:Ke,dark:Le(Ke,.65),hcDark:Ke,hcLight:Ke},p("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));T("searchEditor.findMatchBackground",{light:Le(tl,.66),dark:Le(tl,.66),hcDark:tl,hcLight:tl},p("searchEditor.queryMatch","Color of the Search Editor query matches."));T("searchEditor.findMatchBorder",{light:Le(Pd,.66),dark:Le(Pd,.66),hcDark:Pd,hcLight:Pd},p("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));class X0{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new WA(this.x-e.scrollX,this.y-e.scrollY)}}class WA{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new X0(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class J6{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class eB{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function fL(s){const e=Fs(s);return new J6(e.left,e.top,e.width,e.height)}function gL(s,e,t){const i=e.width/s.offsetWidth,n=e.height/s.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/n;return new eB(o,r)}class Dl extends Io{constructor(e,t,i){super(be(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new X0(this.posx,this.posy),this.editorPos=fL(i),this.relativePos=gL(i,this.editorPos,this.pos)}}class tB{constructor(e){this._editorViewDomNode=e}_create(e){return new Dl(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return j(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return j(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return j(e,J.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return j(e,J.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return j(e,J.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return j(e,"mousemove",i=>t(this._create(i)))}}class iB{constructor(e){this._editorViewDomNode=e}_create(e){return new Dl(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return j(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return j(e,J.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return j(e,J.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return j(e,"pointermove",i=>t(this._create(i)))}}class nB extends G{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new Y0),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=Ai(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{n(new Dl(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class mL{constructor(e){this._editor=e,this._instanceId=++mL._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new _n(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new sB(t,`dyn-rule-${this._instanceId}-${n}`,i_(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}mL._idPool=0;class sB{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new pe,this._styleElement=ys(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const o=t[n];let r;typeof o=="object"?r=ne(o.id):r=o;const a=oB(n);i+=` ${a}: ${r};`}return i+=` }`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function oB(s){return s.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class jg extends G{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,n=e.length;i=a.left?n.width=Math.max(n.width,a.left+a.width-n.left):(t[i++]=n,n=a)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const n=[];for(let o=0,r=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),n=Math.min(l,Math.max(0,n)),t===n&&i===o&&i===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}t!==n&&n>0&&o===0&&(n--,o=1073741824);let c=e.children[t].firstChild,d=e.children[n].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&o===0&&n>0&&(d=e.children[n-1].firstChild,o=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const u=this._readClientRects(c,i,d,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}}var Hs;(function(s){s.DARK="dark",s.LIGHT="light",s.HIGH_CONTRAST_DARK="hcDark",s.HIGH_CONTRAST_LIGHT="hcLight"})(Hs||(Hs={}));function iu(s){return s===Hs.HIGH_CONTRAST_DARK||s===Hs.HIGH_CONTRAST_LIGHT}function e1(s){return s===Hs.DARK||s===Hs.HIGH_CONTRAST_DARK}const dB=function(){return nf?!0:!(Vn||lo||ya)}();let nu=!0;class Xx{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(99):this.renderWhitespace="none",this.renderControlCharacters=i.get(94),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(67),this.stopRenderingLineAfter=i.get(117),this.fontLigatures=i.get(51)}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 cr{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=nt(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 iu(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,n,o){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const r=n.getViewLineRenderingData(e),a=this._options,l=no.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn);let c=null;if(iu(a.themeType)||this._options.renderWhitespace==="selection"){const f=n.selections;for(const g of f){if(g.endLineNumbere)continue;const m=g.startLineNumber===e?g.startColumn:r.minColumn,_=g.endLineNumber===e?g.endColumn:r.maxColumn;m<_&&(iu(a.themeType)&&l.push(new no(m,_,"inline-selected-text",0)),this._options.renderWhitespace==="selection"&&(c||(c=[]),c.push(new wA(m-1,_-1))))}}const d=new th(a.useMonospaceOptimizations,a.canUseHalfwidthRightwardsArrow,r.content,r.continuesWithWrappedLine,r.isBasicASCII,r.containsRTL,r.minColumn-1,r.tokens,l,r.tabSize,r.startVisibleColumn,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,a.stopRenderingLineAfter,a.renderWhitespace,a.renderControlCharacters,a.fontLigatures!==Ns.OFF,c);if(this._renderedViewLine&&this._renderedViewLine.input.equals(d))return!1;o.appendString('
');const u=cL(d,o);o.appendString("
");let h=null;return nu&&dB&&r.isBasicASCII&&a.useMonospaceOptimizations&&u.containsForeignElements===0&&(h=new Im(this._renderedViewLine?this._renderedViewLine.domNode:null,d,u.characterMapping)),h||(h=HA(this._renderedViewLine?this._renderedViewLine.domNode:null,d,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=h,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Im:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Im?this._renderedViewLine.monospaceAssumptionsAreValid():nu}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Im&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;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 o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new Qx(!0,[new yc(this.getWidth(n),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new Qx(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}cr.CLASS_NAME="view-line";class Im{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),nu=!1)}return nu}toSlowRenderedLine(){return HA(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n),r=this._getColumnPixelOffset(e,i,n);return[new yc(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const n=Math.floor((t-1)/300)-1,o=(n+1)*300+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[n],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=r)),r===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),o=Dp.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return zA(this._characterMapping,e,t)}}class VA{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,n);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,n);return r===-1?null:[new yc(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new yc(r,0)]}else return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(n);const o=this._getReadingTarget(e);return o.firstChild?(n.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(this._characterMapping.length===0){const l=Dp.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(n);const o=this._characterMapping.getDomPosition(i),r=Dp.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,n){if(t===1&&i===this._characterMapping.length)return[new yc(0,this.getWidth(n))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return Dp.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,n)}getColumnOfNodeOffset(e,t){return zA(this._characterMapping,e,t)}}class uB extends VA{_readVisibleRangesForRange(e,t,i,n,o){const r=super._readVisibleRangesForRange(e,t,i,n,o);if(!r||r.length===0||i===n||i===1&&n===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,n,o);if(a!==-1){const l=r[r.length-1];l.left=t){const u=t-r;return c-t=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}}class Ru{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(145),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(67),this.stickyTabStops=n.get(116),this.typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Ru.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,l=null;return i.afterLineNumber!==o&&(l=new V(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new V(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=r:r===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,fn._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class pB extends mB{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=Fo.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,n,o){super(e,t,i,n),this.hitTestResult=new Ml(()=>fn.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=o;const r=!!this._eventTarget;this._useHitTestTarget=!r}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return wn.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return r.glyphMarginLane=l[Math.floor(o/e.lineHeight)],t.fulfillMargin(2,n,i.range,r)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,r))}return null}static _hitTestViewLines(e,t){if(!wn.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new V(1,1),Jx);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const n=e.viewModel.getLineCount(),o=e.viewModel.getLineMaxColumn(n);return t.fulfillContentEmpty(new V(n,o),Jx)}if(wn.isStrictChildOfViewLines(t.targetPath)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(n)===0){const r=e.getLineWidth(n),a=bv(t.mouseContentHorizontalOffset-r);return t.fulfillContentEmpty(new V(n,1),a)}const o=e.getLineWidth(n);if(t.mouseContentHorizontalOffset>=o){const r=bv(t.mouseContentHorizontalOffset-o),a=new V(n,e.viewModel.getLineMaxColumn(n));return t.fulfillContentEmpty(a,r)}}const i=t.hitTestResult.value;return i.type===1?fn.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(wn.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new V(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(wn.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const n=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(n);return t.fulfillScrollbar(new V(n,o))}}return null}static _hitTestScrollbar(e,t){if(wn.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new V(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(145),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return fn._getMouseColumn(n,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const r=n.lineNumber,a=n.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){const v=bv(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(n,v)}const c=e.visibleRangeForPosition(r,a);if(!c)return t.fulfillUnknown(n);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const u=[];if(u.push({offset:c.left,column:a}),a>1){const v=e.visibleRangeForPosition(r,a-1);v&&u.push({offset:v.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(r);if(av.offset-b.offset);const f=t.pos.toClientCoordinates(be(e.viewDomNode)),g=i.getBoundingClientRect(),m=g.left<=f.clientX&&f.clientX<=g.right;let _=null;for(let v=1;vo)){const a=Math.floor((n+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new X0(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(be(e.viewDomNode)));if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(be(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=ku(e.viewDomNode);let n;if(i?typeof i.caretRangeFromPoint>"u"?n=_B(i,t.clientX,t.clientY):n=i.caretRangeFromPoint(t.clientX,t.clientY):n=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new Fa;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===cr.CLASS_NAME?sc.createFromDOMInfo(e,r,n.startOffset):new Fa(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===cr.CLASS_NAME?sc.createFromDOMInfo(e,o,o.textContent.length):new Fa(o)}return new Fa}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const n=i.offsetNode.parentNode,o=n?n.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===cr.CLASS_NAME?sc.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Fa(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const n=i.offsetNode.parentNode,o=n&&n.nodeType===n.ELEMENT_NODE?n.className:null,r=n?n.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===cr.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return sc.createFromDOMInfo(e,l,0)}else if(a===cr.CLASS_NAME)return sc.createFromDOMInfo(e,i.offsetNode,0)}return new Fa(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=Yf.atomicPosition(i,e.column-1,n,2);return o!==-1?new V(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new Fa;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(be(e.viewDomNode)))),i.type===1){const n=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,2);(n||!o.equals(i.position))&&(i=new UA(o,i.spanNode,n))}return i}}function _B(s,e,t){const i=document.createRange();let n=s.elementFromPoint(e,t);if(n!==null){for(;n&&n.firstChild&&n.firstChild.nodeType!==n.firstChild.TEXT_NODE&&n.lastChild&&n.lastChild.firstChild;)n=n.lastChild;const o=n.getBoundingClientRect(),r=be(n),a=r.getComputedStyle(n,null).getPropertyValue("font-style"),l=r.getComputedStyle(n,null).getPropertyValue("font-variant"),c=r.getComputedStyle(n,null).getPropertyValue("font-weight"),d=r.getComputedStyle(n,null).getPropertyValue("font-size"),u=r.getComputedStyle(n,null).getPropertyValue("line-height"),h=r.getComputedStyle(n,null).getPropertyValue("font-family"),f=`${a} ${l} ${c} ${d}/${u} ${h}`,g=n.innerText;let m=o.left,_=0,v;if(e>o.left+o.width)_=g.length;else{const b=fc.getInstance();for(let C=0;C=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},It;(function(s){s.Tap="-monaco-gesturetap",s.Change="-monaco-gesturechange",s.Start="-monaco-gesturestart",s.End="-monaco-gesturesend",s.Contextmenu="-monaco-gesturecontextmenu"})(It||(It={}));class Ft extends G{constructor(){super(),this.dispatched=!1,this.targets=new Qn,this.ignoreTargets=new Qn,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(te.runAndSubscribe(M0,({window:e,disposables:t})=>{t.add(j(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(j(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(j(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:wt,disposables:this._store}))}static addTarget(e){if(!Ft.isTouchDevice())return G.None;Ft.INSTANCE||(Ft.INSTANCE=new Ft);const t=Ft.INSTANCE.targets.push(e);return Be(t)}static ignoreTarget(e){if(!Ft.isTouchDevice())return G.None;Ft.INSTANCE||(Ft.INSTANCE=new Ft);const t=Ft.INSTANCE.ignoreTargets.push(e);return Be(t)}static isTouchDevice(){return"ontouchstart"in wt||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i=Ft.HOLD_DELAY&&Math.abs(l.initialPageX-xs(l.rollingPageX))<30&&Math.abs(l.initialPageY-xs(l.rollingPageY))<30){const d=this.newGestureEvent(It.Contextmenu,l.initialTarget);d.pageX=xs(l.rollingPageX),d.pageY=xs(l.rollingPageY),this.dispatchEvent(d)}else if(n===1){const d=xs(l.rollingPageX),u=xs(l.rollingPageY),h=xs(l.rollingTimestamps)-l.rollingTimestamps[0],f=d-l.rollingPageX[0],g=u-l.rollingPageY[0],m=[...this.targets].filter(_=>l.initialTarget instanceof Node&&_.contains(l.initialTarget));this.inertia(e,m,i,Math.abs(f)/h,f>0?1:-1,d,Math.abs(g)/h,g>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(It.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===It.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Ft.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===It.Change||e.type===It.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let n=0,o=e.initialTarget;for(;o&&o!==i;)n++,o=o.parentElement;t.push([n,i])}t.sort((i,n)=>i[0]-n[0]);for(const[i,n]of t)n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,o,r,a,l,c){this.handle=is(e,()=>{const d=Date.now(),u=d-i;let h=0,f=0,g=!0;n+=Ft.SCROLL_FRICTION*u,a+=Ft.SCROLL_FRICTION*u,n>0&&(g=!1,h=o*n*u),a>0&&(g=!1,f=l*a*u);const m=this.newGestureEvent(It.Change);m.translationX=h,m.translationY=f,t.forEach(_=>_.dispatchEvent(m)),g||this.inertia(e,t,d,n,o,r+h,a,l,c+f)})}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Ft.SCROLL_FRICTION=-.005;Ft.HOLD_DELAY=700;Ft.CLEAR_TAP_COUNT_TIME=400;vB([Jt],Ft,"isTouchDevice",null);let La=class extends G{onclick(e,t){this._register(j(e,J.CLICK,i=>t(new Io(be(e),i))))}onmousedown(e,t){this._register(j(e,J.MOUSE_DOWN,i=>t(new Io(be(e),i))))}onmouseover(e,t){this._register(j(e,J.MOUSE_OVER,i=>t(new Io(be(e),i))))}onmouseleave(e,t){this._register(j(e,J.MOUSE_LEAVE,i=>t(new Io(be(e),i))))}onkeydown(e,t){this._register(j(e,J.KEY_DOWN,i=>t(new Ot(i))))}onkeyup(e,t){this._register(j(e,J.KEY_UP,i=>t(new Ot(i))))}oninput(e,t){this._register(j(e,J.INPUT,t))}onblur(e,t){this._register(j(e,J.BLUR,t))}onfocus(e,t){this._register(j(e,J.FOCUS,t))}ignoreGesture(e){return Ft.ignoreTarget(e)}};const Pu=11;class bB extends La{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(...et.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Pu+"px",this.domNode.style.height=Pu+"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._pointerMoveMonitor=this._register(new Y0),this._register(Ai(this.bgDomNode,J.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ai(this.domNode,J.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new VS),this._pointerdownScheduleRepeatTimer=this._register(new Zc)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,be(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class CB extends G{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 Zc)}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(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const wB=140;class $A extends La{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 CB(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Y0),this._shouldRender=!0,this.domNode=nt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(j(this.domNode.domNode,J.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new bB(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=nt(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 n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(j(this.slider.domNode,J.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.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()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=Fs(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(Wn&&a>wB){this._setDesiredScrollPositionNow(n.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),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 yB=20;class Fu{constructor(e,t,i,n,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Fu(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,n,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),l=n>0&&n>i;if(!l)return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(yB,Math.floor(i*a/n))),d=(a-c)/(n-i),u=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){const e=Fu._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 Mc(null,1,0))}),this._createArrow({className:"scra",icon:ce.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Mc(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}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_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}}class LB extends $A{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Fu(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-Pu)/2,a=(t.verticalScrollbarSize-Pu)/2;this._createArrow({className:"scra",icon:ce.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Mc(null,0,1))}),this._createArrow({className:"scra",icon:ce.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Mc(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}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_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 b_{constructor(e,t,i,n,o,r,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,n=n|0,o=o|0,r=r|0,a=a|0),this.rawScrollLeft=n,this.rawScrollTop=a,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),o<0&&(o=0),a+o>r&&(a=r-o),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=o,this.scrollHeight=r,this.scrollTop=a}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 b_(this._forceIntegerValues,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 b_(this._forceIntegerValues,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,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,r=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:n,scrollLeftChanged:o,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}}class ih extends G{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new O),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new b_(e.forceIntegerValues,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){var i;const n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(i=this._smoothScrolling)===null||i===void 0||i.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 n;t?n=new Qf(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=Qf.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_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 e2{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function Cv(s,e){const t=e-s;return function(i){return s+t*xB(i)}}function kB(s,e,t){return function(i){return i2.5*i){let o,r;return e0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const n=Math.abs(e.deltaX),o=Math.abs(e.deltaY),r=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(n,r),1),c=Math.max(Math.min(o,a),1),d=Math.max(n,r),u=Math.max(o,a);d%l===0&&u%c===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}C_.INSTANCE=new C_;class pL extends La{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new O),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new O),e.style.overflow="hidden",this._options=TB(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const n={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new LB(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new SB(this._scrollable,this._options,n)),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=nt(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=nt(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=nt(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,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Zc),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Hi(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ye&&(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()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Mc(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Hi(this._mouseWheelToDispose),e)){const i=n=>{this._onMouseWheel(new Mc(n))};this._mouseWheelToDispose.push(j(this._listenOnDomNode,J.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=C_.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+r===0?a=r=0:Math.abs(r)>=Math.abs(a)?a=0:r=0),this._options.flipAxes&&([r,a]=[a,r]);const l=!Ye&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let d={};if(r){const u=t2*r,h=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,h)}if(a){const u=t2*a,h=c.scrollLeft-(u<0?Math.floor(u):Math.ceil(u));this._horizontalScrollbar.writeScrollPosition(d,h)}d=this._scrollable.validateScrollPosition(d),(c.scrollLeft!==d.scrollLeft||c.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),n=!0)}let o=n;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(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,n=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(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(),EB)}}class NB extends pL{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new ih({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>is(be(e),n)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class t1 extends pL{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 _L extends pL{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new ih({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:n=>is(be(e),n)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(n=>{n.scrollTopChanged&&(this._element.scrollTop=n.scrollTop),n.scrollLeftChanged&&(this._element.scrollLeft=n.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}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 TB(s){const e={lazyRender:typeof s.lazyRender<"u"?s.lazyRender:!1,className:typeof s.className<"u"?s.className:"",useShadows:typeof s.useShadows<"u"?s.useShadows:!0,handleMouseWheel:typeof s.handleMouseWheel<"u"?s.handleMouseWheel:!0,flipAxes:typeof s.flipAxes<"u"?s.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof s.consumeMouseWheelIfScrollbarIsNeeded<"u"?s.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof s.alwaysConsumeMouseWheel<"u"?s.alwaysConsumeMouseWheel:!1,scrollYToX:typeof s.scrollYToX<"u"?s.scrollYToX:!1,mouseWheelScrollSensitivity:typeof s.mouseWheelScrollSensitivity<"u"?s.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof s.fastScrollSensitivity<"u"?s.fastScrollSensitivity:5,scrollPredominantAxis:typeof s.scrollPredominantAxis<"u"?s.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof s.mouseWheelSmoothScroll<"u"?s.mouseWheelSmoothScroll:!0,arrowSize:typeof s.arrowSize<"u"?s.arrowSize:11,listenOnDomNode:typeof s.listenOnDomNode<"u"?s.listenOnDomNode:null,horizontal:typeof s.horizontal<"u"?s.horizontal:1,horizontalScrollbarSize:typeof s.horizontalScrollbarSize<"u"?s.horizontalScrollbarSize:10,horizontalSliderSize:typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:0,horizontalHasArrows:typeof s.horizontalHasArrows<"u"?s.horizontalHasArrows:!1,vertical:typeof s.vertical<"u"?s.vertical:1,verticalScrollbarSize:typeof s.verticalScrollbarSize<"u"?s.verticalScrollbarSize:10,verticalHasArrows:typeof s.verticalHasArrows<"u"?s.verticalHasArrows:!1,verticalSliderSize:typeof s.verticalSliderSize<"u"?s.verticalSliderSize:0,scrollByPage:typeof s.scrollByPage<"u"?s.scrollByPage:!1};return e.horizontalSliderSize=typeof s.horizontalSliderSize<"u"?s.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof s.verticalSliderSize<"u"?s.verticalSliderSize:e.verticalScrollbarSize,Ye&&(e.className+=" mac"),e}class vL extends jg{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new fn(this._context,i),this._mouseDownOperation=this._register(new AB(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(145).height;const n=new tB(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=j(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new Dl(a,!1,this.viewHelper.viewDomNode))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{o=a})),this._register(j(this.viewHelper.viewDomNode,J.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=C_.INSTANCE;let t=0,i=Ka.getZoomLevel(),n=!1,o=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(76))return;const c=new Mc(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=Ka.getZoomLevel(),u=c.deltaY>0?1:-1;Ka.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=Ka.getZoomLevel(),n=a(l),o=0),t=Date.now(),o+=c.deltaY,n&&(Ka.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(j(this.viewHelper.viewDomNode,J.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return Ye?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(145)){const t=this._context.configuration.options.get(145).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const n=new WA(e,t).toPageCoordinates(be(this.viewHelper.viewDomNode)),o=fL(this.viewHelper.viewDomNode);if(n.yo.y+o.height||n.xo.x+o.width)return null;const r=gL(this.viewHelper.viewDomNode,o,n);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,n,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const n=ku(this.viewHelper.viewDomNode);n&&(i=n.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||r&&a))u(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(l){const h=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(u(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class AB extends G{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new nB(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new MB(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new i1,this._currentSelection=new yt(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,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(91)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&n.type===6&&n.position&&this._currentSelection.containsPosition(n.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);$a(r)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=n.getCurrentScrollTop()+e.relativePos.y,c=Ru.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return mn.createOutsideEditor(o,u,"below",a)}const d=n.getLineNumberAtVerticalOffset(l);return mn.createOutsideEditor(o,new V(d,i.getLineMaxColumn(d)),"below",a)}const r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return mn.createOutsideEditor(o,new V(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(n.type===8||n.type===5){const r=this._helpPositionJumpOverViewZone(n.detail);if(r)return mn.createViewZone(n.type,n.element,n.mouseColumn,r,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new V(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,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,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class MB extends G{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new RB(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class RB extends G{constructor(e,t,i,n,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=is(be(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(67),t=this._context.configuration.options.get(145).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(67),t=this._getScrollSpeed(),i=this._tick(),n=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-n:n;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let l;{const c=fL(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(145).horizontalScrollbarHeight,u=new X0(this._mouseEvent.pos.x,c.y+c.height-d-.1),h=gL(this._viewHelper.viewDomNode,c,u);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,u,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=mn.createOutsideEditor(this._position.mouseColumn,new V(a,1),"above",this._position.outsideDistance):l=mn.createOutsideEditor(this._position.mouseColumn,new V(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=is(be(l.element),()=>this._execute())}}class i1{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}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 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>i1.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)}}i1.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class Ue{get event(){return this.emitter.event}constructor(e,t,i){const n=o=>this.emitter.fire(o);this.emitter=new O({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}class Pi{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,n),l=t.value.substring(0,t.selectionStart);a===l&&(r=t.newlineCountBeforeSelection)}return new Pi(i,n,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new Pi(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,n,o,r,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((i=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&i!==void 0?i:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(n=this.selection)===null||n===void 0?void 0:n.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const d=this.value.substring(this.selectionStart,e);if(d.indexOf("…")===-1)return this._finishDeduceEditorPosition((a=(r=this.selection)===null||r===void 0?void 0:r.getStartPosition())!==null&&a!==void 0?a:null,d,1);const u=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,u,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;(o=t.indexOf(` `,o+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(LC(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(kC(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);const r=t.value.substring(n,t.value.length-o),a=e.selectionStart-n,l=e.selectionEnd-n,c=t.selectionStart-n,d=t.selectionEnd-n;if(c===d){const h=e.selectionStart-n;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:r,replacePrevCharCnt:u,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(LC(e.value,t.value),e.selectionEnd),n=Math.min(kC(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-r.length}}}Pi.EMPTY=new Pi("",0,0,null,void 0);class Vd{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new M(n,1,o+1,1)}static fromEditorSelection(e,t,i,n){const r=Vd._getPageOfLine(t.startLineNumber,i),a=Vd._getRangeForPage(r,i),l=Vd._getPageOfLine(t.endLineNumber,i),c=Vd._getRangeForPage(l,i);let d=a.intersectRanges(new M(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,1)>500){const v=e.modifyPosition(d.getEndPosition(),-500);d=M.fromPositions(v,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new M(t.endLineNumber,t.endColumn,h,f));if(n&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=M.fromPositions(g.getStartPosition(),v)}const m=e.getValueInRange(g,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=c.intersectRanges(t);_=e.getValueInRange(v,1)+"…"+e.getValueInRange(b,1)}return n&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new Pi(u+_+m,u.length,u.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var PB=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},i2=function(s,e){return function(t,i){e(t,i,s)}},w_;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(w_||(w_={}));const FB={forceCopyWithSyntaxHighlighting:!1};class y_{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)}}y_.INSTANCE=new y_;class OB{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let cw=class extends G{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=o,this._logService=r,this._onFocus=this._register(new O),this.onFocus=this._onFocus.event,this._onBlur=this._register(new O),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new O),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new O),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new O),this.onCut=this._onCut.event,this._onPaste=this._register(new O),this.onPaste=this._onPaste.event,this._onType=this._register(new O),this.onType=this._onType.event,this._onCompositionStart=this._register(new O),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new O),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new O),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new O),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Ca),this._asyncTriggerCut=this._register(new _n(()=>this._onCut.fire(),0)),this._textAreaState=Pi.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(te.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new _n(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{const c=new Ot(l);(c.keyCode===114||this._currentComposition&&c.keyCode===1)&&c.stopPropagation(),c.equals(9)&&c.preventDefault(),a=c,this._onKeyDown.fire(c)})),this._register(this._textArea.onKeyUp(l=>{const c=new Ot(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{const c=new OB;if(this._currentComposition){this._currentComposition=c;return}if(this._currentComposition=c,this._OS===2&&a&&a.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===l.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){c.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:l.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:l.data});return}this._onCompositionStart.fire({data:l.data})})),this._register(this._textArea.onCompositionUpdate(l=>{const c=this._currentComposition;if(!c)return;if(this._browser.isAndroid){const u=Pi.readFromTextArea(this._textArea,this._textAreaState),h=Pi.deduceAndroidCompositionInput(this._textAreaState,u);this._textAreaState=u,this._onType.fire(h),this._onCompositionUpdate.fire(l);return}const d=c.handleCompositionUpdate(l.data);this._textAreaState=Pi.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{const c=this._currentComposition;if(!c)return;if(this._currentComposition=null,this._browser.isAndroid){const u=Pi.readFromTextArea(this._textArea,this._textAreaState),h=Pi.deduceAndroidCompositionInput(this._textAreaState,u);this._textAreaState=u,this._onType.fire(h),this._onCompositionEnd.fire();return}const d=c.handleCompositionUpdate(l.data);this._textAreaState=Pi.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const c=Pi.readFromTextArea(this._textArea,this._textAreaState),d=Pi.deduceInput(this._textAreaState,c,this._OS===2);d.replacePrevCharCnt===0&&d.text.length===1&&(Di(d.text.charCodeAt(0))||d.text.charCodeAt(0)===127)||(this._textAreaState=c,(d.text!==""||d.replacePrevCharCnt!==0||d.replaceNextCharCnt!==0||d.positionDelta!==0)&&this._onType.fire(d))})),this._register(this._textArea.onCut(l=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[c,d]=n2.getTextData(l.clipboardData);c&&(d=d||y_.INSTANCE.get(c),this._onPaste.fire({text:c,metadata:d}))})),this._register(this._textArea.onFocus(()=>{const l=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!l&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new _n(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return j(this._textArea.ownerDocument,"selectionchange",t=>{if(el.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),u=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(u[0],u[1],u[2]),f=new yt(d.lineNumber,d.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_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.writeNativeTextAreaContent("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}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};y_.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` `):t.text,i),e.preventDefault(),e.clipboardData&&n2.setTextData(e.clipboardData,t.text,t.html,i)}};cw=PB([i2(4,Uo),i2(5,uo)],cw);const n2={getTextData(s){const e=s.getData(Jr.text);let t=null;const i=s.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&s.files.length>0?[Array.prototype.slice.call(s.files,0).map(o=>o.name).join(` `),null]:[e,t]},setTextData(s,e,t,i){s.setData(Jr.text,e),typeof t=="string"&&s.setData("text/html",t),s.setData("vscode-editor-data",JSON.stringify(i))}};class BB extends G{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Ue(this._actual,"keydown")).event,this.onKeyUp=this._register(new Ue(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Ue(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Ue(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Ue(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Ue(this._actual,"beforeinput")).event,this.onInput=this._register(new Ue(this._actual,"input")).event,this.onCut=this._register(new Ue(this._actual,"cut")).event,this.onCopy=this._register(new Ue(this._actual,"copy")).event,this.onPaste=this._register(new Ue(this._actual,"paste")).event,this.onFocus=this._register(new Ue(this._actual,"focus")).event,this.onBlur=this._register(new Ue(this._actual,"blur")).event,this._onSyntheticTap=this._register(new O),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>el.onKeyDown())),this._register(this.onBeforeInput(()=>el.onBeforeInput())),this._register(this.onInput(()=>el.onInput())),this._register(this.onKeyUp(()=>el.onKeyUp())),this._register(j(this._actual,w_.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=ku(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?vn()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const r=ku(n);r?o=r.activeElement:o=vn();const a=be(o),l=o===n,c=n.selectionStart,d=n.selectionEnd;if(l&&c===t&&d===i){lo&&a.parent!==a&&n.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),lo&&a.parent!==a&&n.focus();return}try{const u=zO(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),UO(n,u)}catch{}}}class WB extends vL{constructor(e,t,i){super(e,t,i),this._register(Ft.addTarget(this.viewHelper.linesContentDomNode)),this._register(j(this.viewHelper.linesContentDomNode,It.Tap,o=>this.onTap(o))),this._register(j(this.viewHelper.linesContentDomNode,It.Change,o=>this.onChange(o))),this._register(j(this.viewHelper.linesContentDomNode,It.Contextmenu,o=>this._onContextMenu(new Dl(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(j(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new iB(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new Dl(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===6&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class VB extends vL{constructor(e,t,i){super(e,t,i),this._register(Ft.addTarget(this.viewHelper.linesContentDomNode)),this._register(j(this.viewHelper.linesContentDomNode,It.Tap,n=>this.onTap(n))),this._register(j(this.viewHelper.linesContentDomNode,It.Change,n=>this.onChange(n))),this._register(j(this.viewHelper.linesContentDomNode,It.Contextmenu,n=>this._onContextMenu(new Dl(n,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Dl(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(w_.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class HB extends G{constructor(e,t,i){super(),(Cl||V5&&ON)&&PS.pointerEvents?this.handler=this._register(new WB(e,t,i)):wt.TouchEvent?this.handler=this._register(new VB(e,t,i)):this.handler=this._register(new vL(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class nd extends jg{}const ho=Qe("themeService");function pd(s){return{id:s}}function dw(s){switch(s){case Hs.DARK:return"vs-dark";case Hs.HIGH_CONTRAST_DARK:return"hc-black";case Hs.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const KA={ThemingContribution:"base.contributions.theming"};class zB{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new O}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Be(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const jA=new zB;zi.add(KA.ThemingContribution,jA);function ka(s){return jA.onColorThemeChange(s)}class UB extends G{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(){}}const qA=T("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},p("lineHighlight","Background color for the highlight of line at the cursor position.")),s2=T("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:tt},p("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));T("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},p("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);T("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:si,hcLight:si},p("rangeHighlightBorder","Background color of the border around highlighted ranges."));T("editor.symbolHighlightBackground",{dark:tl,light:tl,hcDark:null,hcLight:null},p("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);T("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:si,hcLight:si},p("symbolHighlightBorder","Background color of the border around highlighted symbols."));const pr=T("editorCursor.foreground",{dark:"#AEAFAD",light:K.black,hcDark:K.white,hcLight:"#0F4A85"},p("caret","Color of the editor cursor.")),la=T("editorCursor.background",null,p("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),GA=T("editorMultiCursor.primary.foreground",{dark:pr,light:pr,hcDark:pr,hcLight:pr},p("editorMultiCursorPrimaryForeground","Color of the primary editor cursor when multiple cursors are present.")),$B=T("editorMultiCursor.primary.background",{dark:la,light:la,hcDark:la,hcLight:la},p("editorMultiCursorPrimaryBackground","The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),ZA=T("editorMultiCursor.secondary.foreground",{dark:pr,light:pr,hcDark:pr,hcLight:pr},p("editorMultiCursorSecondaryForeground","Color of secondary editor cursors when multiple cursors are present.")),KB=T("editorMultiCursor.secondary.background",{dark:la,light:la,hcDark:la,hcLight:la},p("editorMultiCursorSecondaryBackground","The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),ca=T("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},p("editorWhitespaces","Color of whitespace characters in the editor.")),jB=T("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:K.white,hcLight:"#292929"},p("editorLineNumbers","Color of editor line numbers.")),Nm=T("editorIndentGuide.background",{dark:ca,light:ca,hcDark:ca,hcLight:ca},p("editorIndentGuides","Color of the editor indentation guides."),!1,p("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Tm=T("editorIndentGuide.activeBackground",{dark:ca,light:ca,hcDark:ca,hcLight:ca},p("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,p("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),qg=T("editorIndentGuide.background1",{dark:Nm,light:Nm,hcDark:Nm,hcLight:Nm},p("editorIndentGuides1","Color of the editor indentation guides (1).")),qB=T("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides2","Color of the editor indentation guides (2).")),GB=T("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides3","Color of the editor indentation guides (3).")),ZB=T("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides4","Color of the editor indentation guides (4).")),YB=T("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides5","Color of the editor indentation guides (5).")),QB=T("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorIndentGuides6","Color of the editor indentation guides (6).")),Gg=T("editorIndentGuide.activeBackground1",{dark:Tm,light:Tm,hcDark:Tm,hcLight:Tm},p("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),XB=T("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),JB=T("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),eW=T("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),tW=T("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),iW=T("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),Am=T("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:si,hcLight:si},p("editorActiveLineNumber","Color of editor active line number"),!1,p("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));T("editorLineNumber.activeForeground",{dark:Am,light:Am,hcDark:Am,hcLight:Am},p("editorActiveLineNumber","Color of editor active line number"));const nW=T("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},p("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));T("editorRuler.foreground",{dark:"#5A5A5A",light:K.lightgrey,hcDark:K.white,hcLight:"#292929"},p("editorRuler","Color of the editor rulers."));T("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},p("editorCodeLensForeground","Foreground color of editor CodeLens"));T("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},p("editorBracketMatchBackground","Background color behind matching brackets"));T("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:tt,hcLight:tt},p("editorBracketMatchBorder","Color for matching brackets boxes"));const sW=T("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},p("editorOverviewRulerBorder","Color of the overview ruler border.")),oW=T("editorOverviewRuler.background",null,p("editorOverviewRulerBackground","Background color of the editor overview ruler."));T("editorGutter.background",{dark:tn,light:tn,hcDark:tn,hcLight:tn},p("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));T("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:K.fromHex("#fff").transparent(.8),hcLight:tt},p("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const rW=T("editorUnnecessaryCode.opacity",{dark:K.fromHex("#000a"),light:K.fromHex("#0007"),hcDark:null,hcLight:null},p("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.`));T("editorGhostText.border",{dark:null,light:null,hcDark:K.fromHex("#fff").transparent(.8),hcLight:K.fromHex("#292929").transparent(.8)},p("editorGhostTextBorder","Border color of ghost text in the editor."));T("editorGhostText.foreground",{dark:K.fromHex("#ffffff56"),light:K.fromHex("#0007"),hcDark:null,hcLight:null},p("editorGhostTextForeground","Foreground color of the ghost text in the editor."));T("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},p("editorGhostTextBackground","Background color of the ghost text in the editor."));const Mm=new K(new Je(0,122,204,.6)),bie=T("editorOverviewRuler.rangeHighlightForeground",{dark:Mm,light:Mm,hcDark:Mm,hcLight:Mm},p("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),aW=T("editorOverviewRuler.errorForeground",{dark:new K(new Je(255,18,18,.7)),light:new K(new Je(255,18,18,.7)),hcDark:new K(new Je(255,50,50,1)),hcLight:"#B5200D"},p("overviewRuleError","Overview ruler marker color for errors.")),lW=T("editorOverviewRuler.warningForeground",{dark:Dn,light:Dn,hcDark:__,hcLight:__},p("overviewRuleWarning","Overview ruler marker color for warnings.")),cW=T("editorOverviewRuler.infoForeground",{dark:Vs,light:Vs,hcDark:v_,hcLight:v_},p("overviewRuleInfo","Overview ruler marker color for infos.")),YA=T("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},p("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),QA=T("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},p("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),XA=T("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},p("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),JA=T("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),eM=T("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),tM=T("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),dW=T("editorBracketHighlight.unexpectedBracket.foreground",{dark:new K(new Je(255,18,18,.8)),light:new K(new Je(255,18,18,.8)),hcDark:new K(new Je(255,50,50,1)),hcLight:""},p("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),uW=T("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),hW=T("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),fW=T("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),gW=T("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),mW=T("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),pW=T("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),_W=T("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),vW=T("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),bW=T("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),CW=T("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),wW=T("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),yW=T("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},p("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));T("editorUnicodeHighlight.border",{dark:Dn,light:Dn,hcDark:Dn,hcLight:Dn},p("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));T("editorUnicodeHighlight.background",{dark:km,light:km,hcDark:km,hcLight:km},p("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));ka((s,e)=>{const t=s.getColor(tn),i=s.getColor(qA),n=i&&!i.isTransparent()?i:t;n&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${n}; }`)});class Zg extends nd{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new V(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(67);const t=e.get(68);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(95);const i=e.get(145);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.viewModel.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}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new V(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const n=Math.abs(this._lastCursorModelPosition.lineNumber-i);return n===0?''+i+"":String(n)}if(this._renderLineNumbers===3){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const n=this._context.viewModel.getLineCount();return i===n?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Vn?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);o.sort((c,d)=>M.compareRangesUsingEnds(c.range,d.range));let r=0;const a=this._context.viewModel.getLineCount(),l=[];for(let c=i;c<=n;c++){const d=c-i;let u=this._getLineRenderLineNumber(c),h="";for(;r${u}`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Zg.CLASS_NAME="line-numbers";ka((s,e)=>{const t=s.getColor(jB),i=s.getColor(nW);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class Oc extends os{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(145);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=nt(document.createElement("div")),this._domNode.setClassName(Oc.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=nt(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Oc.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(145);return this._canUseLayerHinting=!t.get(32),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)}}Oc.CLASS_NAME="glyph-margin";Oc.OUTER_CLASS_NAME="margin";const su="monaco-mouse-cursor-text";class SW{constructor(){this._onDidChange=new O,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const hf=new SW,Zi=Qe("keybindingService");var LW=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},o2=function(s,e){return function(t,i){e(t,i,s)}};class kW{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new V(this.modelLineNumber,this.distanceToModelLineStart+1),i=new V(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const wv=lo;let uw=class extends os{constructor(e,t,i,n,o){super(e),this._keybindingService=n,this._instantiationService=o,this._primaryCursorPosition=new V(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,a=r.get(145);this._setAccessibilityOptions(r),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=r.get(50),this._lineHeight=r.get(67),this._emptySelectionClipboard=r.get(37),this._copyWithSyntaxHighlighting=r.get(25),this._visibleTextArea=null,this._selections=[new yt(1,1,1,1)],this._modelSelections=[new yt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=nt(document.createElement("textarea")),Fo.write(this.textArea,7),this.textArea.setClassName(`inputarea ${su}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${l*this._fontInfo.spaceWidth}px`,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(r)),this.textArea.setAttribute("aria-required",r.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(124))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",p("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(91)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=nt(document.createElement("div")),this.textAreaCover.setPosition("absolute");const c={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:h=>this._context.viewModel.getLineMaxColumn(h),getValueInRange:(h,f)=>this._context.viewModel.getValueInRange(h,f),getValueLengthInRange:(h,f)=>this._context.viewModel.getValueLengthInRange(h,f),modifyPosition:(h,f)=>this._context.viewModel.modifyPosition(h,f)},d={getDataToCopy:()=>{const h=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Wn),f=this._context.viewModel.model.getEOL(),g=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),m=Array.isArray(h)?h:null,_=Array.isArray(h)?h.join(f):h;let v,b=null;if(FB.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&_.length<65536){const C=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);C&&(v=C.html,b=C.mode)}return{isFromEmptySelection:g,multicursorText:m,text:_,html:v,mode:b}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const h=this._selections[0];if(Ye&&h.isEmpty()){const g=h.getStartPosition();let m=this._getWordBeforePosition(g);if(m.length===0&&(m=this._getCharacterBeforePosition(g)),m.length>0)return new Pi(m,m.length,m.length,M.fromPositions(g),0)}if(Ye&&!h.isEmpty()&&c.getValueLengthInRange(h,0)<500){const g=c.getValueInRange(h,0);return new Pi(g,0,g.length,h,0)}if(ya&&!h.isEmpty()){const g="vscode-placeholder";return new Pi(g,0,g.length,null,void 0)}return Pi.EMPTY}if(SD){const h=this._selections[0];if(h.isEmpty()){const f=h.getStartPosition(),[g,m]=this._getAndroidWordAtPosition(f);if(g.length>0)return new Pi(g,m,m,M.fromPositions(f),0)}return Pi.EMPTY}return Vd.fromEditorSelection(c,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(h,f,g)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(h,f,g)},u=this._register(new BB(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(cw,d,u,to,{isAndroid:SD,isChrome:Fg,isFirefox:lo,isSafari:ya})),this._register(this._textAreaInput.onKeyDown(h=>{this._viewController.emitKeyDown(h)})),this._register(this._textAreaInput.onKeyUp(h=>{this._viewController.emitKeyUp(h)})),this._register(this._textAreaInput.onPaste(h=>{let f=!1,g=null,m=null;h.metadata&&(f=this._emptySelectionClipboard&&!!h.metadata.isFromEmptySelection,g=typeof h.metadata.multicursorText<"u"?h.metadata.multicursorText:null,m=h.metadata.mode),this._viewController.paste(h.text,f,g,m)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(h=>{h.replacePrevCharCnt||h.replaceNextCharCnt||h.positionDelta?this._viewController.compositionType(h.text,h.replacePrevCharCnt,h.replaceNextCharCnt,h.positionDelta):this._viewController.type(h.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(h=>{this._viewController.setSelection(h)})),this._register(this._textAreaInput.onCompositionStart(h=>{const f=this.textArea.domNode,g=this._modelSelections[0],{distanceToModelLineStart:m,widthOfHiddenTextBefore:_}=(()=>{const b=f.value.substring(0,Math.min(f.selectionStart,f.selectionEnd)),C=b.lastIndexOf(` `),w=b.substring(C+1),y=w.lastIndexOf(" "),L=w.length-y-1,k=g.getStartPosition(),D=Math.min(k.column-1,L),N=k.column-1-D,W=w.substring(0,w.length-D),{tabSize:R}=this._context.viewModel.model.getOptions(),A=DW(this.textArea.domNode.ownerDocument,W,this._fontInfo,R);return{distanceToModelLineStart:N,widthOfHiddenTextBefore:A}})(),{distanceToModelLineEnd:v}=(()=>{const b=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),C=b.indexOf(` `),w=C===-1?b:b.substring(0,C),y=w.indexOf(" "),L=y===-1?w.length:w.length-y-1,k=g.getEndPosition(),D=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-D}})();this._context.viewModel.revealRange("keyboard",!0,M.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new kW(this._context,g.startLineNumber,m,_,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${su} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(h=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${su}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(hf.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=Eu(t,[]);let o=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);n.get(d)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);n.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Eu(this._context.configuration.options.get(131),[]);let n=e.column,o=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Di(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,n;if(e.get(2)===1){const r=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(n=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||n===void 0?void 0:n.getAriaLabel(),c=p("accessibilityModeOff","The editor is not accessible at this time.");return r?p("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,r):a?p("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?p("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===jc.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(145).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=wv?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(145);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(67),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${n*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(124))),(e.hasChanged(34)||e.hasChanged(91))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("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)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!hf.enabled||e.get(34)&&e.get(91)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new V(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const n=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,r=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(r&&a&&n&&o&&o.left>=this._scrollLeft&&n.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let d=this._visibleTextArea.widthOfHiddenLineTextBefore,u=this._contentLeft+n.left-this._scrollLeft,h=o.left-n.left+1;if(uthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(r.lineNumber),g=f.tokens.findTokenIndexAtOffset(r.column-1),m=f.tokens.findTokenIndexAtOffset(a.column-1),_=g===m,v=this._visibleTextArea.definePresentation(_?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=d,this._doRender({lastRenderPosition:null,top:l,left:u,width:h,height:this._lineHeight,useCover:!1,color:(oi.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight){this._renderAtTopLeft();return}if(Ye||this._accessibilitySupport===2){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const n=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:wv?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` `,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:wv?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;nn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?K.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(57)?i.setClassName("monaco-editor-background textAreaCover "+Oc.OUTER_CLASS_NAME):n.get(68).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+Zg.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};uw=LW([o2(3,Zi),o2(4,vt)],uw);function DW(s,e,t,i){if(e.length===0)return 0;const n=s.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const o=s.createElement("span");nn(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),n.appendChild(o),s.body.appendChild(n);const r=o.offsetWidth;return s.body.removeChild(n),r}function xW(s,e,t){let i=0;for(let o=0;o!0,IW=()=>!1,NW=s=>s===" "||s===" ";class _d{static shouldRecreate(e){return e.hasChanged(145)||e.hasChanged(131)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(128)||e.hasChanged(50)||e.hasChanged(91)||e.hasChanged(130)}constructor(e,t,i,n){var o;this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const r=i.options,a=r.get(145),l=r.get(50);this.readOnly=r.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(116),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=r.get(128),this.wordSeparators=r.get(131),this.emptySelectionClipboard=r.get(37),this.copyWithSyntaxHighlighting=r.get(25),this.multiCursorMergeOverlapping=r.get(77),this.multiCursorPaste=r.get(79),this.multiCursorLimit=r.get(80),this.autoClosingBrackets=r.get(6),this.autoClosingComments=r.get(7),this.autoClosingQuotes=r.get(11),this.autoClosingDelete=r.get(9),this.autoClosingOvertype=r.get(10),this.autoSurround=r.get(14),this.autoIndent=r.get(12),this.wordSegmenterLocales=r.get(130),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const u of c)this.surroundingPairs[u.open]=u.close;const d=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=d==null?void 0:d.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=hc(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return iM(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return NW;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return EW;case"never":return IW}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return n=>i.indexOf(n)!==-1}visibleColumnFromColumn(e,t){return vi.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=vi.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(nr?r:n}}class je{static fromModelState(e){return new TW(e)}static fromViewState(e){return new AW(e)}static fromModelSelection(e){const t=yt.liftSelection(e),i=new Fi(M.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return je.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;io,c=n>r,d=nr||vn||_0&&n--,oc.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=o;l<=r;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new V(l,c));n=Math.max(n,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-rT(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new V(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=Yf.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=n)return new V(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?pt.leftPositionAtomicSoftTabs(t,i,e.tabSize):pt.leftPosition(t,i);return new yv(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let r,a;if(i.hasSelection()&&!n)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(o-1)),c=t.normalizePosition(pt.clipPositionColumn(l,t),0),d=pt.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(n,r,a,0)}static clipPositionColumn(e,t){return new V(e.lineNumber,pt.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 id?(i=d,a?n=t.getLineMaxColumn(i):n=Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,c),f?o=0:o=c-vi.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),l!==void 0){const g=new V(i,n),m=t.normalizePosition(g,l);o=o+(n-m.column),i=m.lineNumber,n=m.column}return new yv(i,n,o)}static down(e,t,i,n,o,r,a){return this.vertical(e,t,i,n,o,i+r,a,4)}static moveDown(e,t,i,n,o){let r,a;i.hasSelection()&&!n?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=pt.down(e,t,r+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new V(c.lineNumber,c.column),2).lineNumber>r)break;while(l++<10&&r+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=h.length+1)return!1;const f=h.charAt(u.column-2),g=n.get(f);if(!g)return!1;if(Oa(f)){if(i==="never")return!1}else if(t==="never")return!1;const m=h.charAt(u.column-1);let _=!1;for(const v of g)v.open===f&&v.close===m&&(_=!0);if(!_)return!1;if(e==="auto"){let v=!1;for(let b=0,C=a.length;b1){const o=t.getLineContent(n.lineNumber),r=es(o),a=r===-1?o.length+1:r+1;if(n.column<=a){const l=i.visibleColumnFromColumn(t,n),c=vi.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,n.lineNumber,c);return new M(n.lineNumber,d,n.lineNumber,n.column)}}return M.fromPositions(Bc.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=PF(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 V(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const n=[];let o=null;i.sort((r,a)=>V.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(d=c.lineNumber-1,u=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,u=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new M(d,u,h,f);o=g,g.isEmpty()?n[r]=null:n[r]=new qn(g,"")}else n[r]=null;else n[r]=new qn(l,"")}return new An(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class mt{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:1,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;const o=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let r=i.column-2;r>=0;r--){const a=e.charCodeAt(r),l=t.get(a);if(o&&r===o.index)return this._createIntlWord(o,l);if(l===0){if(n===2)return this._createWord(e,n,l,r+1,this._findEndOfWord(e,t,n,r+1));n=1}else if(l===2){if(n===1)return this._createWord(e,n,l,r+1,this._findEndOfWord(e,t,n,r+1));n=2}else if(l===1&&n!==0)return this._createWord(e,n,l,r+1,this._findEndOfWord(e,t,n,r+1))}return n!==0?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=t.findNextIntlWordAtOrAfterOffset(e,n),r=e.length;for(let a=n;a=0;r--){const a=e.charCodeAt(r),l=t.get(a);if(o&&r===o.index)return r;if(l===1||i===1&&l===2||i===2&&l===0)return r+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=mt._findPreviousWordOnLine(e,t,new V(o,r));if(n===0)return new V(o,a?a.start+1:1);if(n===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=mt._findPreviousWordOnLine(e,t,new V(o,a.start+1))),new V(o,a?a.start+1:1);if(n===3){for(;a&&a.wordType===2;)a=mt._findPreviousWordOnLine(e,t,new V(o,a.start+1));return new V(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=mt._findPreviousWordOnLine(e,t,new V(o,a.start+1))),new V(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===1)return i>1?new V(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),l=o.charCodeAt(r-1);if(a===95&&l!==95)return new V(i,r);if(a===45&&l!==45)return new V(i,r);if((xd(a)||_m(a))&&za(l))return new V(i,r);if(za(a)&&za(l)&&r+1=l.start+1&&(l=mt._findNextWordOnLine(e,t,new V(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new V(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?c=1:(l--,c=n.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=mt._findPreviousWordOnLine(i,n,new V(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=n.getLineMaxColumn(l))),new M(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new V(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,n);return o||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(n===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new M(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberu.start+1<=i.column&&i.column<=u.end+1,a=(u,h)=>(u=Math.min(u,i.column),h=Math.max(h,i.column),new M(i.lineNumber,u,i.lineNumber,h)),l=u=>{let h=u.start+1,f=u.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(n,h-2);)h--;return a(h,f)},c=mt._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);const d=mt._findNextWordOnLine(e,t,i);return d&&r(d)?l(d):c&&d?a(c.end+1,d.start+1):c?a(c.start+1,c.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=mt._moveWordPartLeft(e,i);return new M(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=h.start+1&&(h=mt._findNextWordOnLine(i,n,new V(l,h.end+1))),h?c=h.start+1:c!!e)}class ln{static addCursorDown(e,t,i){const n=[];let o=0;for(let r=0,a=t.length;rc&&(d=c,u=e.model.getLineMaxColumn(d)),je.fromModelState(new Fi(new M(r.lineNumber,1,d,u),2,0,new V(d,u),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,u=1;return d>c&&(d=c,u=e.getLineMaxColumn(d)),je.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return je.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return je.fromModelState(mt.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new je(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return je.fromViewState(new Fi(new M(i,n,i,n),0,0,new V(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,n);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,n,o)}const r=e.model.validatePosition(n),a=o?e.coordinatesConverter.validateViewPosition(new V(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return je.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,n,o,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return r===4?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return r===2?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return r===2?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return r===2?t.map(a=>je.fromViewState(pt.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>je.fromModelState(pt.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 5:return r===2?t.map(a=>je.fromViewState(pt.moveToNextBlankLine(e.cursorConfig,e,a.viewState,n))):t.map(a=>je.fromModelState(pt.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,n)));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],n,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;ci.endLineNumber-1?r=i.endLineNumber-1:oje.fromViewState(pt.moveLeft(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,r=t.length;oje.fromViewState(pt.moveRight(e.cursorConfig,e,o.viewState,i,n)))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,r=t.length;o{this.model.tokenization.forceTokenization(f);const g=this.model.tokenization.getLineTokens(f),m=this.model.getLineMaxColumn(f)-1;return hc(g,m)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),n=hc(i,e.startColumn-1),o=bn.createEmpty("",n.languageIdCodec),r=e.startLineNumber-1;if(r===0||!(n.firstCharOffset===0))return o;const c=t(r);if(!(n.languageId===c.languageId))return o;const u=c.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(u)}}class sM{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){var i,n;const o=(l,c)=>{const d=gn(l);return c+l.substring(d.length)};(n=(i=this.model.tokenization).forceTokenization)===null||n===void 0||n.call(i,e);const r=this.model.tokenization.getLineTokens(e);let a=this.getProcessedTokens(r).getLineContent();return t!==void 0&&(a=o(a,t)),a}getProcessedTokens(e){const t=l=>l===2||l===3||l===1,i=e.getLanguageId(0),o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),r=[];return e.forEach(l=>{const c=e.getStandardTokenType(l);let d=e.getTokenText(l);t(c)&&(d=d.replace(o,""));const u=e.getMetadata(l);r.push({text:d,metadata:u})}),bn.createFromTextAndMetadata(r,e.languageIdCodec)}}function CL(s,e){s.tokenization.forceTokenization(e.lineNumber);const t=s.tokenization.getLineTokens(e.lineNumber),i=hc(t,e.column-1),n=i.firstCharOffset===0,o=t.getLanguageId(0)===i.languageId;return!n&&!o}function hw(s,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const n=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(n);if(!o)return null;const a=new bL(e,i).getProcessedTokenContextAroundRange(t),l=a.previousLineProcessedTokens.getLineContent(),c=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),u=o.onEnter(s,l,c,d);if(!u)return null;const h=u.indentAction;let f=u.appendText;const g=u.removeText||0;f?h===xi.Indent&&(f=" "+f):h===xi.Indent||h===xi.IndentOutdent?f=" ":f="";let m=oA(e,t.startLineNumber,t.startColumn);return g&&(m=m.substring(0,m.length-g)),{indentAction:h,appendText:f,removeText:g,indentation:m}}var RW=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},PW=function(s,e){return function(t,i){e(t,i,s)}},Ep;const Sv=Object.create(null);function Vl(s,e){if(e<=0)return"";Sv[s]||(Sv[s]=["",s]);const t=Sv[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}let rc=Ep=class{static unshiftIndent(e,t,i,n,o){const r=vi.visibleColumnFromColumn(e,t,i);if(o){const a=Vl(" ",n),c=vi.prevIndentTabStop(r,n)/n;return Vl(a,c)}else{const a=" ",c=vi.prevRenderTabStop(r,i)/i;return Vl(a,c)}}static shiftIndent(e,t,i,n,o){const r=vi.visibleColumnFromColumn(e,t,i);if(o){const a=Vl(" ",n),c=vi.nextIndentTabStop(r,n)/n;return Vl(a,c)}else{const a=" ",c=vi.nextRenderTabStop(r,i)/i;return Vl(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;this._selection.endColumn===1&&i!==n&&(n=n-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,l=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let u=i;u<=n;u++,c=d){d=0;const h=e.getLineContent(u);let f=es(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),u>1&&vi.visibleColumnFromColumn(h,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(u-1)){const _=hw(this._opts.autoIndent,e,new M(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(_){if(d=c,_.appendText)for(let v=0,b=_.appendText.length;v1){let n,o=-1;for(n=e-1;n>=1;n--){if(s.tokenization.getLanguageIdAtPosition(n,0)!==i)return o;const r=s.getLineContent(n);if(t.shouldIgnore(n)||/^\s+$/.test(r)||r===""){o=n;continue}return n}}return-1}function n1(s,e,t,i=!0,n){if(s<4)return null;const o=n.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;const r=new nM(e,o,n);if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const a=BW(e,t,r);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(r.shouldIncrease(a)||r.shouldIndentNextLine(a)){const l=e.getLineContent(a);return{indentation:gn(l),action:xi.Indent,line:a}}else if(r.shouldDecrease(a)){const l=e.getLineContent(a);return{indentation:gn(l),action:null,line:a}}else{if(a===1)return{indentation:gn(e.getLineContent(a)),action:null,line:a};const l=a-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let u=l-1;u>0;u--)if(!r.shouldIndentNextLine(u)){d=u;break}return{indentation:gn(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:gn(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(r.shouldIncrease(d))return{indentation:gn(e.getLineContent(d)),action:xi.Indent,line:d};if(r.shouldIndentNextLine(d)){let u=0;for(let h=d-1;h>0;h--)if(!r.shouldIndentNextLine(d)){u=h;break}return{indentation:gn(e.getLineContent(u+1)),action:null,line:u+1}}else if(r.shouldDecrease(d))return{indentation:gn(e.getLineContent(d)),action:null,line:d}}return{indentation:gn(e.getLineContent(1)),action:null,line:1}}}function Lie(s,e,t,i,n,o){if(s<4)return null;const r=o.getLanguageConfiguration(t);if(!r)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=new nM(e,a,o),c=n1(s,e,i,void 0,o);if(c){const d=c.line;if(d!==void 0){let u=!0;for(let h=d;hs.getLineCount()?null:i.getIndentMetadata(s.getLineContent(e))}function HW(s,e,t){return{tokenization:{getLineTokens:n=>n===e?t:s.tokenization.getLineTokens(n),getLanguageId:()=>s.getLanguageId(),getLanguageIdAtPosition:(n,o)=>s.getLanguageIdAtPosition(n,o)},getLineContent:n=>n===e?t.getLineContent():s.getLineContent(n)}}class Zt{static indent(e,t,i){if(t===null||i===null)return[];const n=[];for(let o=0,r=i.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Gc(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=hw(e.autoIndent,t,new M(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return n&&(n===xi.Indent&&(o=Zt.shiftIndent(e,o)),n===xi.Outdent&&(o=Zt.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;dthis._compositionType(i,d,o,r,a,l));return new An(4,c,{shouldPushStackElementBefore:Fm(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new M(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new xp(d,i,0,r)}static _typeCommand(e,t,i){return i?new Rm(e,t,!0):new qn(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return Zt._typeCommand(n,` `,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),c=gn(l).substring(0,n.startColumn-1);return Zt._typeCommand(n,` `+e.normalizeIndentation(c),i)}const o=hw(e.autoIndent,t,n,e.languageConfigurationService);if(o){if(o.indentAction===xi.None)return Zt._typeCommand(n,` `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===xi.Indent)return Zt._typeCommand(n,` `+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===xi.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),d=` `+c+` `+l;return i?new Rm(n,d,!0):new xp(n,d,-1,c.length-l.length,!0)}else if(o.indentAction===xi.Outdent){const l=Zt.unshiftIndent(e,o.indentation);return Zt._typeCommand(n,` `+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=gn(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=WW(e.autoIndent,t,n,{unshiftIndent:c=>Zt.unshiftIndent(e,c),shiftIndent:c=>Zt.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,u=t.getLineContent(n.endLineNumber),h=es(u);if(h>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,h+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Rm(n,` `+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return d<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new xp(n,` `+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return Zt._typeCommand(n,` `+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;nZt.shiftIndent(e,a),unshiftIndent:a=>Zt.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Zt._typeCommand(new M(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+n,!1):Zt._typeCommand(new M(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r2?d.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let m=0,_=n.length;m<_;m++){const v=n[m];if(c.lineNumber===v.startLineNumber&&c.column===v.startColumn){g=!0;break}}if(!g)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,o){const r=[];for(let a=0,l=n.length;at.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new M(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+n!==a.open){l=!1;break}l&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,n,o){for(const g of i)if(!g.isEmpty())return null;const r=i.map(g=>{const m=g.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-n.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(g=>new V(g.lineNumber,g.beforeColumn)),n);if(!a)return null;let l,c;if(Oa(n)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const u=this._findContainedAutoClosingPair(e,a),h=u?u.close:"";let f=!0;for(const g of r){const{lineNumber:m,beforeColumn:_,afterColumn:v}=g,b=t.getLineContent(m),C=b.substring(0,_-1),w=b.substring(v-1);if(w.startsWith(h)||(f=!1),w.length>0){const D=w.charAt(0);if(!Zt._isBeforeClosingBrace(e,w)&&!c(D))return null}if(a.open.length===1&&(n==="'"||n==='"')&&l!=="always"){const D=Eu(e.wordSeparators,[]);if(C.length>0){const N=C.charCodeAt(C.length-1);if(D.get(N)===0)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const y=t.tokenization.getLineTokens(m),L=hc(y,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const D=t.tokenization.getTokenTypeIfInsertingCharacter(m,_,k);if(!a.isOK(D))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,i,n,o,r,a){const l=[];for(let c=0,d=n.length;cnew qn(new M(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new An(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,l,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,i,o,l,!0,d):null}static typeWithInterceptors(e,t,i,n,o,r,a){if(!e&&a===` `){const d=[];for(let u=0,h=o.length;u{const n=t.get(gi).getFocusedCodeEditor();return n&&n.hasTextFocus()?this._runEditorCommand(t,n,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const n=vn();return n&&["input","textarea"].indexOf(n.tagName.toLowerCase())>=0?(this.runDOMCommand(n),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const n=t.get(gi).getActiveCodeEditor();return n?(n.focus(),this._runEditorCommand(t,n,i)):!1})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}var Si;(function(s){class e extends Kt{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,C){if(!C.position)return;b.model.pushStackElement(),b.setCursorStates(C.source,3,[ln.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,C.position,C.viewPosition)])&&C.revealType!==2&&b.revealAllCursors(C.source,!0,!0)}}s.MoveTo=Fe(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),s.MoveToSelect=Fe(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends Kt{runCoreEditorCommand(b,C){b.model.pushStackElement();const w=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),C);w!==null&&(b.setCursorStates(C.source,3,w.viewStates.map(y=>je.fromViewState(y))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?b.revealTopMostCursor(C.source):b.revealBottomMostCursor(C.source))}}s.ColumnSelect=Fe(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,C,w){if(typeof w.position>"u"||typeof w.viewPosition>"u"||typeof w.mouseColumn>"u")return null;const y=v.model.validatePosition(w.position),L=v.coordinatesConverter.validateViewPosition(new V(w.viewPosition.lineNumber,w.viewPosition.column),y),k=w.doColumnSelect?C.fromViewLineNumber:L.lineNumber,D=w.doColumnSelect?C.fromViewVisualColumn:w.mouseColumn-1;return oc.columnSelect(v.cursorConfig,v,k,D,L.lineNumber,w.mouseColumn-1)}}),s.CursorColumnSelectLeft=Fe(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,C,w){return oc.columnSelectLeft(v.cursorConfig,v,C)}}),s.CursorColumnSelectRight=Fe(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,C,w){return oc.columnSelectRight(v.cursorConfig,v,C)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,C,w,y){return oc.columnSelectUp(b.cursorConfig,b,w,this._isPaged)}}s.CursorColumnSelectUp=Fe(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:3600,linux:{primary:0}}})),s.CursorColumnSelectPageUp=Fe(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:3595,linux:{primary:0}}}));class n extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,C,w,y){return oc.columnSelectDown(b.cursorConfig,b,w,this._isPaged)}}s.CursorColumnSelectDown=Fe(new n({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:3602,linux:{primary:0}}})),s.CursorColumnSelectPageDown=Fe(new n({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends Kt{constructor(){super({id:"cursorMove",precondition:void 0,metadata:S_.metadata})}runCoreEditorCommand(b,C){const w=S_.parse(C);w&&this._runCursorMove(b,C.source,w)}_runCursorMove(b,C,w){b.model.pushStackElement(),b.setCursorStates(C,3,o._move(b,b.getCursorStates(),w)),b.revealAllCursors(C,!0)}static _move(b,C,w){const y=w.select,L=w.value;switch(w.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return ln.simpleMove(b,C,w.direction,y,L,w.unit);case 11:case 13:case 12:case 14:return ln.viewportMove(b,C,w.direction,y,L);default:return null}}}s.CursorMoveImpl=o,s.CursorMove=Fe(new o);class r extends Kt{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,C){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:C.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(C.source,3,ln.simpleMove(b,b.getCursorStates(),w.direction,w.select,w.value,w.unit)),b.revealAllCursors(C.source,!0)}}s.CursorLeft=Fe(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),s.CursorLeftSelect=Fe(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:1039}})),s.CursorRight=Fe(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),s.CursorRightSelect=Fe(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:1041}})),s.CursorUp=Fe(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),s.CursorUpSelect=Fe(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),s.CursorPageUp=Fe(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:11}})),s.CursorPageUpSelect=Fe(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:1035}})),s.CursorDown=Fe(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),s.CursorDownSelect=Fe(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),s.CursorPageDown=Fe(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:12}})),s.CursorPageDownSelect=Fe(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:1036}})),s.CreateCursor=Fe(new class extends Kt{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let C;b.wholeLine?C=ln.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):C=ln.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const w=v.getCursorStates();if(w.length>1){const y=C.modelState?C.modelState.position:null,L=C.viewState?C.viewState.position:null;for(let k=0,D=w.length;kL&&(y=L);const k=new M(y,1,y,v.model.getLineMaxColumn(y));let D=0;if(C.at)switch(C.at){case Hd.RawAtArgument.Top:D=3;break;case Hd.RawAtArgument.Center:D=1;break;case Hd.RawAtArgument.Bottom:D=4;break}const N=v.coordinatesConverter.convertModelRangeToViewRange(k);v.revealRange(b.source,!1,N,D,0)}}),s.SelectAll=new class extends fw{constructor(){super(I7)}runDOMCommand(v){lo&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,C){const w=b._getViewModel();w&&this.runCoreEditorCommand(w,C)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[ln.selectAll(v,v.getPrimaryCursorState())])}},s.SetSelection=Fe(new class extends Kt{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[je.fromModelSelection(b.selection)]))}})})(Si||(Si={}));const UW=st.and(ae.textInputFocus,ae.columnSelection);function nh(s,e){Fc.registerKeybindingRule({id:s,primary:e,when:UW,weight:Xe+1})}nh(Si.CursorColumnSelectLeft.id,1039);nh(Si.CursorColumnSelectRight.id,1041);nh(Si.CursorColumnSelectUp.id,1040);nh(Si.CursorColumnSelectPageUp.id,1035);nh(Si.CursorColumnSelectDown.id,1042);nh(Si.CursorColumnSelectPageDown.id,1036);function l2(s){return s.register(),s}var c2;(function(s){class e extends Sl{runEditorCommand(i,n,o){const r=n._getViewModel();r&&this.runCoreEditingCommand(n,r,o||{})}}s.CoreEditingCommand=e,s.LineBreakInsert=Fe(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:ae.writable,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Zt.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),s.Outdent=Fe(new class extends e{constructor(){super({id:"outdent",precondition:ae.writable,kbOpts:{weight:Xe,kbExpr:st.and(ae.editorTextFocus,ae.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Zt.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.Tab=Fe(new class extends e{constructor(){super({id:"tab",precondition:ae.writable,kbOpts:{weight:Xe,kbExpr:st.and(ae.editorTextFocus,ae.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,n){t.pushUndoStop(),t.executeCommands(this.id,Zt.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),s.DeleteLeft=Fe(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,n){const[o,r]=Bc.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),s.DeleteRight=Fe(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:Xe,kbExpr:ae.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,n){const[o,r]=Bc.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),s.Undo=new class extends fw{constructor(){super(jT)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(91)===!0))return i.getModel().undo()}},s.Redo=new class extends fw{constructor(){super(qT)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,n){if(!(!i.hasModel()||i.getOption(91)===!0))return i.getModel().redo()}}})(c2||(c2={}));class d2 extends $0{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(gi).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function sd(s,e){l2(new d2("default:"+s,s)),l2(new d2(s,s,e))}sd("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});sd("replacePreviousChar");sd("compositionType");sd("compositionStart");sd("compositionEnd");sd("paste");sd("cut");class $W{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Si.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,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Si.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Si.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Si.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Si.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Si.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Si.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Si.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Si.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Si.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Si.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Si.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Si.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Si.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 rM{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 Dt("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let o=0,r=0;for(let l=i;l<=n;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(o=c,r=1):r++)}if(e=n&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let u=0;ui)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){const u=d-this._rendLineNumberStart;this._lines[u].onTokensChanged(),n=!0}}return n}}class aM{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new rM(()=>this._host.createVisibleLine())}_createDomNode(){const e=nt(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(145)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,n,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const r=Math.max(0,i-o.rendLineNumberStart+1),l=o.linesLength-1-r+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=r+l;a[l].layoutLine(c,n[c-o],this.viewportData.lineHeight)}}_insertLinesBefore(e,t,i,n,o){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const l=e.lines[a];n[a]&&(l.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");ta._ttPolicy&&(t=ta._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;os});ta._sb=new j0(1e5);class lM extends os{constructor(e){super(e),this._visibleLines=new aM(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);nn(this.domNode,i),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,n=t.length;i'),o.appendString(r),o.appendString(""),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class jW extends lM{constructor(e){super(e);const i=this._context.configuration.options.get(145);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(145);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 qW extends lM{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(145);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),nn(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;nn(this.domNode,t.get(50));const i=t.get(145);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 s1{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){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return s1.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new V(e.afterLineNumber,1)).lineNumber}}}class GW extends os{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=nt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const i=this._context.configuration.options.get(145),n=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==n&&(this.contentWidth=n,e=!0);const o=i.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let i=0;const n=e.getDecorationsInViewport();for(const o of n){if(!o.options.blockClassName)continue;let r=this.blocks[i];r||(r=this.blocks[i]=nt(document.createElement("div")),this.domNode.appendChild(r));let a,l;o.options.blockIsAfterEnd?(a=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),l=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(a=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),l=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[c,d,u,h]=(t=o.options.blockPadding)!==null&&t!==void 0?t:[0,0,0,0];r.setClassName("blockDecorations-block "+o.options.blockClassName),r.setLeft(this.contentLeft-h),r.setWidth(this.contentWidth+h+d),r.setTop(a-e.scrollTop-c),r.setHeight(l-a+c+u),i++}for(let o=i;o0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,r=o,a=e.top+e.height,l=n.viewportHeight-a,c=o-i,d=r>=i,u=a,h=l>=i;let f=e.left;return f+t>n.scrollLeft+n.viewportWidth&&(f=n.scrollLeft+n.viewportWidth-t),fc){const f=h-(c-n);h-=f,i-=f}if(h=v,w=f+i<=g.height-b;return this._fixedOverflowWidgets?{fitsAbove:C,aboveTop:Math.max(h,v),fitsBelow:w,belowTop:f,left:_}:{fitsAbove:C,aboveTop:a,fitsBelow:w,belowTop:l,left:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new wh(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;const n=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((i=this._primaryAnchor.viewPosition)===null||i===void 0?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,r=a(o,this._affinity,this._lineHeight);return{primary:n,secondary:r};function a(l,c,d){if(!l)return null;const u=e.visibleRangeForPosition(l);if(!u)return null;const h=l.column===1&&c===3?0:u.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new u2(f,h,d)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){var t;if(!this._renderData||this._renderData.kind==="offViewport"){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,((t=this._renderData)===null||t===void 0?void 0:t.kind)==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&kv(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"&&kv(this._actual.afterRender,this._actual,this._renderData.position)}}class Ch{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class wh{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class u2{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function kv(s,e,...t){try{return s.call(e,...t)}catch{return null}}class cM extends nd{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(145);this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new yt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const o of this._selections)t.add(o.positionLineNumber);const i=Array.from(t);i.sort((o,r)=>o-r),Wi(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(o=>o.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(145);return this._renderLineHighlight=t.get(96),this._renderLineHighlightOnlyWhenFocus=t.get(97),this._wordWrap=i.isViewportWrapping,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=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=[];for(let r=t;r<=i;r++){const a=r-t;n[a]=""}if(this._wordWrap){const r=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new V(a,1)).lineNumber,d=l.convertModelPositionToViewPosition(new V(c,1)).lineNumber,u=l.convertModelPositionToViewPosition(new V(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,h=Math.max(d,t),f=Math.min(u,i);for(let g=h;g<=f;g++){const m=g-t;n[m]=r}}}const o=this._renderOne(e,!0);for(const r of this._cursorLineNumbers){if(ri)continue;const a=r-t;n[a]=o}this._renderData=n}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class QW extends cM{_renderOne(e,t){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class XW extends cM{_renderOne(e,t){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}ka((s,e)=>{const t=s.getColor(qA);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()||s.defines(s2)){const i=s.getColor(s2);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),iu(s.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});class JW extends nd{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(50).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._typicalHalfwidthCharacterWidth=t.get(50).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=[],n=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const d=l.options.className,u=c.options.className;return du?1:M.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=r;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',d=Math.max(l.range.startLineNumber,n),u=Math.min(l.range.endLineNumber,o);for(let h=d;h<=u;h++){const f=h-n;i[f]+=c}}}_renderNormalDecorations(e,t,i){var n;const o=e.visibleRange.startLineNumber;let r=null,a=!1,l=null,c=!1;for(let d=0,u=t.length;d';a[h]+=v}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class eV extends os{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,r=o.get(103),a=o.get(75),l=o.get(40),c=o.get(106),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+dw(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new t1(t.domNode,d,this._context.viewLayout.getScrollable())),Fo.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=nt(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(h,f,g)=>{const m={};{const _=h.scrollTop;_&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,h.scrollTop=0)}if(g){const _=h.scrollLeft;_&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,1)};this._register(j(i.domNode,"scroll",h=>u(i.domNode,!0,!0))),this._register(j(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(j(n.domNode,"scroll",h=>u(n.domNode,!0,!1))),this._register(j(this.scrollbarDomNode.domNode,"scroll",h=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(145);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(73).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}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(103)||e.hasChanged(75)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(103),n=t.get(75),o=t.get(40),r=t.get(106),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:n,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(145)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+dw(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class gw{constructor(e,t,i,n,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=o??0}}class tV{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class iV{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class dM extends nd{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const l=a-e;n[l]=new iV}if(i.length===0)return n;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNamen)continue;const c=Math.max(a,i),d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new V(c,0)),u=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(o.preference.lane);t.push(new oV(c,u,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,n)=>i.lineNumber===n.lineNumber?i.laneIndex===n.laneIndex?i.zIndex===n.zIndex?n.type===i.type?i.type===0&&n.type===0?i.className0;){const n=t.peek();if(!n)break;const o=t.takeWhile(a=>a.lineNumber===n.lineNumber&&a.laneIndex===n.laneIndex);if(!o||o.length===0)break;const r=o[0];if(r.type===0){const a=[];for(const l of o){if(l.zIndex!==r.zIndex||l.type!==r.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,laneIndex:r.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}}}class sV{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new rV(this.lineNumber,this.laneIndex,e)}}class oV{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=1}}class rV{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}class uM extends G{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function aV(s,e){let t=0,i=0;const n=s.length;for(;in)throw new Dt("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,l=-1,c=-2,d=-1;const u=k=>{if(a!==-1&&(a===-2||a>k-1)){a=-1,l=-1;for(let D=k-2;D>=0;D--){const N=this._computeIndentLevel(D);if(N>=0){a=D,l=N;break}}}if(c===-2){c=-1,d=-1;for(let D=k;D=0){c=D,d=N;break}}}};let h=-2,f=-1,g=-2,m=-1;const _=k=>{if(h===-2){h=-1,f=-1;for(let D=k-2;D>=0;D--){const N=this._computeIndentLevel(D);if(N>=0){h=D,f=N;break}}}if(g!==-1&&(g===-2||g=0){g=D,m=N;break}}}};let v=0,b=!0,C=0,w=!0,y=0,L=0;for(let k=0;b||w;k++){const D=e-k,N=e+k;k>1&&(D<1||D1&&(N>n||N>i)&&(w=!1),k>5e4&&(b=!1,w=!1);let W=-1;if(b&&D>=1){const A=this._computeIndentLevel(D-1);A>=0?(c=D-1,d=A,W=Math.ceil(A/this.textModel.getOptions().indentSize)):(u(D),W=this._getIndentLevelForWhitespaceLine(r,l,d))}let R=-1;if(w&&N<=n){const A=this._computeIndentLevel(N-1);A>=0?(h=N-1,f=A,R=Math.ceil(A/this.textModel.getOptions().indentSize)):(_(N),R=this._getIndentLevelForWhitespaceLine(r,f,m))}if(k===0){L=W;continue}if(k===1){if(N<=n&&R>=0&&L+1===R){b=!1,v=N,C=N,y=R;continue}if(D>=1&&W>=0&&W-1===L){w=!1,v=D,C=D,y=W;continue}if(v=e,C=e,y=L,y===0)return{startLineNumber:v,endLineNumber:C,indent:y}}b&&(W>=y?v=D:b=!1),w&&(R>=y?C=N:w=!1)}return{startLineNumber:v,endLineNumber:C,indent:y}}getLinesBracketGuides(e,t,i,n){var o;const r=[];for(let h=e;h<=t;h++)r.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new M(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&l.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(M.fromPositions(i)).toArray()).filter(f=>M.strictContainsPosition(f.range,i));c=(o=d_(h,f=>a))===null||o===void 0?void 0:o.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new hM;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!n.includeInactive)continue;const g=u.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,d)+(n.highlightActive&&f?" "+u.activeClassName:""),m=h.openingBracketRange.getStartPosition(),_=h.closingBracketRange.getStartPosition(),v=n.horizontalGuides===Sc.Enabled||n.horizontalGuides===Sc.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new gc(-1,h.openingBracketRange.getEndPosition().column,g,new ff(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),C=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(C,b,h.minVisibleColumnIndentation+1);let y=!1;es(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&C>w&&r[m.lineNumber-e].push(new gc(w,-1,g,new ff(!1,m.column),-1,-1)),_.lineNumber<=t&&b>w&&r[_.lineNumber-e].push(new gc(w,-1,g,new ff(!y,_.column),-1,-1)))}for(const h of r)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return r}getVisibleColumnFromPosition(e){return vi.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.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 n=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,u=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/n.indentSize);continue}if(l===-2){l=-1,c=-1;for(let m=h-2;m>=0;m--){const _=this._computeIndentLevel(m);if(_>=0){l=m,c=_;break}}}if(d!==-1&&(d===-2||d=0){d=m,u=_;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,c,u)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return t===-1||i===-1?0:tl||this._maxIndentLeft>0&&b>this._maxIndentLeft)break;const C=v.horizontalLine?v.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",w=v.horizontalLine?((o=(n=e.visibleRangeForPosition(new V(h,v.horizontalLine.endColumn)))===null||n===void 0?void 0:n.left)!==null&&o!==void 0?o:b+this._spaceWidth)-b:this._spaceWidth;m+=`
`}u[f]=m}this._renderResult=u}getGuidesByLine(e,t,i){const n=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Sc.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?Sc.EnabledForActive:Sc.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const u=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=u.startLineNumber,a=u.endLineNumber,l=u.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),d=[];for(let u=e;u<=t;u++){const h=new Array;d.push(h);const f=n?n[u-e]:[],g=new ba(f),m=o?o[u-e]:0;for(let _=1;_<=m;_++){const v=(_-1)*c+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=u&&u<=a&&_===l;h.push(...g.takeWhile(w=>w.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function vd(s){if(!(s&&s.isTransparent()))return s}ka((s,e)=>{const t=[{bracketColor:YA,guideColor:uW,guideColorActive:_W},{bracketColor:QA,guideColor:hW,guideColorActive:vW},{bracketColor:XA,guideColor:fW,guideColorActive:bW},{bracketColor:JA,guideColor:gW,guideColorActive:CW},{bracketColor:eM,guideColor:mW,guideColorActive:wW},{bracketColor:tM,guideColor:pW,guideColorActive:yW}],i=new hM,n=[{indentColor:qg,indentColorActive:Gg},{indentColor:qB,indentColorActive:XB},{indentColor:GB,indentColorActive:JB},{indentColor:ZB,indentColorActive:eW},{indentColor:YB,indentColorActive:tW},{indentColor:QB,indentColorActive:iW}],o=t.map(a=>{var l,c;const d=s.getColor(a.bracketColor),u=s.getColor(a.guideColor),h=s.getColor(a.guideColorActive),f=vd((l=vd(u))!==null&&l!==void 0?l:d==null?void 0:d.transparent(.3)),g=vd((c=vd(h))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(bu),r=n.map(a=>{const l=s.getColor(a.indentColor),c=s.getColor(a.indentColorActive),d=vd(l),u=vd(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(bu);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${i.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.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class Dv{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class dV{constructor(){this._currentVisibleRange=new M(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class uV{constructor(e,t,i,n,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class hV{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new _n(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new dV,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(115).enabled,this._maxNumberStickyLines=n.get(115).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new cr(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(146)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),n=t.get(146);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(100),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(115).enabled,this._maxNumberStickyLines=t.get(115).maxLineCount,nn(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(145)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Xx(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)this._visibleLines.getVisibleLine(n).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.minimalReveal,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 uV(e.minimalReveal,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 hV(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!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.viewModel.viewLayout.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 n=this._getLineNumberFor(i);if(n===-1||n<1||n>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(n)===1)return new V(n,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(nr)return null;let a=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(n);return ai)return-1;const n=new Dv(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=M.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let r=0;const a=new Dv(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new V(n.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let u=n.startLineNumber;u<=n.endLineNumber;u++){if(ud)continue;const h=u===n.startLineNumber?n.startColumn:1,f=u!==n.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(u):n.endColumn,m=this._visibleLines.getVisibleLine(u).getVisibleRangesForRange(u,h,g,a);if(m){if(t&&uthis._visibleLines.getEndLineNumber())return null;const n=new Dv(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new cB(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}n=Math.max(n,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).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 n=this._computeScrollLeftToReveal(i);n&&(this._isViewportWrapping||this._ensureMaxLineWidth(n.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:n.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Vn&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++)if(this._visibleLines.getVisibleLine(o).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 v=o[0].startLineNumber,b=o[0].endLineNumber;for(let C=1,w=o.length;Cl){if(!d)return-1;_=u}else if(r===5||r===6)if(r===6&&a<=u&&h<=c)_=a;else{const v=Math.max(5*this._lineHeight,l*.2),b=u-v,C=h-l;_=Math.max(C,b)}else if(r===1||r===2)if(r===2&&a<=u&&h<=c)_=a;else{const v=(u+h)/2;_=Math.max(0,v-l/2)}else _=this._computeMinimumScrolling(a,c,u,h,r===3,r===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(145),n=t.left,o=n+t.width-i.verticalScrollbarWidth;let r=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const d of c.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const d=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!d)return null;for(const u of d.ranges)r=Math.min(r,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(r=Math.max(0,r-o1.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(n,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,n,o,r){e=e|0,t=t|0,i=i|0,n=n|0,o=!!o,r=!!r;const a=t-e;if(n-it)return Math.max(0,n-a)}else return i;return e}}o1.HORIZONTAL_EXTRA_PX=30;class fV extends dM{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(145);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(145);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){var t,i;const n=e.getDecorationsInViewport(),o=[];let r=0;for(let a=0,l=n.length;a',l=[];for(let c=t;c<=i;c++){const d=c-t,u=n[d].getDecorations();let h="";for(const f of u){let g='
';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class _s{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=_s._clamp(e),this.g=_s._clamp(t),this.b=_s._clamp(i),this.a=_s._clamp(n)}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}}_s.Empty=new _s(0,0,0,0);class Yg extends G{static getInstance(){return this._INSTANCE||(this._INSTANCE=new Yg),this._INSTANCE}constructor(){super(),this._onDidChange=new O,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(oi.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=oi.getColorMap();if(!e){this._colors=[_s.Empty],this._backgroundIsLight=!0;return}this._colors=[_s.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}}Yg._INSTANCE=null;const mV=(()=>{const s=[];for(let e=32;e<=126;e++)s.push(e);return s.push(65533),s})(),pV=(s,e)=>(s-=32,s<0||s>96?e<=2?(s+96)%96:95:s);class Xf{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=Xf.soften(e,12/15),this.charDataLight=Xf.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;ne.width||i+g>e.height){console.warn("bad render request outside image data");return}const m=d?this.charDataLight:this.charDataNormal,_=pV(n,c),v=e.width*4,b=a.r,C=a.g,w=a.b,y=o.r-b,L=o.g-C,k=o.b-w,D=Math.max(r,l),N=e.data;let W=_*h*f,R=i*v+t*4;for(let A=0;Ae.width||i+u>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=r.r,m=r.g,_=r.b,v=n.r-g,b=n.g-m,C=n.b-_,w=g+v*f,y=m+b*f,L=_+C*f,k=Math.max(o,a),D=e.data;let N=i*h+t*4;for(let W=0;W{const e=new Uint8ClampedArray(s.length/2);for(let t=0;t>1]=h2[s[t]]<<4|h2[s[t+1]]&15;return e},g2={1:wu(()=>f2("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:wu(()=>f2("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class gf{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return g2[e]?i=new Xf(g2[e](),e):i=gf.createFromSampleData(gf.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="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const o of mV)i.fillText(String.fromCharCode(o),n,16/2),n+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const n=gf._downsample(e,t);return new Xf(n,t)}static _downsampleChar(e,t,i,n,o){const r=1*o,a=2*o;let l=n,c=0;for(let d=0;d0){const c=255/l;for(let d=0;dgf.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=ou._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=ou._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Z8);return i?new _s(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Y8);return t?_s._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Kg);return i?new _s(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&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.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class mf{constructor(e,t,i,n,o,r,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,o,r,a,l,c,d,u){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let L=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(L+=Math.max(0,o-e.lineHeight-e.paddingBottom));const k=Math.max(1,Math.floor(o*o/L)),D=Math.max(0,e.minimapHeight-k),N=D/(d-o),W=c*N,R=D>0,A=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),P=Math.floor(e.paddingTop/e.lineHeight);return new mf(c,d,R,N,W,k,P,1,Math.min(a,A))}let _;if(r&&i!==a){const L=i-t+1;_=Math.floor(L*f/h)}else{const L=o/m;_=Math.floor(L*f/h)}const v=Math.floor(e.paddingTop/m);let b=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const L=o/m;b=Math.max(b,L-1)}let C;if(b>0){const L=o/m;C=(v+a+b-L-1)*f/h}else C=Math.max(0,(v+a)*f/h-_);C=Math.min(e.minimapHeight-_,C);const w=C/(d-o),y=c*w;if(g>=v+a+b){const L=C>0;return new mf(c,d,L,w,y,_,v,1,a)}else{let L;t>1?L=t+v:L=Math.max(1,c/m);let k,D=Math.max(1,Math.floor(L-y*h/f));Dc&&(D=Math.min(D,u.startLineNumber),k=Math.max(k,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?R=(t-D+k+W)*f/h:R=c/e.paddingTop*(k+W)*f/h,new mf(c,d,!0,w,R,_,k,D,N)}}}class L_{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}L_.INVALID=new L_(-1);class m2{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new rM(()=>L_.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let n=0,o=i.length;n1){for(let v=0,b=n-1;v0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=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(n)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=Jf.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let o=0,r=t-e+1;o{var o;return!(!((o=n.options.minimap)===null||o===void 0)&&o.sectionHeaderStyle)});if(this._samplingState){const n=[];for(const o of i){if(!o.options.minimap)continue;const r=o.range,a=this._samplingState.modelLineToMinimapLine(r.startLineNumber),l=this._samplingState.modelLineToMinimapLine(r.endLineNumber);n.push(new LA(new M(a,r.startColumn,l,r.endColumn),o.options))}return n}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,o=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-o)),this._getMinimapDecorationsInViewport(e,t).filter(r=>{var a;return!!(!((a=r.options.minimap)===null||a===void 0)&&a.sectionHeaderStyle)})}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new M(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new M(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(i)}getSectionHeaderText(e,t){var i;const n=(i=e.options.minimap)===null||i===void 0?void 0:i.sectionHeaderText;if(!n)return null;const o=this._sectionHeaderCache.get(n);if(o)return o;const r=t(n);return this._sectionHeaderCache.set(n,r),r}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new M(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class zd extends G{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(Gx),this._domNode=nt(document.createElement("div")),Fo.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=nt(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=nt(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=nt(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=nt(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=nt(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=Ai(this._domNode.domNode,J.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const c=Fs(this._slider.domNode),d=c.top+c.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new Y0,this._sliderPointerDownListener=Ai(this._slider.domNode,J.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Ft.addTarget(this._domNode.domNode),this._sliderTouchStartListener=j(this._domNode.domNode,It.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=j(this._domNode.domNode,It.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Ai(this._domNode.domNode,It.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const l=Fs(this._domNode.domNode),c=Math.min(Math.abs(a-n),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Wn&&c>vV){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(r.pageY,r.pageX),()=>{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._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}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 wL(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){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Gx),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=mf.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((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,n,o);const d=new p2(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);const u=new p2(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,r,l,a,n),this._renderDecorationsHighlights(c,i,u,e,r,l,a,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const l of t){const c=n.intersectWithViewport(l);if(!c)continue;const[d,u]=c;for(let g=d;g<=u;g++)i.set(g,!0);const h=n.getYForLineNumber(d,o),f=n.getYForLineNumber(u,o);a>=h||(a>r&&e.fillRect(Xo,r,e.canvas.width,a-r),r=h),a=f}a>r&&e.fillRect(Xo,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,n,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==1)continue;const d=n.intersectWithViewport(l.range);if(!d)continue;const[u,h]=d,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=r.get(f.toString());g||(g=f.transparent(.5).toString(),r.set(f.toString(),g)),e.fillStyle=g;for(let m=u;m<=h;m++){if(i.has(m))continue;i.set(m,!0);const _=n.getYForLineNumber(u,o);e.fillRect(Xo,_,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=n.intersectWithViewport(c);if(!d)continue;const[u,h]=d;for(let f=u;f<=h;f++)this.renderDecorationOnLine(e,i,c,this._selectionColor,n,f,o,o,r,a,l)}}_renderDecorationsHighlights(e,t,i,n,o,r,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const u=n.intersectWithViewport(c.range);if(!u)continue;const[h,f]=u,g=d.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let m=h;m<=f;m++)switch(d.position){case 1:this.renderDecorationOnLine(e,i,c.range,g,n,m,o,o,r,a,l);continue;case 2:{const _=n.getYForLineNumber(m,o);this.renderDecoration(e,g,2,_,bV,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,r,a,l,c,d,u){const h=o.getYForLineNumber(r,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=i,m=f===r?i.startColumn:1,_=g===r?i.endColumn:this._model.getLineMaxColumn(r),v=this.getXOffsetForPosition(t,r,m,c,d,u),b=this.getXOffsetForPosition(t,r,_,c,d,u);this.renderDecoration(e,n,v,h,b-v,a)}getXOffsetForPosition(e,t,i,n,o,r){if(i===1)return Xo;if((i-1)*o>=r)return r;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[Xo];let d=Xo;for(let u=1;u=r){l[u]=r;break}l[u]=g,d=g}e.set(t,l)}return i-1_.range.startLineNumber-v.range.startLineNumber);const m=zd._fitSectionHeader.bind(null,f,a-Xo);for(const _ of g){const v=e.getYForLineNumber(_.range.startLineNumber,i)+n,b=v-n,C=b+2,w=this._model.getSectionHeaderText(_,m);zd._renderSectionLabel(f,w,((t=_.options.minimap)===null||t===void 0?void 0:t.sectionHeaderStyle)===2,c,u,a,b,r,v,C)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n="…",o=e.measureText(i).width,r=e.measureText(n).width;if(o<=t||o<=r)return i;const a=i.length,l=o/i.length,c=Math.floor((t-r)/l)-1;let d=Math.ceil(c/2);for(;d>0&&/\s/.test(i[d-1]);)--d;return i.substring(0,d)+n+i.substring(a-(c-d))}static _renderSectionLabel(e,t,i,n,o,r,a,l,c,d){t&&(e.fillStyle=n,e.fillRect(0,a,r,l),e.fillStyle=o,e.fillText(t,Xo,c)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(r,d),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const q=this._lastRenderData._get();return new m2(e,q.imageData,q.lines)}const o=this._getBuffer();if(!o)return null;const[r,a,l]=zd._renderUntouchedLines(o,e.topPaddingLineCount,t,i,n,this._lastRenderData),c=this._model.getMinimapLinesRenderingData(t,i,l),d=this._model.getOptions().tabSize,u=this._model.options.defaultBackgroundColor,h=this._model.options.backgroundColor,f=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,m=g.backgroundIsLight(),_=this._model.options.renderMinimap,v=this._model.options.charRenderer(),b=this._model.options.fontScale,C=this._model.options.minimapCharWidth,y=(_===1?2:3)*b,L=n>y?Math.floor((n-y)/2):0,k=h.a/255,D=new _s(Math.round((h.r-u.r)*k+u.r),Math.round((h.g-u.g)*k+u.g),Math.round((h.b-u.b)*k+u.b),255);let N=e.topPaddingLineCount*n;const W=[];for(let q=0,re=i-t+1;q=0&&Rb)return;const A=_.charCodeAt(y);if(A===9){const P=h-(y+L)%h;L+=P-1,w+=P*r}else if(A===32)w+=r;else{const P=yl(A)?2:1;for(let H=0;Hb)return}}}}}class p2{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,o=this._endLineNumber-this._startLineNumber+1;nthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class wV extends os{constructor(e,t){super(e),this._viewDomNode=t;const n=this._context.configuration.options.get(145);this._widgets={},this._verticalScrollbarWidth=n.verticalScrollbarWidth,this._minimapWidth=n.minimap.minimapWidth,this._horizontalScrollbarHeight=n.horizontalScrollbarHeight,this._editorHeight=n.height,this._editorWidth=n.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=nt(document.createElement("div")),Fo.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=nt(document.createElement("div")),Fo.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(145);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=nt(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],n=t?t.preference:null,o=t==null?void 0:t.stackOridinal;return i.preference===n&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const n=this._widgets[t].domNode.domNode;delete this._widgets[t],n.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const n=Object.keys(this._widgets);for(let o=0,r=n.length;o0);t.sort((n,o)=>(this._widgets[n].stack||0)-(this._widgets[o].stack||0));for(let n=0,o=t.length;n=3){const o=Math.floor(n/3),r=Math.floor(n/3),a=n-o-r,l=e,c=l+o,d=l+o+a;return[[0,l,c,l,d,l,c,l],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(n/2),r=n-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=n;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}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.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&K.equals(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 SV extends os{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=nt(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=oi.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new V(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new yV(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)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(n=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}return this._cursorPositions.sort((t,i)=>V.compare(t.position,i.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?K.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(jf.compareByRenderingProps),this._actualShouldRender===1&&!jf.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!Wi(this._renderedCursorPositions,this._cursorPositions,(g,m)=>g.position.lineNumber===m.position.lineNumber&&g.color===m.color)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=n/a,c=6*this._settings.pixelRatio|0,d=c/2|0,u=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(u.fillStyle=K.Format.CSS.formatHexA(e),u.fillRect(0,0,i,n)):(u.clearRect(0,0,i,n),u.fillStyle=K.Format.CSS.formatHexA(e),u.fillRect(0,0,i,n)):u.clearRect(0,0,i,n);const h=this._settings.x,f=this._settings.w;for(const g of t){const m=g.color,_=g.data;u.fillStyle=m;let v=0,b=0,C=0;for(let w=0,y=_.length/3;wn&&(A=n-d),N=A-d,W=A+d}N>C+1||L!==v?(w!==0&&u.fillRect(h[v],b,f[v],C-b),v=L,b=N,C=W):W>C&&(C=W)}u.fillRect(h[v],b,f[v],C-b)}if(!this._settings.hideCursor){const g=2*this._settings.pixelRatio|0,m=g/2|0,_=this._settings.x[7],v=this._settings.w[7];let b=-100,C=-100,w=null;for(let y=0,L=this._cursorPositions.length;yn&&(N=n-m);const W=N-m,R=W+g;W>C+1||k!==w?(y!==0&&w&&u.fillRect(_,b,v,C-b),b=W,C=R):R>C&&(C=R),w=k,u.fillStyle=k}w&&u.fillRect(_,b,v,C-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(u.beginPath(),u.lineWidth=1,u.strokeStyle=this._settings.borderColor,u.moveTo(0,0),u.lineTo(0,n),u.stroke(),u.moveTo(0,0),u.lineTo(i,0),u.stroke())}}class _2{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 fM{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(m=i-_);const v=d.color;let b=this._color2Id[v];b||(b=++this._lastAssignedId,this._color2Id[v]=b,this._id2Color[b]=v);const C=new _2(m-_,m+_,b);d.setColorZone(C),a.push(C)}return this._colorZonesInvalid=!1,a.sort(_2.compare),a}}class kV extends jg{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=nt(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new LV(n=>this._context.viewLayout.getVerticalOffsetForLineNumber(n)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(67)),this._zoneManager.setPixelRatio(i.get(143)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(67)&&(this._zoneManager.setLineHeight(t.get(67)),this._render()),e.hasChanged(143)&&(this._zoneManager.setPixelRatio(t.get(143)),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(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,r=0,a=0;for(const l of t){const c=l.colorId,d=l.from,u=l.to;c!==o?(e.fillRect(0,r,n,a-r),o=c,e.fillStyle=i[o],r=d,a=u):a>=d?a=Math.max(a,u):(e.fillRect(0,r,n,a-r),r=d,a=u)}e.fillRect(0,r,n,a-r)}}class DV extends os{constructor(e){super(e),this.domNode=nt(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(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).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=nt(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const n=this._renderedRulers.pop();this.domNode.removeChild(n),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(145);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(103);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":"")}}class EV{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class IV{constructor(e,t){this.lineNumber=e,this.ranges=t}}function NV(s){return new EV(s)}function TV(s){return new IV(s.lineNumber,s.ranges.map(NV))}class Yt extends nd{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).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._roundedSelection=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).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 n=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c=0;c--)i[c].lineNumber===l&&(r=i[c].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;Om(d-g)g&&(h.top=1),Om(u-m)'}_actualRenderOneSelection(e,t,i,n){if(n.length===0)return;const o=!!n[0].ranges[0].startStyle,r=n[0].lineNumber,a=n[n.length-1].lineNumber;for(let l=0,c=n.length;l1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Yt.SELECTION_CLASS_NAME="selected-text";Yt.SELECTION_TOP_LEFT="top-left-radius";Yt.SELECTION_BOTTOM_LEFT="bottom-left-radius";Yt.SELECTION_TOP_RIGHT="top-right-radius";Yt.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Yt.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Yt.ROUNDED_PIECE_WIDTH=10;ka((s,e)=>{const t=s.getColor(M8);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function Om(s){return s<0?-s:s}class v2{constructor(e,t,i,n,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=r,this.textContentClassName=a}}var da;(function(s){s[s.Single=0]="Single",s[s.MultiPrimary=1]="MultiPrimary",s[s.MultiSecondary=2]="MultiSecondary"})(da||(da={}));class b2{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(50);this._cursorStyle=i.get(28),this._lineHeight=i.get(67),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=nt(document.createElement("div")),this._domNode.setClassName(`cursor ${su}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),nn(this._domNode,n),this._domNode.setDisplay("none"),this._position=new V(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case da.Single:this._pluralityClass="";break;case da.MultiPrimary:this._pluralityClass="cursor-primary";break;case da.MultiSecondary:this._pluralityClass="cursor-secondary";break}}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(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),nn(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=NF(i,t-1);return[new V(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Oi.Line||this._cursorStyle===Oi.LineThin){const h=e.visibleRangeForPosition(n);if(!h||h.outsideRenderedLine)return null;const f=be(this._domNode.domNode);let g;this._cursorStyle===Oi.Line?(g=OD(f,this._lineCursorWidth>0?this._lineCursorWidth:2),g>2&&(t=o,i=this._getTokenClassName(n))):g=OD(f,1);let m=h.left,_=0;g>=2&&m>=1&&(_=1,m-=_);const v=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new v2(v,m,_,g,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new M(n.lineNumber,n.column,n.lineNumber,n.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Oi.Block&&(t=o,i=this._getTokenClassName(n));let d=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===Oi.Underline||this._cursorStyle===Oi.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new v2(d,l.left,0,c,u,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}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 ${this._pluralityClass} ${su} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),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 eg extends os{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new b2(this._context,da.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=nt(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 Zc,this._cursorFlatBlinkInterval=new VS,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(91),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let n=0,o=e.ranges.length;n{this._isVisible?this._hide():this._show()},eg.BLINK_INTERVAL,be(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},eg.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Oi.Line:e+=" cursor-line-style";break;case Oi.Block:e+=" cursor-block-style";break;case Oi.Underline:e+=" cursor-underline-style";break;case Oi.LineThin:e+=" cursor-line-thin-style";break;case Oi.BlockOutline:e+=" cursor-block-outline-style";break;case Oi.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==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=[{class:".cursor",foreground:pr,background:la},{class:".cursor-primary",foreground:GA,background:$B},{class:".cursor-secondary",foreground:ZA,background:KB}];for(const i of t){const n=s.getColor(i.foreground);if(n){let o=s.getColor(i.background);o||(o=n.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${o}; }`),iu(s.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}});const xv=()=>{throw new Error("Invalid change accessor")};class AV extends os{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(145);this._lineHeight=t.get(67),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=nt(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=nt(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 n of e)t.set(n.id,n);let i=!1;return this._context.viewModel.changeWhitespace(n=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const n={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};MV(e,n),n.addZone=xv,n.removeZone=xv,n.layoutZone=xv}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:nt(t.domNode),marginDomNode:t.marginDomNode?nt(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.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],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!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){At(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){At(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,n=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=W.endOffset&&(N++,W=i&&i[N]),P!==9&&P!==32||h&&!L&&A<=D)continue;if(u&&A>=k&&A<=D&&P===32){const q=A-1>=0?a.charCodeAt(A-1):0,re=A+1=0?a.charCodeAt(A-1):0;if(P===32&&q!==32&&q!==9)continue}if(i&&(!W||W.startOffset>A||W.endOffset<=A))continue;const H=e.visibleRangeForPosition(new V(t,A+1));H&&(r?(R=Math.max(R,H.left),P===9?y+=this._renderArrow(f,_,H.left):y+=``):P===9?y+=`
${w?"→":"→"}
`:y+=`
${String.fromCharCode(C)}
`)}return r?(R=Math.round(R+_),``+y+""):y}_renderArrow(e,t,i){const n=t/7,o=t,r=e/2,a=i,l={x:0,y:n/2},c={x:100/125*o,y:l.y},d={x:c.x-.2*c.x,y:c.y+.2*c.x},u={x:d.x+.1*c.x,y:d.y+.1*c.x},h={x:u.x+.35*c.x,y:u.y-.35*c.x},f={x:h.x,y:-h.y},g={x:u.x,y:-u.y},m={x:d.x,y:-d.y},_={x:c.x,y:-c.y},v={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class C2{constructor(e){const t=e.options,i=t.get(50),n=t.get(38);n==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):n==="svg"?(this.renderWhitespace=t.get(99),this.renderWithSVG=!0):(this.renderWhitespace=t.get(99),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(117)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class PV{constructor(e,t,i,n){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new M(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class FV{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class OV{constructor(e,t,i){this.configuration=e,this.theme=new FV(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var BV=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},WV=function(s,e){return function(t,i){e(t,i,s)}};let mw=class extends jg{constructor(e,t,i,n,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new yt(1,1,1,1)],this._renderAnimationFrame=null;const l=new $W(t,n,o,e);this._context=new OV(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(uw,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=nt(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=nt(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=nt(document.createElement("div")),Fo.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new eV(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new o1(this._context,this._linesContent),this._viewZones=new AV(this._context),this._viewParts.push(this._viewZones);const c=new SV(this._context);this._viewParts.push(c);const d=new xV(this._context);this._viewParts.push(d);const u=new jW(this._context);this._viewParts.push(u),u.addDynamicOverlay(new QW(this._context)),u.addDynamicOverlay(new Yt(this._context)),u.addDynamicOverlay(new cV(this._context)),u.addDynamicOverlay(new JW(this._context)),u.addDynamicOverlay(new RV(this._context));const h=new qW(this._context);this._viewParts.push(h),h.addDynamicOverlay(new XW(this._context)),h.addDynamicOverlay(new gV(this._context)),h.addDynamicOverlay(new fV(this._context)),h.addDynamicOverlay(new Zg(this._context)),this._glyphMarginWidgets=new nV(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new Oc(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new ZW(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new eg(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new wV(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const g=new DV(this._context);this._viewParts.push(g);const m=new GW(this._context);this._viewParts.push(m);const _=new CV(this._context);if(this._viewParts.push(_),c){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(c.getDomNode(),v.insertBefore)}this._linesContent.appendChild(u.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(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?(r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),r.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new HB(this._context,l,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map(o=>{var r,a,l;const c=(a=(r=o.options.glyphMargin)===null||r===void 0?void 0:r.position)!==null&&a!==void 0?a:kl.Center;return n=Math.max(n,o.range.endLineNumber),{range:o.range,lane:c,persist:(l=o.options.glyphMargin)===null||l===void 0?void 0:l.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(o=>{const r=e.validateRange(o.preference.range);return n=Math.max(n,r.endLineNumber),{range:r,lane:o.preference.lane}})),i.sort((o,r)=>M.compareRangesUsingStarts(o.range,r.range)),t.reset(n);for(const o of i)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new gB(e,t)},renderNow:()=>{this.render(!0,!1)},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 V(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(145);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(142)+" "+dw(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),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(){if(this._store.isDisposed)throw new Dt;if(this._renderAnimationFrame===null){const e=this._createCoordinatedRendering();this._renderAnimationFrame=pw.INSTANCE.scheduleCoordinatedRendering({window:be(this.domNode.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new Dt;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new Dt;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new Dt;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new Dt;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();ol(()=>e.prepareRenderText());const t=ol(()=>e.renderText());if(t){const[i,n]=t;ol(()=>e.prepareRender(i,n)),ol(()=>e.render(i,n))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}el.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new PV(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new aB(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new V(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?s1.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new kV(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()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}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){var t,i,n,o,r,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(i=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&i!==void 0?i:null,(o=(n=e.position)===null||n===void 0?void 0:n.secondaryPosition)!==null&&o!==void 0?o:null,(a=(r=e.position)===null||r===void 0?void 0:r.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),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){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};mw=BV([WV(6,vt)],mw);function ol(s){try{return s()}catch(e){return At(e),null}}class pw{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[i,n]of this._animationFrameRunners)n.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,NT(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)ol(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;io.renderText())}for(let i=0,n=e.length;io.prepareRender(a,l))}for(let i=0,n=e.length;io.render(a,l))}}}pw.INSTANCE=new pw;class pf{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let n=this.breakOffsets[e]-t;return e>0&&(n+=this.wrappedTextIndentLength),n}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let n=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)n0?this.breakOffsets[o-1]:0,t===0)if(e<=r)n=o-1;else if(e>l)i=o+1;else break;else if(e=l)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new Bm(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new Bm(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const n=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&w2(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let n=i.offsetInInputWithInjections;if(y2(this.injectionOptions[i.injectedTextIndex].cursorStops))return n;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(w2(this.injectionOptions[o].cursorStops)||(n-=this.injectionOptions[o].content.length,y2(this.injectionOptions[o].cursorStops)));)o--;return n}}else if(t===1||t===4){let n=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)n-=this.injectionOptions[o-1].content.length,o--;return n}QS()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let n=0;for(let o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};n+=r}}}}function w2(s){return s==null?!0:s===Iu.Right||s===Iu.Both}function y2(s){return s==null?!0:s===Iu.Left||s===Iu.Both}class Bm{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new V(e+this.outputLineIndex,this.outputOffset+1)}}class VV{constructor(){this.changeType=1}}class Oo{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.options.content;return i+=e.substring(n),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new Oo(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new Oo(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,n)=>i.lineNumber===n.lineNumber?i.column===n.column?i.order-n.order:i.column-n.column:i.lineNumber-n.lineNumber),t}constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}}class S2{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class HV{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class zV{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class UV{constructor(){this.changeType=5}}class ru{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;ts});class yL{static create(e){return new yL(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,o){const r=[],a=[];return{addRequest:(l,c,d)=>{r.push(l),a.push(c)},finalize:()=>$V(TN(this.targetWindow.deref()),r,e,t,i,n,o,a)}}}function $V(s,e,t,i,n,o,r,a){var l;function c(W){const R=a[W];if(R){const A=Oo.applyInjectedText(e[W],R),P=R.map(q=>q.options),H=R.map(q=>q.column-1);return new pf(H,P,[A.length],[],0)}else return null}if(n===-1){const W=[];for(let R=0,A=e.length;Rd?(A=0,P=0):H=d-de}const q=R.substr(A),re=KV(q,P,i,H,m,f);_[W]=A,v[W]=P,b[W]=q,C[W]=re[0],w[W]=re[1]}const y=m.build(),L=(l=Ev==null?void 0:Ev.createHTML(y))!==null&&l!==void 0?l:y;g.innerHTML=L,g.style.position="absolute",g.style.top="10000",r==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),s.document.body.appendChild(g);const k=document.createRange(),D=Array.prototype.slice.call(g.children,0),N=[];for(let W=0;WCe.options),ve=se.map(Ce=>Ce.column-1)):(de=null,ve=null),N[W]=new pf(ve,de,A,re,H)}return s.document.body.removeChild(g),N}function KV(s,e,t,i,n,o){if(o!==0){const h=String(o);n.appendString('
');const r=s.length;let a=e,l=0;const c=[],d=[];let u=0");for(let h=0;h"),c[h]=l,d[h]=a;const f=u;u=h+1"),c[s.length]=l,d[s.length]=a,n.appendString("
"),[c,d]}function jV(s,e,t,i){if(t.length<=1)return null;const n=Array.prototype.slice.call(e.children,0),o=[];try{_w(s,n,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function _w(s,e,t,i,n,o,r,a){if(i===o||(n=n||Iv(s,e,t[i],t[i+1]),r=r||Iv(s,e,t[o],t[o+1]),Math.abs(n[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,c=Iv(s,e,t[l],t[l+1]);_w(s,e,t,i,n,l,c,a),_w(s,e,t,l,c,o,r,a)}function Iv(s,e,t,i){return s.setStart(e[t/16384|0].firstChild,t%16384),s.setEnd(e[i/16384|0].firstChild,i%16384),s.getClientRects()}class qV extends G{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new wS),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t){if(this._pending.has(n.id)){At(new Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(0),this._register(wm(be(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(wm(be(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(wm(be(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;return wm(be((e=this._editor)===null||e===void 0?void 0:e.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){At(i)}}}}class mM{constructor(e,t,i,n,o,r,a){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=o,this._run=r,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Wc(s){let e=0,t=0,i=0,n=0;for(let o=0,r=s.length;o=vs&&(t=t-s%vs),t}function XV(s,e){return s.reduce((t,i)=>hi(t,e(i)),Bn)}function pM(s,e){return s===e}function tg(s,e){const t=s,i=e;if(i-t<=0)return Bn;const o=Math.floor(t/vs),r=Math.floor(i/vs),a=i-r*vs;if(o===r){const l=t-o*vs;return ni(0,a-l)}else return ni(r-o,a)}function au(s,e){return s=e}function Ud(s){return ni(s.lineNumber-1,s.column-1)}function kc(s,e){const t=s,i=Math.floor(t/vs),n=t-i*vs,o=e,r=Math.floor(o/vs),a=o-r*vs;return new M(i+1,n+1,r+1,a+1)}function JV(s){const e=Xu(s);return ni(e.length-1,e[e.length-1].length)}class ua{static fromModelContentChanges(e){return e.map(i=>{const n=M.lift(i.range);return new ua(Ud(n.getStartPosition()),Ud(n.getEndPosition()),JV(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${zs(this.startOffset)}...${zs(this.endOffset)}) -> ${zs(this.newLength)}`}}class eH{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>SL.from(t))}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):null;return i===null?null:tg(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ni(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ni(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=zs(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ni(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ni(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(n===0){const r=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.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 o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const n=YV(e,t,this.lineIdx,this.lineCharOffset);return new Za(n,0,-1,ui.getEmpty(),new ac(n))}}class lH{constructor(e,t){this.text=e,this._offset=Bn,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+`| `,"gi"):null,o=[];let r,a=0,l=0,c=0,d=0;const u=[];for(let g=0;g<60;g++)u.push(new Za(ni(0,g),0,-1,ui.getEmpty(),new ac(ni(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new Za(ni(1,g),0,-1,ui.getEmpty(),new ac(ni(1,g))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const g=r.index,m=r[0];if(m===` `)a++,l=g+1;else{if(c!==g){let _;if(d===a){const v=g-c;if(vcH(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function cH(s){let e=wa(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class dH{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=DL.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function uH(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const r=e,a=s[r].listHeight;for(e++;e=2?_M(r===0&&e===s.length?s:s.slice(r,e),!1):s[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())D2(i,n)<=D2(n,r)?(i=Nv(i,n),n=r):n=Nv(n,r);return Nv(i,n)}function _M(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const i=t>>1;for(let n=0;n=3?s[2]:null,e)}function D2(s,e){return Math.abs(s.listHeight-e.listHeight)}function Nv(s,e){return s.listHeight===e.listHeight?Lr.create23(s,e,null,!1):s.listHeight>e.listHeight?hH(s,e):fH(e,s)}function hH(s,e){s=s.toMutable();let t=s;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Lr.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Lr.create23(s,n,null,!1):s}function fH(s,e){s=s.toMutable();let t=s;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Lr.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Lr.create23(n,s,null,!1):s}class gH{constructor(e){this.lastOffset=Bn,this.nextNodes=[e],this.offsets=[Bn],this.idxs=[]}readLongestNodeAt(e,t){if(au(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=yh(this.nextNodes);if(!i)return;const n=yh(this.offsets);if(au(e,n))return;if(au(n,e))if(hi(n,i.length)<=e)this.nextNodeAfterCurrent();else{const o=Tv(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=Tv(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(n),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=yh(this.offsets),t=yh(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=yh(this.nextNodes),n=Tv(i,this.idxs[this.idxs.length-1]);if(n!==-1){this.nextNodes.push(i.getChild(n)),this.offsets.push(hi(e,t.length)),this.idxs[this.idxs.length-1]=n;break}else this.idxs.pop()}}}function Tv(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function yh(s){return s.length>0?s[s.length-1]:void 0}function x2(s,e,t,i){return new mH(s,e,t,i).parseDocument()}class mH{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new gH(i):void 0,this.positionMapper=new eH(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(ui.getEmpty(),0);return e||(e=Lr.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?uH(i):_M(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!k_(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),n=>t!==null&&!au(n.length,t)?!1:n.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new oH(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new ac(i.length);const n=e.merge(i.bracketIds),o=this.parseList(n,t+1),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),ig.create(i.astNode,o,r.astNode)):ig.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function E_(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new ba(E2(s)),i=E2(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let n=t.dequeue();function o(c){if(c===void 0){const u=t.takeWhile(h=>!0)||[];return n&&u.unshift(n),u}const d=[];for(;n&&!k_(c);){const[u,h]=n.splitAt(c);d.push(u),c=tg(u.lengthAfter,c),n=h??t.dequeue()}return k_(c)||d.push(new rl(!1,c,c)),d}const r=[];function a(c,d,u){if(r.length>0&&pM(r[r.length-1].endOffset,c)){const h=r[r.length-1];r[r.length-1]=new ua(h.startOffset,d,hi(h.newLength,u))}else r.push({startOffset:c,endOffset:d,newLength:u})}let l=Bn;for(const c of i){const d=o(c.lengthBefore);if(c.modified){const u=XV(d,f=>f.lengthBefore),h=hi(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=hi(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return r}class rl{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=tg(e,this.lengthAfter);return pM(t,Bn)?[this,void 0]:this.modified?[new rl(this.modified,this.lengthBefore,e),new rl(this.modified,Bn,t)]:[new rl(this.modified,e,e),new rl(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${zs(this.lengthBefore)} -> ${zs(this.lengthAfter)}`}}function E2(s){const e=[];let t=Bn;for(const i of s){const n=tg(t,i.startOffset);k_(n)||e.push(new rl(!1,n,n));const o=tg(i.startOffset,i.endOffset);e.push(new rl(!0,o,i.newLength)),t=i.endOffset}return e}class pH extends G{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new O,this.denseKeyProvider=new tH,this.brackets=new dH(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),n=new lH(this.textModel.getValue(),i);this.initialAstWithoutTokens=x2(n,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new ua(ni(i.fromLineNumber-1,0),ni(i.toLineNumber,0),ni(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=ua.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=E_(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=E_(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t,o=new rH(this.textModel,this.brackets);return x2(o,e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=ni(e.startLineNumber-1,e.startColumn-1),n=ni(e.endLineNumber-1,e.endColumn-1);return new _r(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;vw(r,Bn,r.length,i,n,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=Ud(e.getStartPosition()),n=Ud(e.getEndPosition());return new _r(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new _H(o,t,this.textModel);bw(r,Bn,r.length,i,n,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return bM(t,Bn,t.length,Ud(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return vM(t,Bn,t.length,Ud(e))}}function vM(s,e,t,i){if(s.kind===4||s.kind===2){const n=[];for(const o of s.children)t=hi(e,o.length),n.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=n.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=n[o];if(au(r,i)){const l=vM(s.children[o],r,a,i);if(l)return l}}return null}else{if(s.kind===3)return null;if(s.kind===1){const n=kc(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function bM(s,e,t,i){if(s.kind===4||s.kind===2){for(const n of s.children){if(t=hi(e,n.length),au(i,t)){const o=bM(n,e,t,i);if(o)return o}e=t}return null}else{if(s.kind===3)return null;if(s.kind===1){const n=kc(e,t);return{bracketInfo:s.bracketInfo,range:n}}}return null}function vw(s,e,t,i,n,o,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(s.kind){case 4:{const u=s.childrenLength;for(let h=0;h200)return!0;let c=!0;if(s.kind===2){let d=0;if(a){let f=a.get(s.openingBracket.text);f===void 0&&(f=0),d=f,f++,a.set(s.openingBracket.text,f)}const u=hi(e,s.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=s.computeMinIndentation(e,o.textModel)),c=o.push(new ZV(kc(e,t),kc(e,u),s.closingBracket?kc(hi(u,((l=s.child)===null||l===void 0?void 0:l.length)||Bn),t):void 0,r,d,s,h)),e=u,c&&s.child){const f=s.child;if(t=hi(e,f.length),lu(e,n)&&qh(t,i)&&(c=bw(f,e,t,i,n,o,r+1,a),!c))return!1}a==null||a.set(s.openingBracket.text,d)}else{let d=e;for(const u of s.children){const h=d;if(d=hi(d,u.length),lu(h,n)&&lu(i,d)&&(c=bw(u,h,d,i,n,o,r,a),!c))return!1}}return c}class vH extends G{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Ca),this.onDidChangeEmitter=new O,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{var n;(!i.languageId||!((n=this.bracketPairsTree.value)===null||n===void 0)&&n.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new pe;this.bracketPairsTree.value=bH(e.add(new pH(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||_r.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||_r.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)===null||i===void 0?void 0:i.object.getBracketsInRange(e,t))||_r.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(M.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?Wm(this._findMatchingBracketUp(l,n,Av(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(M.fromPositions(e,e)).filter(n=>n.closingBracketRange!==void 0&&(n.openingBracketRange.containsPosition(e)||n.closingBracketRange.containsPosition(e))).findLastMaxBy(oo(n=>n.openingBracketRange.containsPosition(e)?n.openingBracketRange:n.closingBracketRange,M.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=Av(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),r=t.getLanguageId(n);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=n-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(Jo(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=n+1;c=l)break;if(Jo(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=n.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Jo(n.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,n,a,r),d=null;for(;;){const u=Ys.findNextBracketInRange(a.forwardRegex,i,o,l,c);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const h=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof jr)return null;d=f}}l=u.endColumn-1}if(d)return d}if(r>0&&n.getStartOffset(r)===e.column-1){const l=r-1,c=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(l)).brackets;if(c&&!Jo(n.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,n,c,l),h=Ys.findPrevBracketInRange(c.reversedRegex,i,o,d,u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof jr?null:g}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof jr?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let r=-1,a=0;const l=(c,d,u,h)=>{for(;;){if(i&&++a%100===0&&!i())return jr.INSTANCE;const f=Ys.findPrevBracketInRange(o,c,d,u,h);if(!f)break;const g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?r++:e.isClose(g)&&r--,r===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),u=d.getCount(),h=this.textModel.getLineContent(c);let f=u-1,g=h.length,m=h.length;c===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),g=t.column-1,m=t.column-1);let _=!0;for(;f>=0;f--){const v=d.getLanguageId(f)===n&&!Jo(d.getStandardTokenType(f));if(v)_?g=d.getStartOffset(f):(g=d.getStartOffset(f),m=d.getEndOffset(f));else if(_&&g!==m){const b=l(c,h,g,m);if(b)return b}_=v}if(_&&g!==m){const v=l(c,h,g,m);if(v)return v}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let r=1,a=0;const l=(d,u,h,f)=>{for(;;){if(i&&++a%100===0&&!i())return jr.INSTANCE;const g=Ys.findNextBracketInRange(o,d,u,h,f);if(!g)break;const m=u.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(m)?r++:e.isClose(m)&&r--,r===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const u=this.textModel.tokenization.getLineTokens(d),h=u.getCount(),f=this.textModel.getLineContent(d);let g=0,m=0,_=0;d===t.lineNumber&&(g=u.findTokenIndexAtOffset(t.column-1),m=t.column-1,_=t.column-1);let v=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let u=c-1,h=d.length,f=d.length;if(a===i.lineNumber){u=l.findTokenIndexAtOffset(i.column-1),h=i.column-1,f=i.column-1;const m=l.getLanguageId(u);n!==m&&(n=m,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let g=!0;for(;u>=0;u--){const m=l.getLanguageId(u);if(n!==m){if(o&&r&&g&&h!==f){const v=Ys.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v);g=!1}n=m,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const _=!!o&&!Jo(l.getStandardTokenType(u));if(_)g?h=l.getStartOffset(u):(h=l.getStartOffset(u),f=l.getEndOffset(u));else if(r&&o&&g&&h!==f){const v=Ys.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v)}g=_}if(r&&o&&g&&h!==f){const m=Ys.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(m)return this._toFoundBracket(r,m)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(i))||null;const n=this.textModel.getLineCount();let o=null,r=null,a=null;for(let l=i.lineNumber;l<=n;l++){const c=this.textModel.tokenization.getLineTokens(l),d=c.getCount(),u=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===i.lineNumber){h=c.findTokenIndexAtOffset(i.column-1),f=i.column-1,g=i.column-1;const _=c.getLanguageId(h);o!==_&&(o=_,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let m=!0;for(;hm.closingBracketRange!==void 0&&m.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const n=Av(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const l=(f,g)=>{if(!r.has(f)){const m=[];for(let _=0,v=g?g.brackets.length:0;_{for(;;){if(n&&++c%100===0&&!n())return jr.INSTANCE;const b=Ys.findNextBracketInRange(f.forwardRegex,g,m,_,v);if(!b)break;const C=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),w=f.textIsBracket[C];if(w&&(w.isOpen(C)?a[w.index]++:w.isClose(C)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(b,w,!1,n);_=b.endColumn-1}return null};let u=null,h=null;for(let f=i.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),m=g.getCount(),_=this.textModel.getLineContent(f);let v=0,b=0,C=0;if(f===i.lineNumber){v=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,C=i.column-1;const y=g.getLanguageId(v);u!==y&&(u=y,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let w=!0;for(;ve==null?void 0:e.dispose()}}function Av(s){if(typeof s>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}class jr{constructor(){this._searchCanceledBrand=void 0}}jr.INSTANCE=new jr;function Wm(s){return s instanceof jr?null:s}class CH extends G{constructor(e){super(),this.textModel=e,this.colorProvider=new CM,this.onDidChangeEmitter=new O,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new M(1,1,this.textModel.getLineCount(),1),e,t):[]}}class CM{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}ka((s,e)=>{const t=[YA,QA,XA,JA,eM,tM],i=new CM;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${s.getColor(dW)}; }`);const n=t.map(o=>s.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=n[o%n.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});function Vm(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class Ki{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Vm(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Vm(this.oldText)}")`:`(replace@${this.oldPosition} "${Vm(this.oldText)}" with "${Vm(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;So(e,n,i),i+=4;for(let o=0;os.length)return!1;if(t){if(!ES(s,e))return!1;if(e.length===s.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,s.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),s.indexOf(e)===0}function yM(s){return s>=65&&s<=90||s>=97&&s<=122}function Iie(s,e=Wn){return e?yM(s.charCodeAt(0))&&s.charCodeAt(1)===58:!1}function Rr(s){return Qp(s,!0)}class SH{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:SC(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()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===ze.file)return Cw(Rr(e),Rr(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(T2(e.authority,t.authority))return Cw(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return $e.joinPath(e,...t)}basenameOrAuthority(e){return xL(e)||e.authority}basename(e){return ri.basename(e.path)}extname(e){return ri.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===ze.file?t=$e.file(oF(Rr(e))).path:(t=ri.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===ze.file?t=$e.file(XN(Rr(e))).path:t=ri.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!T2(e.authority,t.authority))return;if(e.scheme===ze.file){const o=sF(Rr(e),Rr(t));return Wn?wM(o):o}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const r=Math.min(i.length,n.length);oI2(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=fl){return A2(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=fl){let i=!1;if(e.scheme===ze.file){const n=Rr(e);i=n!==void 0&&n.length===I2(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=n.length===1&&n.charCodeAt(n.length-1)===47}return!i&&!A2(e,t)?e.with({path:e.path+"/"}):e}}const Vt=new SH(()=>!1),LH=Vt.isEqual.bind(Vt);Vt.isEqualOrParent.bind(Vt);Vt.getComparisonKey.bind(Vt);const Nie=Vt.basenameOrAuthority.bind(Vt),xL=Vt.basename.bind(Vt),Tie=Vt.extname.bind(Vt),kH=Vt.dirname.bind(Vt),Aie=Vt.joinPath.bind(Vt),DH=Vt.normalizePath.bind(Vt),Mie=Vt.relativePath.bind(Vt),N2=Vt.resolvePath.bind(Vt);Vt.isAbsolutePath.bind(Vt);const T2=Vt.isEqualAuthority.bind(Vt),A2=Vt.hasTrailingPathSeparator.bind(Vt);Vt.removeTrailingPathSeparator.bind(Vt);Vt.addTrailingPathSeparator.bind(Vt);var I_;(function(s){s.META_DATA_LABEL="label",s.META_DATA_DESCRIPTION="description",s.META_DATA_SIZE="size",s.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,l]=r.split(":");a&&l&&i.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(s.META_DATA_MIME,o),i}s.parseMetaData=e})(I_||(I_={}));function bd(s){return s.toString()}class Li{static create(e,t){const i=e.getAlternativeVersionId(),n=ww(e);return new Li(i,i,n,n,t,t,[])}constructor(e,t,i,n,o,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=r,this.changes=a}append(e,t,i,n,o){t.length>0&&(this.changes=wH(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(So(e,t?t.length:0,i),i+=4,t)for(const n of t)So(e,n.selectionStartLineNumber,i),i+=4,So(e,n.selectionStartColumn,i),i+=4,So(e,n.positionLineNumber,i),i+=4,So(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=yo(e,t);t+=4;for(let o=0;ot.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 Li}append(e,t,i,n,o){this._data instanceof Li&&this._data.append(e,t,i,n,o)}close(){this._data instanceof Li&&(this._data=this._data.serialize())}open(){this._data instanceof Li||(this._data=Li.deserialize(this._data))}undo(){if($e.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Li&&(this._data=this._data.serialize());const e=Li.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 Li&&(this._data=this._data.serialize());const e=Li.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Li&&(this._data=this._data.serialize()),this._data.byteLength+168}}class xH{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const o=bd(n.resource);this._editStackElementsMap.set(o,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=bd(e);return this._editStackElementsMap.has(t)}setModel(e){const t=bd($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=bd(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,n,o){const r=bd(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,o)}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=bd(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${xL(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function ww(s){return s.getEOL()===` `?0:1}function qr(s){return s?s instanceof SM||s instanceof xH:!1}class EL{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);qr(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);qr(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(qr(i)&&i.canAppend(this._model))return i;const n=new SM(p("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],ww(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=EL._computeCursorState(i,r),l=r.map((c,d)=>({index:d,textChange:c.textChange}));return l.sort((c,d)=>c.textChange.oldPosition===d.textChange.oldPosition?c.index-d.index:c.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),ww(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return At(i),null}}}class EH{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function IH(s,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(r-l);if(d===0){n.spacesDiff=u,u>0&&0<=l-1&&l-10?n++:w>1&&o++,IH(r,a,_,C,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const L=u.spacesDiff;L<=c&&d[L]++,r=_,a=C}let h=t;n!==o&&(h=n{const _=d[m];_>g&&(g=_,f=m)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function Mn(s){return(s.metadata&1)>>>0}function Rt(s,e){s.metadata=s.metadata&254|e<<0}function Gi(s){return(s.metadata&2)>>>1===1}function Nt(s,e){s.metadata=s.metadata&253|(e?1:0)<<1}function LM(s){return(s.metadata&4)>>>2===1}function R2(s,e){s.metadata=s.metadata&251|(e?1:0)<<2}function kM(s){return(s.metadata&64)>>>6===1}function P2(s,e){s.metadata=s.metadata&191|(e?1:0)<<6}function NH(s){return(s.metadata&24)>>>3}function F2(s,e){s.metadata=s.metadata&231|e<<3}function TH(s){return(s.metadata&32)>>>5===1}function O2(s,e){s.metadata=s.metadata&223|(e?1:0)<<5}class DM{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Rt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,R2(this,!1),P2(this,!1),F2(this,1),O2(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Nt(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;R2(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),P2(this,this.options.glyphMarginClassName!==null),F2(this,this.options.stickiness),O2(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 We=new DM(null,0,0);We.parent=We;We.left=We;We.right=We;Rt(We,0);class Mv{constructor(){this.root=We,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o,r){return this.root===We?[]:WH(this,e,t,i,n,o,r)}search(e,t,i,n){return this.root===We?[]:BH(this,e,t,i,n)}collectNodesFromOwner(e){return FH(this,e)}collectNodesPostOrder(){return OH(this)}insert(e){B2(this,e),this._normalizeDeltaIfNecessary()}delete(e){W2(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,r=i.end+n;i.setCachedOffsets(o,r,t)}acceptReplace(e,t,i,n){const o=RH(this,e,e+t);for(let r=0,a=o.length;rt||i===1?!1:i===2?!0:e}function MH(s,e,t,i,n){const o=NH(s),r=o===0||o===2,a=o===1||o===2,l=t-e,c=i,d=Math.min(l,c),u=s.start;let h=!1;const f=s.end;let g=!1;e<=u&&f<=t&&TH(s)&&(s.start=e,h=!0,s.end=e,g=!0);{const _=n?1:l>0?2:0;!h&&Cd(u,r,e,_)&&(h=!0),!g&&Cd(f,a,e,_)&&(g=!0)}if(d>0&&!n){const _=l>c?2:0;!h&&Cd(u,r,e+d,_)&&(h=!0),!g&&Cd(f,a,e+d,_)&&(g=!0)}{const _=n?1:0;!h&&Cd(u,r,t,_)&&(s.start=e+c,h=!0),!g&&Cd(f,a,t,_)&&(s.end=e+c,g=!0)}const m=c-l;h||(s.start=Math.max(0,u+m)),g||(s.end=Math.max(0,f+m)),s.start>s.end&&(s.end=s.start)}function RH(s,e,t){let i=s.root,n=0,o=0,r=0,a=0;const l=[];let c=0;for(;i!==We;){if(Gi(i)){Nt(i.left,!1),Nt(i.right,!1),i===i.parent.right&&(n-=i.parent.delta),i=i.parent;continue}if(!Gi(i.left)){if(o=n+i.maxEnd,ot){Nt(i,!0);continue}if(a=n+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Nt(i,!0),i.right!==We&&!Gi(i.right)){n+=i.delta,i=i.right;continue}}return Nt(s.root,!1),l}function PH(s,e,t,i){let n=s.root,o=0,r=0,a=0;const l=i-(t-e);for(;n!==We;){if(Gi(n)){Nt(n.left,!1),Nt(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),xl(n),n=n.parent;continue}if(!Gi(n.left)){if(r=o+n.maxEnd,rt){n.start+=l,n.end+=l,n.delta+=l,(n.delta<-1073741824||n.delta>1073741824)&&(s.requestNormalizeDelta=!0),Nt(n,!0);continue}if(Nt(n,!0),n.right!==We&&!Gi(n.right)){o+=n.delta,n=n.right;continue}}Nt(s.root,!1)}function FH(s,e){let t=s.root;const i=[];let n=0;for(;t!==We;){if(Gi(t)){Nt(t.left,!1),Nt(t.right,!1),t=t.parent;continue}if(t.left!==We&&!Gi(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[n++]=t),Nt(t,!0),t.right!==We&&!Gi(t.right)){t=t.right;continue}}return Nt(s.root,!1),i}function OH(s){let e=s.root;const t=[];let i=0;for(;e!==We;){if(Gi(e)){Nt(e.left,!1),Nt(e.right,!1),e=e.parent;continue}if(e.left!==We&&!Gi(e.left)){e=e.left;continue}if(e.right!==We&&!Gi(e.right)){e=e.right;continue}t[i++]=e,Nt(e,!0)}return Nt(s.root,!1),t}function BH(s,e,t,i,n){let o=s.root,r=0,a=0,l=0;const c=[];let d=0;for(;o!==We;){if(Gi(o)){Nt(o.left,!1),Nt(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==We&&!Gi(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,i);let u=!0;if(e&&o.ownerId&&o.ownerId!==e&&(u=!1),t&&LM(o)&&(u=!1),n&&!kM(o)&&(u=!1),u&&(c[d++]=o),Nt(o,!0),o.right!==We&&!Gi(o.right)){r+=o.delta,o=o.right;continue}}return Nt(s.root,!1),c}function WH(s,e,t,i,n,o,r){let a=s.root,l=0,c=0,d=0,u=0;const h=[];let f=0;for(;a!==We;){if(Gi(a)){Nt(a.left,!1),Nt(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Gi(a.left)){if(c=l+a.maxEnd,ct){Nt(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(d,u,o);let g=!0;i&&a.ownerId&&a.ownerId!==i&&(g=!1),n&&LM(a)&&(g=!1),r&&!kM(a)&&(g=!1),g&&(h[f++]=a)}if(Nt(a,!0),a.right!==We&&!Gi(a.right)){l+=a.delta,a=a.right;continue}}return Nt(s.root,!1),h}function B2(s,e){if(s.root===We)return e.parent=We,e.left=We,e.right=We,Rt(e,0),s.root=e,s.root;VH(s,e),Ba(e.parent);let t=e;for(;t!==s.root&&Mn(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;Mn(i)===1?(Rt(t.parent,0),Rt(i,0),Rt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,_f(s,t)),Rt(t.parent,0),Rt(t.parent.parent,1),vf(s,t.parent.parent))}else{const i=t.parent.parent.left;Mn(i)===1?(Rt(t.parent,0),Rt(i,0),Rt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,vf(s,t)),Rt(t.parent,0),Rt(t.parent.parent,1),_f(s,t.parent.parent))}return Rt(s.root,0),e}function VH(s,e){let t=0,i=s.root;const n=e.start,o=e.end;for(;;)if(zH(n,o,i.start+t,i.end+t)<0)if(i.left===We){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===We){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=We,e.right=We,Rt(e,1)}function W2(s,e){let t,i;if(e.left===We?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===We?(t=e.left,i=e):(i=HH(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(s.requestNormalizeDelta=!0)),i===s.root){s.root=t,Rt(t,0),e.detach(),Rv(),xl(t),s.root.parent=We;return}const n=Mn(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,Rt(i,Mn(e)),e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==We&&(i.left.parent=i),i.right!==We&&(i.right.parent=i)),e.detach(),n){Ba(t.parent),i!==e&&(Ba(i),Ba(i.parent)),Rv();return}Ba(t),Ba(t.parent),i!==e&&(Ba(i),Ba(i.parent));let o;for(;t!==s.root&&Mn(t)===0;)t===t.parent.left?(o=t.parent.right,Mn(o)===1&&(Rt(o,0),Rt(t.parent,1),_f(s,t.parent),o=t.parent.right),Mn(o.left)===0&&Mn(o.right)===0?(Rt(o,1),t=t.parent):(Mn(o.right)===0&&(Rt(o.left,0),Rt(o,1),vf(s,o),o=t.parent.right),Rt(o,Mn(t.parent)),Rt(t.parent,0),Rt(o.right,0),_f(s,t.parent),t=s.root)):(o=t.parent.left,Mn(o)===1&&(Rt(o,0),Rt(t.parent,1),vf(s,t.parent),o=t.parent.left),Mn(o.left)===0&&Mn(o.right)===0?(Rt(o,1),t=t.parent):(Mn(o.left)===0&&(Rt(o.right,0),Rt(o,1),_f(s,o),o=t.parent.left),Rt(o,Mn(t.parent)),Rt(t.parent,0),Rt(o.left,0),vf(s,t.parent),t=s.root));Rt(t,0),Rv()}function HH(s){for(;s.left!==We;)s=s.left;return s}function Rv(){We.parent=We,We.delta=0,We.start=0,We.end=0}function _f(s,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==We&&(t.left.parent=e),t.parent=e.parent,e.parent===We?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,xl(e),xl(t)}function vf(s,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==We&&(t.right.parent=e),t.parent=e.parent,e.parent===We?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,xl(e),xl(t)}function xM(s){let e=s.end;if(s.left!==We){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==We){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function xl(s){s.maxEnd=xM(s)}function Ba(s){for(;s!==We;){const e=xM(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function zH(s,e,t,i){return s===t?e-i:s-t}class yw{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!==Te)return IL(this.right);let e=this;for(;e.parent!==Te&&e.parent.left!==e;)e=e.parent;return e.parent===Te?Te:e.parent}prev(){if(this.left!==Te)return EM(this.left);let e=this;for(;e.parent!==Te&&e.parent.right!==e;)e=e.parent;return e.parent===Te?Te:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Te=new yw(null,0);Te.parent=Te;Te.left=Te;Te.right=Te;Te.color=0;function IL(s){for(;s.left!==Te;)s=s.left;return s}function EM(s){for(;s.right!==Te;)s=s.right;return s}function NL(s){return s===Te?0:s.size_left+s.piece.length+NL(s.right)}function TL(s){return s===Te?0:s.lf_left+s.piece.lineFeedCnt+TL(s.right)}function Pv(){Te.parent=Te}function bf(s,e){const 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!==Te&&(t.left.parent=e),t.parent=e.parent,e.parent===Te?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function Cf(s,e){const t=e.left;e.left=t.right,t.right!==Te&&(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===Te?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function Hm(s,e){let t,i;if(e.left===Te?(i=e,t=i.right):e.right===Te?(i=e,t=i.left):(i=IL(e.right),t=i.right),i===s.root){s.root=t,t.color=0,e.detach(),Pv(),s.root.parent=Te;return}const n=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,Gh(s,t)):(i.parent===e?t.parent=i:t.parent=i.parent,Gh(s,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===s.root?s.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Te&&(i.left.parent=i),i.right!==Te&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,Gh(s,i)),e.detach(),t.parent.left===t){const r=NL(t),a=TL(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const l=r-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,Vr(s,t.parent,l,c)}}if(Gh(s,t.parent),n){Pv();return}let o;for(;t!==s.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,bf(s,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,Cf(s,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,bf(s,t.parent),t=s.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,Cf(s,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,bf(s,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,Cf(s,t.parent),t=s.root));t.color=0,Pv()}function V2(s,e){for(Gh(s,e);e!==s.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,bf(s,e)),e.parent.color=0,e.parent.parent.color=1,Cf(s,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,Cf(s,e)),e.parent.color=0,e.parent.parent.color=1,bf(s,e.parent.parent))}s.root.color=0}function Vr(s,e,t,i){for(;e!==s.root&&e!==Te;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function Gh(s,e){let t=0,i=0;if(e!==s.root){for(;e!==s.root&&e===e.parent.right;)e=e.parent;if(e!==s.root)for(e=e.parent,t=NL(e.left)-e.size_left,i=TL(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==s.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const Pr=65535;function IM(s){let e;return s[s.length-1]<65536?e=new Uint16Array(s.length):e=new Uint32Array(s.length),e.set(s,0),e}class UH{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function zr(s,e=!0){const t=[0];let i=1;for(let n=0,o=s.length;n126)&&(r=!1)}const a=new UH(IM(s),i,n,o,r);return s.length=0,a}class Un{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class lc{constructor(e,t){this.buffer=e,this.lineStarts=t}}class KH{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Te&&e.iterate(e.root,i=>(i!==Te&&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 jH{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const 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--){const 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;const i=this._cache;for(let n=0;n=e){i[n]=null,t=!0;continue}}if(t){const n=[];for(const o of i)o!==null&&n.push(o);this._cache=n}}}class qH{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new lc("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Te,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=zr(e[o].buffer));const a=new Un(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),n=this.rbInsertRight(n,a)}this._searchCache=new jH(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Pr,i=t-Math.floor(t/3),n=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(r<=i||r+d0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new lc(l,zr(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 KH(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Te;)if(n.left!==Te&&n.lf_left+1>=e)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;const o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+=o+t-1}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==Te;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=n-r;return new V(i+1,a+1)}return new V(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Te){const o=this.getOffsetAt(i+1,1),r=n-e-o;return new V(i+1,r+1)}else t=t.right;return new V(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Te;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,o=>{if(o===Te)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,c=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,u=r.end.line;let h=c[d]+r.start.column;if(n&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=i,i="",n=!1,a===0))return!0;if(d===u)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(n=!0,i+=l.substr(h,a-1)):i+=l.substr(h,a),!0;i+=this._EOLNormalized?l.substring(h,Math.max(h,c[d+1]-this._EOLLength)):l.substring(h,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fw+g,t.reset(0)):(b=h.buffer,C=w=>w,t.reset(g));do if(_=t.next(b),_){if(C(_.index)>=m)return d;this.positionInBuffer(e,C(_.index)-f,v);const w=this.getLineFeedCnt(e.piece.bufferIndex,o,v),y=v.line===o.line?v.column-o.column+n:v.column+1,L=y+_[0].length;if(u[d++]=ec(new M(i+w,y,i+w,L),_,l),C(_.index)+_[0].length>=m||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,n){const o=[];let r=0;const a=new Nd(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const u=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,u,t,i,n,r,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const m=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(m>=1){const v=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),C=v[d.line+m],w=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,h,w,d,this.positionInBuffer(f,C-b),t,i,n,r,o),r>=n)return o;h+=m}const _=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const v=this.getLineContent(h).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,_,r,o,i,n),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(h).substr(_),h,_,r,o,i,n),r>=n)return o;h++,l=this.nodeAt2(h,1),f=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const m=h===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(h).substring(m,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,m,r,o,i,n),o}const g=h===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,h,g,d,u,t,i,n,r,o),o}_findMatchesInLine(e,t,i,n,o,r,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=i.length;let m=-f;for(;(m=i.indexOf(h,m+f))!==-1;)if((!d||sL(d,i,g,m,f))&&(a[r++]=new zf(new M(n,m+1+o,n,m+1+f+o),null),r>=c))return r;return r}let u;t.reset(0);do if(u=t.next(i),u&&(a[r++]=ec(new M(n,u.index+1+o,n,u.index+1+u[0].length+o),u,l),r>=c))return r;while(u);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Te){const{node:n,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=n.piece,l=a.bufferIndex,c=this.positionInBuffer(n,o);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let u=new Un(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,o)===10){const m={line:u.start.line+1,column:0};u=new Un(u.bufferIndex,m,u.end,this.getLineFeedCnt(u.bufferIndex,m,u.end),u.length-1),t+=` `}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,o-1)===13){const m=this.positionInBuffer(n,o-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,c);else this.deleteNodeTail(n,c);const h=this.createNewPieces(t);u.length>0&&this.rbInsertRight(n,u);let f=n;for(let g=0;g=0;r--)o=this.rbInsertLeft(o,n[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` `);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let r=1;r=h)c=u+1;else break;return i?(i.line=u,i.column=l-f,null):{line:u,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],r=n[i.line]+i.column;if(o>r+1)return i.line-t.line;const a=r-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;tPr){const d=[];for(;e.length>Pr;){const h=e.charCodeAt(Pr-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,Pr-1),e=e.substring(Pr-1)):(f=e.substring(0,Pr),e=e.substring(Pr));const g=zr(f);d.push(new Un(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new lc(f,g))}const u=zr(e);return d.push(new Un(this._buffers.length,{line:0,column:0},{line:u.length-1,column:e.length-u[u.length-1]},u.length-1,e.length)),this._buffers.push(new lc(e,u)),d}let t=this._buffers[0].buffer.length;const i=zr(e,!1);let n=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},n=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,u=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(u+l,u+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Te;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Te;)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){const i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),c=l-n,d=a-o,u=i.length+d;e.piece=new Un(i.bufferIndex,i.start,r,l,u),Vr(this,e,d,c)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),c=a-n,d=o-l,u=i.length+d;e.piece=new Un(i.bufferIndex,r,i.end,a,u),Vr(this,e,d,c)}shrinkNode(e,t,i){const n=e.piece,o=n.start,r=n.end,a=n.length,l=n.lineFeedCnt,c=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,c),u=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new Un(n.bufferIndex,n.start,c,d,u),Vr(this,e,u-a,d-l);const h=new Un(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.bufferIndex,i)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` `);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=zr(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==Te;)if(i.left!==Te&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Te;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}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===Te||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n===i.length-1||i[n+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Te||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Un(e.piece.bufferIndex,e.piece.start,o,a,r),Vr(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Un(t.piece.bufferIndex,l,t.piece.end,d,c),Vr(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces(`\r `);this.rbInsertRight(e,u[0]);for(let h=0;h_.sortIndex-v.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let g=null;if(t&&u.length>0){u.sort((m,_)=>_.lineNumber-m.lineNumber),g=[];for(let m=0,_=u.length;m<_;m++){const v=u[m].lineNumber;if(m>0&&u[m-1].lineNumber===v)continue;const b=u[m].oldContent,C=this.getLineContent(v);C.length===0||C===b||es(C)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new V9(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new M(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(m.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,u,h]=Wc(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:d,firstLineLength:u,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(cu._sortOpsDescending);const t=[];for(let i=0;i0){const h=l.eolCount+1;h===1?u=new M(c,d,c,d+l.firstLineLength):u=new M(c,d,c+h-1,l.lastLineLength+1)}else u=new M(c,d,c,d);i=u.endLineNumber,n=u.endColumn,t.push(u),o=l}return t}static _sortOpsAscending(e,t){const i=M.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=M.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class GH{constructor(e,t,i,n,o,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_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),i=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` `&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o=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=$H(this._tmpLineStarts,e);this.chunks.push(new lc(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Ff(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=lT(e)))}finish(e=!0){return this._finish(),new GH(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;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=zr(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class ZH{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const n=this._store.slice(0,e),o=this._store.slice(e+t),r=YH(i,this._default);this._store=n.concat(r,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let n=0;n0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new QH(e,[t]))}finalize(){return this._tokens}}class XH{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new Lw(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class JH extends XH{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const o=this._textModel.getLineContent(n.lineNumber),r=Sh(this._languageIdCodec,i,this.tokenizationSupport,o,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=Sh(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),l=new bn(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,o=e.column,r=this.getStartState(n);if(!r)return null;const a=this._textModel.getLineContent(n),l=a.substring(0,o-1)+i+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(n,0),d=Sh(this._languageIdCodec,c,this.tokenizationSupport,l,!0,r);return new bn(d.tokens,l,this._languageIdCodec)}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class tz{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Re(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Re(i.start,e):this._ranges.splice(t,1,new Re(i.start,e),new Re(e+1,i.endExclusive))}}addRange(e){Re.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function Sh(s,e,t,i,n,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,n,o.clone())}catch(a){At(a)}return r||(r=aL(s.encodeLanguageId(e),o)),bn.convertToEndOffset(r.tokens,i.length),r}class iz{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,mT(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const i=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Me(e,t))}}const Ur=new Uint32Array(0).buffer;class ir{static deleteBeginning(e,t){return e===null||e===Ur?e:ir.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===Ur)return e;const i=ia(e),n=i[i.length-2];return ir.delete(e,t,n)}static delete(e,t,i){if(e===null||e===Ur||t===i)return e;const n=ia(e),o=n.length>>>1;if(t===0&&n[n.length-2]===i)return Ur;const r=bn.findIndexInTokensArray(n,t),a=r>0?n[r-1<<1]:0,l=n[r<<1];if(id&&(n[c++]=g,n[c++]=n[(f<<1)+1],d=g)}if(c===n.length)return e;const h=new Uint32Array(c);return h.set(n.subarray(0,c),0),h.buffer}static append(e,t){if(t===Ur)return e;if(e===Ur)return t;if(e===null)return e;if(t===null)return null;const i=ia(e),n=ia(t),o=n.length>>>1,r=new Uint32Array(i.length+n.length);r.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c>>1;let r=bn.findIndexInTokensArray(n,t);r>0&&n[r-1<<1]===t&&r--;for(let a=r;a0}getTokens(e,t,i){let n=null;if(t1&&(o=Zn.getLanguageId(n[1])!==e),!o)return Ur}if(!n||n.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=H2(e),o.buffer}return n[n.length-2]=t,n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n}_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;const i=[];for(let n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=ir.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=ir.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len)){if(t===0){this._lineTokens[n]=ir.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=ir.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=ir.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let n=0,o=e.length;n>>0}class AL{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 o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let n=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){n=n||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){n=n||{index:o};continue}const[l,c]=a.split(i);if(l.isEmpty()){n=n||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,r++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=k0(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const n=AL._findFirstPieceWithLine(i,e),o=i[n].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let l=0;const c=[];let d=0,u=0;const h=(f,g)=>{f!==u&&(u=f,c[d++]=f,c[d++]=g)};for(let f=0;f>>0,b=~v>>>0;for(;lt)n=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,n,o){for(const r of this._pieces)r.acceptEdit(e,t,i,n,o)}}class N_ extends uM{constructor(e,t,i,n,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=o,this._attachedViews=r,this._semanticTokens=new AL(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new O),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new O),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new O),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new nz(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,n,o]=Wc(t.text);this._semanticTokens.acceptEdit(t.range,i,n,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Dt("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.grammarTokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[r,a]=N_._findLanguageBoundaries(n,o),l=Mf(t.column,this.getLanguageConfiguration(n.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&r===t.column-1){const[c,d]=N_._findLanguageBoundaries(n,o-1),u=Mf(t.column,this.getLanguageConfiguration(n.getLanguageId(o-1)).getWordDefinition(),i.substring(c,d),c);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn)return u}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)n=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new sz(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new Lw(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const i=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const r=oi.get(this.getLanguageId());if(!r)return[null,null];let a;try{a=r.getInitialState()}catch(l){return At(l),[null,null]}return[r,a]},[n,o]=i();if(n&&o?this._tokenizer=new JH(this._textModel.getLineCount(),n,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const r={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const d=this._tokenizer.store.getFirstInvalidEndStateLineNumber();d!==null&&a>=d&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};n&&n.createBackgroundTokenizer&&!n.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=n.createBackgroundTokenizer(this._textModel,r)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new iz(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),n!=null&&n.backgroundTokenizerShouldOnlyVerifyTokens&&n.createBackgroundTokenizer?(this._debugBackgroundTokens=new sg(this._languageIdCodec),this._debugBackgroundStates=new Lw(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=n.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,i,n;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[r,a]=Wc(o.text);this._tokens.acceptEdit(o.range,r,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,r,a)}(i=this._debugBackgroundStates)===null||i===void 0||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=Me.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,n;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new Sw,{heuristicTokens:r}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(r)for(const l of a.changes)(i=this._backgroundTokenizer.value)===null||i===void 0||i.requestTokens(l.fromLineNumber,l.toLineNumber+1);(n=this._defaultBackgroundTokenizer)===null||n===void 0||n.checkFinished()}forceTokenization(e){var t,i;const n=new Sw;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(n,e),this.setTokens(n.finalize()),(i=this._defaultBackgroundTokenizer)===null||i===void 0||i.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),n=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!n.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return n}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new V(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const n=this._textModel.validatePosition(e);return this.forceTokenization(n.lineNumber),this._tokenizer.tokenizeLineWithEdit(n,t,i)}get hasTokens(){return this._tokens.hasTokens}}class sz extends G{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new _n(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Wi(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}const ML=Qe("undoRedoService");class TM{constructor(e,t){this.resource=e,this.elements=t}}class Ou{constructor(){this.id=Ou._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}Ou._ID=0;Ou.None=new Ou;class dr{constructor(){this.id=dr._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}dr._ID=0;dr.None=new dr;var oz=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Fv=function(s,e){return function(t,i){e(t,i,s)}},Ql;function rz(s){const e=new NM;return e.acceptChunk(s),e.finish()}function az(s){const e=new NM;let t;for(;typeof(t=s.read())=="string";)e.acceptChunk(t);return e.finish()}function z2(s,e){let t;return typeof s=="string"?t=rz(s):B9(s)?t=az(s):t=s,t.create(e)}let zm=0;const lz=999,cz=1e4;class dz{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const n=this._source.read();if(n===null)return this._eos=!0,t===0?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=64*1024)return e.join("")}while(!0)}}const Lh=()=>{throw new Error("Invalid change accessor")};let El=Ql=class extends G{static resolveOptions(e,t){if(t.detectIndentation){const i=M2(e,t.tabSize,t.insertSpaces);return new wp({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new wp(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return br(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,n=null,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new O),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new pz(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new O),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new O),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new O),this._eventEmitter=this._register(new _z),this._languageSelectionListener=this._register(new Ca),this._deltaDecorationCallCnt=0,this._attachedViews=new vz,zm++,this.id="$model"+zm,this.isForSimpleWidget=i.isForSimpleWidget,typeof n>"u"||n===null?this._associatedResource=$e.parse("inmemory://model/"+zm):this._associatedResource=n,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=z2(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=Ql.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new vH(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new lV(this,this._languageConfigurationService)),this._decorationProvider=this._register(new CH(this)),this._tokenizationTextModelPart=new N_(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new M(1,1,u,this._buffer.getLineLength(u)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>Ql.LARGE_FILE_SIZE_THRESHOLD||u>Ql.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>Ql.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>Ql._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=cT(zm),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new U2,this._commandManager=new EL(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new cu([],"",` `,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=G.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Lc(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw x0();const{textBuffer:t,disposable:i}=z2(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new U2,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new ru([new VV],this._versionId,!1,!1),this._createContentChanged2(new M(1,1,o,r),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r `:` `;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new ru([new UV],this._versionId,!1,!1),this._createContentChanged2(new M(1,1,o,r),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const o=this._buffer.getLineLength(n);o>=cz?t+=o:e+=o}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();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new wp({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=M2(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),iM(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(aT.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({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();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const 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){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Dt("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new dz(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}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 Dt("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Dt("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Dt("Operation would exceed heap memory limits");return 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 Dt("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Dt("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Dt("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const u=this.getLineMaxColumn(o);r>=u&&(r=u)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const u=this.getLineMaxColumn(c);d>=u&&(d=u)}return i===o&&n===r&&a===c&&l===d&&e instanceof M&&!(e instanceof yt)?e:new M(o,r,c,d)}_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 n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(Di(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new V(1,1);if(n>r)return new V(r,this.getLineMaxColumn(r));if(o<=1)return new V(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new V(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,o-2);if(Di(l))return new V(n,o-1)}return new V(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof V&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(o,r,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,c=Di(a),d=Di(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof M&&!(e instanceof yt)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const c=r>1?this._buffer.getLineCharCode(o,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=Di(c),h=Di(d);return!u&&!h?new M(o,r,a,l):o===a&&r===l?new M(o,r-1,a,l-1):u&&h?new M(o,r-1,a,l+1):u?new M(o,r-1,a,l):new M(o,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const 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,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,r,a=lz){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>M.isIRange(u))&&(l=t.map(u=>this.validateRange(u)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((u,h)=>u.startLineNumber-h.startLineNumber||u.startColumn-h.startColumn);const c=[];c.push(l.reduce((u,h)=>M.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!i&&e.indexOf(` `)<0){const h=new md(e,i,n,o).parseSearchRequest();if(!h)return[];d=f=>this.findMatchesLineByLine(f,h,r,a)}else d=u=>Sm.findMatches(this,new md(e,i,n,o),u,r,a);return c.map(d).reduce((u,h)=>u.concat(h),[])}findNextMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` `)<0){const c=new md(e,i,n,o).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new M(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),h=this.findMatchesLineByLine(u,c,r,1);return Sm.findNextMatch(this,new md(e,i,n,o),a,r),h.length>0||(u=new M(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,c,r,1),h.length>0)?h[0]:null}return Sm.findNextMatch(this,new md(e,i,n,o),a,r)}findPreviousMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return Sm.findPreviousMatch(this,new md(e,i,n,o),a,r)}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 gv?e:new gv(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,n=e.length;i({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,m=c.startLineNumber>f.endLineNumber;if(!g&&!m){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&m&&m.length>0&&m.charAt(0)===` `)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===` `)){u=!1;break}}if(u){const h=new M(c,1,c,d);t.push(new gv(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new M(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new M(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),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(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c=0;N--){const W=f+N,R=C+N;D.takeFromEndWhile(P=>P.lineNumber>R);const A=D.takeFromEndWhile(P=>P.lineNumber===R);a.push(new S2(W,this.getLineContent(R),A))}if(vde.lineNumberde.lineNumber===re)}a.push(new zV(W+1,f+_,H,P))}l+=b}this._emitContentChangedEvent(new ru(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.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=Array.from(e).map(n=>new S2(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new gM(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,K2(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let n=null;try{n=t(i)}catch(o){At(o)}return i.addDecoration=Lh,i.changeDecoration=Lh,i.changeDecorationOptions=Lh,i.removeDecoration=Lh,i.deltaDecorations=Lh,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),At(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:$2[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,a,o),n.setOptions($2[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),l=Math.min(r,Math.max(1,t)),c=this.getLineMaxColumn(l),d=new M(a,1,l,c),u=this._getDecorationsInRange(d,i,n,o);return Cb(u,this._decorationProvider.getDecorationsInRange(d,i,n)),u}getDecorationsInRange(e,t=0,i=!1,n=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return Cb(a,this._decorationProvider.getDecorationsInRange(r,t,i,n)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return Oo.fromDecorations(n).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,n){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,n)}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 n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),r=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,n),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(n.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const n=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(i.options.before||t.before){const l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}const r=n!==o,a=hz(t)!==Np(i);r||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!1){const o=this.getVersionId(),r=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return uz(this.getLineContent(e))+1}};El._MODEL_SYNC_LIMIT=50*1024*1024;El.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;El.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;El.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;El.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:en.tabSize,indentSize:en.indentSize,insertSpaces:en.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:en.trimAutoWhitespace,largeFileOptimizations:en.largeFileOptimizations,bracketPairColorizationOptions:en.bracketPairColorizationOptions};El=Ql=oz([Fv(4,ML),Fv(5,Mi),Fv(6,Nr)],El);function uz(s){let e=0;for(const t of s)if(t===" "||t===" ")e++;else break;return e}function Ov(s){return!!(s.options.overviewRuler&&s.options.overviewRuler.color)}function hz(s){return!!s.after||!!s.before}function Np(s){return!!s.options.after||!!s.options.before}class U2{constructor(){this._decorationsTree0=new Mv,this._decorationsTree1=new Mv,this._injectedTextDecorationsTree=new Mv}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,o,r){const a=e.getVersionId(),l=this._intervalSearch(t,i,n,o,a,r);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,n,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,n,o,r),l=this._decorationsTree1.intervalSearch(e,t,i,n,o,r),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o,r);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,n,o){const r=e.getVersionId(),a=this._search(t,i,n,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,o){if(i)return this._decorationsTree1.search(e,t,n,o);{const r=this._decorationsTree0.search(e,t,n,o),a=this._decorationsTree1.search(e,t,n,o),l=this._injectedTextDecorationsTree.search(e,t,n,o);return r.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){Np(e)?this._injectedTextDecorationsTree.insert(e):Ov(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Np(e)?this._injectedTextDecorationsTree.delete(e):Ov(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){Np(e)?this._injectedTextDecorationsTree.resolveNode(e,t):Ov(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function Go(s){return s.replace(/[^a-z0-9\-_]/gi," ")}class AM{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class fz extends AM{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:c_.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;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class gz{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:kl.Center,this.persistLane=e==null?void 0:e.persistLane}}class mz extends AM{constructor(e){var t,i;super(e),this.position=e.position,this.sectionHeaderStyle=(t=e.sectionHeaderStyle)!==null&&t!==void 0?t:null,this.sectionHeaderText=(i=e.sectionHeaderText)!==null&&i!==void 0?i:null}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"?K.fromHex(e):t.getColor(e.id)}}class og{static from(e){return e instanceof og?e:new og(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Ci{static register(e){return new Ci(e)}static createDynamic(e){return new Ci(e)}constructor(e){var t,i,n,o,r,a;this.description=e.description,this.blockClassName=e.blockClassName?Go(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(i=e.blockIsAfterEnd)!==null&&i!==void 0?i:null,this.blockPadding=(n=e.blockPadding)!==null&&n!==void 0?n:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Go(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new fz(e.overviewRuler):null,this.minimap=e.minimap?new mz(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new gz(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Go(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Go(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?Go(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?kF(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Go(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Go(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Go(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Go(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Go(e.afterContentClassName):null,this.after=e.after?og.from(e.after):null,this.before=e.before?og.from(e.before):null,this.hideInCommentTokens=(r=e.hideInCommentTokens)!==null&&r!==void 0?r:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}Ci.EMPTY=Ci.register({description:"empty"});const $2=[Ci.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Ci.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Ci.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Ci.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function K2(s){return s instanceof Ci?s:Ci.createDynamic(s)}class pz extends G{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new O),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(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){var t,i;this._affectsMinimap||(this._affectsMinimap=!!(!((t=e.minimap)===null||t===void 0)&&t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(!((i=e.overviewRuler)===null||i===void 0)&&i.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this._affectsLineNumber||(this._affectsLineNumber=!!e.lineNumberClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class _z extends G{constructor(){super(),this._fastEmitter=this._register(new O),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new O),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)}}class vz{constructor(){this._onDidChangeVisibleRanges=new O,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new bz(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class bz{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(n=>new Me(n.startLineNumber,n.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class RL{static create(e){return new RL(e.get(134),e.get(133))}constructor(e,t){this.classifier=new Cz(e,t)}createLineBreaksComputer(e,t,i,n,o){const r=[],a=[],l=[];return{addRequest:(c,d,u)=>{r.push(c),a.push(d),l.push(u)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let u=0,h=r.length;u=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 kw=[],Dw=[];function wz(s,e,t,i,n,o,r,a){if(n===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,u=e.breakOffsetsVisibleColumn,h=MM(t,i,n,o,r),f=n-h,g=kw,m=Dw;let _=0,v=0,b=0,C=n;const w=d.length;let y=0;if(y>=0){let L=Math.abs(u[y]-C);for(;y+1=L)break;L=k,y++}}for(;yL&&(L=v,k=b);let D=0,N=0,W=0,R=0;if(k<=C){let P=k,H=L===0?0:t.charCodeAt(L-1),q=L===0?0:s.get(H),re=!0;for(let de=L;dev&&xw(H,q,se,Ce,c)&&(D=ve,N=P),P+=Ee,P>C){ve>v?(W=ve,R=P-Ee):(W=de+1,R=P),P-N>f&&(D=0),re=!1;break}H=se,q=Ce}if(re){_>0&&(g[_]=d[d.length-1],m[_]=u[d.length-1],_++);break}}if(D===0){let P=k,H=t.charCodeAt(L),q=s.get(H),re=!1;for(let de=L-1;de>=v;de--){const ve=de+1,se=t.charCodeAt(de);if(se===9){re=!0;break}let Ce,Ee;if(Lu(se)?(de--,Ce=0,Ee=2):(Ce=s.get(se),Ee=yl(se)?o:1),P<=C){if(W===0&&(W=ve,R=P),P<=C-f)break;if(xw(se,Ce,H,q,c)){D=ve,N=P;break}}P-=Ee,H=se,q=Ce}if(D!==0){const de=f-(R-N);if(de<=i){const ve=t.charCodeAt(W);let se;Di(ve)?se=2:se=wf(ve,R,i,o),de-se<0&&(D=0)}}if(re){y--;continue}}if(D===0&&(D=W,N=R),D<=v){const P=t.charCodeAt(v);Di(P)?(D=v+2,N=b+2):(D=v+1,N=b+wf(P,b,i,o))}for(v=D,g[_]=D,b=N,m[_]=N,_++,C=N+f;y<0||y=A)break;A=P,y++}}return _===0?null:(g.length=_,m.length=_,kw=e.breakOffsets,Dw=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=h,e)}function yz(s,e,t,i,n,o,r,a){const l=Oo.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(N=>N.options),d=t.map(N=>N.column-1)):(c=null,d=null),n===-1)return c?new pf(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new pf(d,c,[l.length],[],0):null;const h=a==="keepAll",f=MM(l,i,n,o,r),g=n-f,m=[],_=[];let v=0,b=0,C=0,w=n,y=l.charCodeAt(0),L=s.get(y),k=wf(y,0,i,o),D=1;Di(y)&&(k+=1,y=l.charCodeAt(1),L=s.get(y),D++);for(let N=D;Nw&&((b===0||k-C>g)&&(b=W,C=k-P),m[v]=b,_[v]=C,v++,w=C+g,b=0),y=R,L=A}return v===0&&(!t||t.length===0)?null:(m[v]=u,_[v]=k,new pf(d,c,m,_,f))}function wf(s,e,t,i){return s===9?t-e%t:yl(s)||s<32?i:1}function j2(s,e){return e-s%e}function xw(s,e,t,i,n){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!n&&e===3&&i!==2||!n&&i===3&&e!==1)}function MM(s,e,t,i,n){let o=0;if(n!==0){const r=es(s);if(r!==-1){for(let l=0;lt&&(o=0)}}return o}class T_{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Fi(new M(1,1,1,1),0,0,new V(1,1),0),new Fi(new M(1,1,1,1),0,0,new V(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 je(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?yt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):yt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,n,i,r),l=this._validatePositionWithCache(e,o,n,a);return i.equals(r)&&n.equals(a)&&o.equals(l)?t:new Fi(M.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=T_._validateViewState(e.viewModel,i)),t){const n=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(n)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new Fi(n,t.selectionStartKind,o,r,a)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new Fi(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new Fi(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new V(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new V(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new M(n.lineNumber,n.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new Fi(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class q2{constructor(e){this.context=e,this.cursors=[new T_(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return Q9(this.cursors,oo(e=>e.viewState.position,V.compare)).viewState.position}getBottomMostViewPosition(){return Y9(this.cursors,oo(e=>e.viewState.position,V.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(je.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const n=t-i;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;ii.selection,M.compareRangesUsingStarts));for(let i=0;iu&&m.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),i--}}}}class G2{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class Sz{constructor(){this.type=0}}class Lz{constructor(){this.type=1}}class kz{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Dz{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class Hl{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class Um{constructor(){this.type=5}}class xz{constructor(e){this.type=6,this.isFocused=e}}class Ez{constructor(){this.type=7}}class $m{constructor(){this.type=8}}class RM{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class Ew{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Iw{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class yf{constructor(e,t,i,n,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=12}}class Iz{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 Nz{constructor(e){this.theme=e,this.type=14}}class Tz{constructor(e){this.type=15,this.ranges=e}}class Az{constructor(){this.type=16}}let Mz=class{constructor(){this.type=17}};class Rz extends G{constructor(){super(),this._onEvent=this._register(new O),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 Pz{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class PL{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new PL(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class FL{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new FL(this.oldHasFocus,e.hasFocus)}}class OL{constructor(e,t,i,n,o,r,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=r,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}attemptToMerge(e){return e.kind!==this.kind?null:new OL(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Fz{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Oz{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class A_{constructor(e,t,i,n,o,r,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,n=t.length;if(i!==n)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(n=n.slice(0,r),o=!0);const a=Sf.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,o,r){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=M.fromPositions(a[0],a[0]),e.emitViewEvent(new yf(t,i,l,c,n,o,r))}revealPrimary(e,t,i,n,o,r){const l=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new yf(t,i,null,l,n,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const o=je.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,o)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,je.fromModelSelections(o))}}}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:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,je.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(i,n),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,n,o){const r=Sf.from(this._model,this);if(r.equals(n))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new Dz(l,a,i)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((c,d)=>!c.modelState.equals(n.cursorState[d].modelState))){const c=n?n.cursorState.map(u=>u.modelState.selection):null,d=n?n.modelVersionId:0;e.emitOutgoingEvent(new A_(c,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=o.text.length-r[2].length-1,u=o.text.lastIndexOf(c,d-1);if(u===-1)return null;t.push([u,d])}return t}executeEdits(e,t,i,n){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(o)for(let u=0,h=o.length;u0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=Sf.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){At(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return Z2.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new Lf(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(Zt.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let o=0;for(;o{const c=l.getPosition();return new yt(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Zt.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,r)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(Zt.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Bc.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new An(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new An(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class Sf{static from(e,t){return new Sf(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class jz{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let r=0,a=n.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,c=>{const d=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(d[f].sort(u),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:g=>{const m=parseInt(g,10),_=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new yt(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new yt(_.endLineNumber,_.endColumn,_.startLineNumber,_.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,d)=>d-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{M.isEmpty(u)&&h===""||n.push({identifier:{major:t,minor:o++},range:u,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(u,h,f)=>{a=!0,r(u,h,f)},trackSelection:(u,h)=>{const f=yt.liftSelection(u);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const v=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===v?g=2:g=3}else g=1;const m=e.trackedRanges.length,_=e.model._setTrackedRange(null,f,g);return e.trackedRanges[m]=_,e.trackedRangesDirection[m]=f.getDirection(),m.toString()}};try{i.getEditOperations(e.model,d)}catch(u){return At(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,n)=>-M.compareRangesUsingEnds(i.range,n.range));const t={};for(let i=1;io.identifier.major?r=n.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class qz{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class Lf{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new qz(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=Lf._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=Lf._capture(e,t);if(!i||this._original.length!==i.length)return null;const n=[];for(let o=0,r=this._original.length;oKf,tokenizeEncoded:(s,e,t)=>aL(0,t)};async function Gz(s,e,t){if(!t)return Q2(e,s.languageIdCodec,Y2);const i=await oi.getOrCreate(t);return Q2(e,s.languageIdCodec,i||Y2)}function Zz(s,e,t,i,n,o,r){let a="
",l=i,c=0,d=!0;for(let u=0,h=e.getCount();u0;)r&&d?(g+=" ",d=!1):(g+=" ",d=!0),_--;break}case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",d=!1;break;case 13:g+="​",d=!1;break;case 32:r&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(m),d=!1}}if(a+=`${g}`,f>n||l>=n)break}return a+="
",a}function Q2(s,e,t){let i='
';const n=Xu(s);let o=t.getInitialState();for(let r=0,a=n.length;r0&&(i+="
");const c=t.tokenizeEncoded(l,!0,o);bn.convertToEndOffset(c.tokens,l.length);const u=new bn(c.tokens,l,e).inflate();let h=0;for(let f=0,g=u.getCount();f${of(l.substring(h,_))}`,h=_}o=c.endState}return i+="
",i}class Yz{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,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class Qz{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}let PM=class Nw{constructor(e,t,i,n){this._instanceId=cT(++Nw.INSTANCE_COUNT),this._pendingChanges=new Yz,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n>>1;t===e[r].afterLineNumber?i{t=!0,n=n|0,o=o|0,r=r|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Qz(l,n,o,r,a)),l},changeOneWhitespace:(n,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:n,newAfterLineNumber:o,newHeight:r})},removeWhitespace:n=>{t=!0,this._pendingChanges.remove({id:n})}})}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 c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const n=new Set;for(const l of i)n.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const r=l=>{const c=[];for(const d of l)if(!n.has(d.id)){if(o.has(d.id)){const u=o.get(d.id);d.afterLineNumber=u.newAfterLineNumber,d.height=u.newHeight}c.push(d)}return c},a=r(this._arr).concat(r(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=Nw.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,n=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,n=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else n=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+n+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,n=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+n+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 n=1,o=t;for(;n=a+i)n=r+1;else{if(e>=a)return r;o=r}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,n=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(n)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(n)|0;const l=this.getWhitespacesCount()|0;let c,d;a===-1?(a=l,d=r+1,c=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let u=o,h=u;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/i)*i,h-=g);const m=[],_=e+(t-e)/2;let v=-1;for(let y=n;y<=r;y++){if(v===-1){const L=u,k=u+i;(L<=_&&__)&&(v=y)}for(u+=i,m[y-n]=h,h+=i;d===y;)h+=c,u+=c,a++,a>=l?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){r=y;break}}v===-1&&(v=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let C=n,w=r;return Ct&&w--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:r,relativeVerticalOffset:m,centeredLineNumber:v,completelyVisibleStartLineNumber:C,completelyVisibleEndLineNumber:w,lineHeight:this._lineHeight}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let n;return e>0?n=this.getWhitespacesAccumulatedHeight(e-1):n=0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+o)return-1;for(;t=a+l)t=r+1;else{if(e>=a)return r;i=r}}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 n=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=n;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return o}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}};PM.INSTANCE_COUNT=0;const Xz=125;class Zh{constructor(e,t,i,n){e=e|0,t=t|0,i=i|0,n=n|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class Jz extends G{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new O),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new Zh(0,0,0,0),this._scrollable=this._register(new ih({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame: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,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new PL(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)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class eU extends G{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(145),r=n.get(84);this._linesLayout=new PM(t,n.get(67),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new Jz(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new Zh(o.contentWidth,0,o.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(114)?Xz:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){const i=t.get(84);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(145)){const i=t.get(145),n=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new Zh(n,r.contentWidth,o,this._getContentHeight(n,o,a)))}else this._updateHeight();e.hasChanged(114)&&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 n=this._configuration.options.get(103);return n.horizontal===2||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(105)?o+=Math.max(0,t-n.get(67)-n.get(84).bottom):n.get(103).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new Zh(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Mx(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Mx(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(146),n=e.get(50),o=e.get(145);if(i.isViewportWrapping){const r=e.get(73);return t>o.contentWidth+n.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(104)*n.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new Zh(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}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)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class tU{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new V(n.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new V(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);r=new M(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new LA(r,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const n=new M(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,qp(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let l=0;const c=[];for(let d=o;d<=r;d++)c[d-o]=[];for(let d=0,u=n.length;dt===1)}function sU(s,e){return FM(s,e.range,t=>t===2)}function FM(s,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const n=s.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?n.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(n.getStandardTokenType(a)))return!1;a++}}return!0}function Bv(s,e){return s===null?e?M_.INSTANCE:R_.INSTANCE:new oU(s,e)}class oU{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const n=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new Oo(0,0,c+1,this._projectionData.injectionOptions[d],0));r=Oo.applyInjectedText(e.getLineContent(t),a).substring(n,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=X2(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,o,r,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,d=l.injectionOptions;let u=null;if(c){u=[];let f=0,g=0;for(let m=0;m0?l.breakOffsets[m-1]:0,b=l.breakOffsets[m];for(;gb)break;if(v0?l.wrappedTextIndentLength:0,D=k+Math.max(w-v,0),N=k+Math.min(y-v,b-v);D!==N&&_.push(new e8(D,N,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(y<=b)f+=C,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:bn.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=i;f0?n.wrappedTextIndentLength:0,r=i>0?n.breakOffsets[i-1]:0,a=n.breakOffsets[i],l=e.sliceAndInflate(r,a,o);let c=l.getLineContent();i>0&&(c=X2(n.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,u=c.length+1,h=i+1=Wv.length)for(let e=1;e<=s;e++)Wv[e]=rU(e);return Wv[s]}function rU(s){return new Array(s+1).join(" ")}class aU{constructor(e,t,i,n,o,r,a,l,c,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new cU(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new ba(Oo.fromDecorations(n));for(let m=0;mv.lineNumber===m+1);r.addRequest(i[m],_,t?t[m]:null)}const l=r.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(M.compareRangesUsingStarts);let u=1,h=0,f=-1,g=f+1=u&&_<=h,b=Bv(l[m],!v);c[m]=b.getViewLineCount(),this.modelLineProjections[m]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new k9(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=lU(t),n=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(M.compareRangesUsingStarts);if(i.length===n.length){let h=!1;for(let f=0;f({range:h,options:Ci.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,l=0,c=-1,d=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(u=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const m=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,m)}}return u||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===n,d=this.wordBreak===o;if(r&&a&&l&&c&&d)return!1;const u=r&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=o;let h=null;if(u){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,u=n.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,u=d+l-1,g=u+1,m=g+(o-l)-1,c=!0):ot?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new J2(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new V(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new V(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=n.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,u=l===n.modelLineNumber?n.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=d;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),_=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return _.lineNumber===d.modelLineWrappedLineIdx?new gc(f.visibleColumn,g,f.className,new ff(f.horizontalLine.top,m.column),-1,-1):_.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],l=i.lineNumber-1,c=n.lineNumber-1;let d=null;for(let g=l;g<=c;g++){const m=this.modelLineProjections[g];if(m.isVisible()){const _=m.getViewLineNumberOfModelPosition(0,g===l?i.column:1),v=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),b=v-_+1;let C=0;b>1&&m.getViewLineMinColumn(this.model,g+1,v)===1&&(C=_===0?1:2),r.push(b),a.push(C),d===null&&(d=new V(g+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,n.lineNumber)),d=null);const u=t-e+1,h=new Array(u);let f=0;for(let g=0,m=o.length;gt&&(g=!0,f=t-o+1),u.getViewLinesData(this.model,c+1,h,f,o-e,i,l),o+=f,g)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,r=n.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,r),c=a.getViewLineMaxColumn(this.model,o+1,r);tc&&(t=c);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new V(o+1,d)).equals(i)?new V(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new M(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new V(i.modelLineNumber,n))}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,n=!1,o=!1){const r=this.model.validatePosition(new V(e,t)),a=r.lineNumber,l=r.column;let c=a-1,d=!1;if(o)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new V(n?0:1,1);const u=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return d?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,1,i):h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(c+1),i):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(u,l,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),n=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new M(i.lineNumber,i.column,n.lineNumber,n.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new M(r.lineNumber,1,a.lineNumber,a.column),t,i,n,o);let l=[];const c=r.lineNumber-1,d=a.lineNumber-1;let u=null;for(let m=c;m<=d;m++)if(this.modelLineProjections[m].isVisible())u===null&&(u=new V(m+1,m===c?r.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(m);l=l.concat(this.model.getDecorationsInRange(new M(u.lineNumber,u.column,m,v),t,i,n)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new M(u.lineNumber,u.column,a.lineNumber,a.column),t,i,n)),u=null),l.sort((m,_)=>{const v=M.compareRangesUsingStarts(m.range,_.range);return v===0?m.id<_.id?-1:m.id>_.id?1:0:v});const h=[];let f=0,g=null;for(const m of l){const _=m.id;g!==_&&(g=_,h[f++]=m)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function lU(s){if(s.length===0)return[];const e=s.slice();e.sort(M.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,n=e[0].endLineNumber;for(let o=1,r=e.length;on+1?(t.push(new M(i,1,n,1)),i=a.startLineNumber,n=a.endLineNumber):a.endLineNumber>n&&(n=a.endLineNumber)}return t.push(new M(i,1,n,1)),t}class J2{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class eE{constructor(e,t){this.modelRange=e,this.viewLines=t}}class cU{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,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}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 dU{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new uU(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new Ew(t,i)}onModelLinesInserted(e,t,i,n){return new Iw(t,i)}onModelLineChanged(e,t,i){return[!1,new RM(t,1),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,n=new Array(i);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const zl=kl.Right;class hU{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*zl/8))}reset(e){const t=Math.ceil((e+1)*zl/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=BL.create(this.model),this.glyphLanes=new hU(0),this.model.isTooLargeForTokenization())this._lines=new dU(this.model);else{const d=this._configuration.options,u=d.get(50),h=d.get(139),f=d.get(146),g=d.get(138),m=d.get(129);this._lines=new aU(this._editorId,this.model,n,o,u,this.model.getOptions().tabSize,h,f.wrappingColumn,g,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Kz(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new eU(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Iz(d)),this._eventDispatcher.emitOutgoingEvent(new OL(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new tU(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(Yg.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Az)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new Nz(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),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())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new M(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new xz(e)),this._eventDispatcher.emitOutgoingEvent(new FL(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Sz)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Lz)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new V(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new iE(t,this._viewportStart.startLineDelta)}return new iE(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(50),r=n.get(139),a=n.get(146),l=n.get(138),c=n.get(129);this._lines.setWrappingSettings(o,r,a.wrappingColumn,l,c)&&(e.emitViewEvent(new Um),e.emitViewEvent(new $m),e.emitViewEvent(new Hl(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(91)&&(this._decorations.reset(),e.emitViewEvent(new Hl(null))),t.hasChanged(98)&&(this._decorations.reset(),e.emitViewEvent(new Hl(null))),e.emitViewEvent(new kz(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),_d.shouldRecreate(t)&&(this.cursorConfig=new _d(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let n=!1,o=!1;const r=e instanceof Lc?e.rawContentChangedEvent.changes:e.changes,a=e instanceof Lc?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const u of r)switch(u.changeType){case 4:{for(let h=0;h!m.ownerId||m.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;u.injectedText&&(h=u.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(u.detail,h,null);break}}const c=l.finalize(),d=new ba(c);for(const u of r)switch(u.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new Um),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),n=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,u.fromLineNumber,u.toLineNumber);h!==null&&(i.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),n=!0;break}case 4:{const h=d.takeCount(u.detail.length),f=this._lines.onModelLinesInserted(a,u.fromLineNumber,u.toLineNumber,h);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),n=!0;break}case 2:{const h=d.dequeue(),[f,g,m,_]=this._lines.onModelLineChanged(a,u.lineNumber,h);o=f,g&&i.emitViewEvent(g),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),_&&(i.emitViewEvent(_),this.viewLayout.onLinesDeleted(_.fromLineNumber,_.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!n&&o&&(i.emitViewEvent(new $m),i.emitViewEvent(new Hl(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const n=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof Lc&&i.emitOutgoingEvent(new zz(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,n=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new Ez),this.cursorConfig=new _d(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Hz(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new _d(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Vz(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new Um),t.emitViewEvent(new $m),t.emitViewEvent(new Hl(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new _d(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Uz(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Hl(e)),this._eventDispatcher.emitOutgoingEvent(new Wz(e))}))}setHiddenAreas(e,t){var i;this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas)return;this.previousHiddenAreas=n;const o=this._captureStableViewport();let r=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(n),r&&(a.emitViewEvent(new Um),a.emitViewEvent(new $m),a.emitViewEvent(new Hl(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const l=(i=o.viewportStartModelPosition)===null||i===void 0?void 0:i.lineNumber;l&&n.some(d=>d.startLineNumber<=l&&l<=d.endLineNumber)||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new Oz)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(145),t=this._configuration.options.get(67),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new M(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const n=[];let o=0,r=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,u=i.length;dl||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}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=es(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Gc(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const n=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),n=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new Ss(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,n,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new J3(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,qp(this._configuration.options)),i=new gU;for(const n of t){const o=n.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const l=r.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(l,o.zIndex,c,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i==null||i.invalidateCachedColor();const n=t.options.minimap;n==null||n.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const n=i?`\r `:this.model.getEOL();e=e.slice(0),e.sort(M.compareRangesUsingStarts);let o=!1,r=!1;for(const l of e)l.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+n);return c}if(o&&t){const l=[];let c=0;for(const d of e){const u=d.startLineNumber;d.isEmpty()?u!==c&&l.push(this.model.getLineContent(u)):l.push(this.model.getValueInRange(d,i?2:0)),c=u}return l.length===1?l[0]:l}const 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===ro||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new M(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Cs.fontFamily;let c;return l?c=Cs.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Cs.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(n,r)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const d=this.model.tokenization.getLineTokens(c),u=d.getLineContent(),h=c===i?n-1:0,f=c===o?r-1:u.length;u===""?l+="
":l+=Zz(u,d.inflate(),t,h,f,a,Wn)}return l}_getColorMap(){const e=oi.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;ithis._cursor.setStates(n,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(n=>this._cursor.setSelections(n,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 Bz);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,n))}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))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new M(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new yf(e,!1,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(n=>n.emitViewEvent(new yf(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(r=>r.emitViewEvent(new yf(e,!1,i,null,n,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Mz),this._eventDispatcher.emitOutgoingEvent(new Fz))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class BL{static create(e){const t=e._setTrackedRange(null,new M(1,1,1,1),1);return new BL(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new V(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new M(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class gU{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const r=this._asMap[e];if(r){const a=r.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=i){n>c&&(a[a.length-1]=n);return}a.push(o,i,n)}else{const a=new jf(e,t,[o,i,n]);this._asMap[e]=a,this.asArray.push(a)}}}class mU{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&tE(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>pU(t,i),[]);return tE(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function pU(s,e){const t=[];let i=0,n=0;for(;i=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Fr=function(s,e){return function(t,i){e(t,i,s)}},Xl;let ag=Xl=class extends G{get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}constructor(e,t,i,n,o,r,a,l,c,d,u,h){var f,g;super(),this.languageConfigurationService=u,this._deliveryQueue=UP(),this._contributions=this._register(new qV),this._onDidDispose=this._register(new O),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new cn(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new nE({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new nE({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new cn(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new cn(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new cn(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new cn(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new cn(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new cn(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new cn(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new cn(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new cn(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new cn(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new cn(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new cn(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new cn(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new cn(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new cn(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new cn(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new cn(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new O({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onBeginUpdate=this._register(new O),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new O),this.onEndUpdate=this._onEndUpdate.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const m={...t};this._domElement=e,this._overflowWidgetsDomNode=m.overflowWidgetsDomNode,delete m.overflowWidgetsDomNode,this._id=++CU,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,(f=i.contextMenuId)!==null&&f!==void 0?f:i.isSimpleWidget?x.SimpleEditorContext:x.EditorContext,m,d)),this._register(this._configuration.onDidChange(b=>{this._onDidChangeConfiguration.fire(b);const C=this._configuration.options;if(b.hasChanged(145)){const w=C.get(145);this._onDidLayoutChange.fire(w)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new yU(this,this._contextKeyService)),this._register(new SU(this,this._contextKeyService,h)),this._instantiationService=this._register(n.createChild(new Qg([bt,this._contextKeyService]))),this._modelData=null,this._focusTracker=new LU(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let _;Array.isArray(i.contributions)?_=i.contributions:_=Xd.getEditorContributions(),this._contributions.initialize(this,_,this._instantiationService);for(const b of Xd.getEditorActions()){if(this._actions.has(b.id)){At(new Error(`Cannot have two actions with the same id ${b.id}`));continue}const C=new mM(b.id,b.label,b.alias,b.metadata,(g=b.precondition)!==null&&g!==void 0?g:void 0,w=>this._instantiationService.invokeFunction(y=>Promise.resolve(b.runEditorCommand(y,this,w))),this._contextKeyService);this._actions.set(C.id,C)}const v=()=>!this._configuration.options.get(91)&&this._configuration.options.get(36).enabled;this._register(new ZO(this._domElement,{onDragOver:b=>{if(!v())return;const C=this.getTargetAtClientPoint(b.clientX,b.clientY);C!=null&&C.position&&this.showDropIndicatorAt(C.position)},onDrop:async b=>{if(!v()||(this.removeDropIndicator(),!b.dataTransfer))return;const C=this.getTargetAtClientPoint(b.clientX,b.clientY);C!=null&&C.position&&this._onDropIntoEditor.fire({position:C.position,event:b})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n){return new nw(e,t,i,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return $g.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?mt.getWordAtPosition(this._modelData.model,this._configuration.options.get(131),this._configuration.options.get(130),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===` `?i=1:e&&e.lineEnding&&e.lineEnding===`\r `&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;try{this._beginUpdate();const i=e;if(this._modelData===null&&i===null||this._modelData&&this._modelData.model===i)return;const n={oldModelUrl:((t=this._modelData)===null||t===void 0?void 0:t.model.uri)||null,newModelUrl:(i==null?void 0:i.uri)||null};this._onWillChangeModel.fire(n);const o=this.hasTextFocus(),r=this._detachModel();this._attachModel(i),o&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(n),this._postDetachModelCleanup(r),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Xl._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Xl._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?Xl._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(n=>M.lift(n)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return vi.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!V.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!M.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,n)}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,n){if(!V.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new M(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=yt.isISelection(e),n=M.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new yt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}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,n){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new M(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,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,n){if(!M.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(M.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let n=0,o=e.length;n0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const n=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(n)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._beginUpdate(),t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null,o.clipboardEvent);return}case"cut":this._cut(e);return}const n=this.getAction(t);if(n){Promise.resolve(n.run(i)).then(void 0,At);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_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,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o,r){if(!this._modelData)return;const a=this._modelData.viewModel,l=a.getSelection().getStartPosition();a.paste(t,i,n,e);const c=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:r,range:new M(l.lineNumber,l.column,c.lineNumber,c.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=Xd.getEditorCommand(t);return n?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(n.runEditorCommand(o,this,i)).then(void 0,At)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(91)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(91))return!1;let n;return i?Array.isArray(i)?n=()=>i:n=i:n=()=>null,this._modelData.viewModel.executeEdits(e,t,n),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new kU(this,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,qp(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,qp(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){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(145)}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}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||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:"+e.getId()),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)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(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,n=i.get(145),o=Xl._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(67)}}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.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){nn(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_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.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),n=new fU(this._id,this._configuration,e,yL.create(be(this._domElement)),RL.create(this._configuration.options),a=>is(be(this._domElement),a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const u=this.getOption(80),h=p("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",u);this._notificationService.prompt(_U.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:p("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let u=0,h=a.selections.length;u{this._paste("keyboard",o,r,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,l)=>{this._compositionType("keyboard",o,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,l)=>{const c={text:o,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const r={text:o};this._commandService.executeCommand("type",r)},compositionType:(o,r,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new s1(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new mw(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var e;if((e=this._contributionsDisposable)===null||e===void 0||e.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const t=this._modelData.model,i=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),i&&this._domElement.contains(i)&&this._domElement.removeChild(i),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),t}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new M(e.lineNumber,e.column,e.lineNumber,e.column),options:Xl.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}};ag.dropIntoEditorDecorationOptions=Ci.register({description:"workbench-dnd-target",className:"dnd-target"});ag=Xl=bU([Fr(3,vt),Fr(4,gi),Fr(5,Ls),Fr(6,bt),Fr(7,ho),Fr(8,$o),Fr(9,Uo),Fr(10,Nr),Fr(11,kt)],ag);let CU=0,wU=class{constructor(e,t,i,n,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o,this.attachedView=r}dispose(){Hi(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}};class nE extends G{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new O(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new O(this._emitterOptions)),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 cn extends O{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class yU extends G{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=ae.editorSimpleInput.bindTo(t),this._editorFocus=ae.focus.bindTo(t),this._textInputFocus=ae.textInputFocus.bindTo(t),this._editorTextFocus=ae.editorTextFocus.bindTo(t),this._tabMovesFocus=ae.tabMovesFocus.bindTo(t),this._editorReadonly=ae.readOnly.bindTo(t),this._inDiffEditor=ae.inDiffEditor.bindTo(t),this._editorColumnSelection=ae.columnSelection.bindTo(t),this._hasMultipleSelections=ae.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=ae.hasNonEmptySelection.bindTo(t),this._canUndo=ae.canUndo.bindTo(t),this._canRedo=ae.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._register(p_.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(p_.getTabFocusMode()),this._editorReadonly.set(e.get(91)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_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(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class SU extends G{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=ae.languageId.bindTo(t),this._hasCompletionItemProvider=ae.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=ae.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=ae.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=ae.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=ae.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=ae.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=ae.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=ae.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=ae.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=ae.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=ae.hasReferenceProvider.bindTo(t),this._hasRenameProvider=ae.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=ae.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=ae.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=ae.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=ae.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=ae.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=ae.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=ae.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}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._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===ze.walkThroughSnippet||e.uri.scheme===ze.vscodeChatCodeBlock)})}}class LU extends G{constructor(e,t){super(),this._onChange=this._register(new O),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Wf(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Wf(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){var e;return(e=this._hadFocus)!==null&&e!==void 0?e:!1}}class kU{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(n=>{this._isChangingDecorations||e.call(t,n)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const DU=encodeURIComponent("");function Vv(s){return DU+encodeURIComponent(s.toString())+xU}const EU=encodeURIComponent('');function NU(s){return EU+encodeURIComponent(s.toString())+IU}ka((s,e)=>{const t=s.getColor(oa);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${Vv(t)}") repeat-x bottom left; }`);const i=s.getColor(Dn);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${Vv(i)}") repeat-x bottom left; }`);const n=s.getColor(Vs);n&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${Vv(n)}") repeat-x bottom left; }`);const o=s.getColor(A8);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${NU(o)}") no-repeat bottom left; }`);const r=s.getColor(rW);r&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)});var TU=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},AU=function(s,e){return function(t,i){e(t,i,s)}};let Tw=class extends G{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new O),this._onCodeEditorAdd=this._register(new O),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new O),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new O),this._onDiffEditorAdd=this._register(new O),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new O),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Qn,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(const n of this._codeEditorOpenHandlers){const o=await n(e,t,i);if(o!==null)return o}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Be(t)}};Tw=TU([AU(0,ho)],Tw);var MU=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sE=function(s,e){return function(t,i){e(t,i,s)}};let P_=class extends Tw{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(i,n,o)=>n?this.doOpenEditor(n,i):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===ze.http||o===ze.https)return OT(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if(typeof n.endLineNumber=="number"&&typeof n.endColumn=="number")e.setSelection(n),e.revealRangeInCenter(n,1);else{const o={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};P_=MU([sE(0,bt),sE(1,ho)],P_);rt(gi,P_,0);const Pl=Qe("layoutService");var OM=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},BM=function(s,e){return function(t,i){e(t,i,s)}};let F_=class{get mainContainer(){var e,t;return(t=(e=fS(this._codeEditorService.listCodeEditors()))===null||e===void 0?void 0:e.getContainerDomNode())!==null&&t!==void 0?t:wt.document.body}get activeContainer(){var e,t;const i=(e=this._codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:this._codeEditorService.getActiveCodeEditor();return(t=i==null?void 0:i.getContainerDomNode())!==null&&t!==void 0?t:this.mainContainer}get mainContainerDimension(){return MC(this.mainContainer)}get activeContainerDimension(){return MC(this.activeContainer)}get containers(){return EN(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=te.None,this.onDidLayoutActiveContainer=te.None,this.onDidLayoutContainer=te.None,this.onDidChangeActiveContainer=te.None,this.onDidAddContainer=te.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};F_=OM([BM(0,gi)],F_);let Aw=class extends F_{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Aw=OM([BM(1,gi)],Aw);rt(Pl,F_,1);const WM=Qe("dialogService");var RU=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},oE=function(s,e){return function(t,i){e(t,i,s)}};function Km(s){return s.scheme===ze.file?s.fsPath:s.path}let VM=0;class jm{constructor(e,t,i,n,o,r,a){this.id=++VM,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class rE{constructor(e,t){this.resourceLabel=e,this.reason=t}}class aE{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(n.reason===0?e:t).push(n.resourceLabel);const i=[];return e.length>0&&i.push(p({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(p({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` `)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class PU{constructor(e,t,i,n,o,r,a){this.id=++VM,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new aE),this.removedResources.has(t)||this.removedResources.set(t,new rE(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new aE),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new rE(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class HM{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` `)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i=0;i--)t.push(this._future[i].id);return new TM(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[n])&&(i=!1,o=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class Hv{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof dr){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){At(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),n.dispose(),o()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return G.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?G.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(G.None);const i=e.actual.prepareUndoRedo();return i?KN(i)?t(i):i.then(n=>t(n)):t(G.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||zM);return new Hv(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new qm(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new qm}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,p({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,p({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,p({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,p({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,p({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const n=t.getSecondClosestPastElement();if(n&&n.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=await this._dialogService.prompt({type:fi.Info,message:p("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:p({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:p({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;n=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,n))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const n=p({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(n);return}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new Hv([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof dr){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),o=n.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:p("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:p({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:p("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,p({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,p({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,p({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=p({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new Hv([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrder=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},lE=function(s,e){return function(t,i){e(t,i,s)}};const BU=Qe("ILanguageFeatureDebounceService");var O_;(function(s){const e=new WeakMap;let t=0;function i(n){let o=e.get(n);return o===void 0&&(o=++t,e.set(n,o)),o}s.of=i})(O_||(O_={}));class WU{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class VU{constructor(e,t,i,n,o,r){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=o,this._max=r,this._cache=new zg(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>T0(O_.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Pn(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new FU(6),this._cache.set(i,n));const o=Pn(n.update(t),this._min,this._max);return BS(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new UM;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return Pn(e,this._min,this._max)}}let Rw=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var n,o,r;const a=(n=i==null?void 0:i.min)!==null&&n!==void 0?n:50,l=(o=i==null?void 0:i.max)!==null&&o!==void 0?o:a**2,c=(r=i==null?void 0:i.key)!==null&&r!==void 0?r:void 0,d=`${O_.of(e)},${a}${c?","+c:""}`;let u=this._data.get(d);return u||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),u=new WU(a*1.5)):u=new VU(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l),this._data.set(d,u)),u}_overallAverage(){const e=new UM;for(const t of this._data.values())e.update(t.default());return e.value}};Rw=OU([lE(0,uo),lE(1,$M)],Rw);rt(BU,Rw,1);class kf{static create(e,t){return new kf(e,new B_(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e&&new M(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[n,o,r]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new kf(this._startLineNumber,n),new kf(this._startLineNumber+r,o)]}applyEdit(e,t){const[i,n,o]=Wc(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new V(e.startLineNumber,e.startColumn),t,i,n,o),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 o=i-t;this._startLineNumber-=o;return}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,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,n,o){if(t===0&&i===0)return;const r=e.lineNumber-this._startLineNumber;if(r<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();r>=a+1||this._tokens.acceptInsertText(r,e.column-1,t,i,n,o)}}class B_{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=n-1;else{let r=n;for(;r>t&&this._getDeltaLine(r-1)===e;)r--;let a=n;for(;ae||h===e&&g>=t)&&(he||g===e&&_>=t){if(go?m-=o-i:m=i;else if(f===t&&g===i)if(f===n&&m>o)m-=o-i;else{d=!0;continue}else if(fo)f=t,g=i,m=g+(m-o);else{d=!0;continue}else if(f>n){if(l===0&&!d){c=a;break}f-=l}else if(f===n&&g>=o)e&&f===0&&(g+=e,m+=e),f-=l,g-=o-i,m-=o-i;else throw new Error("Not possible!");const v=4*c;r[v]=f,r[v+1]=g,r[v+2]=m,r[v+3]=_,c++}this._tokenCount=c}acceptInsertText(e,t,i,n,o,r){const a=i===0&&n===1&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),l=this._tokens,c=this._tokenCount;for(let d=0;d=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},zv=function(s,e){return function(t,i){e(t,i,s)}};let Pw=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new Gr}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let r;if(o)r=o.metadata,this._logService.getLevel()===ji.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${Zn.getForeground(r)}, fontStyle ${Zn.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let u=0;c>0&&u>1;c>0&&this._logService.getLevel()===ji.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof d>"u")r=2147483647;else{if(r=0,typeof d.italic<"u"){const u=(d.italic?1:0)<<11;r|=u|1}if(typeof d.bold<"u"){const u=(d.bold?2:0)<<11;r|=u|2}if(typeof d.underline<"u"){const u=(d.underline?4:0)<<11;r|=u|4}if(typeof d.strikethrough<"u"){const u=(d.strikethrough?8:0)<<11;r|=u|8}if(d.foreground){const u=d.foreground<<15;r|=u|16}r===0&&(r=2147483647)}}else this._logService.getLevel()===ji.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,n,r),this._logService.getLevel()===ji.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${Zn.getForeground(r)}, fontStyle ${Zn.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${o}).`))}};Pw=HU([zv(1,ho),zv(2,Mi),zv(3,uo)],Pw);function jie(s,e,t){const i=s.data,n=s.data.length/5|0,o=Math.max(Math.ceil(n/1024),400),r=[];let a=0,l=1,c=0;for(;ad&&i[5*b]===0;)b--;if(b-1===d){let C=u;for(;C+1L)e.warnOverlappingSemanticTokens(y,L+1);else{const R=e.getMetadata(N,W,t);R!==2147483647&&(g===0&&(g=y),h[f]=y-g,h[f+1]=L,h[f+2]=D,h[f+3]=R,f+=4,m=y,_=D)}l=y,c=L,a++}f!==h.length&&(h=h.subarray(0,f));const v=kf.create(g,h);r.push(v)}return r}class zU{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class Gr{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Gr._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=Gr._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Uv=function(s,e){return function(t,i){e(t,i,s)}};let Fw=class extends G{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new Pw(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Fw=$U([Uv(0,ho),Uv(1,uo),Uv(2,Mi)],Fw);rt(UU,Fw,1);const Gm="**",dE="/",Tp="[/\\\\]",Ap="[^/\\\\]",KU=/\//g;function uE(s,e){switch(s){case 0:return"";case 1:return`${Ap}*?`;default:return`(?:${Tp}|${Ap}+${Tp}${e?`|${Tp}${Ap}+`:""})*?`}}function hE(s,e){if(!s)return[];const t=[];let i=!1,n=!1,o="";for(const r of s){switch(r){case e:if(!i&&!n){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}o+=r}return o&&t.push(o),t}function KM(s){if(!s)return"";let e="";const t=hE(s,dE);if(t.every(i=>i===Gm))e=".*";else{let i=!1;t.forEach((n,o)=>{if(n===Gm){if(i)return;e+=uE(2,o===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const d of n){if(d!=="}"&&r){a+=d;continue}if(l&&(d!=="]"||!c)){let u;d==="-"?u=d:(d==="^"||d==="!")&&!c?u="^":d===dE?u="":u=wa(d),c+=u;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${hE(a,",").map(f=>KM(f)).join("|")})`;e+=h,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=Ap;continue;case"*":e+=uE(1);continue;default:e+=wa(d)}}oWL(a,e)).filter(a=>a!==Cr),s),i=t.length;if(!i)return Cr;if(i===1)return t[0];const n=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function pE(s,e,t){const i=fl===ri.sep,n=i?s:s.replace(KU,fl),o=fl+n,r=ri.sep+s;let a;return t?a=function(l,c){return typeof l=="string"&&(l===n||l.endsWith(o)||!i&&(l===s||l.endsWith(r)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===n||!i&&l===s)?e:null},a.allPaths=[(t?"*/":"./")+s],a}function t$(s){try{const e=new RegExp(`^${KM(s)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?s:null}}catch{return Cr}}function i$(s,e,t){return!s||typeof e!="string"?!1:jM(s)(e,void 0,t)}function jM(s,e={}){if(!s)return gE;if(typeof s=="string"||n$(s)){const t=WL(s,e);if(t===Cr)return gE;const i=function(n,o){return!!t(n,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return s$(s,e)}function n$(s){const e=s;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function s$(s,e){const t=qM(Object.getOwnPropertyNames(s).map(a=>o$(a,s[a],e)).filter(a=>a!==Cr)),i=t.length;if(!i)return Cr;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,u){let h;for(let f=0,g=t.length;f{for(const f of h){const g=await f;if(typeof g=="string")return g}return null})():null},l=t.find(d=>!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((d,u)=>u.allPaths?d.concat(u.allPaths):d,[]);return c.length&&(a.allPaths=c),a}const n=function(a,l,c){let d,u;for(let h=0,f=t.length;h{for(const h of u){const f=await h;if(typeof f=="string")return f}return null})():null},o=t.find(a=>!!a.allBasenames);o&&(n.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(n.allPaths=r),n}function o$(s,e,t){if(e===!1)return Cr;const i=WL(s,t);if(i===Cr)return Cr;if(typeof e=="boolean")return i;if(e){const n=e.when;if(typeof n=="string"){const o=(r,a,l,c)=>{if(!c||!i(r,a))return null;const d=n.replace("$(basename)",()=>l),u=c(d);return EC(u)?u.then(h=>h?s:null):u?s:null};return o.requiresSiblings=!0,o}}return i}function qM(s,e){const t=s.filter(a=>!!a.basenames);if(t.length<2)return s;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let n;if(e){n=[];for(let a=0,l=i.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){const u=a.charCodeAt(d-1);if(u===47||u===92)break}l=a.substr(d)}const c=i.indexOf(l);return c!==-1?n[c]:null};o.basenames=i,o.patterns=n,o.allBasenames=i;const r=s.filter(a=>!a.basenames);return r.push(o),r}function GM(s,e,t,i,n,o){if(Array.isArray(s)){let r=0;for(const a of s){const l=GM(a,e,t,i,n,o);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof s=="string")return i?s==="*"?5:s===t?10:0:0;if(s){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=s;if(!i&&!c)return 0;d&&n&&(e=n);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(r)if(r===t)u=10;else if(r==="*")u=Math.max(u,5);else return 0;if(d)if(d===o)u=10;else if(d==="*"&&o!==void 0)u=Math.max(u,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h={...a,base:XN(a.base)},h===e.fsPath||i$(h,e.fsPath))u=10;else return 0}return u}else return 0}}function ZM(s){return typeof s=="string"?!1:Array.isArray(s)?s.every(ZM):!!s.exclusive}class _E{constructor(e,t,i,n){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}}class Wt{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new O,this.onDidChange=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),Be(()=>{if(i){const n=this._entries.indexOf(i);n>=0&&(this._entries.splice(n,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(const 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,n;return this._orderedForEach(e,o=>{i&&n===o._score?i.push(o.provider):(n=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const n=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=n?new _E(e.uri,e.getLanguageId(),n.uri,n.type):new _E(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(o))){this._lastCandidate=o;for(const r of this._entries)if(r._score=GM(r.selector,o.uri,o.languageId,H9(e),o.notebookUri,o.notebookType),ZM(r.selector)&&r._score>0){for(const a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(Wt._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:Yh(e.selector)&&!Yh(t.selector)?1:!Yh(e.selector)&&Yh(t.selector)?-1:e._timet._time?-1:0}}function Yh(s){return typeof s=="string"?!1:Array.isArray(s)?s.some(Yh):!!s.isBuiltin}class r${constructor(){this.referenceProvider=new Wt(this._score.bind(this)),this.renameProvider=new Wt(this._score.bind(this)),this.newSymbolNamesProvider=new Wt(this._score.bind(this)),this.codeActionProvider=new Wt(this._score.bind(this)),this.definitionProvider=new Wt(this._score.bind(this)),this.typeDefinitionProvider=new Wt(this._score.bind(this)),this.declarationProvider=new Wt(this._score.bind(this)),this.implementationProvider=new Wt(this._score.bind(this)),this.documentSymbolProvider=new Wt(this._score.bind(this)),this.inlayHintsProvider=new Wt(this._score.bind(this)),this.colorProvider=new Wt(this._score.bind(this)),this.codeLensProvider=new Wt(this._score.bind(this)),this.documentFormattingEditProvider=new Wt(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Wt(this._score.bind(this)),this.onTypeFormattingEditProvider=new Wt(this._score.bind(this)),this.signatureHelpProvider=new Wt(this._score.bind(this)),this.hoverProvider=new Wt(this._score.bind(this)),this.documentHighlightProvider=new Wt(this._score.bind(this)),this.multiDocumentHighlightProvider=new Wt(this._score.bind(this)),this.selectionRangeProvider=new Wt(this._score.bind(this)),this.foldingRangeProvider=new Wt(this._score.bind(this)),this.linkProvider=new Wt(this._score.bind(this)),this.inlineCompletionsProvider=new Wt(this._score.bind(this)),this.inlineEditProvider=new Wt(this._score.bind(this)),this.completionProvider=new Wt(this._score.bind(this)),this.linkedEditingRangeProvider=new Wt(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Wt(this._score.bind(this)),this.documentSemanticTokensProvider=new Wt(this._score.bind(this)),this.documentDropEditProvider=new Wt(this._score.bind(this)),this.documentPasteEditProvider=new Wt(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}rt(kt,r$,1);var a$=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},vE=function(s,e){return function(t,i){e(t,i,s)}};const Xg=Qe("hoverService");let lg=class extends G{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},n,o){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=o,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new pe),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const n=Vi(e.target)?[e.target]:e.target.targetElements;for(const r of n)this.hoverDisposables.add(Ai(r,"keydown",a=>{a.equals(9)&&this.hoverService.hideHover()}));const o=Vi(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:o,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime{i.stopPropagation(),i.preventDefault(),t(e)}))}}class u$ extends G{constructor(e,t,i){super(),this._register(j(e,J.KEY_DOWN,n=>{const o=new Ot(n);i.some(r=>o.equals(r))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}const em=Qe("openerService");function h$(s){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(s.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},s=s.with({fragment:""})),{selection:e,uri:s}}function f$(s,e={}){const t=HL(e);return t.textContent=s,t}function g$(s,e={}){const t=HL(e);return YM(t,p$(s,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function HL(s){const e=s.inline?"span":"div",t=document.createElement(e);return s.className&&(t.className=s.className),t}class m${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 YM(s,e,t,i){let n;if(e.type===2)n=document.createTextNode(e.content||"");else if(e.type===3)n=document.createElement("b");else if(e.type===4)n=document.createElement("i");else if(e.type===7&&i)n=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(Ai(o,"click",r=>{t.callback(String(e.index),r)})),n=o}else e.type===8?n=document.createElement("br"):e.type===1&&(n=s);n&&s!==n&&s.appendChild(n),n&&Array.isArray(e.children)&&e.children.forEach(o=>{YM(n,o,t,i)})}function p$(s,e){const t={type:1,children:[]};let i=0,n=t;const o=[],r=new m$(s);for(;!r.eos();){let a=r.next();const l=a==="\\"&&Ow(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&_$(a,e)&&a===r.peek()){r.advance(),n.type===2&&(n=o.pop());const c=Ow(a,e);if(n.type===c||n.type===5&&c===6)n=o.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),n.children.push(d),o.push(n),n=d}}else if(a===` `)n.type===2&&(n=o.pop()),n.children.push({type:8});else if(n.type!==2){const c={type:2,content:a};n.children.push(c),o.push(n),n=c}else n.content+=a}return n.type===2&&(n=o.pop()),t}function _$(s,e){return Ow(s,e)!==0}function Ow(s,e){switch(s){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const v$=new RegExp(`(\\\\)?\\$\\((${et.iconNameExpression}(?:${et.iconModifierExpression})?)\\)`,"g");function Dc(s){const e=new Array;let t,i=0,n=0;for(;(t=v$.exec(s))!==null;){n=t.index||0,i0)return new Uint32Array(e)}let us=0;const Ya=new Uint32Array(10);function C$(s){if(us=0,Zo(s,Kv,4352),us>0||(Zo(s,jv,4449),us>0)||(Zo(s,qv,4520),us>0)||(Zo(s,Ul,12593),us))return Ya.subarray(0,us);if(s>=44032&&s<=55203){const e=s-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),o=t%28-1;if(i=0&&(o0)return Ya.subarray(0,us)}}function Zo(s,e,t){s>=t&&s>8&&(Ya[us++]=s>>8&255),s>>16&&(Ya[us++]=s>>16&255))}const Kv=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),jv=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),qv=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Ul=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function QM(...s){return function(e,t){for(let i=0,n=s.length;i0?[{start:0,end:e.length}]:[]:null}function y$(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function S$(s,e){return Bw(s.toLowerCase(),e.toLowerCase(),0,0)}function Bw(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]===e[i]){let n=null;return(n=Bw(s,e,t+1,i+1))?$L({start:i,end:i+1},n):null}return Bw(s,e,t,i+1)}function zL(s){return 97<=s&&s<=122}function r1(s){return 65<=s&&s<=90}function UL(s){return 48<=s&&s<=57}function JM(s){return s===32||s===9||s===10||s===13}const eR=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(s=>eR.add(s.charCodeAt(0)));function H_(s){return JM(s)||eR.has(s)}function bE(s,e){return s===e||H_(s)&&H_(e)}const Gv=new Map;function CE(s){if(Gv.has(s))return Gv.get(s);let e;const t=b$(s);return t&&(e=t),Gv.set(s,e),e}function tR(s){return zL(s)||r1(s)||UL(s)}function $L(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function iR(s,e){for(let t=e;t0&&!tR(s.charCodeAt(t-1)))return t}return s.length}function Ww(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]!==e[i].toLowerCase())return null;{let n=null,o=i+1;for(n=Ww(s,e,t+1,i+1);!n&&(o=iR(e,o)).6}function D$(s){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:n}=s;return t>.2&&e<.8&&i>.6&&n<.2}function x$(s){let e=0,t=0,i=0,n=0;for(let o=0;o60&&(e=e.substring(0,60));const t=L$(e);if(!D$(t)){if(!k$(t))return null;e=e.toLowerCase()}let i=null,n=0;for(s=s.toLowerCase();n0&&H_(s.charCodeAt(t-1)))return t;return s.length}const E$=QM(V_,nR,y$),I$=QM(V_,nR,S$),wE=new zg(1e4);function yE(s,e,t=!1){if(typeof s!="string"||typeof e!="string")return null;let i=wE.get(s);i||(i=new RegExp(xF(s),"i"),wE.set(s,i));const n=i.exec(e);return n?[{start:n.index,end:n.index+n[0].length}]:t?I$(s,e):E$(s,e)}function N$(s,e){const t=cg(s,s.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?T$(t):null}function Qie(s,e,t,i,n,o){const r=Math.min(13,s.length);for(;t"u")return[];const e=[],t=s[1];for(let i=s.length-1;i>1;i--){const n=s[i]+t,o=e[e.length-1];o&&o.end===n?o.end=n+1:e.push({start:n,end:n+1})}return e}const al=128;function KL(){const s=[],e=[];for(let t=0;t<=al;t++)e[t]=0;for(let t=0;t<=al;t++)s.push(e.slice(0));return s}function oR(s){const e=[];for(let t=0;t<=s;t++)e[t]=0;return e}const rR=oR(2*al),Hw=oR(2*al),Or=KL(),$l=KL(),Ym=KL();function Qm(s,e){if(e<0||e>=s.length)return!1;const t=s.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 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!MS(t)}}function SE(s,e){if(e<0||e>=s.length)return!1;switch(s.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function Mp(s,e,t){return e[s]!==t[s]}function A$(s,e,t,i,n,o,r=!1){for(;eal?al:s.length,l=i.length>al?al:i.length;if(t>=a||o>=l||a-t>l-o||!A$(e,t,a,n,o,l,!0))return;M$(a,l,t,o,e,n);let c=1,d=1,u=t,h=o;const f=[!1];for(c=1,u=t;ub,N=D?$l[c][d-1]+(Or[c][d-1]>0?-5:0):0,W=h>b+1&&Or[c][d-1]>0,R=W?$l[c][d-2]+(Or[c][d-2]>0?-5:0):0;if(W&&(!D||R>=N)&&(!L||R>=k))$l[c][d]=R,Ym[c][d]=3,Or[c][d]=0;else if(D&&(!L||N>=k))$l[c][d]=N,Ym[c][d]=2,Or[c][d]=0;else if(L)$l[c][d]=k,Ym[c][d]=1,Or[c][d]=Or[c-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;c--,d--;const g=[$l[c][d],o];let m=0,_=0;for(;c>=1;){let b=d;do{const C=Ym[c][b];if(C===3)b=b-2;else if(C===2)b=b-1;else break}while(b>=1);m>1&&e[t+c-1]===n[o+d-1]&&!Mp(b+o-1,i,n)&&m+1>Or[c][b]&&(b=d),b===d?m++:m=1,_||(_=b),c--,d=b-1,g.push(d)}l-o===a&&r.boostFullMatch&&(g[0]+=2);const v=_-a;return g[0]-=v,g}function M$(s,e,t,i,n,o){let r=s-1,a=e-1;for(;r>=t&&a>=i;)n[r]===o[a]&&(Hw[r]=a,r--),a--}function R$(s,e,t,i,n,o,r,a,l,c,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let u=1,h=!1;return r===t-i?u=s[t]===n[r]?7:5:Mp(r,n,o)&&(r===0||!Mp(r-1,n,o))?(u=s[t]===n[r]?7:5,h=!0):Qm(o,r)&&(r===0||!Qm(o,r-1))?u=5:(Qm(o,r-1)||SE(o,r-1))&&(u=5,h=!0),u>1&&t===i&&(d[0]=!0),h||(h=Mp(r,n,o)||Qm(o,r-1)||SE(o,r-1)),t===i?r>l&&(u-=h?3:5):c?u+=h?2:0:u+=h?0:1,r+1===a&&(u-=h?3:5),u}function Xie(s,e,t,i,n,o,r){return P$(s,e,t,i,n,o,!0,r)}function P$(s,e,t,i,n,o,r,a){let l=cg(s,e,t,i,n,o,a);if(l&&!r)return l;if(s.length>=3){const c=Math.min(7,s.length-1);for(let d=t+1;dl[0])&&(l=h))}}}return l}function F$(s,e){if(e+1>=s.length)return;const t=s[e],i=s[e+1];if(t!==i)return s.slice(0,e)+i+t+s.slice(e+2)}const O$="$(",jL=new RegExp(`\\$\\(${et.iconNameExpression}(?:${et.iconModifierExpression})?\\)`,"g"),B$=new RegExp(`(\\\\)?${jL.source}`,"g");function W$(s){return s.replace(B$,(e,t)=>t?e:`\\${e}`)}const V$=new RegExp(`\\\\${jL.source}`,"g");function H$(s){return s.replace(V$,e=>`\\${e}`)}const z$=new RegExp(`(\\s)?(\\\\)?${jL.source}(\\s)?`,"g");function lR(s){return s.indexOf(O$)===-1?s:s.replace(z$,(e,t,i,n)=>i?e:t||n||"")}function U$(s){return s?s.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const Zv=new RegExp(`\\$\\(${et.iconNameCharacter}+\\)`,"g");function Qh(s){Zv.lastIndex=0;let e="";const t=[];let i=0;for(;;){const n=Zv.lastIndex,o=Zv.exec(s),r=s.substring(n,o==null?void 0:o.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` ${q$(t,e)} `,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(wa(t),"g");return e.replace(i,(n,o)=>e.charAt(o-1)!=="\\"?`\\${n}`:n)}}function $$(s){return xc(s)?!s.value:Array.isArray(s)?s.every($$):!0}function xc(s){return s instanceof cR?!0:s&&typeof s=="object"?typeof s.value=="string"&&(typeof s.isTrusted=="boolean"||typeof s.isTrusted=="object"||s.isTrusted===void 0)&&(typeof s.supportThemeIcons=="boolean"||s.supportThemeIcons===void 0):!1}function K$(s,e){return s===e?!0:!s||!e?!1:s.value===e.value&&s.isTrusted===e.isTrusted&&s.supportThemeIcons===e.supportThemeIcons&&s.supportHtml===e.supportHtml&&(s.baseUri===e.baseUri||!!s.baseUri&&!!e.baseUri&&LH($e.from(s.baseUri),$e.from(e.baseUri)))}function j$(s){return s.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function q$(s,e){var t,i;const n=(i=(t=s.match(/^`+/gm))===null||t===void 0?void 0:t.reduce((r,a)=>r.length>a.length?r:a).length)!==null&&i!==void 0?i:0,o=n>=3?n+1:3;return[`${"`".repeat(o)}${e}`,s,`${"`".repeat(o)}`].join(` `)}function Xm(s){return s.replace(/"/g,""")}function Qv(s){return s&&s.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function G$(s){const e=[],t=s.split("|").map(n=>n.trim());s=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=n?n[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:s,dimensions:e}}class dR{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const LE=new dR("id#");let In={};(function(){function s(e,t){t(In)}s.amd=!0,function(e,t){typeof s=="function"&&s.amd?s(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){function t(Q,U){for(var z=0;zQ.length)&&(U=Q.length);for(var z=0,E=new Array(U);z=Q.length?{done:!0}:{done:!1,value:Q[E++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(Q){e.defaults=Q}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(U){return f[U]};function m(Q,U){if(U){if(c.test(Q))return Q.replace(d,g)}else if(u.test(Q))return Q.replace(h,g);return Q}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(Q){return Q.replace(_,function(U,z){return z=z.toLowerCase(),z==="colon"?":":z.charAt(0)==="#"?z.charAt(1)==="x"?String.fromCharCode(parseInt(z.substring(2),16)):String.fromCharCode(+z.substring(1)):""})}var b=/(^|[^\[])\^/g;function C(Q,U){Q=typeof Q=="string"?Q:Q.source,U=U||"";var z={replace:function(I,B){return B=B.source||B,B=B.replace(b,"$1"),Q=Q.replace(I,B),z},getRegex:function(){return new RegExp(Q,U)}};return z}var w=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(Q,U,z){if(Q){var E;try{E=decodeURIComponent(v(z)).replace(w,"").toLowerCase()}catch{return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}U&&!y.test(z)&&(z=R(U,z));try{z=encodeURI(z).replace(/%25/g,"%")}catch{return null}return z}var k={},D=/^[^:]+:\/*[^/]*$/,N=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function R(Q,U){k[" "+Q]||(D.test(Q)?k[" "+Q]=Q+"/":k[" "+Q]=q(Q,"/",!0)),Q=k[" "+Q];var z=Q.indexOf(":")===-1;return U.substring(0,2)==="//"?z?U:Q.replace(N,"$1")+U:U.charAt(0)==="/"?z?U:Q.replace(W,"$1")+U:Q+U}var A={exec:function(){}};function P(Q){for(var U=1,z,E;U=0&&Z[_e]==="\\";)ee=!ee;return ee?"|":" |"}),E=z.split(/ \|/),I=0;if(E[0].trim()||E.shift(),E.length>0&&!E[E.length-1].trim()&&E.pop(),E.length>U)E.splice(U);else for(;E.length1;)U&1&&(z+=Q),U>>=1,Q+=Q;return z+Q}function se(Q,U,z,E){var I=U.href,B=U.title?m(U.title):null,F=Q[1].replace(/\\([\[\]])/g,"$1");if(Q[0].charAt(0)!=="!"){E.state.inLink=!0;var Z={type:"link",raw:z,href:I,title:B,text:F,tokens:E.inlineTokens(F)};return E.state.inLink=!1,Z}return{type:"image",raw:z,href:I,title:B,text:m(F)}}function Ce(Q,U){var z=Q.match(/^(\s+)(?:```)/);if(z===null)return U;var E=z[1];return U.split(` `).map(function(I){var B=I.match(/^\s+/);if(B===null)return I;var F=B[0];return F.length>=E.length?I.slice(E.length):I}).join(` `)}var Ee=function(){function Q(z){this.options=z||e.defaults}var U=Q.prototype;return U.space=function(E){var I=this.rules.block.newline.exec(E);if(I&&I[0].length>0)return{type:"space",raw:I[0]}},U.code=function(E){var I=this.rules.block.code.exec(E);if(I){var B=I[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:I[0],codeBlockStyle:"indented",text:this.options.pedantic?B:q(B,` `)}}},U.fences=function(E){var I=this.rules.block.fences.exec(E);if(I){var B=I[0],F=Ce(B,I[3]||"");return{type:"code",raw:B,lang:I[2]?I[2].trim():I[2],text:F}}},U.heading=function(E){var I=this.rules.block.heading.exec(E);if(I){var B=I[2].trim();if(/#$/.test(B)){var F=q(B,"#");(this.options.pedantic||!F||/ $/.test(F))&&(B=F.trim())}return{type:"heading",raw:I[0],depth:I[1].length,text:B,tokens:this.lexer.inline(B)}}},U.hr=function(E){var I=this.rules.block.hr.exec(E);if(I)return{type:"hr",raw:I[0]}},U.blockquote=function(E){var I=this.rules.block.blockquote.exec(E);if(I){var B=I[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:I[0],tokens:this.lexer.blockTokens(B,[]),text:B}}},U.list=function(E){var I=this.rules.block.list.exec(E);if(I){var B,F,Z,ee,_e,we,Oe,Ae,St,ht,Ie,Ut,zt=I[1].trim(),ls=zt.length>1,Ze={type:"list",raw:"",ordered:ls,start:ls?+zt.slice(0,-1):"",loose:!1,items:[]};zt=ls?"\\d{1,9}\\"+zt.slice(-1):"\\"+zt,this.options.pedantic&&(zt=ls?zt:"[*+-]");for(var qt=new RegExp("^( {0,3}"+zt+")((?:[ ][^\\n]*)?(?:\\n|$))");E&&(Ut=!1,!(!(I=qt.exec(E))||this.rules.block.hr.test(E)));){if(B=I[0],E=E.substring(B.length),Ae=I[2].split(` `,1)[0],St=E.split(` `,1)[0],this.options.pedantic?(ee=2,Ie=Ae.trimLeft()):(ee=I[2].search(/[^ ]/),ee=ee>4?1:ee,Ie=Ae.slice(ee),ee+=I[1].length),we=!1,!Ae&&/^ *$/.test(St)&&(B+=St+` `,E=E.substring(St.length+1),Ut=!0),!Ut)for(var oe=new RegExp("^ {0,"+Math.min(3,ee-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),ge=new RegExp("^ {0,"+Math.min(3,ee-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Pe=new RegExp("^ {0,"+Math.min(3,ee-1)+"}(?:```|~~~)"),ei=new RegExp("^ {0,"+Math.min(3,ee-1)+"}#");E&&(ht=E.split(` `,1)[0],Ae=ht,this.options.pedantic&&(Ae=Ae.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Pe.test(Ae)||ei.test(Ae)||oe.test(Ae)||ge.test(E)));){if(Ae.search(/[^ ]/)>=ee||!Ae.trim())Ie+=` `+Ae.slice(ee);else if(!we)Ie+=` `+Ae;else break;!we&&!Ae.trim()&&(we=!0),B+=ht+` `,E=E.substring(ht.length+1)}Ze.loose||(Oe?Ze.loose=!0:/\n *\n *$/.test(B)&&(Oe=!0)),this.options.gfm&&(F=/^\[[ xX]\] /.exec(Ie),F&&(Z=F[0]!=="[ ] ",Ie=Ie.replace(/^\[[ xX]\] +/,""))),Ze.items.push({type:"list_item",raw:B,task:!!F,checked:Z,loose:!1,text:Ie}),Ze.raw+=B}Ze.items[Ze.items.length-1].raw=B.trimRight(),Ze.items[Ze.items.length-1].text=Ie.trimRight(),Ze.raw=Ze.raw.trimRight();var ci=Ze.items.length;for(_e=0;_e1)return!0}return!1});!Ze.loose&&Ct.length&&ft&&(Ze.loose=!0,Ze.items[_e].loose=!0)}return Ze}},U.html=function(E){var I=this.rules.block.html.exec(E);if(I){var B={type:"html",raw:I[0],pre:!this.options.sanitizer&&(I[1]==="pre"||I[1]==="script"||I[1]==="style"),text:I[0]};if(this.options.sanitize){var F=this.options.sanitizer?this.options.sanitizer(I[0]):m(I[0]);B.type="paragraph",B.text=F,B.tokens=this.lexer.inline(F)}return B}},U.def=function(E){var I=this.rules.block.def.exec(E);if(I){I[3]&&(I[3]=I[3].substring(1,I[3].length-1));var B=I[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:B,raw:I[0],href:I[2],title:I[3]}}},U.table=function(E){var I=this.rules.block.table.exec(E);if(I){var B={type:"table",header:H(I[1]).map(function(Oe){return{text:Oe}}),align:I[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:I[3]&&I[3].trim()?I[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(B.header.length===B.align.length){B.raw=I[0];var F=B.align.length,Z,ee,_e,we;for(Z=0;Z/i.test(I[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(I[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(I[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:I[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):m(I[0]):I[0]}},U.link=function(E){var I=this.rules.inline.link.exec(E);if(I){var B=I[2].trim();if(!this.options.pedantic&&/^$/.test(B))return;var F=q(B.slice(0,-1),"\\");if((B.length-F.length)%2===0)return}else{var Z=re(I[2],"()");if(Z>-1){var ee=I[0].indexOf("!")===0?5:4,_e=ee+I[1].length+Z;I[2]=I[2].substring(0,Z),I[0]=I[0].substring(0,_e).trim(),I[3]=""}}var we=I[2],Oe="";if(this.options.pedantic){var Ae=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);Ae&&(we=Ae[1],Oe=Ae[3])}else Oe=I[3]?I[3].slice(1,-1):"";return we=we.trim(),/^$/.test(B)?we=we.slice(1):we=we.slice(1,-1)),se(I,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},I[0],this.lexer)}},U.reflink=function(E,I){var B;if((B=this.rules.inline.reflink.exec(E))||(B=this.rules.inline.nolink.exec(E))){var F=(B[2]||B[1]).replace(/\s+/g," ");if(F=I[F.toLowerCase()],!F||!F.href){var Z=B[0].charAt(0);return{type:"text",raw:Z,text:Z}}return se(B,F,B[0],this.lexer)}},U.emStrong=function(E,I,B){B===void 0&&(B="");var F=this.rules.inline.emStrong.lDelim.exec(E);if(F&&!(F[3]&&B.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var Z=F[1]||F[2]||"";if(!Z||Z&&(B===""||this.rules.inline.punctuation.exec(B))){var ee=F[0].length-1,_e,we,Oe=ee,Ae=0,St=F[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(St.lastIndex=0,I=I.slice(-1*E.length+ee);(F=St.exec(I))!=null;)if(_e=F[1]||F[2]||F[3]||F[4]||F[5]||F[6],!!_e){if(we=_e.length,F[3]||F[4]){Oe+=we;continue}else if((F[5]||F[6])&&ee%3&&!((ee+we)%3)){Ae+=we;continue}if(Oe-=we,!(Oe>0)){if(we=Math.min(we,we+Oe+Ae),Math.min(ee,we)%2){var ht=E.slice(1,ee+F.index+we);return{type:"em",raw:E.slice(0,ee+F.index+we+1),text:ht,tokens:this.lexer.inlineTokens(ht)}}var Ie=E.slice(2,ee+F.index+we-1);return{type:"strong",raw:E.slice(0,ee+F.index+we+1),text:Ie,tokens:this.lexer.inlineTokens(Ie)}}}}}},U.codespan=function(E){var I=this.rules.inline.code.exec(E);if(I){var B=I[2].replace(/\n/g," "),F=/[^ ]/.test(B),Z=/^ /.test(B)&&/ $/.test(B);return F&&Z&&(B=B.substring(1,B.length-1)),B=m(B,!0),{type:"codespan",raw:I[0],text:B}}},U.br=function(E){var I=this.rules.inline.br.exec(E);if(I)return{type:"br",raw:I[0]}},U.del=function(E){var I=this.rules.inline.del.exec(E);if(I)return{type:"del",raw:I[0],text:I[2],tokens:this.lexer.inlineTokens(I[2])}},U.autolink=function(E,I){var B=this.rules.inline.autolink.exec(E);if(B){var F,Z;return B[2]==="@"?(F=m(this.options.mangle?I(B[1]):B[1]),Z="mailto:"+F):(F=m(B[1]),Z=F),{type:"link",raw:B[0],text:F,href:Z,tokens:[{type:"text",raw:F,text:F}]}}},U.url=function(E,I){var B;if(B=this.rules.inline.url.exec(E)){var F,Z;if(B[2]==="@")F=m(this.options.mangle?I(B[0]):B[0]),Z="mailto:"+F;else{var ee;do ee=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0];while(ee!==B[0]);F=m(B[0]),B[1]==="www."?Z="http://"+F:Z=F}return{type:"link",raw:B[0],text:F,href:Z,tokens:[{type:"text",raw:F,text:F}]}}},U.inlineText=function(E,I){var B=this.rules.inline.text.exec(E);if(B){var F;return this.lexer.state.inRawBlock?F=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(B[0]):m(B[0]):B[0]:F=m(this.options.smartypants?I(B[0]):B[0]),{type:"text",raw:B[0],text:F}}},Q}(),fe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:A,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};fe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,fe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,fe.def=C(fe.def).replace("label",fe._label).replace("title",fe._title).getRegex(),fe.bullet=/(?:[*+-]|\d{1,9}[.)])/,fe.listItemStart=C(/^( *)(bull) */).replace("bull",fe.bullet).getRegex(),fe.list=C(fe.list).replace(/bull/g,fe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+fe.def.source+")").getRegex(),fe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fe._comment=/|$)/,fe.html=C(fe.html,"i").replace("comment",fe._comment).replace("tag",fe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fe.paragraph=C(fe._paragraph).replace("hr",fe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",fe._tag).getRegex(),fe.blockquote=C(fe.blockquote).replace("paragraph",fe.paragraph).getRegex(),fe.normal=P({},fe),fe.gfm=P({},fe.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),fe.gfm.table=C(fe.gfm.table).replace("hr",fe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",fe._tag).getRegex(),fe.gfm.paragraph=C(fe._paragraph).replace("hr",fe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",fe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",fe._tag).getRegex(),fe.pedantic=P({},fe.normal,{html:C(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A,paragraph:C(fe.normal._paragraph).replace("hr",fe.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",fe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:A,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:A,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",X.punctuation=C(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,X.escapedEmSt=/\\\*|\\_/g,X._comment=C(fe._comment).replace("(?:-->|$)","-->").getRegex(),X.emStrong.lDelim=C(X.emStrong.lDelim).replace(/punct/g,X._punctuation).getRegex(),X.emStrong.rDelimAst=C(X.emStrong.rDelimAst,"g").replace(/punct/g,X._punctuation).getRegex(),X.emStrong.rDelimUnd=C(X.emStrong.rDelimUnd,"g").replace(/punct/g,X._punctuation).getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,X.autolink=C(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=C(X.tag).replace("comment",X._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=C(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=C(X.reflink).replace("label",X._label).replace("ref",fe._label).getRegex(),X.nolink=C(X.nolink).replace("ref",fe._label).getRegex(),X.reflinkSearch=C(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=P({},X),X.pedantic=P({},X.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:C(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=P({},X.normal,{escape:C(X.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(E="x"+E.toString(16)),U+="&#"+E+";";return U}var Mt=function(){function Q(z){this.tokens=[],this.tokens.links=Object.create(null),this.options=z||e.defaults,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var E={block:fe.normal,inline:X.normal};this.options.pedantic?(E.block=fe.pedantic,E.inline=X.pedantic):this.options.gfm&&(E.block=fe.gfm,this.options.breaks?E.inline=X.breaks:E.inline=X.gfm),this.tokenizer.rules=E}Q.lex=function(E,I){var B=new Q(I);return B.lex(E)},Q.lexInline=function(E,I){var B=new Q(I);return B.inlineTokens(E)};var U=Q.prototype;return U.lex=function(E){E=E.replace(/\r\n|\r/g,` `),this.blockTokens(E,this.tokens);for(var I;I=this.inlineQueue.shift();)this.inlineTokens(I.src,I.tokens);return this.tokens},U.blockTokens=function(E,I){var B=this;I===void 0&&(I=[]),this.options.pedantic?E=E.replace(/\t/g," ").replace(/^ +$/gm,""):E=E.replace(/^( *)(\t+)/gm,function(Oe,Ae,St){return Ae+" ".repeat(St.length)});for(var F,Z,ee,_e;E;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Oe){return(F=Oe.call({lexer:B},E,I))?(E=E.substring(F.raw.length),I.push(F),!0):!1}))){if(F=this.tokenizer.space(E)){E=E.substring(F.raw.length),F.raw.length===1&&I.length>0?I[I.length-1].raw+=` `:I.push(F);continue}if(F=this.tokenizer.code(E)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&(Z.type==="paragraph"||Z.type==="text")?(Z.raw+=` `+F.raw,Z.text+=` `+F.text,this.inlineQueue[this.inlineQueue.length-1].src=Z.text):I.push(F);continue}if(F=this.tokenizer.fences(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.heading(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.hr(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.blockquote(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.list(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.html(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.def(E)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&(Z.type==="paragraph"||Z.type==="text")?(Z.raw+=` `+F.raw,Z.text+=` `+F.raw,this.inlineQueue[this.inlineQueue.length-1].src=Z.text):this.tokens.links[F.tag]||(this.tokens.links[F.tag]={href:F.href,title:F.title});continue}if(F=this.tokenizer.table(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.lheading(E)){E=E.substring(F.raw.length),I.push(F);continue}if(ee=E,this.options.extensions&&this.options.extensions.startBlock&&function(){var Oe=1/0,Ae=E.slice(1),St=void 0;B.options.extensions.startBlock.forEach(function(ht){St=ht.call({lexer:this},Ae),typeof St=="number"&&St>=0&&(Oe=Math.min(Oe,St))}),Oe<1/0&&Oe>=0&&(ee=E.substring(0,Oe+1))}(),this.state.top&&(F=this.tokenizer.paragraph(ee))){Z=I[I.length-1],_e&&Z.type==="paragraph"?(Z.raw+=` `+F.raw,Z.text+=` `+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Z.text):I.push(F),_e=ee.length!==E.length,E=E.substring(F.raw.length);continue}if(F=this.tokenizer.text(E)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&Z.type==="text"?(Z.raw+=` `+F.raw,Z.text+=` `+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Z.text):I.push(F);continue}if(E){var we="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(we);break}else throw new Error(we)}}return this.state.top=!0,I},U.inline=function(E,I){return I===void 0&&(I=[]),this.inlineQueue.push({src:E,tokens:I}),I},U.inlineTokens=function(E,I){var B=this;I===void 0&&(I=[]);var F,Z,ee,_e=E,we,Oe,Ae;if(this.tokens.links){var St=Object.keys(this.tokens.links);if(St.length>0)for(;(we=this.tokenizer.rules.inline.reflinkSearch.exec(_e))!=null;)St.includes(we[0].slice(we[0].lastIndexOf("[")+1,-1))&&(_e=_e.slice(0,we.index)+"["+ve("a",we[0].length-2)+"]"+_e.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(we=this.tokenizer.rules.inline.blockSkip.exec(_e))!=null;)_e=_e.slice(0,we.index)+"["+ve("a",we[0].length-2)+"]"+_e.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(we=this.tokenizer.rules.inline.escapedEmSt.exec(_e))!=null;)_e=_e.slice(0,we.index)+"++"+_e.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;E;)if(Oe||(Ae=""),Oe=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Ie){return(F=Ie.call({lexer:B},E,I))?(E=E.substring(F.raw.length),I.push(F),!0):!1}))){if(F=this.tokenizer.escape(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.tag(E)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&F.type==="text"&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):I.push(F);continue}if(F=this.tokenizer.link(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.reflink(E,this.tokens.links)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&F.type==="text"&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):I.push(F);continue}if(F=this.tokenizer.emStrong(E,_e,Ae)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.codespan(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.br(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.del(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.autolink(E,ut)){E=E.substring(F.raw.length),I.push(F);continue}if(!this.state.inLink&&(F=this.tokenizer.url(E,ut))){E=E.substring(F.raw.length),I.push(F);continue}if(ee=E,this.options.extensions&&this.options.extensions.startInline&&function(){var Ie=1/0,Ut=E.slice(1),zt=void 0;B.options.extensions.startInline.forEach(function(ls){zt=ls.call({lexer:this},Ut),typeof zt=="number"&&zt>=0&&(Ie=Math.min(Ie,zt))}),Ie<1/0&&Ie>=0&&(ee=E.substring(0,Ie+1))}(),F=this.tokenizer.inlineText(ee,ie)){E=E.substring(F.raw.length),F.raw.slice(-1)!=="_"&&(Ae=F.raw.slice(-1)),Oe=!0,Z=I[I.length-1],Z&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):I.push(F);continue}if(E){var ht="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return I},i(Q,null,[{key:"rules",get:function(){return{block:fe,inline:X}}}]),Q}(),it=function(){function Q(z){this.options=z||e.defaults}var U=Q.prototype;return U.code=function(E,I,B){var F=(I||"").match(/\S*/)[0];if(this.options.highlight){var Z=this.options.highlight(E,F);Z!=null&&Z!==E&&(B=!0,E=Z)}return E=E.replace(/\n$/,"")+` `,F?'
'+(B?E:m(E,!0))+`
`:"
"+(B?E:m(E,!0))+`
`},U.blockquote=function(E){return`
`+E+`
`},U.html=function(E){return E},U.heading=function(E,I,B,F){if(this.options.headerIds){var Z=this.options.headerPrefix+F.slug(B);return"'+E+" `}return""+E+" `},U.hr=function(){return this.options.xhtml?`
`:`
`},U.list=function(E,I,B){var F=I?"ol":"ul",Z=I&&B!==1?' start="'+B+'"':"";return"<"+F+Z+`> `+E+" `},U.listitem=function(E){return"
  • "+E+`
  • `},U.checkbox=function(E){return" "},U.paragraph=function(E){return"

    "+E+`

    `},U.table=function(E,I){return I&&(I=""+I+""),` `+E+` `+I+`
    `},U.tablerow=function(E){return` `+E+` `},U.tablecell=function(E,I){var B=I.header?"th":"td",F=I.align?"<"+B+' align="'+I.align+'">':"<"+B+">";return F+E+(" `)},U.strong=function(E){return""+E+""},U.em=function(E){return""+E+""},U.codespan=function(E){return""+E+""},U.br=function(){return this.options.xhtml?"
    ":"
    "},U.del=function(E){return""+E+""},U.link=function(E,I,B){if(E=L(this.options.sanitize,this.options.baseUrl,E),E===null)return B;var F='",F},U.image=function(E,I,B){if(E=L(this.options.sanitize,this.options.baseUrl,E),E===null)return B;var F=''+B+'":">",F},U.text=function(E){return E},Q}(),ai=function(){function Q(){}var U=Q.prototype;return U.strong=function(E){return E},U.em=function(E){return E},U.codespan=function(E){return E},U.del=function(E){return E},U.html=function(E){return E},U.text=function(E){return E},U.link=function(E,I,B){return""+B},U.image=function(E,I,B){return""+B},U.br=function(){return""},Q}(),Yi=function(){function Q(){this.seen={}}var U=Q.prototype;return U.serialize=function(E){return E.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},U.getNextSafeSlug=function(E,I){var B=E,F=0;if(this.seen.hasOwnProperty(B)){F=this.seen[E];do F++,B=E+"-"+F;while(this.seen.hasOwnProperty(B))}return I||(this.seen[E]=F,this.seen[B]=0),B},U.slug=function(E,I){I===void 0&&(I={});var B=this.serialize(E);return this.getNextSafeSlug(B,I.dryrun)},Q}(),mi=function(){function Q(z){this.options=z||e.defaults,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ai,this.slugger=new Yi}Q.parse=function(E,I){var B=new Q(I);return B.parse(E)},Q.parseInline=function(E,I){var B=new Q(I);return B.parseInline(E)};var U=Q.prototype;return U.parse=function(E,I){I===void 0&&(I=!0);var B="",F,Z,ee,_e,we,Oe,Ae,St,ht,Ie,Ut,zt,ls,Ze,qt,oe,ge,Pe,ei,ci=E.length;for(F=0;F0&&qt.tokens[0].type==="paragraph"?(qt.tokens[0].text=Pe+" "+qt.tokens[0].text,qt.tokens[0].tokens&&qt.tokens[0].tokens.length>0&&qt.tokens[0].tokens[0].type==="text"&&(qt.tokens[0].tokens[0].text=Pe+" "+qt.tokens[0].tokens[0].text)):qt.tokens.unshift({type:"text",text:Pe}):Ze+=Pe),Ze+=this.parse(qt.tokens,ls),ht+=this.renderer.listitem(Ze,ge,oe);B+=this.renderer.list(ht,Ut,zt);continue}case"html":{B+=this.renderer.html(Ie.text);continue}case"paragraph":{B+=this.renderer.paragraph(this.parseInline(Ie.tokens));continue}case"text":{for(ht=Ie.tokens?this.parseInline(Ie.tokens):Ie.text;F+1"u"||Q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Q)+", string expected");if(typeof U=="function"&&(z=U,U=null),U=P({},ke.defaults,U||{}),de(U),z){var E=U.highlight,I;try{I=Mt.lex(Q,U)}catch(_e){return z(_e)}var B=function(we){var Oe;if(!we)try{U.walkTokens&&ke.walkTokens(I,U.walkTokens),Oe=mi.parse(I,U)}catch(Ae){we=Ae}return U.highlight=E,we?z(we):z(null,Oe)};if(!E||E.length<3||(delete U.highlight,!I.length))return B();var F=0;ke.walkTokens(I,function(_e){_e.type==="code"&&(F++,setTimeout(function(){E(_e.text,_e.lang,function(we,Oe){if(we)return B(we);Oe!=null&&Oe!==_e.text&&(_e.text=Oe,_e.escaped=!0),F--,F===0&&B()})},0))}),F===0&&B();return}function Z(_e){if(_e.message+=` Please report this to https://github.com/markedjs/marked.`,U.silent)return"

    An error occurred:

    "+m(_e.message+"",!0)+"
    ";throw _e}try{var ee=Mt.lex(Q,U);if(U.walkTokens){if(U.async)return Promise.all(ke.walkTokens(ee,U.walkTokens)).then(function(){return mi.parse(ee,U)}).catch(Z);ke.walkTokens(ee,U.walkTokens)}return mi.parse(ee,U)}catch(_e){Z(_e)}}ke.options=ke.setOptions=function(Q){return P(ke.defaults,Q),l(ke.defaults),ke},ke.getDefaults=a,ke.defaults=e.defaults,ke.use=function(){for(var Q=arguments.length,U=new Array(Q),z=0;z"u"||Q===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Q!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Q)+", string expected");U=P({},ke.defaults,U||{}),de(U);try{var z=Mt.lexInline(Q,U);return U.walkTokens&&ke.walkTokens(z,U.walkTokens),mi.parseInline(z,U)}catch(E){if(E.message+=` Please report this to https://github.com/markedjs/marked.`,U.silent)return"

    An error occurred:

    "+m(E.message+"",!0)+"
    ";throw E}},ke.Parser=mi,ke.parser=mi.parse,ke.Renderer=it,ke.TextRenderer=ai,ke.Lexer=Mt,ke.lexer=Mt.lex,ke.Tokenizer=Ee,ke.Slugger=Yi,ke.parse=ke;var rn=ke.options,rs=ke.setOptions,Tn=ke.use,Cn=ke.walkTokens,li=ke.parseInline,as=ke,ks=mi.parse,cd=Mt.lex;e.Lexer=Mt,e.Parser=mi,e.Renderer=it,e.Slugger=Yi,e.TextRenderer=ai,e.Tokenizer=Ee,e.getDefaults=a,e.lexer=cd,e.marked=ke,e.options=rn,e.parse=as,e.parseInline=li,e.parser=ks,e.setOptions=rs,e.use=Tn,e.walkTokens=Cn,Object.defineProperty(e,"__esModule",{value:!0})})})();In.Lexer||exports.Lexer;In.Parser||exports.Parser;In.Renderer||exports.Renderer;In.Slugger||exports.Slugger;In.TextRenderer||exports.TextRenderer;In.Tokenizer||exports.Tokenizer;In.getDefaults||exports.getDefaults;In.lexer||exports.lexer;var Eo=In.marked||exports.marked;In.options||exports.options;In.parse||exports.parse;In.parseInline||exports.parseInline;In.parser||exports.parser;In.setOptions||exports.setOptions;In.use||exports.use;In.walkTokens||exports.walkTokens;function Z$(s){return JSON.stringify(s,Y$)}function zw(s){let e=JSON.parse(s);return e=Uw(e),e}function Y$(s,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function Uw(s,e=0){if(!s||e>200)return s;if(typeof s=="object"){switch(s.$mid){case 1:return $e.revive(s);case 2:return new RegExp(s.source,s.flags);case 17:return new Date(s.source)}if(s instanceof iL||s instanceof Uint8Array)return s;if(Array.isArray(s))for(let t=0;t{let i=[],n=[];return s&&({href:s,dimensions:i}=G$(s),n.push(`src="${Xm(s)}"`)),t&&n.push(`alt="${Xm(t)}"`),e&&n.push(`title="${Xm(e)}"`),i.length&&(n=n.concat(i)),""},paragraph:s=>`

    ${s}

    `,link:(s,e,t)=>typeof s!="string"?"":(s===t&&(t=Qv(t)),e=typeof e=="string"?Xm(Qv(e)):"",s=Qv(s),s=s.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${t}`)});function qL(s,e={},t={}){var i,n;const o=new pe;let r=!1;const a=HL(e),l=function(v){let b;try{b=zw(decodeURIComponent(v))}catch{}return b?(b=MN(b,C=>{if(s.uris&&s.uris[C])return $e.revive(s.uris[C])}),encodeURIComponent(JSON.stringify(b))):v},c=function(v,b){const C=s.uris&&s.uris[v];let w=$e.revive(C);return b?v.startsWith(ze.data+":")?v:(w||(w=$e.parse(v)),DT.uriToBrowserUri(w).toString(!0)):!w||$e.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},d=new Eo.Renderer;d.image=Xv.image,d.link=Xv.link,d.paragraph=Xv.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(v,b)=>{const C=LE.nextId(),w=e.codeBlockRendererSync(kE(b),v);return h.push([C,w]),`
    ${of(v)}
    `}:e.codeBlockRenderer&&(d.code=(v,b)=>{const C=LE.nextId(),w=e.codeBlockRenderer(kE(b),v);return u.push(w.then(y=>[C,y])),`
    ${of(v)}
    `}),e.actionHandler){const v=function(w){let y=w.target;if(!(y.tagName!=="A"&&(y=y.parentElement,!y||y.tagName!=="A")))try{let L=y.dataset.href;L&&(s.baseUri&&(L=Jv($e.from(s.baseUri),L)),e.actionHandler.callback(L,w))}catch(L){At(L)}finally{w.preventDefault()}},b=e.actionHandler.disposables.add(new Ue(a,"click")),C=e.actionHandler.disposables.add(new Ue(a,"auxclick"));e.actionHandler.disposables.add(te.any(b.event,C.event)(w=>{const y=new Io(be(a),w);!y.leftButton&&!y.middleButton||v(y)})),e.actionHandler.disposables.add(j(a,"keydown",w=>{const y=new Ot(w);!y.equals(10)&&!y.equals(3)||v(y)}))}s.supportHtml||(t.sanitizer=v=>{var b;return!((b=e.sanitizerOptions)===null||b===void 0)&&b.replaceWithPlaintext?of(v):(s.isTrusted?v.match(/^(]+>)|(<\/\s*span>)$/):void 0)?v:""},t.sanitize=!0,t.silent=!0),t.renderer=d;let f=(i=s.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),s.supportThemeIcons&&(f=H$(f));let g;if(e.fillInIncompleteTokens){const v={...Eo.defaults,...t},b=Eo.lexer(f,v),C=cK(b);g=Eo.parser(C,v)}else g=Eo.parse(f,t);s.supportThemeIcons&&(g=Dc(g).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const _=new DOMParser().parseFromString($w({isTrusted:s.isTrusted,...e.sanitizerOptions},g),"text/html");if(_.body.querySelectorAll("img, audio, video, source").forEach(v=>{const b=v.getAttribute("src");if(b){let C=b;try{s.baseUri&&(C=Jv($e.from(s.baseUri),C))}catch{}if(v.setAttribute("src",c(C,!0)),e.remoteImageIsAllowed){const w=$e.parse(C);w.scheme!==ze.file&&w.scheme!==ze.data&&!e.remoteImageIsAllowed(w)&&v.replaceWith(De("",void 0,v.outerHTML))}}}),_.body.querySelectorAll("a").forEach(v=>{const b=v.getAttribute("href");if(v.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!s.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))v.replaceWith(...v.childNodes);else{let C=c(b,!1);s.baseUri&&(C=Jv($e.from(s.baseUri),b)),v.dataset.href=C}}),a.innerHTML=$w({isTrusted:s.isTrusted,...e.sanitizerOptions},_.body.innerHTML),u.length>0)Promise.all(u).then(v=>{var b,C;if(r)return;const w=new Map(v),y=a.querySelectorAll("div[data-code]");for(const L of y){const k=w.get((b=L.dataset.code)!==null&&b!==void 0?b:"");k&&xn(L,k)}(C=e.asyncRenderCallback)===null||C===void 0||C.call(e)});else if(h.length>0){const v=new Map(h),b=a.querySelectorAll("div[data-code]");for(const C of b){const w=v.get((n=C.dataset.code)!==null&&n!==void 0?n:"");w&&xn(C,w)}}if(e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const b=o.add(j(v,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,o.dispose()}}}function kE(s){if(!s)return"";const e=s.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:s}function Jv(s,e){return/^\w[\w\d+.-]*:/.test(e)?e:s.path.endsWith("/")?N2(s,e).toString():N2(kH(s),e).toString()}const Q$=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function $w(s,e){const{config:t,allowedSchemes:i}=J$(s),n=new pe;n.add(DE("uponSanitizeAttribute",(o,r)=>{var a;if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}else if(o.tagName==="INPUT"&&((a=o.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"){if(r.attrName==="type"&&r.attrValue==="checkbox"||r.attrName==="disabled"||r.attrName==="checked"){r.keepAttr=!0;return}r.keepAttr=!1}})),n.add(DE("uponSanitizeElement",(o,r)=>{var a,l;if(r.tagName==="input"&&(((a=o.attributes.getNamedItem("type"))===null||a===void 0?void 0:a.value)==="checkbox"?o.setAttribute("disabled",""):s.replaceWithPlaintext||(l=o.parentElement)===null||l===void 0||l.removeChild(o)),s.replaceWithPlaintext&&!r.allowedTags[r.tagName]&&r.tagName!=="body"&&o.parentElement){let c,d;if(r.tagName==="#comment")c=``;else{const g=Q$.includes(r.tagName),m=o.attributes.length?" "+Array.from(o.attributes).map(_=>`${_.name}="${_.value}"`).join(" "):"";c=`<${r.tagName}${m}>`,g||(d=``)}const u=document.createDocumentFragment(),h=o.parentElement.ownerDocument.createTextNode(c);u.appendChild(h);const f=d?o.parentElement.ownerDocument.createTextNode(d):void 0;for(;o.firstChild;)u.appendChild(o.firstChild);f&&u.appendChild(f),o.parentElement.replaceChild(u,o)}})),n.add(qO(i));try{return yT(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{n.dispose()}}const X$=["align","autoplay","alt","checked","class","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","src","style","target","title","type","width","start"];function J$(s){var e;const t=[ze.http,ze.https,ze.mailto,ze.data,ze.file,ze.vscodeFileResource,ze.vscodeRemote,ze.vscodeRemoteResource];return s.isTrusted&&t.push(ze.command),{config:{ALLOWED_TAGS:(e=s.allowedTags)!==null&&e!==void 0?e:[...GO],ALLOWED_ATTR:X$,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}function eK(s){return typeof s=="string"?s:tK(s)}function tK(s,e){var t;let i=(t=s.value)!==null&&t!==void 0?t:"";i.length>1e5&&(i=`${i.substr(0,1e5)}…`);const n=Eo.parse(i,{renderer:sK.value}).replace(/&(#\d+|[a-zA-Z]+);/g,o=>{var r;return(r=iK.get(o))!==null&&r!==void 0?r:o});return $w({isTrusted:!1},n).toString()}const iK=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function nK(){const s=new Eo.Renderer;return s.code=e=>e,s.blockquote=e=>e,s.html=e=>"",s.heading=(e,t,i)=>e+` `,s.hr=()=>"",s.list=(e,t)=>e,s.listitem=e=>e+` `,s.paragraph=e=>e+` `,s.table=(e,t)=>e+t+` `,s.tablerow=e=>e,s.tablecell=(e,t)=>e+" ",s.strong=e=>e,s.em=e=>e,s.codespan=e=>e,s.br=()=>` `,s.del=e=>e,s.image=(e,t,i)=>"",s.text=e=>e,s.link=(e,t,i)=>i,s}const sK=new Ml(s=>nK());function dg(s){let e="";return s.forEach(t=>{e+=t.raw}),e}function uR(s){var e,t;if(s.tokens)for(let i=s.tokens.length-1;i>=0;i--){const n=s.tokens[i];if(n.type==="text"){const o=n.raw.split(` `),r=o[o.length-1];if(r.includes("`"))return hK(s);if(r.includes("**"))return vK(s);if(r.match(/\*\w/))return fK(s);if(r.match(/(^|\s)__\w/))return bK(s);if(r.match(/(^|\s)_\w/))return gK(s);if(oK(r)||rK(r)&&s.tokens.slice(0,i).some(a=>a.type==="text"&&a.raw.match(/\[[^\]]*$/))){const a=s.tokens.slice(i+1);return((e=a[0])===null||e===void 0?void 0:e.type)==="link"&&((t=a[1])===null||t===void 0?void 0:t.type)==="text"&&a[1].raw.match(/^ *"[^"]*$/)||r.match(/^[^"]* +"[^"]*$/)?pK(s):mK(s)}else if(r.match(/(^|\s)\[\w*/))return _K(s)}}}function oK(s){return!!s.match(/(^|\s)\[.*\]\(\w*/)}function rK(s){return!!s.match(/^[^\[]*\]\([^\)]*$/)}function aK(s){var e;const t=s.items[s.items.length-1],i=t.tokens?t.tokens[t.tokens.length-1]:void 0;let n;if((i==null?void 0:i.type)==="text"&&!("inRawBlock"in t)&&(n=uR(i)),!n||n.type!=="paragraph")return;const o=dg(s.items.slice(0,-1)),r=(e=t.raw.match(/^(\s*(-|\d+\.) +)/))===null||e===void 0?void 0:e[0];if(!r)return;const a=r+dg(t.tokens.slice(0,-1))+n.raw,l=Eo.lexer(o+a)[0];if(l.type==="list")return l}const lK=3;function cK(s){for(let e=0;e"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(o!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const o=n?t.slice(0,-1).join(` `):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+` |${" --- |".repeat(i)}`;return Eo.lexer(a)}}function DE(s,e){return ST(s,e),Be(()=>LT(s))}var wK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},xE=function(s,e){return function(t,i){e(t,i,s)}},Kw;let z_=Kw=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new O,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new pe,o=n.add(qL(e,{...this._getRenderOptions(e,n),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{var o,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=ro);const c=await Gz(this._languageService,n,l),d=document.createElement("span");if(d.innerHTML=(a=(r=Kw._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const u=this._options.editor.getOption(50);nn(d,u)}else this._options.codeBlockFontFamily&&(d.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(d.style.fontSize=this._options.codeBlockFontSize),d},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>hR(this._openerService,i,e.isTrusted),disposables:t}}}};z_._ttpTokenizer=ed("tokenizeToString",{createHTML(s){return s}});z_=Kw=wK([xE(1,Mi),xE(2,em)],z_);async function hR(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:yK(t)})}catch(i){return At(i),!1}}function yK(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}var SK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},kh=function(s,e){return function(t,i){e(t,i,s)}};const Yo=De;let jw=class extends La{get _targetWindow(){return be(this._target.targetElements[0])}get _targetDocumentElement(){return be(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,o,r){var a,l,c,d,u,h,f,g;super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,this._instantiationService=o,this._accessibilityService=r,this._messageListeners=new pe,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new O),this._onRequestLayout=this._register(new O),this._linkHandler=e.linkHandler||(w=>hR(this._openerService,w,xc(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new LK(e.target),this._hoverPointer=!((a=e.appearance)===null||a===void 0)&&a.showPointer?Yo("div.workbench-hover-pointer"):void 0,this._hover=this._register(new l$),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),!((l=e.appearance)===null||l===void 0)&&l.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),!((c=e.appearance)===null||c===void 0)&&c.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),!((d=e.position)===null||d===void 0)&&d.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=(h=(u=e.position)===null||u===void 0?void 0:u.hoverPosition)!==null&&h!==void 0?h:3,this.onmousedown(this._hover.containerDomNode,w=>w.stopPropagation()),this.onkeydown(this._hover.containerDomNode,w=>{w.equals(9)&&this.dispose()}),this._register(j(this._targetWindow,"blur",()=>this.dispose()));const m=Yo("div.hover-row.markdown-hover"),_=Yo("div.hover-contents");if(typeof e.content=="string")_.textContent=e.content,_.style.whiteSpace="pre-wrap";else if(Vi(e.content))_.appendChild(e.content),_.classList.add("html-hover-contents");else{const w=e.content,y=this._instantiationService.createInstance(z_,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||Cs.fontFamily}),{element:L}=y.render(w,{actionHandler:{callback:k=>this._linkHandler(k),disposables:this._messageListeners},asyncRenderCallback:()=>{_.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});_.appendChild(L)}if(m.appendChild(_),this._hover.contentsDomNode.appendChild(m),e.actions&&e.actions.length>0){const w=Yo("div.hover-row.status-bar"),y=Yo("div.actions");e.actions.forEach(L=>{const k=this._keybindingService.lookupKeybinding(L.commandId),D=k?k.getLabel():null;VL.render(y,{label:L.label,commandId:L.commandId,run:N=>{L.run(N),this.dispose()},iconClass:L.iconClass},D)}),w.appendChild(y),this._hover.containerDomNode.appendChild(w)}this._hoverContainer=Yo("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let v;if(e.actions&&e.actions.length>0?v=!1:((f=e.persistence)===null||f===void 0?void 0:f.hideOnHover)===void 0?v=typeof e.content=="string"||xc(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):v=e.persistence.hideOnHover,v&&(!((g=e.appearance)===null||g===void 0)&&g.showHoverHint)){const w=Yo("div.hover-row.status-bar"),y=Yo("div.info");y.textContent=p("hoverhint","Hold {0} key to mouse over",Ye?"Option":"Alt"),w.appendChild(y),this._hover.containerDomNode.appendChild(w)}const b=[...this._target.targetElements];v||b.push(this._hoverContainer);const C=this._register(new EE(b));if(this._register(C.onMouseOut(()=>{this._isLocked||this.dispose()})),v){const w=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new EE(w)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=C}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=qS(this._hoverContainer,Yo("div")),n=he(this._hoverContainer,Yo("div"));i.tabIndex=0,n.tabIndex=0,this._register(j(n,"focus",o=>{e.focus(),o.preventDefault()})),this._register(j(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){var t;e.appendChild(this._hoverContainer);const n=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&c$(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(t=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||t===void 0?void 0:t.getAriaLabel());n&&g_(n),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const u=TT(d),h=d.getBoundingClientRect();return{top:h.top*u,bottom:h.bottom*u,right:h.right*u,left:h.left*u}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:n,bottom:o,left:r}=t[0],a=n-r,l=o-i,c={top:i,right:n,bottom:o,left:r,width:a,height:l,center:{x:r+a/2,y:i+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?3:0;if(this._forcePosition){const i=t+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?3:0;this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-i):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const n=this._x+i;(ne.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};jw=SK([kh(1,Zi),kh(2,Xt),kh(3,em),kh(4,vt),kh(5,Uo)],jw);class EE extends La{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new O),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=be(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(be(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class LK{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var Xi;(function(s){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}s.intersect=e;function t(o){return o.end-o.start<=0}s.isEmpty=t;function i(o,r){return!t(e(o,r))}s.intersects=i;function n(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},c={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}s.relativeComplement=n})(Xi||(Xi={}));function kK(s){const e=s;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var ll;(function(s){s[s.AVOID=0]="AVOID",s[s.ALIGN=1]="ALIGN"})(ll||(ll={}));function $d(s,e,t){const i=t.mode===ll.ALIGN?t.offset:t.offset+t.size,n=t.mode===ll.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=s-i?i:e<=n?n-e:Math.max(s-e,0):e<=n?n-e:e<=s-i?i:0}class Bu extends G{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=G.None,this.toDisposeOnSetContainer=G.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=De(".context-view"),FC(this.view),this.setContainer(e,t),this._register(Be(()=>this.setContainer(null,1)))}setContainer(e,t){var i;this.useFixedPosition=t!==1;const n=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&n===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=De(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const r=document.createElement("style");r.textContent=DK,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(De("slot"))}else this.container.appendChild(this.view);const o=new pe;Bu.BUBBLE_UP_EVENTS.forEach(r=>{o.add(Ai(this.container,r,a=>{this.onDOMEvent(a,!1)}))}),Bu.BUBBLE_DOWN_EVENTS.forEach(r=>{o.add(Ai(this.container,r,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,i,n;this.isVisible()&&this.hide(),Po(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+((t=e.layer)!==null&&t!==void 0?t:0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",GS(this.view),this.toDisposeOnClean=e.render(this.view)||G.None,this.delegate=e,this.doLayout(),(n=(i=this.delegate).focus)===null||n===void 0||n.call(i)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Cl&&PS.pointerEvents)){this.hide();return}(t=(e=this.delegate)===null||e===void 0?void 0:e.layout)===null||t===void 0||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Vi(e)){const h=Fs(e),f=TT(e);t={top:h.top*f,left:h.left*f,width:h.width*f,height:h.height*f}}else kK(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=zS(this.view),n=RC(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;const d=vp();if(a===0){const h={offset:t.top-d.pageYOffset,size:t.height,position:o===0?0:1},f={offset:t.left,size:t.width,position:r===0?0:1,mode:ll.ALIGN};l=$d(d.innerHeight,n,h)+d.pageYOffset,Xi.intersects({start:l,end:l+n},{start:h.offset,end:h.offset+h.size})&&(f.mode=ll.AVOID),c=$d(d.innerWidth,i,f)}else{const h={offset:t.left,size:t.width,position:r===0?0:1},f={offset:t.top,size:t.height,position:o===0?0:1,mode:ll.ALIGN};c=$d(d.innerWidth,i,h),Xi.intersects({start:c,end:c+i},{start:h.offset,end:h.offset+h.size})&&(f.mode=ll.AVOID),l=$d(d.innerHeight,n,f)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const u=Fs(this.container);this.view.style.top=`${l-(this.useFixedPosition?Fs(this.view).top:u.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Fs(this.view).left:u.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),FC(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,be(e).document.activeElement):t&&!Ni(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Bu.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Bu.BUBBLE_DOWN_EVENTS=["click"];const DK=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } .codicon[class*='codicon-'] { font: normal normal normal 16px/1 codicon; display: inline-block; text-decoration: none; text-rendering: auto; text-align: center; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; user-select: none; -webkit-user-select: none; -ms-user-select: none; } :host { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } `;var xK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},EK=function(s,e){return function(t,i){e(t,i,s)}};let U_=class extends G{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Bu(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(be(t))?n=1:i?n=3:n=2:n=1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};U_=xK([EK(0,Pl)],U_);class IK extends U_{getContextViewElement(){return this.contextView.getViewElement()}}class NK{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){var n;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Jn(e)||Vi(e))o=e;else if(!$p(e.markdown))o=(n=e.markdown)!==null&&n!==void 0?n:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(p("iconLabel.loading","Loading..."),t,i),this._cancellationTokenSource=new Ho;const r=this._cancellationTokenSource.token;if(o=await e.markdown(r),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(o,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:2},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}n==null||n.dispose()}hasContent(e){return e?xc(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}}var TK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Dh=function(s,e){return function(t,i){e(t,i,s)}};let qw=class extends G{constructor(e,t,i,n,o){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=o,this._existingHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new U_(this._layoutService))}showHover(e,t,i){var n,o,r,a;if(IE(this._currentHoverOptions)===IE(e)||this._currentHover&&(!((o=(n=this._currentHoverOptions)===null||n===void 0?void 0:n.persistence)===null||o===void 0)&&o.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const l=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),c=vn();i||(l&&c?c.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=c):this._lastFocusedElementBeforeOpen=void 0);const d=new pe,u=this._instantiationService.createInstance(jw,e);if(!((r=e.persistence)===null||r===void 0)&&r.sticky&&(u.isLocked=!0),u.onDispose(()=>{var h,f;((h=this._currentHover)===null||h===void 0?void 0:h.domNode)&&MT(this._currentHover.domNode)&&((f=this._lastFocusedElementBeforeOpen)===null||f===void 0||f.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),d.dispose()},void 0,d),!e.container){const h=Vi(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(be(h))}if(this._contextViewHandler.showContextView(new AK(u,t),e.container),u.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,d),!((a=e.persistence)===null||a===void 0)&&a.sticky)d.add(j(be(e.container).document,J.MOUSE_DOWN,h=>{Ni(h.target,u.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const f of e.target.targetElements)d.add(j(f,J.CLICK,()=>this.hideHover()));else d.add(j(e.target,J.CLICK,()=>this.hideHover()));const h=vn();if(h){const f=be(h).document;d.add(j(h,J.KEY_DOWN,g=>{var m;return this._keyDown(g,u,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),d.add(j(f,J.KEY_DOWN,g=>{var m;return this._keyDown(g,u,!!(!((m=e.persistence)===null||m===void 0)&&m.hideOnKeyDown))})),d.add(j(h,J.KEY_UP,g=>this._keyUp(g,u))),d.add(j(f,J.KEY_UP,g=>this._keyUp(g,u)))}}if("IntersectionObserver"in wt){const h=new IntersectionObserver(g=>this._intersectionChange(g,u),{threshold:0}),f="targetElements"in e.target?e.target.targetElements[0]:e.target;h.observe(f),d.add(Be(()=>h.disconnect()))}return this._currentHover=u,u}hideHover(){var e;!((e=this._currentHover)===null||e===void 0)&&e.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showHover(this._lastHoverOptions,!0,!0)}_keyDown(e,t,i){var n,o;if(e.key==="Alt"){t.isLocked=!0;return}const r=new Ot(e);this._keybindingService.resolveKeyboardEvent(r).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(r,r.target).kind!==0||i&&(!(!((n=this._currentHoverOptions)===null||n===void 0)&&n.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(o=this._lastFocusedElementBeforeOpen)===null||o===void 0||o.focus())}_keyUp(e,t){var i;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(i=this._lastFocusedElementBeforeOpen)===null||i===void 0||i.focus()))}setupUpdatableHover(e,t,i,n){t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let o,r;const a=(C,w)=>{var y;const L=r!==void 0;C&&(r==null||r.dispose(),r=void 0),w&&(o==null||o.dispose(),o=void 0),L&&((y=e.onDidHideHover)===null||y===void 0||y.call(e),r=void 0)},l=(C,w,y,L)=>new Zc(async()=>{(!r||r.isDisposed)&&(r=new NK(e,y||t,C>0),await r.update(typeof i=="function"?i():i,w,{...n,trapFocus:L}))},C);let c=!1;const d=j(t,J.MOUSE_DOWN,()=>{c=!0,a(!0,!0)},!0),u=j(t,J.MOUSE_UP,()=>{c=!1},!0),h=j(t,J.MOUSE_LEAVE,C=>{c=!1,a(!1,C.fromElement===t)},!0),f=C=>{if(o)return;const w=new pe,y={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const L=k=>{y.x=k.x+10,Vi(k.target)&&NE(k.target,t)!==t&&a(!0,!0)};w.add(j(t,J.MOUSE_MOVE,L,!0))}o=w,!(Vi(C.target)&&NE(C.target,t)!==t)&&w.add(l(e.delay,!1,y))},g=j(t,J.MOUSE_OVER,f,!0),m=()=>{if(c||o)return;const C={targetElements:[t],dispose:()=>{}},w=new pe,y=()=>a(!0,!0);w.add(j(t,J.BLUR,y,!0)),w.add(l(e.delay,!1,C)),o=w};let _;const v=t.tagName.toLowerCase();v!=="input"&&v!=="textarea"&&(_=j(t,J.FOCUS,m,!0));const b={show:C=>{a(!1,!0),l(0,C,void 0,C)},hide:()=>{a(!0,!0)},update:async(C,w)=>{i=C,await(r==null?void 0:r.update(i,void 0,w))},dispose:()=>{this._existingHovers.delete(t),g.dispose(),h.dispose(),d.dispose(),u.dispose(),_==null||_.dispose(),a(!0,!0)}};return this._existingHovers.set(t,b),b}triggerUpdatableHover(e){const t=this._existingHovers.get(e);t&&t.show(!0)}dispose(){this._existingHovers.forEach(e=>e.dispose()),super.dispose()}};qw=TK([Dh(0,vt),Dh(1,Da),Dh(2,Zi),Dh(3,Pl),Dh(4,Uo)],qw);function IE(s){var e;if(s!==void 0)return(e=s==null?void 0:s.id)!==null&&e!==void 0?e:s}class AK{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function NE(s,e){for(e=e??be(s).document.body;!s.hasAttribute("custom-hover")&&s!==e;)s=s.parentElement;return s}rt(Xg,qw,1);ka((s,e)=>{const t=s.getColor(R8);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const MK=Qe("IWorkspaceEditService");class GL{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Ec.is(t))return Ec.lift(t);if(uu.is(t))return uu.lift(t);throw new Error("Unsupported edit")})}}class Ec extends GL{static is(e){return e instanceof Ec?!0:Yn(e)&&$e.isUri(e.resource)&&Yn(e.textEdit)}static lift(e){return e instanceof Ec?e:new Ec(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class uu extends GL{static is(e){return e instanceof uu?!0:Yn(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof uu?e:new uu(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const Qi={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},RK=Object.freeze({id:"editor",order:5,type:"object",title:p("editorConfigurationTitle","Editor"),scope:5}),$_={...RK,properties:{"editor.tabSize":{type:"number",default:en.tabSize,minimum:1,markdownDescription:p("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:p("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:en.insertSpaces,markdownDescription:p("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:en.detectIndentation,markdownDescription:p("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:en.trimAutoWhitespace,description:p("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:en.largeFileOptimizations,description:p("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[p("wordBasedSuggestions.off","Turn off Word Based Suggestions."),p("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),p("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),p("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:p("wordBasedSuggestions","Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[p("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),p("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),p("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:p("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:p("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:p("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:p("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:p("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:p("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:p("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:p("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Qi.maxComputationTime,description:p("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Qi.maxFileSize,description:p("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Qi.renderSideBySide,description:p("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Qi.renderSideBySideInlineBreakpoint,description:p("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Qi.useInlineViewWhenSpaceIsLimited,description:p("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Qi.renderMarginRevertIcon,description:p("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Qi.renderGutterMenu,description:p("renderGutterMenu","When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Qi.ignoreTrimWhitespace,description:p("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Qi.renderIndicators,description:p("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Qi.diffCodeLens,description:p("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Qi.diffWordWrap,markdownEnumDescriptions:[p("wordWrap.off","Lines will never wrap."),p("wordWrap.on","Lines will wrap at the viewport width."),p("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Qi.diffAlgorithm,markdownEnumDescriptions:[p("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),p("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Qi.hideUnchangedRegions.enabled,markdownDescription:p("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Qi.hideUnchangedRegions.revealLineCount,markdownDescription:p("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Qi.hideUnchangedRegions.minimumLineCount,markdownDescription:p("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Qi.hideUnchangedRegions.contextLineCount,markdownDescription:p("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Qi.experimental.showMoves,markdownDescription:p("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Qi.experimental.showEmptyDecorations,description:p("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}};function PK(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of Dd){const e=s.schema;if(typeof e<"u")if(PK(e))$_.properties[`editor.${s.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&($_.properties[t]=e[t])}let Jm=null;function fR(){return Jm===null&&(Jm=Object.create(null),Object.keys($_.properties).forEach(s=>{Jm[s]=!0})),Jm}function FK(s){return fR()[`editor.${s}`]||!1}function OK(s){return fR()[`diffEditor.${s}`]||!1}const BK=zi.as(td.Configuration);BK.registerConfiguration($_);class Gw{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}}}function ep(s){return Object.isFrozen(s)?s:k5(s)}class Bi{static createEmptyModel(e){return new Bi({},[],[],void 0,e)}constructor(e,t,i,n,o){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.logService=o,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(i=>{if(i instanceof Bi)return i;const n=new WK("",this.logService);return n.parseRaw(i),n.configurationModel});this._rawConfiguration=t.reduce((i,n)=>n===i?n:i.merge(n),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?YD(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return ep(i.rawConfiguration.getValue(e))},get override(){return t?ep(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return ep(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const n=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const l=new Bi(o,a,[],void 0,i.logService).getValue(e);l!==void 0&&n.push({identifiers:r,value:l})}return n.length?ep(n):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?YD(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const n=Ha(this.contents),o=Ha(this.overrides),r=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(n,l.contents);for(const c of l.overrides){const[d]=o.filter(u=>Wi(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=Nc(d.keys)):o.push(Ha(c))}for(const c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new Bi(n,r,o,a.every(l=>l instanceof Bi)?void 0:a,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const n of Nc([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[n];const r=t[n];r&&(typeof o=="object"&&typeof r=="object"?(o=Ha(o),this.mergeContents(o,r)):o=r),i[n]=o}return new Bi(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Yn(e[i])&&Yn(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Ha(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=o=>{o&&(i?this.mergeContents(i,o):i=Ha(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&n(o.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),n9(this.contents,e),Ll.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Wi(i.identifiers,r_(e))),1))}updateValue(e,t,i){eA(this.contents,e,t,n=>this.logService.error(n)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),Ll.test(e)&&this.overrides.push({identifiers:r_(e),keys:Object.keys(this.contents[e]),contents:zC(this.contents[e],n=>this.logService.error(n))})}}class WK{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||Bi.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Bi(i,n,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=zi.as(td.Configuration).getConfigurationProperties(),n=this.filter(e,i,!0,t);e=n.raw;const o=zC(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`)),r=Object.keys(e),a=this.toOverrides(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:r,overrides:a,restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){var o,r,a;let l=!1;if(!(n!=null&&n.scopes)&&!(n!=null&&n.skipRestricted)&&!(!((o=n==null?void 0:n.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},d=[];for(const u in e)if(Ll.test(u)&&i){const h=this.filter(e[u],t,!1,n);c[u]=h.raw,l=l||h.hasExcludedProperties,d.push(...h.restricted)}else{const h=t[u],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&d.push(u),!(!((r=n.exclude)===null||r===void 0)&&r.includes(u))&&(!((a=n.include)===null||a===void 0)&&a.includes(u)||(f===void 0||n.scopes===void 0||n.scopes.includes(f))&&!(n.skipRestricted&&(h!=null&&h.restricted)))?c[u]=e[u]:l=!0}return{raw:c,restricted:d,hasExcludedProperties:l}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(Ll.test(n)){const o={};for(const r in e[n])o[r]=e[n][r];i.push({identifiers:r_(n),keys:Object.keys(o),contents:zC(o,t)})}return i}}class VK{constructor(e,t,i,n,o,r,a,l,c,d,u,h,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=u,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}toInspectValue(e){return(e==null?void 0:e.value)!==void 0||(e==null?void 0:e.override)!==void 0||(e==null?void 0:e.overrides)!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class a1{constructor(e,t,i,n,o,r,a,l,c,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new pn,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=Bi.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,t===void 0?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of n.overrides)for(const c of l.identifiers)n.getOverrideValue(e,c)!==void 0&&a.add(c);return new VK(e,t,n.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(n=n.merge(this._policyConfiguration)),n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e},[])}}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),n=this.parseConfigurationModel(e.policy,t),o=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.user,t),a=this.parseConfigurationModel(e.workspace,t),l=e.folders.reduce((c,d)=>(c.set($e.revive(d[0]),this.parseConfigurationModel(d[1],t)),c),new pn);return new a1(i,n,o,r,Bi.createEmptyModel(t),a,l,Bi.createEmptyModel(t),new pn,t)}static parseConfigurationModel(e,t){return new Bi(e.contents,e.keys,e.overrides,void 0,t)}}class HK{constructor(e,t,i,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=o,this._marker=` `,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=a1.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,o=this._affectsConfigStr.indexOf(n);if(o<0)return!1;const r=o+n.length;if(r>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!bs(l,c)}return!0}}const K_={kind:0},zK={kind:1};function UK(s,e,t){return{kind:2,commandId:s,commandArgs:e,isBubble:t}}class Df{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Df.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const o=i[n];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i"u"||i.length===0)return null;if(i.length===1)return i[0];for(let n=i.length-1;n>=0;n--){const o=i[n];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const o=this._map.get(n[0]);if(o===void 0)return this._log("\\ No keybinding entries."),K_;let r=null;if(n.length<2)r=o;else{r=[];for(let l=0,c=o.length;ld.chords.length)continue;let u=!0;for(let h=1;h=0;i--){const n=t[i];if(Df._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function TE(s){return s?`${s.serialize()}`:"no when condition"}function AE(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}const $K=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class KK extends G{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:te.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new O),this._currentChords=[],this._currentChordChecker=new OS,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Kd.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Zc,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),K_;const[n]=i.getDispatchChords();if(n===null)return this._log("\\ Keyboard event cannot be dispatched"),K_;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw CS("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(p("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:n})=>n).join(", ");this._currentChordStatusMessage=this._notificationService.status(p("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),hf.enabled&&hf.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],hf.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=Kd.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Kd.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new Kd(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var n;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,a=null;if(i){const[u]=e.getSingleModifierDispatchChords();r=u,a=u?[u]:[]}else[r]=e.getDispatchChords(),a=this._currentChords.map(({keypress:u})=>u);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),d=this._getResolver().resolve(l,a,r);switch(d.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(p("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(r,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${d.commandId} ]`),d.commandId===null||d.commandId===""){if(this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(p("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else{this.inChordMode&&this._leaveChordMode(),d.isBubble||(o=!0),this._log(`+ Invoking command ${d.commandId}.`),this._currentlyDispatchingCommandId=d.commandId;try{typeof d.commandArgs>"u"?this._commandService.executeCommand(d.commandId).then(void 0,u=>this._notificationService.warn(u)):this._commandService.executeCommand(d.commandId,d.commandArgs).then(void 0,u=>this._notificationService.warn(u))}finally{this._currentlyDispatchingCommandId=null}$K.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding",detail:(n=e.getUserSettingsLabel())!==null&&n!==void 0?n:void 0})}return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class Kd{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}Kd.EMPTY=new Kd(null);class ME{constructor(e,t,i,n,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?Zw(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=Zw(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function Zw(s){const e=[];for(let t=0,i=s.length;tthis._getLabel(e))}getAriaLabel(){return jK.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:qK.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return GK.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new VF(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class ug extends YK{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Yr.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Yr.toString(e.keyCode)}_getElectronAccelerator(e){return Yr.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Yr.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return ug.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Yr.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=LS[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Ac)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Ac(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=Zw(e.chords.map(n=>this._toKeyCodeChord(n)));return i.length>0?[new ug(i,t)]:[]}}const QK=Qe("labelService"),XK=Qe("progressService");class JK{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}JK.None=Object.freeze({report(){}});const YL=Qe("editorProgressService");class ej{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=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new xf(new nj(e,t))}static forStrings(){return new xf(new ej)}static forConfigKeys(){return new xf(new tj)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new tp,this._root.segment=i.value());const o=[];for(n=this._root;;){const a=i.cmp(n.segment);if(a>0)n.left||(n.left=new tp,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(a<0)n.right||(n.right=new tp,n.right.segment=i.value()),o.push([1,n]),n=n.right;else if(i.hasNext())i.next(),n.mid||(n.mid=new tp,n.mid.segment=i.value()),o.push([0,n]),n=n.mid;else break}const r=n.value;n.value=t,n.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=o[a][0],u=o[a+1][0];if(d===1&&u===1)o[a][1]=l.rotateLeft();else if(d===-1&&u===-1)o[a][1]=l.rotateRight();else if(d===1&&u===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(d===-1&&u===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}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 n=t.cmp(i.segment);if(n>0)i=i.left;else if(n<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==null?void 0:t.value)===void 0&&(t==null?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 n=this._iter.reset(e),o=[];let r=this._root;for(;r;){const a=n.cmp(r.segment);if(a>0)o.push([-1,r]),r=r.left;else if(a<0)o.push([1,r]),r=r.right;else if(n.hasNext())n.next(),o.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const a=this._min(r.right);if(a.key){const{key:l,value:c,segment:d}=a;this._delete(a.key,!1),r.key=l,r.value=c,r.segment=d}}else{const a=(i=r.left)!==null&&i!==void 0?i:r.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),n=i.value||n,i=i.mid;else break}return i&&i.value||n}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const o=i.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(i.hasNext())i.next(),n=n.mid;else return n.mid?this._entries(n.mid):t?n.value:void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const sj=Qe("contextService");function oj(s){const e=s;return typeof(e==null?void 0:e.id)=="string"&&$e.isUri(e.uri)}function nne(s){const e=s;return typeof(e==null?void 0:e.id)=="string"&&!oj(s)&&!aj(s)}const rj={id:"empty-window"};function sne(s,e){if(typeof s=="string"||typeof s>"u")return typeof s=="string"?{id:kS(s)}:rj;const t=s;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function aj(s){const e=s;return typeof(e==null?void 0:e.id)=="string"&&$e.isUri(e.configPath)}class lj{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const cj="code-workspace";p("codeWorkspace","Code Workspace");const gR="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function one(s){return s.id===gR}var RE;(function(s){s.inspectTokensAction=p("inspectTokens","Developer: Inspect Tokens")})(RE||(RE={}));var PE;(function(s){s.gotoLineActionLabel=p("gotoLineActionLabel","Go to Line/Column...")})(PE||(PE={}));var FE;(function(s){s.helpQuickAccessActionLabel=p("helpQuickAccess","Show all Quick Access Providers")})(FE||(FE={}));var OE;(function(s){s.quickCommandActionLabel=p("quickCommandActionLabel","Command Palette"),s.quickCommandHelp=p("quickCommandActionHelp","Show And Run Commands")})(OE||(OE={}));var BE;(function(s){s.quickOutlineActionLabel=p("quickOutlineActionLabel","Go to Symbol..."),s.quickOutlineByCategoryActionLabel=p("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(BE||(BE={}));var j_;(function(s){s.editorViewAccessibleLabel=p("editorViewAccessibleLabel","Editor content"),s.accessibilityHelpMessage=p("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(j_||(j_={}));var WE;(function(s){s.toggleHighContrast=p("toggleHighContrast","Toggle High Contrast Theme")})(WE||(WE={}));var Yw;(function(s){s.bulkEditServiceSummary=p("bulkEditServiceSummary","Made {0} edits in {1} files")})(Yw||(Yw={}));const dj=Qe("workspaceTrustManagementService");let Wu=[],QL=[],mR=[];function ip(s,e=!1){uj(s,!1,e)}function uj(s,e,t){const i=hj(s,e);Wu.push(i),i.userConfigured?mR.push(i):QL.push(i),t&&!i.userConfigured&&Wu.forEach(n=>{n.mime===i.mime||n.userConfigured||(i.extension&&n.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&n.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&n.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&n.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function hj(s,e){return{id:s.id,mime:s.mime,filename:s.filename,extension:s.extension,filepattern:s.filepattern,firstline:s.firstline,userConfigured:e,filenameLowercase:s.filename?s.filename.toLowerCase():void 0,extensionLowercase:s.extension?s.extension.toLowerCase():void 0,filepatternLowercase:s.filepattern?jM(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(ri.sep)>=0:!1}}function fj(){Wu=Wu.filter(s=>s.userConfigured),QL=[]}function gj(s,e){return mj(s,e).map(t=>t.id)}function mj(s,e){let t;if(s)switch(s.scheme){case ze.file:t=s.fsPath;break;case ze.data:{t=I_.parseMetaData(s).get(I_.META_DATA_LABEL);break}case ze.vscodeNotebookCell:t=void 0;break;default:t=s.path}if(!t)return[{id:"unknown",mime:Jr.unknown}];t=t.toLowerCase();const i=kS(t),n=VE(t,i,mR);if(n)return[n,{id:ro,mime:Jr.text}];const o=VE(t,i,QL);if(o)return[o,{id:ro,mime:Jr.text}];if(e){const r=pj(e);if(r)return[r,{id:ro,mime:Jr.text}]}return[{id:"unknown",mime:Jr.unknown}]}function VE(s,e,t){var i;let n,o,r;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){n=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?s:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,c)&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(n)return n;if(o)return o;if(r)return r}function pj(s){if(RS(s)&&(s=s.substr(1)),s.length>0)for(let e=Wu.length-1;e>=0;e--){const t=Wu[e];if(!t.firstline)continue;const i=s.match(t.firstline);if(i&&i.length>0)return t}}const np=Object.prototype.hasOwnProperty,HE="vs.editor.nullLanguage";class _j{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(HE,0),this._register(ro,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||HE}}class hg extends G{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new O),this.onDidChange=this._onDidChange.event,hg.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new _j,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(xu.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){hg.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},fj();const e=[].concat(xu.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(n=>{this._lowercaseNameMap[n.toLowerCase()]=i.identifier}),i.mimetypes.forEach(n=>{this._mimeTypesMap[n]=i.identifier})}),zi.as(td.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;np.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)ip({id:i,mime:n,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)ip({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)ip({id:i,mime:n,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);EF(l)||ip({id:i,mime:n,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?np.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return np.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&np.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:gj(e,t)}}hg.instanceCount=0;class fg extends G{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new O),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new O),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new O({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,fg.instanceCount++,this._registry=this._register(new hg(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){fg.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return fS(i,null)}createById(e){return new zE(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new zE(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=ro),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),oi.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}fg.instanceCount=0;class zE{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new O({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const pR={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Jr.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},vj=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let c1=vj;const bj=new Ml(()=>c1("mouse",!1)),Cj=new Ml(()=>c1("element",!1));function wj(s){c1=s}function $s(s){return s==="element"?Cj.value:bj.value}function XL(){return c1("element",!0)}let _R={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupUpdatableHover:()=>null,triggerUpdatableHover:()=>{}};function yj(s){_R=s}function Tr(){return _R}class Sj{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}class Kl extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function UE(s,e){const t=[];for(const i of e){if(s.start>=i.range.end)continue;if(s.ende.concat(t),[]))}class Dj{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,o=UE({start:0,end:e},this.groups),r=UE({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:Qw(l.range,n),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=kj(o,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.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;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var xa=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const jl={CurrentDragAndDropData:void 0},Qo={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(s){return[s]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class tm{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Ij{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Nj{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;tn,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class Ks{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}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:ev(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=""}}constructor(e,t,i,n=Qo){var o,r,a,l,c,d,u,h,f,g,m,_,v;if(this.virtualDelegate=t,this.domId=`list_id_${++Ks.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Og(50),this.splicing=!1,this.dragOverAnimationStopDisposable=G.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=G.None,this.onDragLeaveTimeout=G.None,this.disposables=new pe,this._onDidChangeContentHeight=new O,this._onDidChangeContentWidth=new O,this.onDidChangeContentHeight=te.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap((o=n.paddingTop)!==null&&o!==void 0?o:0);for(const C of i)this.renderers.set(C.templateId,C);this.cache=this.disposables.add(new Ej(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 n.mouseSupport=="boolean"?n.mouseSupport:!0),this._horizontalScrolling=(r=n.horizontalScrolling)!==null&&r!==void 0?r:Qo.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof n.paddingBottom>"u"?0:n.paddingBottom,this.accessibilityProvider=new Aj(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=n.transformOptimization)!==null&&a!==void 0?a:Qo.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Ft.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new ih({forceIntegerValues:!0,smoothScrollDuration:(l=n.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:C=>is(be(this.domNode),C)})),this.scrollableElement=this.disposables.add(new t1(this.rowsContainer,{alwaysConsumeMouseWheel:(c=n.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:Qo.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=n.verticalScrollMode)!==null&&d!==void 0?d:Qo.verticalScrollMode,useShadows:(u=n.useShadows)!==null&&u!==void 0?u:Qo.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(j(this.rowsContainer,It.Change,C=>this.onTouchChange(C))),this.disposables.add(j(this.scrollableElement.getDomNode(),"scroll",C=>C.target.scrollTop=0)),this.disposables.add(j(this.domNode,"dragover",C=>this.onDragOver(this.toDragEvent(C)))),this.disposables.add(j(this.domNode,"drop",C=>this.onDrop(this.toDragEvent(C)))),this.disposables.add(j(this.domNode,"dragleave",C=>this.onDragLeave(this.toDragEvent(C)))),this.disposables.add(j(this.domNode,"dragend",C=>this.onDragEnd(C))),this.setRowLineHeight=(h=n.setRowLineHeight)!==null&&h!==void 0?h:Qo.setRowLineHeight,this.setRowHeight=(f=n.setRowHeight)!==null&&f!==void 0?f:Qo.setRowHeight,this.supportDynamicHeights=(g=n.supportDynamicHeights)!==null&&g!==void 0?g:Qo.supportDynamicHeights,this.dnd=(m=n.dnd)!==null&&m!==void 0?m:this.disposables.add(Qo.dnd),this.layout((_=n.initialSize)===null||_===void 0?void 0:_.height,(v=n.initialSize)===null||v===void 0?void 0:v.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,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);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),n=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+n),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new Dj(e)}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 n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=Xi.intersect(n,o),a=new Map;for(let y=r.end-1;y>=r.start;y--){const L=this.items[y];if(L.dragStartDisposable.dispose(),L.checkedDisposable.dispose(),L.row){let k=a.get(L.templateId);k||(k=[],a.set(L.templateId,k));const D=this.renderers.get(L.templateId);D&&D.disposeElement&&D.disposeElement(L.element,y,L.row.templateData,L.size),k.unshift(L.row)}L.row=null,L.stale=!0}const l={start:e+t,end:this.items.length},c=Xi.intersect(l,n),d=Xi.relativeComplement(l,n),u=i.map(y=>({id:String(this.itemId++),element:y,templateId:this.virtualDelegate.getTemplateId(y),size:this.virtualDelegate.getHeight(y),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(y),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:G.None,checkedDisposable:G.None,stale:!1}));let h;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,u),h=this.items,this.items=u):(this.rangeMap.splice(e,t,u),h=this.items.splice(e,t,...u));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=Qw(c,f),_=Xi.intersect(g,m);for(let y=_.start;y<_.end;y++)this.updateItemInDOM(this.items[y],y);const v=Xi.relativeComplement(m,g);for(const y of v)for(let L=y.start;LQw(y,f)),w=[{start:e,end:e+i.length},...b].map(y=>Xi.intersect(g,y)).reverse();for(const y of w)for(let L=y.end-1;L>=y.start;L--){const k=this.items[L],D=a.get(k.templateId),N=D==null?void 0:D.pop();this.insertItemInDOM(L,N)}for(const y of a.values())for(const L of y)this.cache.release(L);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(y=>y.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=is(be(this.domNode),()=>{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}),this._onDidChangeContentWidth.fire(this.scrollWidth)}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}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}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){const i={height:typeof e=="number"?e:RO(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:ev(this.domNode)})}render(e,t,i,n,o,r=!1){const a=this.getRenderRange(t,i),l=Xi.relativeComplement(a,e).reverse(),c=Xi.relativeComplement(e,a);if(r){const d=Xi.intersect(e,a);for(let u=d.start;u{for(const d of c)for(let u=d.start;u=d.start;u--)this.insertItemInDOM(u)}),n!==void 0&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){var i,n,o;const r=this.items[e];if(!r.row)if(t)r.row=t,r.stale=!0;else{const u=this.cache.alloc(r.templateId);r.row=u.row,r.stale||(r.stale=u.isReusingConnectedDomNode)}const a=this.accessibilityProvider.getRole(r.element)||"listitem";r.row.domNode.setAttribute("role",a);const l=this.accessibilityProvider.isChecked(r.element);if(typeof l=="boolean")r.row.domNode.setAttribute("aria-checked",String(!!l));else if(l){const u=h=>r.row.domNode.setAttribute("aria-checked",String(!!h));u(l.value),r.checkedDisposable=l.onDidChange(()=>u(l.value))}if(r.stale||!r.row.domNode.parentElement){const u=(o=(n=(i=this.items.at(e+1))===null||i===void 0?void 0:i.row)===null||n===void 0?void 0:n.domNode)!==null&&o!==void 0?o:null;(r.row.domNode.parentElement!==this.rowsContainer||r.row.domNode.nextElementSibling!==u)&&this.rowsContainer.insertBefore(r.row.domNode,u),r.stale=!1}this.updateItemInDOM(r,e);const c=this.renderers.get(r.templateId);if(!c)throw new Error(`No renderer found for template id ${r.templateId}`);c==null||c.renderElement(r.element,e,r.row.templateData,r.size);const d=this.dnd.getDragURI(r.element);r.dragStartDisposable.dispose(),r.row.domNode.draggable=!!d,d&&(r.dragStartDisposable=j(r.row.domNode,"dragstart",u=>this.onDragStart(r.element,d,u))),this.horizontalScrolling&&(this.measureItemWidth(r),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=ev(e.row.domNode);const t=be(e.row.domNode).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.checkedDisposable.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.paddingBottom}get onMouseClick(){return te.map(this.disposables.add(new Ue(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return te.map(this.disposables.add(new Ue(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return te.filter(te.map(this.disposables.add(new Ue(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return te.map(this.disposables.add(new Ue(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return te.map(this.disposables.add(new Ue(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return te.map(this.disposables.add(new Ue(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return te.any(te.map(this.disposables.add(new Ue(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),te.map(this.disposables.add(new Ue(this.domNode,It.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return te.map(this.disposables.add(new Ue(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return te.map(this.disposables.add(new Ue(this.rowsContainer,It.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],n=i&&i.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,sector:o}}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){var n,o;if(!i.dataTransfer)return;const r=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(pR.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(r,i)),typeof a>"u"&&(a=String(r.length));const l=De(".monaco-drag-image");l.textContent=a;const d=(u=>{for(;u&&!u.classList.contains("monaco-workbench");)u=u.parentElement;return u||this.domNode.ownerDocument})(this.domNode);d.appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>d.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new tm(r),jl.CurrentDragAndDropData=new Ij(r),(o=(n=this.dnd).onDragStart)===null||o===void 0||o.call(n,this.currentDragData,i)}onDragOver(e){var t,i;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),jl.CurrentDragAndDropData&&jl.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(jl.CurrentDragAndDropData)this.currentDragData=jl.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new Nj}const n=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof n=="boolean"?n:n.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof n!="boolean"&&((t=n.effect)===null||t===void 0?void 0:t.type)===0?"copy":"move";let o;typeof n!="boolean"&&n.feedback?o=n.feedback:typeof e.index>"u"?o=[-1]:o=[e.index],o=Nc(o).filter(a=>a>=-1&&aa-l),o=o[0]===-1?[-1]:o;let r=typeof n!="boolean"&&n.effect&&n.effect.position?n.effect.position:"drop-target";if(Tj(this.currentDragFeedback,o)&&this.currentDragFeedbackPosition===r)return!0;if(this.currentDragFeedback=o,this.currentDragFeedbackPosition=r,this.currentDragFeedbackDisposable.dispose(),o[0]===-1)this.domNode.classList.add(r),this.rowsContainer.classList.add(r),this.currentDragFeedbackDisposable=Be(()=>{this.domNode.classList.remove(r),this.rowsContainer.classList.remove(r)});else{if(o.length>1&&r!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");r==="drop-target-after"&&o[0]{var a;for(const l of o){const c=this.items[l];c.dropTarget=!1,(a=c.row)===null||a===void 0||a.domNode.classList.remove(r)}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=IC(()=>this.clearDragOverFeedback(),100,this.disposables),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.domNode.classList.remove("dragging"),this.currentDragData=void 0,jl.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,jl.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=G.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=MO(this.domNode).top;this.dragOverAnimationDisposable=jO(be(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=IC(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),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)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,n=Math.floor(i/.25);return Pn(n,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;Vi(i)&&i!==this.rowsContainer&&t.contains(i);){const n=i.getAttribute("data-index");if(n){const o=Number(n);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,r;e===this.elementTop(n.start)?(o=n.start,r=0):n.end-n.start>1&&(o=n.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=h.start;f--)this.insertItemInDOM(f);for(let h=l.start;hs===e;function rne(s=Bo){return(e,t)=>Wi(e,t,s)}function ane(){return(s,e)=>s.equals(e)}function lne(s,e,t){return!s||!e?s===e:t(s,e)}class zn{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return Mj(e,this)}}const $E=new Map,Xw=new WeakMap;function Mj(s,e){var t;const i=Xw.get(s);if(i)return i;const n=Rj(s,e);if(n){let o=(t=$E.get(n))!==null&&t!==void 0?t:0;o++,$E.set(n,o);const r=o===1?n:`${n}#${o}`;return Xw.set(s,r),r}}function Rj(s,e){const t=Xw.get(s);if(t)return t;const i=e.owner?Fj(e.owner)+".":"";let n;const o=e.debugNameSource;if(o!==void 0)if(typeof o=="function"){if(n=o(),n!==void 0)return i+n}else return i+o;const r=e.referenceFn;if(r!==void 0&&(n=d1(r),n!==void 0))return i+n;if(e.owner!==void 0){const a=Pj(e.owner,s);if(a!==void 0)return i+a}}function Pj(s,e){for(const t in s)if(s[t]===e)return t}const KE=new Map,jE=new WeakMap;function Fj(s){var e;const t=jE.get(s);if(t)return t;const i=Oj(s);let n=(e=KE.get(i))!==null&&e!==void 0?e:0;n++,KE.set(i,n);const o=n===1?i:`${i}#${n}`;return jE.set(s,o),o}function Oj(s){const e=s.constructor;return e?e.name:"Object"}function d1(s){const e=s.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),n=i?i[1]:void 0;return n==null?void 0:n.trim()}let Bj;function wr(){return Bj}let vR;function Wj(s){vR=s}let bR;function Vj(s){bR=s}class CR{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,n=t===void 0?e:t;return bR({owner:i,debugName:()=>{const o=d1(n);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(n.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:n},o=>n(this.read(o),o))}recomputeInitiallyAndOnChange(e,t){return e.add(vR(this,t)),this}}class im extends CR{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Ti(s,e){const t=new u1(s,e);try{s(t)}finally{t.finish()}}let sp;function Rp(s){if(sp)s(sp);else{const e=new u1(s,void 0);sp=e;try{s(e)}finally{e.finish(),sp=void 0}}}async function cne(s,e){const t=new u1(s,e);try{await s(t)}finally{t.finish()}}function JL(s,e,t){s?e(s):Ti(e,t)}class u1{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=wr())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():d1(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;for(let i=0;i{},()=>`Setting ${this.debugName}`));try{const r=this._value;this._setValue(e),(n=wr())===null||n===void 0||n.handleObservableChanged(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function Hj(s,e){let t;return typeof s=="string"?t=new zn(void 0,s,void 0):t=new zn(s,void 0,void 0),new zj(t,e,Bo)}class zj extends ek{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}function He(s,e){return e!==void 0?new Vc(new zn(s,void 0,e),e,void 0,void 0,void 0,Bo):new Vc(new zn(void 0,void 0,s),s,void 0,void 0,void 0,Bo)}function wR(s,e,t){return new Uj(new zn(s,void 0,e),e,void 0,void 0,void 0,Bo,t)}function tk(s,e){var t;return new Vc(new zn(s.owner,s.debugName,s.debugReferenceFn),e,void 0,void 0,s.onLastObserverRemoved,(t=s.equalsFn)!==null&&t!==void 0?t:Bo)}Vj(tk);function une(s,e){var t;return new Vc(new zn(s.owner,s.debugName,void 0),e,s.createEmptyChangeSummary,s.handleChange,void 0,(t=s.equalityComparer)!==null&&t!==void 0?t:Bo)}function sh(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);const n=new pe;return new Vc(new zn(i,void 0,t),o=>(n.clear(),t(o,n)),void 0,void 0,()=>n.dispose(),Bo)}function tr(s,e){let t,i;e===void 0?(t=s,i=void 0):(i=s,t=e);const n=new pe;return new Vc(new zn(i,void 0,t),o=>{n.clear();const r=t(o);return r&&n.add(r),r},void 0,void 0,()=>n.dispose(),Bo)}class Vc extends im{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,n,o=void 0,r){var a,l;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=n,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(a=this.createChangeSummary)===null||a===void 0?void 0:a.call(this),(l=wr())===null||l===void 0||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const n=this.state!==0,o=this.value;this.state=3;const r=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,r)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=n&&!this._equalityComparator(o,this.value);if((t=wr())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:n}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}Pc(()=>this.updateCount>=0)}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,n=this.state===3;if(i&&(this.state===1||n)&&(this.state=2,n))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}class Uj extends Vc{constructor(e,t,i,n,o=void 0,r,a){super(e,t,i,n,o,r),this.set=a}}function _t(s){return new f1(new zn(void 0,void 0,s),s,void 0,void 0)}function ik(s,e){var t;return new f1(new zn(s.owner,s.debugName,(t=s.debugReferenceFn)!==null&&t!==void 0?t:e),e,void 0,void 0)}function h1(s,e){var t;return new f1(new zn(s.owner,s.debugName,(t=s.debugReferenceFn)!==null&&t!==void 0?t:e),e,s.createEmptyChangeSummary,s.handleChange)}function kr(s){const e=new pe,t=ik({owner:void 0,debugName:void 0,debugReferenceFn:s},i=>{e.clear(),s(i,e)});return Be(()=>{t.dispose(),e.dispose()})}class f1{get debugName(){var e;return(e=this._debugNameData.getDebugName(this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,n){var o,r;this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=n,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(r=wr())===null||r===void 0||r.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,i;if(this.state===3)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n,this.state=3;const o=this.disposed;try{if(!o){(e=wr())===null||e===void 0||e.handleAutorunTriggered(this);const r=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,r)}}finally{o||(i=wr())===null||i===void 0||i.handleAutorunFinished(this);for(const r of this.dependenciesToBeRemoved)r.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,Pc(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:n=>n===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(s){s.Observer=f1})(_t||(_t={}));function q_(s){return new $j(s)}class $j extends CR{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function wi(s,e){return new mc(s,e)}class mc extends im{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{var n;const o=this._getValue(i),r=this.value,a=!this.hasValue||r!==o;let l=!1;a&&(this.value=o,this.hasValue&&(l=!0,JL(mc.globalTransaction,c=>{var d;(d=wr())===null||d===void 0||d.handleFromEventObservableTriggered(this,{oldValue:r,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue});for(const u of this.observers)c.updateObserver(u,this),u.handleChange(this,void 0)},()=>{const c=this.getDebugName();return"Event fired"+(c?`: ${c}`:"")})),this.hasValue=!0),l||(n=wr())===null||n===void 0||n.handleFromEventObservableTriggered(this,{oldValue:r,newValue:o,change:void 0,didChange:a,hadValue:this.hasValue})}}getDebugName(){return d1(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(s){s.Observer=mc;function e(t,i){let n=!1;mc.globalTransaction===void 0&&(mc.globalTransaction=t,n=!0);try{i()}finally{n&&(mc.globalTransaction=void 0)}}s.batchEventsGlobally=e})(wi||(wi={}));function Rs(s,e){return new Kj(s,e)}class Kj extends im{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Ti(i=>{for(const n of this.observers)i.updateObserver(n,this),n.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function yR(s){return typeof s=="string"?new qE(s):new qE(void 0,s)}class qE extends im{get debugName(){var e;return(e=new zn(this._owner,this._debugName,void 0).getDebugName(this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Ti(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function g1(s,e){const t=new jj(!0,e);return s.addObserver(t),e?e(s.get()):s.reportChanges(),Be(()=>{s.removeObserver(t)})}Wj(g1);class jj{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function hne(s,e){let t;return He(s,n=>(t=e(n,t),t))}function fne(s,e,t,i){let n=new GE(t,i);return tk({debugReferenceFn:t,owner:s,onLastObserverRemoved:()=>{n.dispose(),n=new GE(t)}},r=>(n.setItems(e.read(r)),n.getItems()))}class GE{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const n of e){const o=this._keySelector?this._keySelector(n):n;let r=this._cache.get(o);if(r)i.delete(o);else{const a=new pe;r={out:this._map(n,a),store:a},this._cache.set(o,r)}t.push(r.out)}for(const n of i)this._cache.get(n).store.dispose(),this._cache.delete(n);this._items=t}getItems(){return this._items}}function qj(s,e,t,i){return e||(e=n=>n!=null),new Promise((n,o)=>{let r=!0,a=!1;const l=s.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),c=_t(d=>{const{isFinished:u,error:h,state:f}=l.read(d);(u||h)&&(r?a=!0:c.dispose(),h?o(h===!0?f:h):n(f))});if(i){const d=i.onCancellationRequested(()=>{c.dispose(),d.dispose(),o(new wl)});if(i.isCancellationRequested){c.dispose(),d.dispose(),o(new wl);return}}r=!1,a&&c.dispose()})}var Ol=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class Gj{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex(o=>o.templateData===i);if(n>=0){const o=this.renderedElements[n];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}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)}}let G_=class{get name(){return this._trait}get renderer(){return new Gj(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new O,this.onChange=this._onChange.event}splice(e,t,i){const n=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+n);this.renderer.splice(e,t,i.length),this._set(r,r)}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(YE),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=Jw(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return f5(this.sortedIndexes,e,YE)>=0}dispose(){Hi(this._onChange)}};Ol([Jt],G_.prototype,"renderer",null);class Zj extends G_{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 eb{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,new Array(i.length).fill(!1));const n=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(n.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(n),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function vl(s){return s.tagName==="INPUT"||s.tagName==="TEXTAREA"}function nm(s,e){return s.classList.contains(e)?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:nm(s.parentElement,e)}function Xh(s){return nm(s,"monaco-editor")}function Yj(s){return nm(s,"monaco-custom-toggle")}function Qj(s){return nm(s,"action-item")}function Ef(s){return nm(s,"monaco-tree-sticky-row")}function gg(s){return s.classList.contains("monaco-tree-sticky-container")}function SR(s){return s.tagName==="A"&&s.classList.contains("monaco-button")||s.tagName==="DIV"&&s.classList.contains("monaco-button-dropdown")?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:SR(s.parentElement)}class LR{get onKeyDown(){return te.chain(this.disposables.add(new Ue(this.view.domNode,"keydown")).event,e=>e.filter(t=>!vl(t.target)).map(t=>new Ot(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new pe,this.multipleSelectionDisposables=new pe,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(n=>{switch(n.keyCode){case 3:return this.onEnter(n);case 16:return this.onUpArrow(n);case 18:return this.onDownArrow(n);case 11:return this.onPageUpArrow(n);case 12:return this.onPageDownArrow(n);case 9:return this.onEscape(n);case 31:this.multipleSelectionSupport&&(Ye?n.metaKey:n.ctrlKey)&&this.onCtrlA(n)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}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(Rn(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()}}Ol([Jt],LR.prototype,"onKeyDown",null);var ur;(function(s){s[s.Automatic=0]="Automatic",s[s.Trigger=1]="Trigger"})(ur||(ur={}));var jd;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(jd||(jd={}));const Xj=new class{mightProducePrintableCharacter(s){return s.ctrlKey||s.metaKey||s.altKey?!1:s.keyCode>=31&&s.keyCode<=56||s.keyCode>=21&&s.keyCode<=30||s.keyCode>=98&&s.keyCode<=107||s.keyCode>=85&&s.keyCode<=95}};class Jj{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=jd.Idle,this.mode=ur.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new pe,this.disposables=new pe,this.updateOptions(e.options)}updateOptions(e){var t,i;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(i=e.typeNavigationMode)!==null&&i!==void 0?i:ur.Automatic}enable(){if(this.enabled)return;let e=!1;const t=te.chain(this.enabledDisposables.add(new Ue(this.view.domNode,"keydown")).event,o=>o.filter(r=>!vl(r.target)).filter(()=>this.mode===ur.Automatic||this.triggered).map(r=>new Ot(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>Ge.stop(r,!0)).map(r=>r.browserEvent.key)),i=te.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);te.reduce(te.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,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]));typeof i=="string"?iw(i):i&&iw(i.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=jd.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===jd.Idle?1:0;this.state=jd.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||V_(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class eq{constructor(e,t){this.list=e,this.view=t,this.disposables=new pe;const i=te.chain(this.disposables.add(new Ue(t.domNode,"keydown")).event,o=>o.filter(r=>!vl(r.target)).map(r=>new Ot(r)));te.chain(i,o=>o.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(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 n=i.querySelector("[tabIndex]");if(!n||!Vi(n)||n.tabIndex===-1)return;const o=be(n).getComputedStyle(n);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function kR(s){return Ye?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function DR(s){return s.browserEvent.shiftKey}function tq(s){return jS(s)&&s.button===2}const ZE={isSelectionSingleChangeEvent:kR,isSelectionRangeChangeEvent:DR};class xR{constructor(e){this.list=e,this.disposables=new pe,this._onPointer=new O,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||ZE),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(Ft.addTarget(e.getHTMLElement()))),te.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||ZE))}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){Xh(e.browserEvent.target)||vn()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(vl(e.browserEvent.target)||Xh(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||vl(e.browserEvent.target)||Xh(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;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.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),tq(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(vl(e.browserEvent.target)||Xh(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;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 d=this.list.getFocus()[0];i=d??t,this.list.setAnchor(i)}const n=Math.min(i,t),o=Math.max(i,t),r=Rn(n,o+1),a=this.list.getSelection(),l=sq(Jw(a,[i]),i);if(l.length===0)return;const c=Jw(r,oq(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const n=this.list.getSelection(),o=n.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),n.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class ER{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const n=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${n} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${n}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${n}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${n}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` .monaco-drag-image, .monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&o.push(` .monaco-drag-image, .monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } `),e.listInactiveFocusForeground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const r=ga(e.listFocusAndSelectionOutline,ga(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(` .monaco-drag-image, .monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } `);const a=ga(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&o.push(` .monaco-list${n}.drop-target, .monaco-list${n} .monaco-list-rows.drop-target, .monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } `),e.listDropBetweenBackground&&(o.push(` .monaco-list${n} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before, .monaco-list${n} .monaco-list-row.drop-target-before::before { content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`),o.push(` .monaco-list${n} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after, .monaco-list${n} .monaco-list-row.drop-target-after::after { content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`)),e.tableColumnsBorder&&o.push(` .monaco-table > .monaco-split-view2, .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { border-color: ${e.tableColumnsBorder}; } .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before { border-color: transparent; } `),e.tableOddRowsBackgroundColor&&o.push(` .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr { background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=o.join(` `)}}const iq={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:K.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:K.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:K.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},nq={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function sq(s,e){const t=s.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&s[n]===e-(t-n);)i.push(s[n--]);for(i.reverse(),n=t;n=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){t.push(s[i]),i++,n++;continue}else s[i]=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){i++,n++;continue}else s[i]s-e;class rq{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,n){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){var o;let r=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[r],n),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class aq{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new pe}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),o=n&&typeof n!="string"?n:q_(n);i.disposables.add(_t(a=>{this.setAriaLabel(a.readObservable(o),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,n){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class lq{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){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,e,t)}onDragOver(e,t,i,n,o){return this.dnd.onDragOver(e,t,i,n,o)}onDragLeave(e,t,i,n){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,n)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,n,o){this.dnd.drop(e,t,i,n,o)}dispose(){this.dnd.dispose()}}class Ko{get onDidChangeFocus(){return te.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return te.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}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 onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=te.chain(this.disposables.add(new Ue(this.view.domNode,"keydown")).event,o=>o.map(r=>new Ot(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Ge.stop(r,!0)).filter(()=>!1)),i=te.chain(this.disposables.add(new Ue(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new Ot(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Ge.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),n=te.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new Io(be(this.view.domNode),l),browserEvent:l})));return te.any(t,i,n)}get onKeyDown(){return this.disposables.add(new Ue(this.view.domNode,"keydown")).event}get onDidFocus(){return te.signal(this.disposables.add(new Ue(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return te.signal(this.disposables.add(new Ue(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,o=nq){var r,a,l,c;this.user=e,this._options=o,this.focus=new G_("focused"),this.anchor=new G_("anchor"),this.eventBufferer=new E0,this._ariaLabel="",this.disposables=new pe,this._onDidDispose=new O,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new Zj(d!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(u.push(new aq(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(f=>new rq(f.templateId,[...u,f]));const h={...o,dnd:o.dnd&&new lq(this,o.dnd)};if(this.view=this.createListView(t,i,n,h),this.view.domNode.setAttribute("role",d),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=ys(this.view.domNode);this.styleController=new ER(f,this.view.domId)}if(this.spliceable=new Sj([new eb(this.focus,this.view,o.identityProvider),new eb(this.selection,this.view,o.identityProvider),new eb(this.anchor,this.view,o.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 eq(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new LR(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||Xj;this.typeNavigationController=new Jj(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),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")}createListView(e,t,i,n){return new Ks(e,t,i,n)}createMouseController(e){return new xR(this)}updateOptions(e={}){var t,i;this._options={...this._options,...e},(t=this.typeNavigationController)===null||t===void 0||t.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),(i=this.keyboardController)===null||i===void 0||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new Kl(this.user,`Invalid start index: ${e}`);if(t<0)throw new Kl(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)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}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 Kl(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 Kl(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return fS(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 Kl(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,n);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,n){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const n=this.getFocus()[0];if(n!==i&&(n===void 0||i>n)){const o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>n&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await Of(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const o=i(),r=this.view.getScrollTop()+o;r===0?n=this.view.indexAt(r):n=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==n&&(a===void 0||a>=n)){const l=this.findNextIndex(n,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([n],e)}else{const l=r;this.view.setScrollTop(r-this.view.renderHeight-o),this.view.getScrollTop()+i()!==l&&(this.setFocus([]),await Of(0),await this.focusPreviousPage(e,t,i))}}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 n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n=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 n=0;nthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new Kl(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(Zu(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*Pn(t,0,1)+o-i)}else{const a=o+r,l=n+this.view.renderHeight;o=l||(o=l&&r>=this.view.renderHeight?this.view.setScrollTop(o-i):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new Kl(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(ni+this.view.renderHeight)return null;const r=o-this.view.renderHeight+t;return Math.abs((i+t-n)/r)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}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()}}Ol([Jt],Ko.prototype,"onDidChangeFocus",null);Ol([Jt],Ko.prototype,"onDidChangeSelection",null);Ol([Jt],Ko.prototype,"onContextMenu",null);Ol([Jt],Ko.prototype,"onKeyDown",null);Ol([Jt],Ko.prototype,"onDidFocus",null);Ol([Jt],Ko.prototype,"onDidBlur",null);const pc=De,IR="selectOption.entry.template";class cq{get templateId(){return IR}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=he(e,pc(".option-text")),t.detail=he(e,pc(".option-detail")),t.decoratorRight=he(e,pc(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;n.text.textContent=o,n.detail.textContent=r||"",n.decoratorRight.innerText=a||"",l?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class hr extends G{constructor(e,t,i,n,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=hr.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new O,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(Tr().setupUpdatableHover($s("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return IR}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=De(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=he(this.selectDropDownContainer,pc(".select-box-details-pane"));const t=he(this.selectDropDownContainer,pc(".select-box-dropdown-container-width-control")),i=he(t,pc(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",he(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=ys(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(j(this.selectDropDownContainer,J.DRAG_START,n=>{Ge.stop(n,!0)}))}registerListeners(){this._register(Ai(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(j(this.selectElement,J.CLICK,t=>{Ge.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(j(this.selectElement,J.MOUSE_DOWN,t=>{Ge.stop(t)}));let e;this._register(j(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(j(this.selectElement,"touchend",t=>{Ge.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(j(this.selectElement,J.KEY_DOWN,t=>{const i=new Ot(t);let n=!1;Ye?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(n=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(n=!0),n&&(this.showSelectDropDown(),Ge.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Wi(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` `)}styleSelectElement(){var e,t,i;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",r=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=o,this.selectElement.style.borderColor=r}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",n=ga(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=be(this.selectElement),i=Fs(this.selectElement),n=be(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-hr.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let u=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const h=this._hasDetails?this._cachedMaxDetailsHeight:0,f=u+o+h,g=Math.floor((r-o-h)/this.getHeight()),m=Math.floor((a-o-h)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topg&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(u=g*this.getHeight())}else f>a&&(u=m*this.getHeight());return this.selectList.layout(u),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=u+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=u+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>n&&(i=r,n=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=zS(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=he(e,pc(".select-box-dropdown-list-container")),this.listRenderer=new cq,this.selectList=new Ko("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:n=>{let o=n.text;return n.detail&&(o+=`. ${n.detail}`),n.decoratorRight&&(o+=`. ${n.decoratorRight}`),n.description&&(o+=`. ${n.description}`),o},getWidgetAriaLabel:()=>p({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Ye?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new Ue(this.selectDropDownListContainer,"keydown")),i=te.chain(t.event,n=>n.filter(()=>this.selectList.length>0).map(o=>new Ot(o)));this._register(te.chain(i,n=>n.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(te.chain(i,n=>n.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(te.chain(i,n=>n.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(te.chain(i,n=>n.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(te.chain(i,n=>n.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(te.chain(i,n=>n.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(te.chain(i,n=>n.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(te.chain(i,n=>n.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(te.chain(i,n=>n.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(te.chain(i,n=>n.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(j(this.selectList.getHTMLElement(),J.POINTER_UP,n=>this.onPointerUp(n))),this._register(this.selectList.onMouseOver(n=>typeof n.index<"u"&&this.selectList.setFocus([n.index]))),this._register(this.selectList.onDidChangeFocus(n=>this.onListFocus(n))),this._register(j(this.selectDropDownContainer,J.FOCUS_OUT,n=>{!this._isVisible||Ni(n.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Ge.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");n>=0&&n{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(Ge.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){Ge.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){Ge.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Ge.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Yr.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(j(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Ai(this.selectElement,"click",e=>{Ge.stop(e,!0)})),this._register(Ai(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Ai(this.selectElement,"keydown",e=>{let t=!1;Ye?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Wi(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,n)=>{this.selectElement.add(this.createOption(i.text,n,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(n)}))}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 Rc)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Ft.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,lo&&this._register(j(e,J.DRAG_START,n=>{var o;return(o=n.dataTransfer)===null||o===void 0?void 0:o.setData(pR.TEXT,this._action.label)}))),this._register(j(t,It.Tap,n=>this.onClick(n,!0))),this._register(j(t,J.MOUSE_DOWN,n=>{i||Ge.stop(n,!0),this._action.enabled&&n.button===0&&t.classList.add("active")})),Ye&&this._register(j(t,J.CONTEXT_MENU,n=>{n.button===0&&n.ctrlKey===!0&&this.onClick(n)})),this._register(j(t,J.CLICK,n=>{Ge.stop(n,!0),this.options&&this.options.isMenu||this.onClick(n)})),this._register(j(t,J.DBLCLICK,n=>{Ge.stop(n,!0)})),[J.MOUSE_UP,J.MOUSE_OUT].forEach(n=>{this._register(j(t,n,o=>{Ge.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;Ge.stop(e,!0);const n=gs(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}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(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var e,t,i;if(!this.element)return;const n=(e=this.getTooltip())!==null&&e!==void 0?e:"";if(this.updateAriaLabel(),!((t=this.options.hoverDelegate)===null||t===void 0)&&t.showNativeHover)this.element.title=n;else if(!this.customHover&&n!==""){const o=(i=this.options.hoverDelegate)!==null&&i!==void 0?i:$s("element");this.customHover=this._store.add(Tr().setupUpdatableHover(o,this.element,n))}else this.customHover&&this.customHover.update(n)}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class nk extends ko{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),vr(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===qi.ID?"presentation":this.options.isMenu?"menuitem":"button"}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.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=p({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.removeAttribute("aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class hq extends ko{constructor(e,t,i,n,o,r,a){super(e,t),this.selectBox=new uq(i,n,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class fq extends Rc{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new O),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=he(e,De(".monaco-dropdown")),this._label=he(this._element,De(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[J.CLICK,J.MOUSE_DOWN,It.Tap])this._register(j(this.element,o,r=>Ge.stop(r,!0)));for(const o of[J.MOUSE_DOWN,It.Tap])this._register(j(this._label,o,r=>{jS(r)&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(j(this._label,J.KEY_UP,o=>{const r=new Ot(o);(r.equals(3)||r.equals(10))&&(Ge.stop(o,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(Ft.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 gq extends fq{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class Z_ extends ko{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new O),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{var r;this.element=he(o,De("a.action-label"));let a=[];return typeof this.options.classNames=="string"?a=this.options.classNames.split(/\s+/g).filter(l=>!!l):this.options.classNames&&(a=this.options.classNames),a.find(l=>l==="icon")||a.push("codicon"),this.element.classList.add(...a),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(Tr().setupUpdatableHover((r=this.options.hoverDelegate)!==null&&r!==void 0?r:$s("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),n={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new gq(e,n)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const i=!this.action.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)}}function mne(s){return s&&typeof s=="object"&&typeof s.original=="string"&&typeof s.value=="string"}function mq(s){return s?s.condition!==void 0:!1}var hu;(function(s){s[s.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",s[s.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(hu||(hu={}));var qd;(function(s){s[s.None=0]="None",s[s.Initialized=1]="Initialized",s[s.Closed=2]="Closed"})(qd||(qd={}));class fu extends G{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Rf),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=qd.None,this.cache=new Map,this.flushDelayer=this._register(new gT(fu.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;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((n,o)=>this.acceptExternal(o,n)),(i=e.deleted)===null||i===void 0||i.forEach(n=>this.acceptExternal(n,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===qd.Closed)return;let i=!1;gs(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return gs(i)?t:i}getBoolean(e,t){const i=this.get(e);return gs(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return gs(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===qd.Closed)return;if(gs(t))return this.delete(e,i);const n=Yn(t)||Array.isArray(t)?Z$(t):String(t);if(this.cache.get(e)!==n)return this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===qd.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){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()})}async doFlush(e){return this.options.hint===hu.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}}fu.DEFAULT_FLUSH_DELAY=100;class tb{constructor(){this.onDidChangeItemsExternal=te.None,this.items=new Map}async updateItems(e){var t,i;(t=e.insert)===null||t===void 0||t.forEach((n,o)=>this.items.set(o,n)),(i=e.delete)===null||i===void 0||i.forEach(n=>this.items.delete(n))}}const Pp="__$__targetStorageMarker",m1=Qe("storageService");var QE;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(QE||(QE={}));function pq(s){const e=s.get(Pp);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class p1 extends G{constructor(e={flushInterval:p1.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Rf),this._onDidChangeTarget=this._register(new Rf),this._onWillSaveState=this._register(new O),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return te.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===Pp){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){var n;return(n=this.getStorage(t))===null||n===void 0?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return(n=this.getStorage(t))===null||n===void 0?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return(n=this.getStorage(t))===null||n===void 0?void 0:n.getNumber(e,i)}store(e,t,i,n,o=!1){if(gs(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,n),(r=this.getStorage(i))===null||r===void 0||r.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var n;this.updateKeyTarget(e,t,void 0),(n=this.getStorage(t))===null||n===void 0||n.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){var o,r;const a=this.getKeyTargets(t);typeof i=="number"?a[e]!==i&&(a[e]=i,(o=this.getStorage(t))===null||o===void 0||o.set(Pp,JSON.stringify(a),n)):typeof a[e]=="number"&&(delete a[e],(r=this.getStorage(t))===null||r===void 0||r.set(Pp,JSON.stringify(a),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?pq(t):Object.create(null)}}p1.DEFAULT_FLUSH_INTERVAL=60*1e3;class _q extends p1{constructor(){super(),this.applicationStorage=this._register(new fu(new tb,{hint:hu.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new fu(new tb,{hint:hu.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new fu(new tb,{hint:hu.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function vq(s,e){const t={...e};for(const i in s){const n=s[i];t[i]=n!==void 0?ne(n):void 0}return t}const bq={keybindingLabelBackground:ne(w6),keybindingLabelForeground:ne(y6),keybindingLabelBorder:ne(S6),keybindingLabelBottomBorder:ne(L6),keybindingLabelShadow:ne(sl)},Cq={buttonForeground:ne(Uh),buttonSeparator:ne(f6),buttonBackground:ne($h),buttonHoverBackground:ne(g6),buttonSecondaryForeground:ne(p6),buttonSecondaryBackground:ne(rw),buttonSecondaryHoverBackground:ne(_6),buttonBorder:ne(m6)},wq={progressBarBackground:ne(T8)},NR={inputActiveOptionBorder:ne(e6),inputActiveOptionForeground:ne(i6),inputActiveOptionBackground:ne(t6)};ne(v6),ne(C6),ne(b6);ne(bi),ne(sa),ne(sl),ne(tt),ne(U8),ne($8),ne(K8),ne(I8);const TR={inputBackground:ne(Q8),inputForeground:ne(X8),inputBorder:ne(J8),inputValidationInfoBorder:ne(o6),inputValidationInfoBackground:ne(n6),inputValidationInfoForeground:ne(s6),inputValidationWarningBorder:ne(l6),inputValidationWarningBackground:ne(r6),inputValidationWarningForeground:ne(a6),inputValidationErrorBorder:ne(u6),inputValidationErrorBackground:ne(c6),inputValidationErrorForeground:ne(d6)},yq={listFilterWidgetBackground:ne(F6),listFilterWidgetOutline:ne(O6),listFilterWidgetNoMatchesOutline:ne(B6),listFilterWidgetShadow:ne(W6),inputBoxStyles:TR,toggleStyles:NR},Sq={badgeBackground:ne(kp),badgeForeground:ne(N8),badgeBorder:ne(tt)};ne(H8),ne(V8),ne($x),ne($x),ne(z8);const oh={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ne(k6),listFocusForeground:ne(D6),listFocusOutline:ne(x6),listActiveSelectionBackground:ne(aa),listActiveSelectionForeground:ne(mr),listActiveSelectionIconForeground:ne(Kh),listFocusAndSelectionOutline:ne(E6),listFocusAndSelectionBackground:ne(aa),listFocusAndSelectionForeground:ne(mr),listInactiveSelectionBackground:ne(I6),listInactiveSelectionIconForeground:ne(T6),listInactiveSelectionForeground:ne(N6),listInactiveFocusBackground:ne(A6),listInactiveFocusOutline:ne(M6),listHoverBackground:ne(PA),listHoverForeground:ne(FA),listDropOverBackground:ne(R6),listDropBetweenBackground:ne(P6),listSelectionOutline:ne(si),listHoverOutline:ne(si),treeIndentGuidesStroke:ne(jh),treeInactiveIndentGuidesStroke:ne(V6),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0,tableColumnsBorder:ne(H6),tableOddRowsBackgroundColor:ne(z6)};function sm(s){return vq(s,oh)}const Lq={selectBackground:ne(gr),selectListBackground:ne(h6),selectForeground:ne(ra),decoratorRightForeground:ne(OA),selectBorder:ne(Wd),focusBorder:ne(Ws),listFocusBackground:ne(lw),listInactiveSelectionIconForeground:ne(BA),listFocusForeground:ne(aw),listFocusOutline:k8(si,K.transparent.toString()),listHoverBackground:ne(PA),listHoverForeground:ne(FA),listHoverOutline:ne(si),selectListBorder:ne(zh),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},kq={shadowColor:ne(sl),borderColor:ne(U6),foregroundColor:ne($6),backgroundColor:ne(K6),selectionForegroundColor:ne(j6),selectionBackgroundColor:ne(q6),selectionBorderColor:ne(G6),separatorColor:ne(Z6),scrollbarShadow:ne(Bh),scrollbarSliderBackground:ne(Wh),scrollbarSliderHoverBackground:ne(Vh),scrollbarSliderActiveBackground:ne(Hh)};var _1=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},On=function(s,e){return function(t,i){e(t,i,s)}};function Dq(s,e,t,i){const n=s.getActions(e),o=Ja.getInstance(),r=o.keyStatus.altKey||(Wn||Vn)&&o.keyStatus.shiftKey;AR(n,t,r,a=>a==="navigation")}function xq(s,e,t,i,n,o){const r=s.getActions(e);AR(r,t,!1,typeof i=="string"?l=>l===i:i,n,o)}function AR(s,e,t,i=r=>r==="navigation",n=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of s){let u;i(c)?(u=r,u.length>0&&o&&u.push(new qi)):(u=a,u.length>0&&u.push(new qi));for(let h of d){t&&(h=h instanceof pa&&h.alt?h.alt:h);const f=u.push(h);h instanceof R0&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:d,index:u}of l){const h=i(c)?r:a,f=d.actions;n(d,c,h.length)&&h.splice(u,1,...f)}}let mg=class extends nk{constructor(e,t,i,n,o,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Ca),this._altKey=Ja.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var n;const o=!!(!((n=this._menuItemAction.alt)===null||n===void 0)&&n.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(j(e,"mouseleave",n=>{t=!1,i()})),this._register(j(e,"mouseenter",n=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let o=i?p("titleAndKb","{0} ({1})",n,i):n;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?p("titleAndKb","{0} ({1})",r,l):r;o=p("titleAndKbAndAlt",`{0} [{1}] {2}`,o,ZL.modifierLabels[to].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&mq(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(et.isThemeIcon(n)){const o=et.asClassNameArray(n);i.classList.add(...o),this._itemClassDispose.value=Be(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=e1(this._themeService.getColorTheme().type)?Sa(n.dark):Sa(n.light),i.classList.add("icon"),this._itemClassDispose.value=br(Be(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};mg=_1([On(2,Zi),On(3,$o),On(4,bt),On(5,ho),On(6,Da),On(7,Uo)],mg);let ey=class extends Z_{constructor(e,t,i,n,o){var r,a,l;const c={...t,menuAsChild:(r=t==null?void 0:t.menuAsChild)!==null&&r!==void 0?r:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:et.isThemeIcon(e.item.icon)?et.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:d=>i.lookupKeybinding(d.id)};super(e,{getActions:()=>e.actions},n,c),this._keybindingService=i,this._contextMenuService=n,this._themeService=o}render(e){super.render(e),vr(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!et.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=e1(this._themeService.getColorTheme().type)?Sa(i.dark):Sa(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};ey=_1([On(2,Zi),On(3,Da),On(4,ho)],ey);let ty=class extends ko{constructor(e,t,i,n,o,r,a,l){var c,d,u;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(m=>f===m.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(mg,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g={keybindingProvider:m=>this._keybindingService.lookupKeybinding(m.id),...t,menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(d=t==null?void 0:t.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(u=t==null?void 0:t.actionRunner)!==null&&u!==void 0?u:new Rc};this._dropdown=new Z_(e,e.actions,this._contextMenuService,g),this._register(this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof pa&&this.update(m.action)}))}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(mg,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Rc{async runAction(i,n){await i.run(void 0)}},this._container&&this._defaultAction.render(qS(this._container,De(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const n=this._keybindingService.lookupKeybinding(e.id);n&&(i=`(${n.getLabel()})`)}return i}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=De(".action-container");this._defaultAction.render(he(this._container,t)),this._register(j(t,J.KEY_DOWN,n=>{const o=new Ot(n);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=De(".dropdown-action-container");this._dropdown.render(he(this._container,i)),this._register(j(i,J.KEY_DOWN,n=>{var o;const r=new Ot(n);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),r.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()}};ty=_1([On(2,Zi),On(3,$o),On(4,Da),On(5,Jc),On(6,vt),On(7,m1)],ty);let iy=class extends hq{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===qi.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,Lq,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=ne(Wd)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};iy=_1([On(1,Jg)],iy);function Eq(s,e,t){return e instanceof pa?s.createInstance(mg,e,t):e instanceof lf?e.item.isSelection?s.createInstance(iy,e):e.item.rememberDefaultAction?s.createInstance(ty,e,{...t,persistLastActionId:!0}):s.createInstance(ey,e,t):void 0}class Il extends G{constructor(e,t={}){var i,n,o,r,a,l,c;super(),this._actionRunnerDisposables=this._register(new pe),this.viewItemDisposables=this._register(new wS),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new O),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new O({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new O),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new O),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(n=this.options.orientation)!==null&&n!==void 0?n:0,this._triggerKeys={keyDown:(r=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&r!==void 0?r:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this._hoverDelegate=(c=t.hoverDelegate)!==null&&c!==void 0?c:this._register(XL()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Rc,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(h=>this._onDidRun.fire(h))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(h=>this._onWillRun.fire(h))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let d,u;switch(this._orientation){case 0:d=[15],u=[17];break;case 1:d=[16],u=[18],this.domNode.className+=" vertical";break}this._register(j(this.domNode,J.KEY_DOWN,h=>{const f=new Ot(h);let g=!0;const m=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;d&&(f.equals(d[0])||f.equals(d[1]))?g=this.focusPrevious():u&&(f.equals(u[0])||f.equals(u[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 ko&&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(j(this.domNode,J.KEY_UP,h=>{const f=new Ot(h);this.isTriggerKeyEvent(f)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(f)),f.preventDefault(),f.stopPropagation()):(f.equals(2)||f.equals(1026)||f.equals(16)||f.equals(18)||f.equals(15)||f.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(Wf(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(vn()===this.domNode||!Ni(vn(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,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.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof ko&&i.isEnabled());t instanceof ko&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof ko&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){var e,t;for(let i=0;it.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(Vi(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new nk(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,j(r,J.CONTEXT_MENU,c=>{Ge.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof ko&&this.viewItems.length===0&&a.setFocusable(!0),n===null||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[n]),this.viewItems.splice(n,0,a),n++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=Hi(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Po(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}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 n=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=n===-1?void 0:n,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===qi.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===qi.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var n,o;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((n=this.viewItems[this.previouslyFocusedItem])===null||n===void 0||n.blur());const r=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(r){let a=!0;$p(r.focus)||(a=!1),this.options.focusOnlyEnabledItems&&$p(r.isEnabled)&&!r.isEnabled()&&(a=!1),r.action.id===qi.ID&&(a=!1),a?(i||this.previouslyFocusedItem!==this.focusedItem)&&(r.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((o=r.showHover)===null||o===void 0||o.call(r))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof ko){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=Hi(this.viewItems),this.getContainer().remove(),super.dispose()}}const ny=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,ib=/(&)?(&)([^\s&])/g;var Y_;(function(s){s[s.Right=0]="Right",s[s.Left=1]="Left"})(Y_||(Y_={}));var sy;(function(s){s[s.Above=0]="Above",s[s.Below=1]="Below"})(sy||(sy={}));class gu extends Il{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Ye||Vn?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(Ft.addTarget(o)),this._register(j(o,J.KEY_DOWN,c=>{new Ot(c).equals(2)&&c.preventDefault()})),i.enableMnemonics&&this._register(j(o,J.KEY_DOWN,c=>{const d=c.key.toLocaleLowerCase();if(this.mnemonics.has(d)){Ge.stop(c,!0);const u=this.mnemonics.get(d);if(u.length===1&&(u[0]instanceof XE&&u[0].container&&this.focusItemByElement(u[0].container),u[0].onClick(c)),u.length>1){const h=u.shift();h&&h.container&&(this.focusItemByElement(h.container),u.push(h)),this.mnemonics.set(d,u)}}})),Vn&&this._register(j(o,J.KEY_DOWN,c=>{const d=new Ot(c);d.equals(14)||d.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Ge.stop(c,!0)):(d.equals(13)||d.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Ge.stop(c,!0))})),this._register(j(this.domNode,J.MOUSE_OUT,c=>{const d=c.relatedTarget;Ni(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(j(this.actionsList,J.MOUSE_OVER,c=>{let d=c.target;if(!(!d||!Ni(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(d),u!==this.focusedItem&&this.updateFocus()}}})),this._register(Ft.addTarget(this.actionsList)),this._register(j(this.actionsList,It.Tap,c=>{let d=c.initialTarget;if(!(!d||!Ni(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(d),u!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new _L(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,n),this._register(j(o,It.Change,c=>{Ge.stop(c,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-c.translationY})})),this._register(j(a,J.MOUSE_UP,c=>{c.preventDefault()}));const l=be(e);o.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,d)=>{var u;return!((u=i.submenuIds)===null||u===void 0)&&u.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof qi&&(d===t.length-1||d===0||t[d-1]instanceof qi))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof JE)).forEach((c,d,u)=>{c.updatePositionInSet(d+1,u.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(i_(e)?this.styleSheet=ys(e):(gu.globalStyleSheet||(gu.globalStyleSheet=ys()),this.styleSheet=gu.globalStyleSheet)),this.styleSheet.textContent=Nq(t,i_(e))}styleScrollElement(e,t){var i,n;const o=(i=t.foregroundColor)!==null&&i!==void 0?i:"",r=(n=t.backgroundColor)!==null&&n!==void 0?n:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=r,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(j(this.element,J.MOUSE_UP,o=>{if(Ge.stop(o,!0),lo){if(new Io(be(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(j(this.element,J.CONTEXT_MENU,o=>{Ge.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=he(this.element,De("a.action-menu-item")),this._action.id===qi.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=he(this.item,De("span.menu-item-check"+et.asCSSSelector(ce.menuSelection))),this.check.setAttribute("role","none"),this.label=he(this.item,De("span.action-label")),this.options.label&&this.options.keybinding&&(he(this.item,De("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Po(this.label);let t=lR(this.action.label);if(t){const i=Iq(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const n=ny.exec(t);if(n){t=of(t),ib.lastIndex=0;let o=ib.exec(t);for(;o&&o[1];)o=ib.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(N0(r(t.substr(0,o.index))," "),De("u",{"aria-hidden":"true"},o[3]),DF(r(t.substr(o.index+o[0].length))," ")):this.label.innerText=r(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=n,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class XE extends MR{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new pe),this.mouseOver=!1,this.expandDirection=n&&n.expandDirection!==void 0?n.expandDirection:{horizontal:Y_.Right,vertical:sy.Below},this.showScheduler=new _n(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new _n(()=>{this.element&&!Ni(vn(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=he(this.item,De("span.submenu-indicator"+et.asCSSSelector(ce.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(j(this.element,J.KEY_UP,t=>{const i=new Ot(t);(i.equals(17)||i.equals(3))&&(Ge.stop(t,!0),this.createSubmenu(!0))})),this._register(j(this.element,J.KEY_DOWN,t=>{const i=new Ot(t);vn()===this.item&&(i.equals(17)||i.equals(3))&&Ge.stop(t,!0)})),this._register(j(this.element,J.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(j(this.element,J.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(j(this.element,J.FOCUS_OUT,t=>{this.element&&!Ni(vn(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){Ge.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=$d(e.width,t.width,{position:n.horizontal===Y_.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new Ot(d).equals(15)&&(Ge.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(j(this.submenuContainer,J.KEY_DOWN,d=>{new Ot(d).equals(15)&&Ge.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class JE extends nk{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Iq(s){const e=ny,t=e.exec(s);if(!t)return s;const i=!t[1];return s.replace(e,i?"$2$3":"").trim()}function eI(s){const e=iT()[s.id];return`.codicon-${s.id}:before { content: '\\${e.toString(16)}'; }`}function Nq(s,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } ${eI(ce.menuSelection)} ${eI(ce.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; overflow: hidden; white-space: nowrap; } .monaco-menu .monaco-action-bar .actions-container { display: flex; margin: 0 auto; padding: 0; width: 100%; justify-content: flex-end; } .monaco-menu .monaco-action-bar.vertical .actions-container { display: inline-block; } .monaco-menu .monaco-action-bar.reverse .actions-container { flex-direction: row-reverse; } .monaco-menu .monaco-action-bar .action-item { cursor: pointer; display: inline-block; transition: transform 50ms ease; position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */ } .monaco-menu .monaco-action-bar .action-item.disabled { cursor: default; } .monaco-menu .monaco-action-bar .action-item .icon, .monaco-menu .monaco-action-bar .action-item .codicon { display: inline-block; } .monaco-menu .monaco-action-bar .action-item .codicon { display: flex; align-items: center; } .monaco-menu .monaco-action-bar .action-label { font-size: 11px; margin-right: 4px; } .monaco-menu .monaco-action-bar .action-item.disabled .action-label, .monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { color: var(--vscode-disabledForeground); } /* Vertical actions */ .monaco-menu .monaco-action-bar.vertical { text-align: left; } .monaco-menu .monaco-action-bar.vertical .action-item { display: block; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { display: block; border-bottom: 1px solid var(--vscode-menu-separatorBackground); padding-top: 1px; padding: 30px; } .monaco-menu .secondary-actions .monaco-action-bar .action-label { margin-left: 6px; } /* Action Items */ .monaco-menu .monaco-action-bar .action-item.select-container { overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ flex: 1; max-width: 170px; min-width: 60px; display: flex; align-items: center; justify-content: center; margin-right: 10px; } .monaco-menu .monaco-action-bar.vertical { margin-left: 0; overflow: visible; } .monaco-menu .monaco-action-bar.vertical .actions-container { display: block; } .monaco-menu .monaco-action-bar.vertical .action-item { padding: 0; transform: none; display: flex; } .monaco-menu .monaco-action-bar.vertical .action-item.active { transform: none; } .monaco-menu .monaco-action-bar.vertical .action-menu-item { flex: 1 1 auto; display: flex; height: 2em; align-items: center; position: relative; margin: 0 4px; border-radius: 4px; } .monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding, .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding { opacity: unset; } .monaco-menu .monaco-action-bar.vertical .action-label { flex: 1 1 auto; text-decoration: none; padding: 0 1em; background: none; font-size: 12px; line-height: 1; } .monaco-menu .monaco-action-bar.vertical .keybinding, .monaco-menu .monaco-action-bar.vertical .submenu-indicator { display: inline-block; flex: 2 1 auto; padding: 0 1em; text-align: right; font-size: 12px; line-height: 1; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { font-size: 16px !important; display: flex; align-items: center; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { margin-left: auto; margin-right: -20px; } .monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding, .monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { opacity: 0.4; } .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { display: inline-block; box-sizing: border-box; margin: 0; } .monaco-menu .monaco-action-bar.vertical .action-item { position: static; overflow: visible; } .monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { position: absolute; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { width: 100%; height: 0px !important; opacity: 1; } .monaco-menu .monaco-action-bar.vertical .action-label.separator.text { padding: 0.7em 1em 0.1em 1em; font-weight: bold; opacity: 1; } .monaco-menu .monaco-action-bar.vertical .action-label:hover { color: inherit; } .monaco-menu .monaco-action-bar.vertical .menu-item-check { position: absolute; visibility: hidden; width: 1em; height: 100%; } .monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { visibility: visible; display: flex; align-items: center; justify-content: center; } /* Context Menu */ .context-view.monaco-menu-container { outline: 0; border: none; animation: fadeIn 0.083s linear; -webkit-app-region: no-drag; } .context-view.monaco-menu-container :focus, .context-view.monaco-menu-container .monaco-action-bar.vertical:focus, .context-view.monaco-menu-container .monaco-action-bar.vertical :focus { outline: 0; } .hc-black .context-view.monaco-menu-container, .hc-light .context-view.monaco-menu-container, :host-context(.hc-black) .context-view.monaco-menu-container, :host-context(.hc-light) .context-view.monaco-menu-container { box-shadow: none; } .hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused, .hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused, :host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused, :host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused { background: none; } /* Vertical Action Bar Styles */ .monaco-menu .monaco-action-bar.vertical { padding: 4px 0; } .monaco-menu .monaco-action-bar.vertical .action-menu-item { height: 2em; } .monaco-menu .monaco-action-bar.vertical .action-label:not(.separator), .monaco-menu .monaco-action-bar.vertical .keybinding { font-size: inherit; padding: 0 2em; max-height: 100%; } .monaco-menu .monaco-action-bar.vertical .menu-item-check { font-size: inherit; width: 2em; } .monaco-menu .monaco-action-bar.vertical .action-label.separator { font-size: inherit; margin: 5px 0 !important; padding: 0; border-radius: 0; } .linux .monaco-menu .monaco-action-bar.vertical .action-label.separator, :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { margin-left: 0; margin-right: 0; } .monaco-menu .monaco-action-bar.vertical .submenu-indicator { font-size: 60%; padding: 0 1.8em; } .linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator, :host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; mask-size: 10px 10px; -webkit-mask-size: 10px 10px; } .monaco-menu .action-item { cursor: default; }`;if(e){t+=` /* Arrows */ .monaco-scrollable-element > .scrollbar > .scra { cursor: pointer; font-size: 11px !important; } .monaco-scrollable-element > .visible { opacity: 1; /* Background rule added for IE9 - to allow clicks on dom node */ background:rgba(0,0,0,0); transition: opacity 100ms linear; } .monaco-scrollable-element > .invisible { opacity: 0; pointer-events: none; } .monaco-scrollable-element > .invisible.fade { transition: opacity 800ms linear; } /* Scrollable Content Inset Shadow */ .monaco-scrollable-element > .shadow { position: absolute; display: none; } .monaco-scrollable-element > .shadow.top { display: block; top: 0; left: 3px; height: 3px; width: 100%; } .monaco-scrollable-element > .shadow.left { display: block; top: 3px; left: 0; height: 100%; width: 3px; } .monaco-scrollable-element > .shadow.top-left-corner { display: block; top: 0; left: 0; height: 3px; width: 3px; } `;const i=s.scrollbarShadow;i&&(t+=` .monaco-scrollable-element > .shadow.top { box-shadow: ${i} 0 6px 6px -6px inset; } .monaco-scrollable-element > .shadow.left { box-shadow: ${i} 6px 0 6px -6px inset; } .monaco-scrollable-element > .shadow.top.left { box-shadow: ${i} 6px 6px 6px -6px inset; } `);const n=s.scrollbarSliderBackground;n&&(t+=` .monaco-scrollable-element > .scrollbar > .slider { background: ${n}; } `);const o=s.scrollbarSliderHoverBackground;o&&(t+=` .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${o}; } `);const r=s.scrollbarSliderActiveBackground;r&&(t+=` .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } `)}return t}class Tq{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=vn();let i;const n=Vi(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var r;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(De(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(r=this.blockDisposable)===null||r===void 0||r.dispose(),this.blockDisposable=j(this.block,J.MOUSE_DOWN,u=>u.stopPropagation()));const l=new pe,c=e.actionRunner||new Rc;c.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new gu(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},kq),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);const d=be(o);return l.add(j(d,J.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(j(d,J.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const h=new Io(d,u);let f=h.target;if(!h.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),br(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)===null||r===void 0||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(vn()===this.lastContainer||Ni(vn(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Mg(e.error)&&this.notificationService.error(e.error)}}var Aq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},wd=function(s,e){return function(t,i){e(t,i,s)}};let oy=class extends G{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Tq(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new O),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new O)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=ry.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}}),Ja.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};oy=Aq([wd(0,Rl),wd(1,$o),wd(2,Jg),wd(3,Zi),wd(4,Jc),wd(5,bt)],oy);var ry;(function(s){function e(i){return i&&i.menuId instanceof x}function t(i,n,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{const c=[];if(r){const d=n.createMenu(r,l??o);Dq(d,a,c),d.dispose()}return i.getActions?qi.join(i.getActions(),c):c}}}s.transform=t})(ry||(ry={}));var Q_;(function(s){s[s.API=0]="API",s[s.USER=1]="USER"})(Q_||(Q_={}));var sk=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},X_=function(s,e){return function(t,i){e(t,i,s)}};let ay=class{constructor(e){this._commandService=e}async open(e,t){if(!BS(e,ze.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=$e.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=zw(decodeURIComponent(e.query))}catch{try{i=zw(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};ay=sk([X_(0,Ls)],ay);let ly=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=$e.parse(e));const{selection:i,uri:n}=h$(e);return e=n,e.scheme===ze.file&&(e=DH(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t!=null&&t.fromUserGesture?Q_.USER:Q_.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};ly=sk([X_(0,gi)],ly);let cy=class{constructor(e,t){this._openers=new Qn,this._validators=new Qn,this._resolvers=new Qn,this._resolvedUriTargets=new pn(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Qn,this._defaultExternalOpener={openExternal:async i=>(AD(i,ze.http,ze.https)?OT(i):wt.location.href=i,!0)},this._openers.push({open:async(i,n)=>n!=null&&n.openExternal||AD(i,ze.mailto,ze.http,ze.https,ze.vsls)?(await this._doOpenExternal(i,n),!0):!1}),this._openers.push(new ay(t)),this._openers.push(new ly(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){var i;const n=typeof e=="string"?$e.parse(e):e,o=(i=this._resolvedUriTargets.get(n))!==null&&i!==void 0?i:e;for(const r of this._validators)if(!await r.shouldOpen(o,t))return!1;for(const r of this._openers)if(await r.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?$e.parse(e):e;let n;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}let o;if(typeof e=="string"&&i.toString()===n.toString()?o=e:o=encodeURI(n.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:i,preferredOpenerId:r},ao.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},ao.None)}dispose(){this._validators.clear()}};cy=sk([X_(0,gi),X_(1,Ls)],cy);const od=Qe("editorWorkerService");var Ps;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(Ps||(Ps={}));(function(s){function e(r,a){return a-r}s.compare=e;const t=Object.create(null);t[s.Error]=p("sev.error","Error"),t[s.Warning]=p("sev.warning","Warning"),t[s.Info]=p("sev.info","Info");function i(r){return t[r]||""}s.toString=i;function n(r){switch(r){case fi.Error:return s.Error;case fi.Warning:return s.Warning;case fi.Info:return s.Info;case fi.Ignore:return s.Hint}}s.fromSeverity=n;function o(r){switch(r){case s.Error:return fi.Error;case s.Warning:return fi.Warning;case s.Info:return fi.Info;case s.Hint:return fi.Ignore}}s.toSeverity=o})(Ps||(Ps={}));var tI;(function(s){const e="";function t(n){return i(n,!0)}s.makeKey=t;function i(n,o){const r=[e];return n.source?r.push(n.source.replace("¦","\\¦")):r.push(e),n.code?typeof n.code=="string"?r.push(n.code.replace("¦","\\¦")):r.push(n.code.value.replace("¦","\\¦")):r.push(e),n.severity!==void 0&&n.severity!==null?r.push(Ps.toString(n.severity)):r.push(e),n.message&&o?r.push(n.message.replace("¦","\\¦")):r.push(e),n.startLineNumber!==void 0&&n.startLineNumber!==null?r.push(n.startLineNumber.toString()):r.push(e),n.startColumn!==void 0&&n.startColumn!==null?r.push(n.startColumn.toString()):r.push(e),n.endLineNumber!==void 0&&n.endLineNumber!==null?r.push(n.endLineNumber.toString()):r.push(e),n.endColumn!==void 0&&n.endColumn!==null?r.push(n.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}s.makeKeyOptionalMessage=i})(tI||(tI={}));const rd=Qe("markerService");function Mq(s,e){const t=[],i=[];for(const n of s)e.has(n)||t.push(n);for(const n of e)s.has(n)||i.push(n);return{removed:t,added:i}}function Rq(s,e){const t=new Set;for(const i of e)s.has(i)&&t.add(i);return t}var Pq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},iI=function(s,e){return function(t,i){e(t,i,s)}};let dy=class extends G{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new O),this._markerDecorations=new pn,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new Fq(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===ze.inMemory||e.uri.scheme===ze.internal||e.uri.scheme===ze.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(n=>n.owner).forEach(n=>this._markerService.remove(n,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};dy=Pq([iI(0,ns),iI(1,rd)],dy);class Fq extends G{constructor(e){super(),this.model=e,this._map=new F9,this._register(Be(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=Mq(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const n=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(n,o);for(const a of i)this._map.delete(a);for(let a=0;a=n)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new M(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0:!1}}var Oq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},xh=function(s,e){return function(t,i){e(t,i,s)}},Sd;function ql(s){return s.toString()}class Bq{constructor(e,t,i){this.model=e,this._modelEventListeners=new pe,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(n=>i(e,n)))}dispose(){this._modelEventListeners.dispose()}}const Wq=Vn||Ye?1:2;class Vq{constructor(e,t,i,n,o,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}let J_=Sd=class extends G{constructor(e,t,i,n,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,this._languageConfigurationService=o,this._onModelAdded=this._register(new O),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new O),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new O),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let n=en.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(n=f),n<1&&(n=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let r=en.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=Wq;const l=e.eol;l===`\r `?a=2:l===` `&&(a=1);let c=en.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=en.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=en.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=en.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:r,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:u,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:to===3||to===2?` `:`\r `}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[n+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);o=Sd._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;ne){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),r=new El(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(ql(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),u=this._getSHA1Computer(),h=u.canComputeSHA1(r)?u.computeSHA1(r)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of d.past)qr(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)qr(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>qr(f)&&f.matchesResource(i)),h&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=ql(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new Bq(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,n=!1){let o;return t?o=this._createModelData(e,t,i,n):o=this._createModelData(e,ro,i,n),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||c.future.length>0){for(const d of c.past)qr(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)qr(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=Sd.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!n&&(r>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>qr(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new Vq(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!n){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);Sd._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new v1}};J_.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;J_=Sd=Oq([xh(0,Xt),xh(1,vA),xh(2,ML),xh(3,Mi),xh(4,Nr)],J_);class v1{canComputeSHA1(e){return e.getValueLength()<=v1.MAX_MODEL_SIZE}computeSHA1(e){const t=new A0,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}}v1.MAX_MODEL_SIZE=10*1024*1024;var uy;(function(s){s[s.PRESERVE=0]="PRESERVE",s[s.LAST=1]="LAST"})(uy||(uy={}));const RR={Quickaccess:"workbench.contributions.quickaccess"};class Hq{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Be(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return EN([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}zi.add(RR.Quickaccess,new Hq);const zq={ctrlCmd:!1,alt:!1};var Vu;(function(s){s[s.Blur=1]="Blur",s[s.Gesture=2]="Gesture",s[s.Other=3]="Other"})(Vu||(Vu={}));var nr;(function(s){s[s.NONE=0]="NONE",s[s.FIRST=1]="FIRST",s[s.SECOND=2]="SECOND",s[s.LAST=3]="LAST"})(nr||(nr={}));var Et;(function(s){s[s.First=1]="First",s[s.Second=2]="Second",s[s.Last=3]="Last",s[s.Next=4]="Next",s[s.Previous=5]="Previous",s[s.NextPage=6]="NextPage",s[s.PreviousPage=7]="PreviousPage",s[s.NextSeparator=8]="NextSeparator",s[s.PreviousSeparator=9]="PreviousSeparator"})(Et||(Et={}));const b1=Qe("quickInputService");var Uq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},nI=function(s,e){return function(t,i){e(t,i,s)}};let hy=class extends G{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=zi.as(RR.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n,o,r,a;const[l,c]=this.getOrInstantiateProvider(e,i==null?void 0:i.enabledProviderPrefixes),d=this.visibleQuickAccess,u=d==null?void 0:d.descriptor;if(d&&c&&u===c){e!==c.prefix&&!(i!=null&&i.preserveValue)&&(d.picker.value=e),this.adjustValueSelection(d.picker,c,i);return}if(c&&!(i!=null&&i.preserveValue)){let b;if(d&&u&&u!==c){const C=d.value.substr(u.prefix.length);C&&(b=`${c.prefix}${C}`)}if(!b){const C=l==null?void 0:l.defaultFilterValue;C===uy.LAST?b=this.lastAcceptedPickerValues.get(c):typeof C=="string"&&(b=`${c.prefix}${C}`)}typeof b=="string"&&(e=b)}const h=(n=d==null?void 0:d.picker)===null||n===void 0?void 0:n.valueSelection,f=(o=d==null?void 0:d.picker)===null||o===void 0?void 0:o.value,g=new pe,m=g.add(this.quickInputService.createQuickPick());m.value=e,this.adjustValueSelection(m,c,i),m.placeholder=(r=i==null?void 0:i.placeholder)!==null&&r!==void 0?r:c==null?void 0:c.placeholder,m.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,m.hideInput=!!m.quickNavigate&&!d,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(m.itemActivation=(a=i==null?void 0:i.itemActivation)!==null&&a!==void 0?a:nr.SECOND),m.contextKey=c==null?void 0:c.contextKey,m.filterValue=b=>b.substring(c?c.prefix.length:0);let _;t&&(_=new _T,g.add(te.once(m.onWillAccept)(b=>{b.veto(),m.hide()}))),g.add(this.registerPickerListeners(m,l,c,e,i));const v=g.add(new Ho);if(l&&g.add(l.provide(m,v.token,i==null?void 0:i.providerOptions)),te.once(m.onDidHide)(()=>{m.selectedItems.length===0&&v.cancel(),g.dispose(),_==null||_.complete(m.selectedItems.slice(0))}),m.show(),h&&f===e&&(m.valueSelection=h),t)return _==null?void 0:_.p}adjustValueSelection(e,t,i){var n;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(n=t==null?void 0:t.prefix.length)!==null&&n!==void 0?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n,o){const r=new pe,a=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return r.add(Be(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l,o==null?void 0:o.enabledProviderPrefixes);c!==t?this.show(l,{enabledProviderPrefixes:o==null?void 0:o.enabledProviderPrefixes,preserveValue:!0,providerOptions:o==null?void 0:o.providerOptions}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!(t!=null&&t.includes(i.prefix)))return[void 0,void 0];let n=this.mapProviderToDescriptor.get(i);return n||(n=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,n)),[n,i]}};hy=Uq([nI(0,b1),nI(1,vt)],hy);class C1 extends La{constructor(e){var t;super(),this._onChange=this._register(new O),this.onChange=this._onChange.event,this._onKeyDown=this._register(new O),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const i=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,i.push(...et.asClassNameArray(this._icon))),this._opts.actionClassName&&i.push(...this._opts.actionClassName.split(" ")),this._checked&&i.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(Tr().setupUpdatableHover((t=e.hoverDelegate)!==null&&t!==void 0?t:$s("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...i),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,n=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),n.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,n=>{if(n.keyCode===10||n.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),n.preventDefault(),n.stopPropagation();return}this._onKeyDown.fire(n)})}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 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}var $q=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class PR{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}$q([Jt],PR.prototype,"toString",null);const Kq=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function jq(s){const e=[];let t=0,i;for(;i=Kq.exec(s);){i.index-t>0&&e.push(s.substring(t,i.index));const[,n,o,,r]=i;r?e.push({label:n,href:o,title:r}):e.push({label:n,href:o}),t=i.index+i[0].length}return t{HO(f)&&Ge.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new Ue(a,J.CLICK)).event,d=t.disposables.add(new Ue(a,J.KEY_DOWN)).event,u=te.chain(d,f=>f.filter(g=>{const m=new Ot(g);return m.equals(10)||m.equals(3)}));t.disposables.add(Ft.addTarget(a));const h=t.disposables.add(new Ue(a,It.Tap)).event;te.any(c,h,u)(l,null,t.disposables),e.appendChild(a)}}var Yq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sI=function(s,e){return function(t,i){e(t,i,s)}};const FR="inQuickInput",Qq=new me(FR,!1,p("inQuickInput","Whether keyboard focus is inside the quick input control")),Xq=st.has(FR),OR="quickInputType",Jq=new me(OR,void 0,p("quickInputType","The type of the currently visible quick input")),BR="cursorAtEndOfQuickInputBox",eG=new me(BR,!1,p("cursorAtEndOfQuickInputBox","Whether the cursor in the quick input is at the end of the input box")),tG=st.has(BR),fy={iconClass:et.asClassName(ce.quickInputBack),tooltip:p("quickInput.back","Back"),handle:-1};class om extends G{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=om.noPromptMessage,this._severity=fi.Ignore,this.onDidTriggerButtonEmitter=this._register(new O),this.onDidHideEmitter=this._register(new O),this.onWillHideEmitter=this._register(new O),this.onDisposeEmitter=this._register(new O),this.visibleDisposables=this._register(new pe),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!Cl;this._ignoreFocusOut=e&&!Cl,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=Vu.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=Vu.Other){this.onWillHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:!i&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const n=this.getDescription();if(this.ui.description1.textContent!==n&&(this.ui.description1.textContent=n),this.ui.description2.textContent!==n&&(this.ui.description2.textContent=n),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?xn(this.ui.widget,this._widget):xn(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Zc,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const r=this.buttons.filter(l=>l===fy).map((l,c)=>e0(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(r,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==fy).map((l,c)=>e0(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const r=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof C1))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=r}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,xn(this.ui.message),Zq(o,this.ui.message,{callback:r=>{this.ui.linkOpenerDelegate(r)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?p("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==fi.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}om.noPromptMessage=p("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class pg extends om{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new O),this.onWillAcceptEmitter=this._register(new O),this.onDidAcceptEmitter=this._register(new O),this.onDidCustomEmitter=this._register(new O),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=nr.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new O),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new O),this.onDidTriggerItemButtonEmitter=this._register(new O),this.onDidTriggerSeparatorButtonEmitter=this._register(new O),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new E0,this.type="quickPick",this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?zq:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Et.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Wi(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Wi(e,this._selectedItems,(i,n)=>i===n)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(jS(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Wi(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return j(this.ui.container,J.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Ot(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;!n&&i.inputBox&&(n=this.placeholder||pg.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=n??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case nr.NONE:this._itemActivation=nr.FIRST;break;case nr.SECOND:this.ui.list.focus(Et.Second),this._itemActivation=nr.FIRST;break;case nr.LAST:this.ui.list.focus(Et.Last),this._itemActivation=nr.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Et.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(e??!1))}}pg.DEFAULT_ARIA_LABEL=p("quickInputBox.ariaLabel","Type to narrow down results.");let iG=class extends om{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new O),this.onDidAcceptEmitter=this._register(new O),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}},gy=class extends lg{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){var t;const i=(Vi(e.content)?(t=e.content.textContent)!==null&&t!==void 0?t:"":typeof e.content=="string"?e.content:e.content.value).includes(` `);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:i,skipFadeInAnimation:!0}}}};gy=Yq([sI(0,Xt),sI(1,Xg)],gy);K.white.toString(),K.white.toString();class my extends G{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new O),this._onDidEscape=this._register(new O),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(Ft.addTarget(this._element)),[J.CLICK,It.Tap].forEach(o=>{this._register(j(this._element,o,r=>{if(!this.enabled){Ge.stop(r);return}this._onDidClick.fire(r)}))}),this._register(j(this._element,J.KEY_DOWN,o=>{const r=new Ot(o);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(o),a=!0):r.equals(9)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&Ge.stop(r,!0)})),this._register(j(this._element,J.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(j(this._element,J.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Wf(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of Dc(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const n=document.createElement("span");n.textContent=i,t.push(n)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||xc(this._label)&&xc(e)&&K$(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(xc(e)){const o=qL(e,{inline:!0});o.dispose();const r=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(r){const a=yT(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=a}else xn(i)}else this.options.supportIcons?xn(i,...this.getContentElements(e)):i.textContent=e;let n="";typeof this.options.title=="string"?n=this.options.title:this.options.title&&(n=eK(e)),this.setTitle(n),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",n),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...et.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){var t;!this._hover&&e!==""?this._hover=this._register(Tr().setupUpdatableHover((t=this.options.hoverDelegate)!==null&&t!==void 0?t:$s("mouse"),this._element,e)):this._hover&&this._hover.update(e)}}class oI{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=he(e,De(".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(){var e,t;this.element.textContent=Xp(this.countFormat,this.count),this.element.title=Xp(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const rI="done",aI="active",sb="infinite",ob="infinite-long-running",lI="discrete";class w1 extends G{constructor(e,t){super(),this.progressSignal=this._register(new Ca),this.workedVal=0,this.showDelayedScheduler=this._register(new _n(()=>GS(this.element),0)),this.longRunningScheduler=this._register(new _n(()=>this.infiniteLongRunning(),w1.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(aI,sb,ob,lI),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(rI),this.element.classList.contains(sb)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(lI,rI,ob),this.element.classList.add(aI,sb),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(ob)}getContainer(){return this.element}}w1.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const nG=p("caseDescription","Match Case"),sG=p("wordsDescription","Match Whole Word"),oG=p("regexDescription","Use Regular Expression");class rG extends C1{constructor(e){var t;super({icon:ce.caseSensitive,title:nG+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:$s("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class aG extends C1{constructor(e){var t;super({icon:ce.wholeWord,title:sG+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:$s("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class lG extends C1{constructor(e){var t;super({icon:ce.regex,title:oG+e.appendTitle,isChecked:e.isChecked,hoverDelegate:(t=e.hoverDelegate)!==null&&t!==void 0?t:$s("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class cG{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}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 dG{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._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new cG(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 Eh=De;class uG extends La{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new O),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new O),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(n=this.options.tooltip)!==null&&n!==void 0?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=he(e,Eh(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",r=he(this.element,Eh(".ibwrapper"));if(this.input=he(r,Eh(o+".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=he(r,Eh("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new NB(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),he(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new Ue(e.ownerDocument,"selectionchange")),l=te.filter(a.event,()=>{const c=e.ownerDocument.getSelection();return(c==null?void 0:c.anchorNode)===r});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._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Il(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.hover?this.hover.update(e):this.hover=this._register(Tr().setupUpdatableHover($s("mouse"),this.input,e))}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:RC(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return US(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}getSelection(){var e;const t=this.input.selectionStart;if(t===null)return null;const i=(e=this.input.selectionEnd)!==null&&e!==void 0?e:t;return{start:t,end:i}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${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){if(this.state==="open"&&bs(this.message,e))return;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=`1px solid ${ga(i.border,"transparent")}`,this.message.content&&(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==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.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;const t=()=>e.style.width=zS(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:n=>{var o,r;if(!this.message)return null;e=he(n,Eh(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?g$(this.message.content,a):f$(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(r=c.foreground)!==null&&r!==void 0?r:"",l.style.border=c.border?`1px solid ${c.border}`:"",he(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=p("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=p("alertWarningMessage","Warning: {0}",this.message.content):i=p("alertInfoMessage","Info: {0}",this.message.content),iw(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=" ",this.layout()}applyStyles(){var e,t,i;const n=this.options.inputBoxStyles,o=(e=n.inputBackground)!==null&&e!==void 0?e:"",r=(t=n.inputForeground)!==null&&t!==void 0?t:"",a=(i=n.inputBorder)!==null&&i!==void 0?i:"";this.element.style.backgroundColor=o,this.element.style.color=r,this.input.style.backgroundColor="inherit",this.input.style.color=r,this.element.style.border=`1px solid ${ga(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=RC(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,n=t.selectionEnd,o=t.value;i!==null&&n!==null&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}}class hG extends uG{constructor(e,t,i){const n=p({key:"history.inputbox.hint.suffix.noparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field ends in a closing parenthesis ")", for example "Filter (e.g. text, !exclude)". The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," or {0} for history","⇅"),o=p({key:"history.inputbox.hint.suffix.inparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field does NOT end in a closing parenthesis (eg. "Find"). The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new O),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new O),this.onDidBlur=this._onDidBlur.event,this.history=new dG(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?n:o,l=this.placeholder+a;i.showPlaceholderOnFocus&&!US(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return i.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(o)||a(n)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",g_(this.value?this.value:p("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,g_(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}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()}}const fG=p("defaultLabel","input");class gG extends La{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Ca),this.additionalToggles=[],this._onDidOptionChange=this._register(new O),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new O),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new O),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new O),this._onKeyUp=this._register(new O),this._onCaseSensitiveKeyDown=this._register(new O),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new O),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||fG,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,d=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new hG(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles}));const u=this._register(XL());if(this.showCommonFindToggles){this.regex=this._register(new lG({appendTitle:r,isChecked:!1,hoverDelegate:u,...i.toggleStyles})),this._register(this.regex.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(f=>{this._onRegexKeyDown.fire(f)})),this.wholeWords=this._register(new aG({appendTitle:o,isChecked:!1,hoverDelegate:u,...i.toggleStyles})),this._register(this.wholeWords.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new rG({appendTitle:n,isChecked:!1,hoverDelegate:u,...i.toggleStyles})),this._register(this.caseSensitive.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(f=>{this._onCaseSensitiveKeyDown.fire(f)}));const h=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(15)||f.equals(17)||f.equals(9)){const g=h.indexOf(this.domNode.ownerDocument.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(),Ge.stop(f,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(j(this.inputBox.inputElement,"compositionstart",h=>{this.imeSessionInProgress=!0})),this._register(j(this.inputBox.inputElement,"compositionend",h=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(i=this.caseSensitive)===null||i===void 0||i.enable();for(const n of this.additionalToggles)n.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(i=this.caseSensitive)===null||i===void 0||i.disable();for(const n of this.additionalToggles)n.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new pe;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,n,o,r,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((i=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&i!==void 0?i:0)+((o=(n=this.wholeWords)===null||n===void 0?void 0:n.width())!==null&&o!==void 0?o:0)+((a=(r=this.regex)===null||r===void 0?void 0:r.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.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()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}const mG=De;class pG extends G{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>Ai(this.findInput.inputBox.inputElement,J.KEY_DOWN,o),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=he(this.parent,mG(".quick-input-box")),this.findInput=this._register(new gG(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="combobox",n.ariaHasPopup="menu",n.ariaAutoComplete="list",n.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===fi.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===fi.Info?1:e===fi.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===fi.Info?1:e===fi.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class _G{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:G.None}}renderElement(e,t,i,n){var o;if((o=i.disposable)===null||o===void 0||o.dispose(),!i.data)return;const r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,n);const a=new Ho,l=r.resolve(e,a.token);i.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,i.data),l.then(c=>this.renderer.renderElement(c,e,i.data,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class vG{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 bG(s,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new vG(s,e.accessibilityProvider)}}class CG{constructor(e,t,i,n,o={}){const r=()=>this.model,a=n.map(l=>new _G(l,r));this.list=new Ko(e,t,i,a,bG(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return te.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 te.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 te.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(n=>this._model.get(n)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Rn(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()}}var rh=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const wG=!1;var cI;(function(s){s.North="north",s.South="south",s.East="east",s.West="west"})(cI||(cI={}));let yG=4;const SG=new O;let LG=300;const kG=new O;class ok{constructor(e){this.el=e,this.disposables=new pe}get onPointerMove(){return this.disposables.add(new Ue(be(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new Ue(be(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}rh([Jt],ok.prototype,"onPointerMove",null);rh([Jt],ok.prototype,"onPointerUp",null);class rk{get onPointerMove(){return this.disposables.add(new Ue(this.el,It.Change)).event}get onPointerUp(){return this.disposables.add(new Ue(this.el,It.End)).event}constructor(e){this.el=e,this.disposables=new pe}dispose(){this.disposables.dispose()}}rh([Jt],rk.prototype,"onPointerMove",null);rh([Jt],rk.prototype,"onPointerUp",null);class t0{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}rh([Jt],t0.prototype,"onPointerMove",null);rh([Jt],t0.prototype,"onPointerUp",null);const dI="pointer-events-disabled";class Is extends G{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}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))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=he(this.el,De(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Be(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new Ue(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Is.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Ue(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Is.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=he(this.el,De(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Be(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new Ue(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Is.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Ue(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Is.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=LG,this.hoverDelayer=this._register(new Og(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new O),this._onDidStart=this._register(new O),this._onDidChange=this._register(new O),this._onDidReset=this._register(new O),this._onDidEnd=this._register(new O),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.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=he(e,De(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Ye&&this.el.classList.add("mac");const n=this._register(new Ue(this.el,"mousedown")).event;this._register(n(u=>this.onPointerStart(u,new ok(e)),this));const o=this._register(new Ue(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new Ue(this.el,"mouseenter")).event;this._register(r(()=>Is.onMouseEnter(this)));const a=this._register(new Ue(this.el,"mouseleave")).event;this._register(a(()=>Is.onMouseLeave(this))),this._register(Ft.addTarget(this.el));const l=this._register(new Ue(this.el,It.Start)).event;this._register(l(u=>this.onPointerStart(u,new rk(this.el)),this));const c=this._register(new Ue(this.el,It.Tap)).event;let d;this._register(c(u=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(u);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},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=yG,this._register(SG.event(u=>{this.size=u,this.layout()}))),this._register(kG.event(u=>this.hoverDelay=u)),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",wG),this.layout()}onPointerStart(e,t){Ge.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new t0(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new t0(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const g of n)g.classList.add(dI);const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=ys(this.el),d=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=Ye?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=Ye?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},u=new pe;d(),i||this.onDidEnablementChange.event(d,null,u);const h=g=>{Ge.stop(g,!1);const m={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(m)},f=g=>{Ge.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),u.dispose();for(const m of n)m.classList.remove(dI)};t.onPointerMove(h,null,u),t.onPointerUp(f,null,u),u.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&&Is.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Is.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Is.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")}}getOrthogonalSash(e){var t;const i=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!i||!Vi(i))&&i.classList.contains("orthogonal-drag-handle"))return i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const DG={separatorBorder:K.transparent};class WR{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,n;if(e!==this.visible){e?(this.size=Pn(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);try{(n=(i=this.view).setVisible)===null||n===void 0||n.call(i,e)}catch(o){console.error("Splitview: Failed to set visible view"),console.error(o)}}}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 proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,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)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class xG extends WR{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class EG extends WR{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var $r;(function(s){s[s.Idle=0]="Idle",s[s.Busy=1]="Busy"})($r||($r={}));var uI;(function(s){s.Distribute={type:"distribute"};function e(n){return{type:"split",index:n}}s.Split=e;function t(n){return{type:"auto",index:n}}s.Auto=t;function i(n){return{type:"invisible",cachedVisibleSize:n}}s.Invisible=i})(uI||(uI={}));class IG extends G{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,n,o,r,a;super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=$r.Idle,this._onDidSashChange=this._register(new O),this._onDidSashReset=this._register(new O),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(i=t.orientation)!==null&&i!==void 0?i:0,this.inverseAltBehavior=(n=t.inverseAltBehavior)!==null&&n!==void 0?n:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,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=he(this.el,De(".sash-container")),this.viewContainer=De(".split-view-container"),this.scrollable=this._register(new ih({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:c=>is(be(this.el),c)})),this.scrollableElement=this._register(new t1(this.viewContainer,{vertical:this.orientation===0?(r=t.scrollbarVisibility)!==null&&r!==void 0?r:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new Ue(this.viewContainer,"scroll")).event;this._register(l(c=>{const d=this.scrollableElement.getScrollPosition(),u=Math.abs(this.viewContainer.scrollLeft-d.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-d.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(u!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:u,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),he(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||DG),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{const u=To(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,u,d,!0)}),this._contentSize=this.viewItems.reduce((c,d)=>c+d.size,0),this.saveProportions())}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,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let n=0;for(let o=0;o0&&(r.size=Pn(Math.round(a*e/n),r.minimumSize,r.maximumSize))}}else{const n=Rn(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const n=this.sashItems.findIndex(a=>a.sash===e),o=br(j(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),j(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const c=this.viewItems.map(g=>g.size);let d=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(n===this.sashItems.length-1){const m=this.viewItems[n];d=(m.minimumSize-m.size)/2,u=(m.maximumSize-m.size)/2}else{const m=this.viewItems[n+1];d=(m.size-m.maximumSize)/2,u=(m.size-m.minimumSize)/2}let h,f;if(!l){const g=Rn(n,-1),m=Rn(n+1,this.viewItems.length),_=g.reduce((D,N)=>D+(this.viewItems[N].minimumSize-c[N]),0),v=g.reduce((D,N)=>D+(this.viewItems[N].viewMaximumSize-c[N]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((D,N)=>D+(c[N]-this.viewItems[N].minimumSize),0),C=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((D,N)=>D+(c[N]-this.viewItems[N].viewMaximumSize),0),w=Math.max(_,C),y=Math.min(b,v),L=this.findFirstSnapIndex(g),k=this.findFirstSnapIndex(m);if(typeof L=="number"){const D=this.viewItems[L],N=Math.floor(D.viewMinimumSize/2);h={index:L,limitDelta:D.visible?w-N:w+N,size:D.size}}if(typeof k=="number"){const D=this.viewItems[k],N=Math.floor(D.viewMinimumSize/2);f={index:k,limitDelta:D.visible?y+N:y-N,size:D.size}}}this.sashDragState={start:a,current:a,index:n,sizes:c,minDelta:d,maxDelta:u,alt:l,snapBefore:h,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,u=this.resize(t,d,n,void 0,void 0,r,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(C=>C.size),g=h?t:t+1,m=this.viewItems[g],_=m.size-m.maximumSize,v=m.size-m.minimumSize,b=h?t-1:t+1;this.resize(b,-u,f,void 0,void 0,_,v)}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=Pn(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(!(e<0||e>=this.viewItems.length)){if(this.state!==$r.Idle)throw new Error("Cant modify splitview");this.state=$r.Busy;try{const i=Rn(this.viewItems.length).filter(a=>a!==e),n=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=Pn(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,o)}finally{this.state=$r.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=Pn(i,a.minimumSize,a.maximumSize);const n=Rn(this.viewItems.length),o=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==$r.Idle)throw new Error("Cant modify splitview");this.state=$r.Busy;try{const o=De(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(h=>this.onViewChange(d,h)),a=Be(()=>this.viewContainer.removeChild(o)),l=br(r,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new xG(o,e,c,l):new EG(o,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new Is(this.sashContainer,{getHorizontalSashTop:D=>this.getSashPosition(D),getHorizontalSashWidth:this.getSashOrthogonalSize},{...h,orientation:1}):new Is(this.sashContainer,{getVerticalSashLeft:D=>this.getSashPosition(D),getVerticalSashHeight:this.getSashOrthogonalSize},{...h,orientation:0}),g=this.orientation===0?D=>({sash:f,start:D.startY,current:D.currentY,alt:D.altKey}):D=>({sash:f,start:D.startX,current:D.currentX,alt:D.altKey}),_=te.map(f.onDidStart,g)(this.onSashStart,this),b=te.map(f.onDidChange,g)(this.onSashChange,this),w=te.map(f.onDidEnd,()=>this.sashItems.findIndex(D=>D.sash===f))(this.onSashEnd,this),y=f.onDidReset(()=>{const D=this.sashItems.findIndex(P=>P.sash===f),N=Rn(D,-1),W=Rn(D+1,this.viewItems.length),R=this.findFirstSnapIndex(N),A=this.findFirstSnapIndex(W);typeof R=="number"&&!this.viewItems[R].visible||typeof A=="number"&&!this.viewItems[A].visible||this._onDidSashReset.fire(D)}),L=br(_,b,w,y,f),k={sash:f,disposable:L};this.sashItems.splice(i-1,0,k)}o.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),n||this.relayout([i],u),!n&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=$r.Idle}}relayout(e,t){const i=this.viewItems.reduce((n,o)=>n+o.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(d=>d.size),n,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=Rn(e,-1),u=Rn(e+1,this.viewItems.length);if(o)for(const k of o)V1(d,k),V1(u,k);if(n)for(const k of n)fm(d,k),fm(u,k);const h=d.map(k=>this.viewItems[k]),f=d.map(k=>i[k]),g=u.map(k=>this.viewItems[k]),m=u.map(k=>i[k]),_=d.reduce((k,D)=>k+(this.viewItems[D].minimumSize-i[D]),0),v=d.reduce((k,D)=>k+(this.viewItems[D].maximumSize-i[D]),0),b=u.length===0?Number.POSITIVE_INFINITY:u.reduce((k,D)=>k+(i[D]-this.viewItems[D].minimumSize),0),C=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((k,D)=>k+(i[D]-this.viewItems[D].maximumSize),0),w=Math.max(_,C,r),y=Math.min(b,v,a);let L=!1;if(l){const k=this.viewItems[l.index],D=t>=l.limitDelta;L=D!==k.visible,k.setVisible(D,l.size)}if(!L&&c){const k=this.viewItems[c.index],D=ta+l.size,0);let i=this.size-t;const n=Rn(this.viewItems.length-1,-1),o=n.filter(a=>this.viewItems[a].priority===1),r=n.filter(a=>this.viewItems[a].priority===2);for(const a of r)V1(n,a);for(const a of o)fm(n,a);typeof e=="number"&&fm(n,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),n=[...this.viewItems].reverse();e=!1;const o=n.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=n.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:b&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),Hi(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class rm{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=rm.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=n.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=he(e,De(".monaco-table-tr")),i=[],n=[];for(let r=0;rthis.disposables.add(new TG(d,u))),l={size:a.reduce((d,u)=>d+u.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new IG(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 c=new rm(n,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new Ko(e,this.domNode,NG(i),[c],r)),te.any(...a.map(d=>d.onDidLayout))(([d,u])=>c.layoutColumn(d,u),null,this.disposables),this.splitview.onDidSashReset(d=>{const u=n.reduce((f,g)=>f+g.weight,0),h=n[d].weight/u*this.cachedWidth;this.splitview.resizeView(d,h)},null,this.disposables),this.styleElement=ys(this.domNode),this.style(iq)}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.disposables.dispose()}}y1.InstanceCount=0;var hs;(function(s){s[s.Expanded=0]="Expanded",s[s.Collapsed=1]="Collapsed",s[s.PreserveOrExpanded=2]="PreserveOrExpanded",s[s.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(hs||(hs={}));var _c;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element",s[s.Filter=3]="Filter"})(_c||(_c={}));class ms extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class ak{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}}function lk(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function _g(s){switch(s){case!0:return 1;case!1:return 0;default:return s}}function rb(s){return typeof s.collapsible=="boolean"}class AG{constructor(e,t,i,n={}){var o;this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new E0,this._onDidChangeCollapseState=new O,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new O,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new O,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Og(hT),this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.allowNonCollapsibleParents=(o=n.allowNonCollapsibleParents)!==null&&o!==void 0?o:!1,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren>"u"?!1:n.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=ot.empty(),n={}){if(e.length===0)throw new ms(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n,o,r){var a;n===void 0&&(n=ot.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,n,o);const c=[...n],d=t[t.length-1],u=new ea({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,d),...c,...l.children.slice(d+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),f=(_,v,b)=>{if(r>0)for(let C=0;Cb.originalStart-v.originalStart))f(g,m,g-(_.originalStart+_.originalLength)),g=_.originalStart,m=_.modifiedStart-d,this.spliceSimple([...h,g],_.originalLength,ot.slice(c,m,m+_.modifiedLength),o);f(g,m,g)}spliceSimple(e,t,i=ot.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=ot.map(i,y=>this.createTreeNode(y,a,a.visible?1:0,c,u,n)),f=e[e.length-1];let g=0;for(let y=f;y>=0&&yr.getId(y.element).toString())):a.lastDiffIds=a.children.map(y=>r.getId(y.element).toString()):a.lastDiffIds=void 0;let C=0;for(const y of b)y.visible&&C++;if(C!==0)for(let y=f+m.length;yL+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,v-y),this.list.splice(l,y,u)}if(b.length>0&&o){const y=L=>{o(L),L.children.forEach(y)};b.forEach(y)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:b});let w=a;for(;w;){if(w.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}w=w.parent}}rerender(e){if(e.length===0)throw new ms(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?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 n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);typeof t>"u"&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!rb(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 r}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(rb(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!rb(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,t,!0)||n;return n}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),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,o,r){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,n&&o.push(a);const c=e.children||ot.empty(),d=n&&l!==0&&!a.collapsed;let u=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,d,o,r);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=u++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=u,a.visible=l===2?u>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,n&&o.pop()),r==null||r(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,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,i,n&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,n&&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):lk(i)?(e.filterData=i.data,_g(i.visibility)):(e.filterData=void 0,_g(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...n]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new ms(this.user,"Invalid tree location");return this.getTreeNode(n,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:n,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new ms(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:n,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new ms(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function ab(s){return s instanceof tm?new MG(s):s}class RG{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=G.None,this.disposables=new pe}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){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,ab(e),t)}onDragOver(e,t,i,n,o,r=!0){const a=this.dnd.onDragOver(ab(e),t&&t.element,i,n,o),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=IC(()=>{const f=this.modelProvider(),g=f.getNodeLocation(t);f.isCollapsed(g)&&f.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){const f=typeof a=="boolean"?a:a.accept,g=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:g,feedback:[i]}}return a}if(a.bubble===1){const f=this.modelProvider(),g=f.getNodeLocation(t),m=f.getParentNodeLocation(g),_=f.getNode(m),v=m&&f.getListIndex(m);return this.onDragOver(e,_,v,n,o,!1)}const c=this.modelProvider(),d=c.getNodeLocation(t),u=c.getListIndex(d),h=c.getListRenderCount(d);return{...a,feedback:Rn(u,u+h)}}drop(e,t,i,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(ab(e),t&&t.element,i,n,o)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function PG(s,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new RG(s,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const i=s(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n);return i.getNode(o).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&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class ck{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){var i,n;(n=(i=this.delegate).setDynamicHeight)===null||n===void 0||n.call(i,e.element,t)}}var Hu;(function(s){s.None="none",s.OnHover="onHover",s.Always="always"})(Hu||(Hu={}));class FG{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new pe,this.onDidChange=te.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class vg{constructor(e,t,i,n,o,r={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=vg.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=G.None,this.disposables=new pe,this.templateId=e.templateId,this.updateOptions(r),te.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=Pn(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,n]of this.renderedNodes)this.renderTreeElement(i,n)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==Hu.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,n]of this.renderedNodes)this._renderIndentGuides(i,n);if(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=he(e,De(".monaco-tl-row")),i=he(t,De(".monaco-tl-indent")),n=he(t,De(".monaco-tl-twistie")),o=he(t,De(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:G.None,templateData:r}}renderElement(e,t,i,n){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){var o,r;i.indentGuidesDisposable.dispose(),(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,e,t,i.templateData,n),typeof n=="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._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=vg.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...et.asClassNameArray(ce.treeItemExpanded));let n=!1;this.renderer.renderTwistie&&(n=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(n||t.twistie.classList.add(...et.asClassNameArray(ce.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Po(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new pe,n=this.modelProvider();for(;;){const o=n.getNodeLocation(e),r=n.getParentNodeLocation(o);if(!r)break;const a=n.getNode(r),l=De(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(Be(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(n=>{const o=i.getNodeLocation(n);try{const r=i.getParentNodeLocation(o);n.collapsible&&n.children.length>0&&!n.collapsed?t.add(n):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(n=>{t.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.remove("active"))}),t.forEach(n=>{this.activeIndentNodes.has(n)||this.renderedIndentGuides.forEach(n,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Hi(this.disposables)}}vg.DefaultIndent=8;class OG{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}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)}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:lk(r)?i=_g(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:du.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:du.Default,visibility:i};let l;if(this.tree.findMatchType===Hc.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)l.push(c+d-1)}}else l=cg(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===ha.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:du.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Hi(this.disposables)}}var ha;(function(s){s[s.Highlight=0]="Highlight",s[s.Filter=1]="Filter"})(ha||(ha={}));var Hc;(function(s){s[s.Fuzzy=0]="Fuzzy",s[s.Contiguous=1]="Contiguous"})(Hc||(Hc={}));class BG{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n,o,r={}){var a,l;this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=o,this.options=r,this._pattern="",this.width=0,this._onDidChangeMode=new O,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new O,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new O,this._onDidChangeOpenState=new O,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new pe,this.disposables=new pe,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:ha.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Hc.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,i,n;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:p("not found","No elements found.")}):(i=this.widget)===null||i===void 0||i.showMessage({type:2}):(n=this.widget)===null||n===void 0||n.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!du.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}function WG(s,e){return s.position===e.position&&VR(s,e)}function VR(s,e){return s.node.element===e.node.element&&s.startIndex===e.startIndex&&s.height===e.height&&s.endIndex===e.endIndex}class VG{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Wi(this.stickyNodes,e.stickyNodes,WG)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Wi(this.stickyNodes,e.stickyNodes,VR)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class HG{constrainStickyScrollNodes(e,t,i){for(let n=0;ni||n>=t)return e.slice(0,n)}return e}}class hI extends G{constructor(e,t,i,n,o,r={}){var a;super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const l=this.validateStickySettings(r);this.stickyScrollMaxItemCount=l.stickyScrollMaxItemCount,this.stickyScrollDelegate=(a=r.stickyScrollDelegate)!==null&&a!==void 0?a:new HG,this._widget=this._register(new zG(i.getScrollableElement(),i,e,n,o,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}get height(){return this._widget.height}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,n=0,o=this.getNextStickyNode(i,void 0,n);for(;o&&(t.push(o),n+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,n);const r=this.constrainStickyNodes(t);return r.length?new VG(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n&&!(n===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(n,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),o=t;return this.view.scrollTop===n-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:n,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(n===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];const o=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return n}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const n=this.model.getListRenderCount(t),o=i+n-1;return{startIndex:i,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let o=0;o0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const n=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${n.position}px`;else{this._previousStateDisposables.clear();const o=Array(e.count);for(let r=e.count-1;r>=0;r--){const a=e.stickyNodes[r],{element:l,disposable:c}=this.createElement(a,r,e.count);o[r]=l,this._rootDomNode.appendChild(l),this._previousStateDisposables.add(c)}this.stickyScrollFocus.updateElements(o,e),this._previousElements=o}this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}createElement(e,t,i){const n=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(o.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${n}`),o.setAttribute("data-parity",n%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(n));const r=this.setAccessibilityAttributes(o,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),l=this.treeRenderers.find(h=>h.templateId===a);if(!l)throw new Error(`No renderer found for template id ${a}`);let c=e.node;c===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(c=new Proxy(e.node,{}));const d=l.renderTemplate(o);l.renderElement(c,e.startIndex,d,e.height);const u=Be(()=>{r.dispose(),l.disposeElement(c,e.startIndex,d,e.height),l.disposeTemplate(d),o.remove()});return{element:o,disposable:u}}setAccessibilityAttributes(e,t,i,n){var o;if(!this.accessibilityProvider)return G.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",(o=this.accessibilityProvider.getRole(t))!==null&&o!==void 0?o:"treeitem");const r=this.accessibilityProvider.getAriaLabel(t),a=r&&typeof r!="string"?r:q_(r),l=_t(d=>{const u=d.readObservable(a);u?e.setAttribute("aria-label",u):e.removeAttribute("aria-label")});typeof r=="string"||r&&e.setAttribute("aria-label",r.get());const c=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof c=="number"&&e.setAttribute("aria-level",`${c}`),e.setAttribute("aria-selected",String(!1)),l}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}}class UG extends G{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new O,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new O,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this.container.addEventListener("focus",()=>this.onFocus()),this.container.addEventListener("blur",()=>this.onBlur()),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!gg(t)&&!Ef(t)){this.focusedLast()&&this.view.domFocus();return}if(!$a(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const r=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)===null||l===void 0?void 0:l.element)});if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const n=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:n,anchor:o,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!gg(t)&&!Ef(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const n=Pn(i,0,t.count-1);this.setFocus(n)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),r=n?n.position+n.height+i.height:i.height;this.view.scrollTop=o-r}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function op(s){let e=_c.Unknown;return tv(s.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=_c.Twistie:tv(s.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=_c.Element:tv(s.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=_c.Filter),{browserEvent:s.browserEvent,element:s.element?s.element.element:null,target:e}}function $G(s){const e=gg(s.browserEvent.target);return{element:s.element?s.element.element:null,browserEvent:s.browserEvent,anchor:s.anchor,isStickyScroll:e}}function Fp(s,e){e(s),s.children.forEach(t=>Fp(t,e))}class lb{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new O,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Wi(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 n=this;this._onDidChange.fire({get elements(){return n.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(),c=d=>l.delete(d);t.forEach(d=>Fp(d,c)),this.set([...l.values()]);return}const i=new Set,n=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>Fp(l,n));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>Fp(l,r));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const u=o.get(c);u&&u.visible&&a.push(u)}}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 KG extends xR{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(SR(e.browserEvent.target)||vl(e.browserEvent.target)||Xh(e.browserEvent.target)||e.browserEvent.isHandledByList)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,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=Ef(e.browserEvent.target);let r=!1;if(o?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!n&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||n)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),n){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(Yj(e.browserEvent.target)||Qj(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),o=this.list.getElementTop(n),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-r,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!gg(t)&&!Ef(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!gg(t)&&!Ef(t)){super.onContextMenu(e);return}}}class jG extends Ko{constructor(e,t,i,n,o,r,a,l){super(e,t,i,n,l),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new KG(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const n=[],o=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&n.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),n.length>0&&super.setFocus(Nc([...super.getFocus(),...n])),o.length>0&&super.setSelection(Nc([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(n=>this.element(n)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(n=>this.element(n)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class HR{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return te.filter(te.map(this.view.onMouseDblClick,op),e=>e.target!==_c.Filter)}get onMouseOver(){return te.map(this.view.onMouseOver,op)}get onMouseOut(){return te.map(this.view.onMouseOut,op)}get onContextMenu(){var e,t;return te.any(te.filter(te.map(this.view.onContextMenu,$G),i=>!i.isStickyScroll),(t=(e=this.stickyScrollController)===null||e===void 0?void 0:e.onContextMenu)!==null&&t!==void 0?t:te.None)}get onPointer(){return te.map(this.view.onPointer,op)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return te.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:ha.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Hc.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}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}constructor(e,t,i,n,o={}){var r;this._user=e,this._options=o,this.eventBufferer=new E0,this.onDidChangeFindOpenState=te.None,this.onDidChangeStickyScrollFocused=te.None,this.disposables=new pe,this._onWillRefilter=new O,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new O,this.treeDelegate=new ck(i);const a=new oD,l=new oD,c=this.disposables.add(new FG(l.event)),d=new lA;this.renderers=n.map(m=>new vg(m,()=>this.model,a.event,c,d,o));for(const m of this.renderers)this.disposables.add(m);let u;o.keyboardNavigationLabelProvider&&(u=new OG(this,o.keyboardNavigationLabelProvider,o.filter),o={...o,filter:u},this.disposables.add(u)),this.focus=new lb(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new lb(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new lb(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new jG(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...PG(()=>this.model,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,o),a.input=this.model.onDidChangeCollapseState;const h=te.forEach(this.model.onDidSplice,m=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(m),this.selection.onDidModelSplice(m)})},this.disposables);h(()=>null,null,this.disposables);const f=this.disposables.add(new O),g=this.disposables.add(new Og(0));if(this.disposables.add(te.any(h,this.focus.onDidChange,this.selection.onDidChange)(()=>{g.trigger(()=>{const m=new Set;for(const _ of this.focus.getNodes())m.add(_);for(const _ of this.selection.getNodes())m.add(_);f.fire([...m.values()])})})),l.input=f.event,o.keyboardSupport!==!1){const m=te.chain(this.view.onKeyDown,_=>_.filter(v=>!vl(v.target)).map(v=>new Ot(v)));te.chain(m,_=>_.filter(v=>v.keyCode===15))(this.onLeftArrow,this,this.disposables),te.chain(m,_=>_.filter(v=>v.keyCode===17))(this.onRightArrow,this,this.disposables),te.chain(m,_=>_.filter(v=>v.keyCode===10))(this.onSpace,this,this.disposables)}if((!((r=o.findWidgetEnabled)!==null&&r!==void 0)||r)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const m=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new BG(this,this.model,this.view,u,o.contextViewProvider,m),this.focusNavigationFilter=_=>this.findController.shouldAllowFocus(_),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=te.None,this.onDidChangeFindMatchType=te.None;o.enableStickyScroll&&(this.stickyScrollController=new hI(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=ys(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Hu.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Hu.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new hI(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=te.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)===null||t===void 0||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){var e;!((e=this.stickyScrollController)===null||e===void 0)&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),Zu(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){var t,i;const n=`.${this.view.domId}`,o=[];e.treeIndentGuidesStroke&&(o.push(`.monaco-list${n}:hover .monaco-tl-indent > .indent-guide, .monaco-list${n}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),o.push(`.monaco-list${n} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));const r=(t=e.treeStickyScrollBackground)!==null&&t!==void 0?t:e.listBackground;r&&(o.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${r}; }`),o.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${r}; }`)),e.treeStickyScrollBorder&&o.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&o.push(`.monaco-list${n} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(o.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),o.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const a=ga(e.listFocusAndSelectionOutline,ga(e.listSelectionOutline,(i=e.listFocusOutline)!==null&&i!==void 0?i:""));a&&(o.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${a}; outline-offset: -1px;}`),o.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(o.push(`.monaco-list${n}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),o.push(`.monaco-list${n}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),o.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),o.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),o.push(`.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=o.join(` `),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,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){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=$a(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=$a(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=$a(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=$a(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i,n;return(n=(i=this.stickyScrollController)===null||i===void 0?void 0:i.height)!==null&&n!==void 0?n:0})}focusFirst(e,t=$a(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);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],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+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],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){var e;Hi(this.disposables),(e=this.stickyScrollController)===null||e===void 0||e.dispose(),this.view.dispose()}}class dk{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new AG(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,o){return i.sorter.compare(n.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=ot.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=ot.empty(),i){const n=new Set,o=new Set,r=l=>{var c;if(l.element===null)return;const d=l;if(n.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.add(u),this.nodesByIdentity.set(u,d)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,d)},a=l=>{var c;if(l.element===null)return;const d=l;if(n.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.has(u)||this.nodesByIdentity.delete(u)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=ot.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),ot.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===hs.Collapsed||t.collapsed===hs.PreserveOrCollapsed?r=!0:t.collapsed===hs.Expanded||t.collapsed===hs.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===hs.PreserveOrCollapsed||t.collapsed===hs.PreserveOrExpanded?o=i.collapsed:t.collapsed===hs.Collapsed?o=!0:t.collapsed===hs.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:n,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(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 n=this.getElementLocation(e);return this.model.setCollapsed(n,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 ms(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new ms(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new ms(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new ms(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function Op(s){const e=[s.element],t=s.incompressible||!1;return{element:{elements:e,incompressible:t},children:ot.map(ot.from(s.children),Op),collapsible:s.collapsible,collapsed:s.collapsed}}function Bp(s){const e=[s.element],t=s.incompressible||!1;let i,n;for(;[n,i]=ot.consume(ot.from(s.children),2),!(n.length!==1||n[0].incompressible);)s=n[0],e.push(s.element);return{element:{elements:e,incompressible:t},children:ot.map(ot.concat(n,i),Bp),collapsible:s.collapsible,collapsed:s.collapsed}}function py(s,e=0){let t;return epy(i,0)),e===0&&s.element.incompressible?{element:s.element.elements[e],children:t,incompressible:!0,collapsible:s.collapsible,collapsed:s.collapsed}:{element:s.element.elements[e],children:t,collapsible:s.collapsible,collapsed:s.collapsed}}function fI(s){return py(s,0)}function zR(s,e,t){return s.element===e?{...s,children:t}:{...s,children:ot.map(ot.from(s.children),i=>zR(i,e,t))}}const qG=s=>({getId(e){return e.elements.map(t=>s.getId(t).toString()).join("\0")}});class GG{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new dk(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=ot.empty(),i){const n=i.diffIdentityProvider&&qG(i.diffIdentityProvider);if(e===null){const g=ot.map(t,this.enabled?Bp:Op);this._setChildren(null,g,{diffIdentityProvider:n,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new ms(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=fI(r),d=zR(c,e,t),u=(this.enabled?Bp:Op)(d),h=i.diffIdentityProvider?(g,m)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(m):void 0;if(Wi(u.element.elements,r.element.elements,h)){this._setChildren(o,u.children||ot.empty(),{diffIdentityProvider:n,diffDepth:1});return}const f=l.children.map(g=>g===r?u:g);this._setChildren(l.element,f,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,n=ot.map(i,fI),o=ot.map(n,e?Bp:Op);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,o=a=>{for(const l of a.element.elements)n.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)n.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...i,onDidCreateNode:o,onDidDeleteNode:r})}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]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}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 n=this.getCompressedNode(e);return this.model.setCollapsed(n,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 ms(this.user,`Tree element not found: ${e}`);return t}}const ZG=s=>s[s.length-1];class uk{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new uk(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}constructor(e,t){this.unwrapper=e,this.node=t}}function YG(s,e){return{splice(t,i,n){e.splice(t,i,n.map(o=>s.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function QG(s,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(s(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(s(t),i)}}}}class XG{get onDidSplice(){return te.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 te.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return te.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||ZG;const n=o=>this.elementMapper(o.elements);this.nodeMapper=new ak(o=>new uk(n,o)),this.model=new GG(e,YG(this.nodeMapper,t),QG(n,i))}setChildren(e,t=ot.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}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)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}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 JG=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class hk extends HR{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=ot.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 dk(e,t,i)}}class UR{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){var o,r,a,l;i.compressedTreeNode?(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,i.compressedTreeNode,t,i.data,n):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}JG([Jt],UR.prototype,"compressedTreeNodeProvider",null);class eZ{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let n=0;ni||n>=t-1&&tthis,a=new eZ(()=>this.model),l=n.map(c=>new UR(r,a,c));super(e,t,i,l,{...tZ(r,o),stickyScrollDelegate:a})}setChildren(e,t=ot.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new XG(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)}}function cb(s){return{...s,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function _y(s,e){return e.parent?e.parent===s?!0:_y(s,e.parent):!1}function iZ(s,e){return s===e||_y(s,e)||_y(e,s)}class fk{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new fk(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}constructor(e){this.node=e}}class nZ{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,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...et.asClassNameArray(ce.treeItemLoading)),!0):(t.classList.remove(...et.asClassNameArray(ce.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function gI(s){return{browserEvent:s.browserEvent,elements:s.elements.map(e=>e.element)}}function mI(s){return{browserEvent:s.browserEvent,element:s.element&&s.element.element,target:s.target}}class sZ extends tm{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function db(s){return s instanceof tm?new sZ(s):s}class oZ{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){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,db(e),t)}onDragOver(e,t,i,n,o,r=!0){return this.dnd.onDragOver(db(e),t&&t.element,i,n,o)}drop(e,t,i,n,o){this.dnd.drop(db(e),t&&t.element,i,n,o)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.dnd.dispose()}}function KR(s){return s&&{...s,collapseByDefault:!0,identityProvider:s.identityProvider&&{getId(e){return s.identityProvider.getId(e.element)}},dnd:s.dnd&&new oZ(s.dnd),multipleSelectionController:s.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return s.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return s.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:s.accessibilityProvider&&{...s.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:s.accessibilityProvider.getRole?e=>s.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:s.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=s.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return s.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return s.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:s.accessibilityProvider.getWidgetRole?()=>s.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:s.accessibilityProvider.getAriaLevel&&(e=>s.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:s.accessibilityProvider.getActiveDescendantId&&(e=>s.accessibilityProvider.getActiveDescendantId(e.element))},filter:s.filter&&{filter(e,t){return s.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:s.keyboardNavigationLabelProvider&&{...s.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return s.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof s.expandOnlyOnTwistieClick>"u"?void 0:typeof s.expandOnlyOnTwistieClick!="function"?s.expandOnlyOnTwistieClick:e=>s.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof s.defaultFindVisibility=="number"?s.defaultFindVisibility:typeof s.defaultFindVisibility>"u"?2:s.defaultFindVisibility(e.element)}}function vy(s,e){e(s),s.children.forEach(t=>vy(t,e))}class jR{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return te.map(this.tree.onDidChangeFocus,gI)}get onDidChangeSelection(){return te.map(this.tree.onDidChangeSelection,gI)}get onMouseDblClick(){return te.map(this.tree.onMouseDblClick,mI)}get onPointer(){return te.map(this.tree.onPointer,mI)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new O,this._onDidChangeNodeSlowState=new O,this.nodeMapper=new ak(a=>new fk(a)),this.disposables=new pe,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=a=>r.collapseByDefault?r.collapseByDefault(a)?hs.PreserveOrCollapsed:hs.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,n,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=cb({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,n,o){const r=new ck(i),a=n.map(c=>new nZ(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=KR(o)||{};return new hk(e,t,r,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}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(n=>n.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await 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)}async _updateChildren(e=this.root.element,t=!0,i=!1,n,o){if(typeof this.root.element>"u")throw new ms(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await te.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,n,o),i)try{this.tree.rerender(r)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new ms(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await te.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await this.root.refreshPromise,await te.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await te.toPromise(this._onDidRender.event)),n}setSelection(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(n=>this.getDataNode(n));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new ms(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,n){await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,n)}async refreshNode(e,t,i){let n;if(this.subTreeRefreshPromises.forEach((o,r)=>{!n&&iZ(r,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n)return n;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){let n;e.refreshPromise=new Promise(o=>n=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=await this.doRefreshNode(e,t,i);e.stale=!1,await NC.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{n()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let n;if(!e.hasChildren)n=Promise.resolve(ot.empty());else{const o=this.doGetChildren(e);if(Jk(o))n=Promise.resolve(o);else{const r=Of(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),n=o.finally(()=>r.cancel())}}try{const o=await n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Mg(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return Jk(i)?this.processChildren(i):(t=fT(async()=>this.processChildren(await 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(At))}setChildren(e,t,i,n){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)r.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const l=[],c=o.map(d=>{const u=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const m=cb({element:d,parent:e,hasChildren:u,defaultCollapseState:this.getDefaultCollapseState(d)});return u&&m.defaultCollapseState===hs.PreserveOrExpanded&&l.push(m),m}const h=this.identityProvider.getId(d).toString(),f=a.get(h);if(f){const m=f.node;return r.delete(m.element),this.nodes.delete(m.element),this.nodes.set(d,m),m.element=d,m.hasChildren=u,i?f.collapsed?(m.children.forEach(_=>vy(_,v=>this.nodes.delete(v.element))),m.children.splice(0,m.children.length),m.stale=!0):l.push(m):u&&!f.collapsed&&l.push(m),m}const g=cb({element:d,parent:e,id:h,hasChildren:u,defaultCollapseState:this.getDefaultCollapseState(d)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(h)>-1&&n.focus.push(g),n&&n.viewState.selection&&n.viewState.selection.indexOf(h)>-1&&n.selection.push(g),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(h)>-1||u&&g.defaultCollapseState===hs.PreserveOrExpanded)&&l.push(g),g});for(const d of r.values())vy(d,u=>this.nodes.delete(u.element));for(const d of c)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].forceExpanded=!0,l.push(c[0])),l}render(e,t,i){const n=e.children.map(r=>this.asTreeElement(r,t)),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,n,o),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:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?ot.map(e.children,n=>this.asTreeElement(n,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(),this.tree.dispose()}}class gk{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 gk(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}constructor(e){this.node=e}}class rZ{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...et.asClassNameArray(ce.treeItemLoading)),!0):(t.classList.remove(...et.asClassNameArray(ce.treeItemLoading)),!1)}disposeElement(e,t,i,n){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){var o,r;(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Hi(this.disposables)}}function aZ(s){const e=s&&KR(s);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return s.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class lZ extends jR{constructor(e,t,i,n,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=n,this.compressibleNodeMapper=new ak(l=>new gk(l)),this.filter=a.filter}createTree(e,t,i,n,o){const r=new ck(i),a=n.map(c=>new rZ(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=aZ(o)||{};return new $R(e,t,r,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=f=>this.identityProvider.getId(f).toString(),o=f=>{const g=new Set;for(const m of f){const _=this.tree.getCompressedTreeNode(m===this.root?null:m);if(_.element)for(const v of _.element.elements)g.add(n(v.element))}return g},r=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,i);const l=this.getSelection();let c=!1;const d=this.getFocus();let u=!1;const h=f=>{const g=f.element;if(g)for(let m=0;m{const i=this.filter.filter(t,1),n=cZ(i);if(n===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return n===1})),super.processChildren(e)}}function cZ(s){return typeof s=="boolean"?s?1:0:lk(s)?_g(s.visibility):_g(s)}class dZ extends HR{constructor(e,t,i,n,o,r={}){super(e,t,i,n,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t,i){return new dk(e,t,i)}}new me("isMac",Ye,p("isMac","Whether the operating system is macOS"));new me("isLinux",Vn,p("isLinux","Whether the operating system is Linux"));const Ine=new me("isWindows",Wn,p("isWindows","Whether the operating system is Windows")),Nne=new me("isWeb",Yu,p("isWeb","Whether the platform is a web browser"));new me("isMacNative",Ye&&!Yu,p("isMacNative","Whether the operating system is macOS on a non-browser platform"));new me("isIOS",Cl,p("isIOS","Whether the operating system is iOS"));new me("isMobile",ON,p("isMobile","Whether the platform is a mobile web browser"));new me("isDevelopment",!1,!0);new me("productQualityType","",p("productQualityType","Quality type of VS Code"));const qR="inputFocus",uZ=new me(qR,!1,p("inputFocus","Whether keyboard focus is inside an input box"));var Ea=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Tt=function(s,e){return function(t,i){e(t,i,s)}};const Ar=Qe("listService");class hZ{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new pe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)===null||i===void 0||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new ER(ys(),"").style(oh)),this.lists.some(n=>n.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),US(e.getHTMLElement())&&this.setLastFocusedList(e),br(e.onDidFocus(()=>this.setLastFocusedList(e)),Be(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(n=>n!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const bg=new me("listScrollAtBoundary","none");st.or(bg.isEqualTo("top"),bg.isEqualTo("both"));st.or(bg.isEqualTo("bottom"),bg.isEqualTo("both"));const GR=new me("listFocus",!0),ZR=new me("treestickyScrollFocused",!1),S1=new me("listSupportsMultiselect",!0),Tne=st.and(GR,st.not(qR),ZR.negate()),mk=new me("listHasSelectionOrFocus",!1),pk=new me("listDoubleSelection",!1),_k=new me("listMultiSelection",!1),L1=new me("listSelectionNavigation",!1),fZ=new me("listSupportsFind",!0),gZ=new me("treeElementCanCollapse",!1),mZ=new me("treeElementHasParent",!1),pZ=new me("treeElementCanExpand",!1),_Z=new me("treeElementHasChild",!1),vZ=new me("treeFindOpen",!1),YR="listTypeNavigationMode",QR="listAutomaticKeyboardNavigation";function k1(s,e){const t=s.createScoped(e.getHTMLElement());return GR.bindTo(t),t}function D1(s,e){const t=bg.bindTo(s),i=()=>{const n=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;n&&o?t.set("both"):n?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const ad="workbench.list.multiSelectModifier",Wp="workbench.list.openMode",Us="workbench.list.horizontalScrolling",vk="workbench.list.defaultFindMode",bk="workbench.list.typeNavigationMode",i0="workbench.list.keyboardNavigation",Wo="workbench.list.scrollByPage",Ck="workbench.list.defaultFindMatchType",Cg="workbench.tree.indent",n0="workbench.tree.renderIndentGuides",Vo="workbench.list.smoothScrolling",Dr="workbench.list.mouseWheelScrollSensitivity",xr="workbench.list.fastScrollSensitivity",s0="workbench.tree.expandMode",o0="workbench.tree.enableStickyScroll",r0="workbench.tree.stickyScrollMaxItemCount";function Er(s){return s.getValue(ad)==="alt"}class bZ extends G{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Er(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(ad)&&(this.useAltAsMultipleSelectionModifier=Er(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:kR(e)}isSelectionRangeChangeEvent(e){return DR(e)}}function x1(s,e){var t;const i=s.get(Xt),n=s.get(Zi),o=new pe;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return n.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(Vo),mouseWheelScrollSensitivity:i.getValue(Dr),fastScrollSensitivity:i.getValue(xr),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new bZ(i)),keyboardNavigationEventFilter:yZ(n),scrollByPage:!!i.getValue(Wo)},o]}let pI=class extends Ko{constructor(e,t,i,n,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Us),[u,h]=c.invokeFunction(x1,o);super(e,t,i,n,{keyboardSupport:!1,...u,horizontalScrolling:d}),this.disposables.add(h),this.contextKeyService=k1(r,this),this.disposables.add(D1(this.contextKeyService,this)),this.listSupportsMultiSelect=S1.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),L1.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=mk.bindTo(this.contextKeyService),this.listDoubleSelection=pk.bindTo(this.contextKeyService),this.listMultiSelection=_k.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Er(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||m.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||m.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(ad)&&(this._useAltAsMultipleSelectionModifier=Er(l));let m={};if(g.affectsConfiguration(Us)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Us);m={...m,horizontalScrolling:_}}if(g.affectsConfiguration(Wo)){const _=!!l.getValue(Wo);m={...m,scrollByPage:_}}if(g.affectsConfiguration(Vo)){const _=!!l.getValue(Vo);m={...m,smoothScrolling:_}}if(g.affectsConfiguration(Dr)){const _=l.getValue(Dr);m={...m,mouseWheelScrollSensitivity:_}}if(g.affectsConfiguration(xr)){const _=l.getValue(xr);m={...m,fastScrollSensitivity:_}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new XR(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?sm(e):oh)}};pI=Ea([Tt(5,bt),Tt(6,Ar),Tt(7,Xt),Tt(8,vt)],pI);let _I=class extends CG{constructor(e,t,i,n,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Us),[u,h]=c.invokeFunction(x1,o);super(e,t,i,n,{keyboardSupport:!1,...u,horizontalScrolling:d}),this.disposables=new pe,this.disposables.add(h),this.contextKeyService=k1(r,this),this.disposables.add(D1(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=S1.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),L1.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Er(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(ad)&&(this._useAltAsMultipleSelectionModifier=Er(l));let m={};if(g.affectsConfiguration(Us)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Us);m={...m,horizontalScrolling:_}}if(g.affectsConfiguration(Wo)){const _=!!l.getValue(Wo);m={...m,scrollByPage:_}}if(g.affectsConfiguration(Vo)){const _=!!l.getValue(Vo);m={...m,smoothScrolling:_}}if(g.affectsConfiguration(Dr)){const _=l.getValue(Dr);m={...m,mouseWheelScrollSensitivity:_}}if(g.affectsConfiguration(xr)){const _=l.getValue(xr);m={...m,fastScrollSensitivity:_}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new XR(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?sm(e):oh)}dispose(){this.disposables.dispose(),super.dispose()}};_I=Ea([Tt(5,bt),Tt(6,Ar),Tt(7,Xt),Tt(8,vt)],_I);let vI=class extends y1{constructor(e,t,i,n,o,r,a,l,c,d){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(Us),[h,f]=d.invokeFunction(x1,r);super(e,t,i,n,o,{keyboardSupport:!1,...h,horizontalScrolling:u}),this.disposables.add(f),this.contextKeyService=k1(a,this),this.disposables.add(D1(this.contextKeyService,this)),this.listSupportsMultiSelect=S1.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),L1.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=mk.bindTo(this.contextKeyService),this.listDoubleSelection=pk.bindTo(this.contextKeyService),this.listMultiSelection=_k.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Er(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||_.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||_.length>0)})),this.disposables.add(c.onDidChangeConfiguration(m=>{m.affectsConfiguration(ad)&&(this._useAltAsMultipleSelectionModifier=Er(c));let _={};if(m.affectsConfiguration(Us)&&this.horizontalScrolling===void 0){const v=!!c.getValue(Us);_={..._,horizontalScrolling:v}}if(m.affectsConfiguration(Wo)){const v=!!c.getValue(Wo);_={..._,scrollByPage:v}}if(m.affectsConfiguration(Vo)){const v=!!c.getValue(Vo);_={..._,smoothScrolling:v}}if(m.affectsConfiguration(Dr)){const v=c.getValue(Dr);_={..._,mouseWheelScrollSensitivity:v}}if(m.affectsConfiguration(xr)){const v=c.getValue(xr);_={..._,fastScrollSensitivity:v}}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new CZ(this,{configurationService:c,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?sm(e):oh)}dispose(){this.disposables.dispose(),super.dispose()}};vI=Ea([Tt(6,bt),Tt(7,Ar),Tt(8,Xt),Tt(9,vt)],vI);class wk extends G{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new O),this.onDidOpen=this._onDidOpen.event,this._register(te.filter(this.widget.onDidChangeSelection,n=>$a(n.browserEvent))(n=>this.onSelectionFromKeyboard(n))),this._register(this.widget.onPointer(n=>this.onPointer(n.element,n.browserEvent))),this._register(this.widget.onMouseDblClick(n=>this.onMouseDblClick(n.element,n.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(Wp))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(n=>{n.affectsConfiguration(Wp)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(Wp))!=="doubleClick")}))):this.openOnSingleClick=(i=t==null?void 0: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,n=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const n=t.button===1,o=!0,r=n,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,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 o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class XR extends wk{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class CZ extends wk{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class wZ extends wk{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function yZ(s){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=s.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let by=class extends hk{constructor(e,t,i,n,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(am,o);super(e,t,i,n,d),this.disposables.add(h),this.internals=new zc(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};by=Ea([Tt(5,vt),Tt(6,bt),Tt(7,Ar),Tt(8,Xt)],by);let bI=class extends $R{constructor(e,t,i,n,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(am,o);super(e,t,i,n,d),this.disposables.add(h),this.internals=new zc(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};bI=Ea([Tt(5,vt),Tt(6,bt),Tt(7,Ar),Tt(8,Xt)],bI);let CI=class extends dZ{constructor(e,t,i,n,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(am,r);super(e,t,i,n,o,u),this.disposables.add(f),this.internals=new zc(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};CI=Ea([Tt(6,vt),Tt(7,bt),Tt(8,Ar),Tt(9,Xt)],CI);let wI=class extends jR{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(am,r);super(e,t,i,n,o,u),this.disposables.add(f),this.internals=new zc(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};wI=Ea([Tt(6,vt),Tt(7,bt),Tt(8,Ar),Tt(9,Xt)],wI);let yI=class extends lZ{constructor(e,t,i,n,o,r,a,l,c,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(am,a);super(e,t,i,n,o,r,h),this.disposables.add(g),this.internals=new zc(this,a,f,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};yI=Ea([Tt(7,vt),Tt(8,bt),Tt(9,Ar),Tt(10,Xt)],yI);function JR(s){const e=s.getValue(vk);if(e==="highlight")return ha.Highlight;if(e==="filter")return ha.Filter;const t=s.getValue(i0);if(t==="simple"||t==="highlight")return ha.Highlight;if(t==="filter")return ha.Filter}function e4(s){const e=s.getValue(Ck);if(e==="fuzzy")return Hc.Fuzzy;if(e==="contiguous")return Hc.Contiguous}function am(s,e){var t;const i=s.get(Xt),n=s.get(Jg),o=s.get(bt),r=s.get(vt),a=()=>{const f=o.getContextKeyValue(YR);if(f==="automatic")return ur.Automatic;if(f==="trigger"||o.getContextKeyValue(QR)===!1)return ur.Trigger;const m=i.getValue(bk);if(m==="automatic")return ur.Automatic;if(m==="trigger")return ur.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(Us),[c,d]=r.invokeFunction(x1,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(n0);return{getTypeNavigationMode:a,disposable:d,options:{keyboardSupport:!1,...c,indent:typeof i.getValue(Cg)=="number"?i.getValue(Cg):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(Vo),defaultFindMode:JR(i),defaultFindMatchType:e4(i),horizontalScrolling:l,scrollByPage:!!i.getValue(Wo),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(s0)==="doubleClick",contextViewProvider:n,findWidgetStyles:yq,enableStickyScroll:!!i.getValue(o0),stickyScrollMaxItemCount:Number(i.getValue(r0))}}}let zc=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,r,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=k1(o,e),this.disposables.push(D1(this.contextKeyService,e)),this.listSupportsMultiSelect=S1.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),L1.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=fZ.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=mk.bindTo(this.contextKeyService),this.hasDoubleSelection=pk.bindTo(this.contextKeyService),this.hasMultiSelection=_k.bindTo(this.contextKeyService),this.treeElementCanCollapse=gZ.bindTo(this.contextKeyService),this.treeElementHasParent=mZ.bindTo(this.contextKeyService),this.treeElementCanExpand=pZ.bindTo(this.contextKeyService),this.treeElementHasChild=_Z.bindTo(this.contextKeyService),this.treeFindOpen=vZ.bindTo(this.contextKeyService),this.treeStickyScrollFocused=ZR.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Er(a),this.updateStyleOverrides(n);const d=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},u=new Set;u.add(YR),u.add(QR),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),d()}),e.onDidChangeCollapseState(d),e.onDidChangeModel(d),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(ad)&&(this._useAltAsMultipleSelectionModifier=Er(a)),h.affectsConfiguration(Cg)){const g=a.getValue(Cg);f={...f,indent:g}}if(h.affectsConfiguration(n0)&&t.renderIndentGuides===void 0){const g=a.getValue(n0);f={...f,renderIndentGuides:g}}if(h.affectsConfiguration(Vo)){const g=!!a.getValue(Vo);f={...f,smoothScrolling:g}}if(h.affectsConfiguration(vk)||h.affectsConfiguration(i0)){const g=JR(a);f={...f,defaultFindMode:g}}if(h.affectsConfiguration(bk)||h.affectsConfiguration(i0)){const g=i();f={...f,typeNavigationMode:g}}if(h.affectsConfiguration(Ck)){const g=e4(a);f={...f,defaultFindMatchType:g}}if(h.affectsConfiguration(Us)&&t.horizontalScrolling===void 0){const g=!!a.getValue(Us);f={...f,horizontalScrolling:g}}if(h.affectsConfiguration(Wo)){const g=!!a.getValue(Wo);f={...f,scrollByPage:g}}if(h.affectsConfiguration(s0)&&t.expandOnlyOnTwistieClick===void 0&&(f={...f,expandOnlyOnTwistieClick:a.getValue(s0)==="doubleClick"}),h.affectsConfiguration(o0)){const g=a.getValue(o0);f={...f,enableStickyScroll:g}}if(h.affectsConfiguration(r0)){const g=Math.max(1,a.getValue(r0));f={...f,stickyScrollMaxItemCount:g}}if(h.affectsConfiguration(Dr)){const g=a.getValue(Dr);f={...f,mouseWheelScrollSensitivity:g}}if(h.affectsConfiguration(xr)){const g=a.getValue(xr);f={...f,fastScrollSensitivity:g}}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(u)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new wZ(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?sm(e):oh)}dispose(){this.disposables=Hi(this.disposables)}};zc=Ea([Tt(4,bt),Tt(5,Ar),Tt(6,Xt)],zc);const SZ=zi.as(td.Configuration);SZ.registerConfiguration({id:"workbench",order:7,title:p("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[ad]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[p("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),p("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:p({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.")},[Wp]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:p({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.")},[Us]:{type:"boolean",default:!1,description:p("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Wo]:{type:"boolean",default:!1,description:p("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[Cg]:{type:"number",default:8,minimum:4,maximum:40,description:p("tree indent setting","Controls tree indentation in pixels.")},[n0]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:p("render tree indent guides","Controls whether the tree should render indent guides.")},[Vo]:{type:"boolean",default:!1,description:p("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[Dr]:{type:"number",default:1,markdownDescription:p("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[xr]:{type:"number",default:5,markdownDescription:p("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[vk]:{type:"string",enum:["highlight","filter"],enumDescriptions:[p("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),p("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:p("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[i0]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[p("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),p("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),p("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:p("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:p("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[Ck]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[p("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),p("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:p("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[s0]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:p("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.")},[o0]:{type:"boolean",default:!0,description:p("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},[r0]:{type:"number",minimum:1,default:7,markdownDescription:p("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when `#workbench.tree.enableStickyScroll#` is enabled.")},[bk]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:p("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});class Ic extends G{constructor(e,t){var i;super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(i=t==null?void 0:t.supportIcons)!==null&&i!==void 0?i:!1,this.domNode=he(e,De("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=Ic.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&bs(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){var e,t,i,n;const o=[];let r=0;for(const a of this.highlights){if(a.end===a.start)continue;if(r{n=o===`\r `?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class Ih{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 SI extends G{constructor(e,t){var i;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new Ih(he(e,De(".monaco-icon-label")))),this.labelContainer=he(this.domNode.element,De(".monaco-icon-label-container")),this.nameContainer=he(this.labelContainer,De("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=this._register(new DZ(this.nameContainer,!!t.supportIcons)):this.nameNode=new LZ(this.nameContainer),this.hoverDelegate=(i=t==null?void 0:t.hoverDelegate)!==null&&i!==void 0?i:$s("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){var n;const o=["monaco-icon-label"],r=["monaco-icon-label-container"];let a="";i&&(i.extraClasses&&o.push(...i.extraClasses),i.italic&&o.push("italic"),i.strikethrough&&o.push("strikethrough"),i.disabledCommand&&r.push("disabled"),i.title&&(typeof i.title=="string"?a+=i.title:a+=e));const l=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i!=null&&i.iconPath){let c;!l||!Vi(l)?(c=De(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=l,c.style.backgroundImage=Sa(i==null?void 0:i.iconPath)}else l&&l.remove();if(this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=r.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const c=this.getOrCreateDescriptionNode();c instanceof Ic?(c.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(c.element,i==null?void 0:i.descriptionTitle)):(c.textContent=t&&(i!=null&&i.labelEscapeNewLines)?Ic.escapeNewLines(t,[]):t||"",this.setupHover(c.element,(i==null?void 0:i.descriptionTitle)||""),c.empty=!t)}if(i!=null&&i.suffix||this.suffixNode){const c=this.getOrCreateSuffixNode();c.textContent=(n=i==null?void 0:i.suffix)!==null&&n!==void 0?n:""}}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.showNativeHover)(function(o,r){Jn(r)?o.title=lR(r):r!=null&&r.markdownNotSupportedFallback?o.title=r.markdownNotSupportedFallback:o.removeAttribute("title")})(e,t);else{const n=Tr().setupUpdatableHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new Ih($O(this.nameContainer,De("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new Ih(he(e.element,De("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new Ih(he(this.labelContainer,De("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new Ic(he(t.element,De("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new Ih(he(t.element,De("span.label-description"))))}return this.descriptionNode}}class LZ{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&bs(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=he(this.container,De("a.label-name",{id:t==null?void 0: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 o={start:i,end:i+n.length},r=t.map(a=>Xi.intersect(o,a)).filter(a=>!Xi.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class DZ extends G{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&bs(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=this._register(new Ic(he(this.container,De("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",n=kZ(e,i,t==null?void 0:t.matches);for(let o=0;o{const s=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:s,collatorIsNumeric:s.resolvedOptions().numeric}});function xZ(s,e,t=!1){const i=s||"",n=e||"",o=LI.value.collator.compare(i,n);return LI.value.collatorIsNumeric&&o===0&&i!==n?in.length)return 1}return 0}var E1=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Cy=function(s,e){return function(t,i){e(t,i,s)}},wy;const Co=De;class t4{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new Ml(()=>{var n;const o=(n=i.label)!==null&&n!==void 0?n:"",r=Qh(o).text.trim(),a=i.ariaLabel||[o,this.saneDescription,this.saneDetail].map(l=>U$(l)).filter(l=>!!l).join(", ");return{saneLabel:o,saneSortLabel:r,saneAriaLabel:a}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class dn extends t4{constructor(e,t,i,n,o,r){var a,l,c;super(e,t,o),this.fireButtonTriggered=i,this._onChecked=n,this.item=o,this._separator=r,this._checked=!1,this.onChecked=t?te.map(te.filter(this._onChecked.event,d=>d.element===this),d=>d.checked):te.None,this._saneDetail=o.detail,this._labelHighlights=(a=o.highlights)===null||a===void 0?void 0:a.label,this._descriptionHighlights=(l=o.highlights)===null||l===void 0?void 0:l.description,this._detailHighlights=(c=o.highlights)===null||c===void 0?void 0:c.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var sr;(function(s){s[s.NONE=0]="NONE",s[s.MOUSE_HOVER=1]="MOUSE_HOVER",s[s.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(sr||(sr={}));class Wa extends t4{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=sr.NONE}}class NZ{getHeight(e){return e instanceof Wa?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof dn?wg.ID:lm.ID}}class TZ{getWidgetAriaLabel(){return p("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof dn)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class i4{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new pe,t.toDisposeTemplate=new pe,t.entry=he(e,Co(".quick-input-list-entry"));const i=he(t.entry,Co("label.quick-input-list-label"));t.toDisposeTemplate.add(Ai(i,J.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=he(i,Co("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const n=he(i,Co(".quick-input-list-rows")),o=he(n,Co(".quick-input-list-row")),r=he(n,Co(".quick-input-list-row"));t.label=new SI(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=qS(t.label.element,Co(".quick-input-list-icon"));const a=he(o,Co(".quick-input-list-entry-keybinding"));t.keybinding=new yk(a,to),t.toDisposeTemplate.add(t.keybinding);const l=he(r,Co(".quick-input-list-label-meta"));return t.detail=new SI(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=he(t.entry,Co(".quick-input-list-separator")),t.actionBar=new Il(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}let wg=wy=class extends i4{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return wy.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(Ai(t.checkbox,J.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){var n,o,r;const a=e.element;i.element=a,a.element=(n=i.entry)!==null&&n!==void 0?n:void 0;const l=a.item;i.checkbox.checked=a.checked,i.toDisposeElement.add(a.onChecked(m=>i.checkbox.checked=m)),i.checkbox.disabled=a.checkboxDisabled;const{labelHighlights:c,descriptionHighlights:d,detailHighlights:u}=a;if(l.iconPath){const m=e1(this.themeService.getColorTheme().type)?l.iconPath.dark:(o=l.iconPath.light)!==null&&o!==void 0?o:l.iconPath.dark,_=$e.revive(m);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Sa(_)}else i.icon.style.backgroundImage="",i.icon.className=l.iconClass?`quick-input-list-icon ${l.iconClass}`:"";let h;!a.saneTooltip&&a.saneDescription&&(h={markdown:{value:a.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:a.saneDescription});const f={matches:c||[],descriptionTitle:h,descriptionMatches:d||[],labelEscapeNewLines:!0};if(f.extraClasses=l.iconClasses,f.italic=l.italic,f.strikethrough=l.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(a.saneLabel,a.saneDescription,f),i.keybinding.set(l.keybinding),a.saneDetail){let m;a.saneTooltip||(m={markdown:{value:a.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:a.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(a.saneDetail,void 0,{matches:u,title:m,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";!((r=a.separator)===null||r===void 0)&&r.label?(i.separator.textContent=a.separator.label,i.separator.style.display="",this.addItemWithSeparator(a)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!a.separator);const g=l.buttons;g&&g.length?(i.actionBar.push(g.map((m,_)=>e0(m,`id-${_}`,()=>a.fireButtonTriggered({button:m,item:a.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}};wg.ID="quickpickitem";wg=wy=E1([Cy(1,ho)],wg);class lm extends i4{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return lm.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){var n;const o=e.element;i.element=o,o.element=(n=i.entry)!==null&&n!==void 0?n:void 0,o.element.classList.toggle("focus-inside",!!o.focusInsideSeparator);const r=o.separator,{labelHighlights:a,descriptionHighlights:l,detailHighlights:c}=o;i.icon.style.backgroundImage="",i.icon.className="";let d;!o.saneTooltip&&o.saneDescription&&(d={markdown:{value:o.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:o.saneDescription});const u={matches:a||[],descriptionTitle:d,descriptionMatches:l||[],labelEscapeNewLines:!0};if(i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(o.saneLabel,o.saneDescription,u),o.saneDetail){let f;o.saneTooltip||(f={markdown:{value:o.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:o.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(o.saneDetail,void 0,{matches:c,title:f,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const h=r.buttons;h&&h.length?(i.actionBar.push(h.map((f,g)=>e0(f,`id-${g}`,()=>o.fireSeparatorButtonTriggered({button:f,separator:o.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(o)}disposeElement(e,t,i){var n;this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||(n=e.element.element)===null||n===void 0||n.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}}lm.ID="quickpickseparator";let yg=class extends G{constructor(e,t,i,n,o,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new O,this._onLeave=new O,this.onLeave=this._onLeave.event,this._onChangedAllVisibleChecked=new O,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new O,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new O,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new O,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new O,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new O,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new O,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new pe),this._shouldFireCheckedEvents=!0,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=he(this.parent,Co(".quick-input-list")),this._separatorRenderer=new lm(t),this._itemRenderer=o.createInstance(wg,t),this._tree=this._register(o.createInstance(by,"QuickInput",this._container,new NZ,[this._itemRenderer,this._separatorRenderer],{accessibilityProvider:new TZ,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:Hu.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return te.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof dn).map(t=>t.item))}get onDidChangeSelection(){return te.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof dn).map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new Ot(e);switch(t.keyCode){case 10:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(j(this._container,J.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(j(this._container,J.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnElementChecked(){this._register(this._elementChecked.event(e=>this._fireCheckedEvents()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new gT(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{var i;if(FD(t.browserEvent.target)){e.cancel();return}if(!(!FD(t.browserEvent.relatedTarget)&&Ni(t.browserEvent.relatedTarget,(i=t.element)===null||i===void 0?void 0:i.element)))try{await e.trigger(async()=>{t.element instanceof dn&&this.showHover(t.element)})}catch(n){if(!Mg(n))throw n}})),this._register(this._tree.onMouseOut(t=>{var i;Ni(t.browserEvent.relatedTarget,(i=t.element)===null||i===void 0?void 0:i.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const n=i===t;!!(i.focusInsideSeparator&sr.ACTIVE_ITEM)!==n&&(n?i.focusInsideSeparator|=sr.ACTIVE_ITEM:i.focusInsideSeparator&=~sr.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&sr.MOUSE_HOVER)||(i.focusInsideSeparator|=sr.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&sr.MOUSE_HOVER)&&(i.focusInsideSeparator&=~sr.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof dn);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof Wa&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}getAllVisibleChecked(){return this._allVisibleChecked(this._itemElements,!1)}getCheckedCount(){return this._itemElements.filter(e=>e.checked).length}getVisibleCount(){return this._itemElements.filter(e=>!e.hidden).length}setAllVisibleChecked(e){try{this._shouldFireCheckedEvents=!1,this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}setElements(e){this._elementDisposable.clear(),this._inputElements=e;const t=this.parent.classList.contains("show-checkboxes");let i;this._itemElements=new Array,this._elementTree=e.reduce((r,a,l)=>{let c;if(a.type==="separator"){if(!a.buttons)return r;i=new Wa(l,d=>this.fireSeparatorButtonTriggered(d),a),c=i}else{const d=l>0?e[l-1]:void 0;let u;d&&d.type==="separator"&&!d.buttons&&(i=void 0,u=d);const h=new dn(l,t,f=>this.fireButtonTriggered(f),this._elementChecked,a,u);if(this._itemElements.push(h),i)return i.children.push(h),r;c=h}return r.push(c),r},new Array);const n=new Array;let o=0;for(const r of this._elementTree)r instanceof Wa?(n.push({element:r,collapsible:!1,collapsed:!1,children:r.children.map(a=>({element:a,collapsible:!1,collapsed:!1}))}),o+=r.children.length+1):(n.push({element:r,collapsible:!1,collapsed:!1}),o++);this._tree.setChildren(null,n),this._onChangedVisibleCount.fire(o),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const r=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),a=r==null?void 0:r.parentNode;if(r&&a){const l=r.nextSibling;a.removeChild(r),a.insertBefore(r,l)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(n=>n.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._shouldFireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}focus(e){var t;if(this._itemElements.length)switch(e===Et.Second&&this._itemElements.length<2&&(e=Et.First),e){case Et.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,i=>i.element instanceof dn);break;case Et.Second:this._tree.scrollTop=0,this._tree.setFocus([this._itemElements[1]]);break;case Et.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]);break;case Et.Next:{const i=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,o=>o.element instanceof dn?(this._tree.reveal(o.element),!0):!1);const n=this._tree.getFocus();i.length&&i[0]===n[0]&&i[0]===this._itemElements[this._itemElements.length-1]&&this._onLeave.fire();break}case Et.Previous:{const i=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,o=>{if(!(o.element instanceof dn))return!1;const r=this._tree.getParentElement(o.element);return r===null||r.children[0]!==o.element?this._tree.reveal(o.element):this._tree.reveal(r),!0});const n=this._tree.getFocus();i.length&&i[0]===n[0]&&i[0]===this._itemElements[0]&&this._onLeave.fire();break}case Et.NextPage:this._tree.focusNextPage(void 0,i=>i.element instanceof dn?(this._tree.reveal(i.element),!0):!1);break;case Et.PreviousPage:this._tree.focusPreviousPage(void 0,i=>{if(!(i.element instanceof dn))return!1;const n=this._tree.getParentElement(i.element);return n===null||n.children[0]!==i.element?this._tree.reveal(i.element):this._tree.reveal(n),!0});break;case Et.NextSeparator:{let i=!1;const n=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,r=>{if(i)return!0;if(r.element instanceof Wa)i=!0,this._separatorRenderer.isSeparatorVisible(r.element)?this._tree.reveal(r.element.children[0]):this._tree.reveal(r.element,0);else if(r.element instanceof dn){if(r.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(r.element)?this._tree.reveal(r.element):this._tree.reveal(r.element,0),!0;if(r.element===this._elementTree[0])return this._tree.reveal(r.element,0),!0}return!1});const o=this._tree.getFocus()[0];n===o&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.setFocus([this._itemElements[this._itemElements.length-1]]));break}case Et.PreviousSeparator:{let i,n=!!(!((t=this._tree.getFocus()[0])===null||t===void 0)&&t.separator);this._tree.focusPrevious(void 0,!0,void 0,o=>{if(o.element instanceof Wa)n?i||(this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),i=o.element.children[0]):n=!0;else if(o.element instanceof dn&&!i){if(o.element.separator)this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),i=o.element;else if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1}),i&&this._tree.setFocus([i]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(a=>{a.labelHighlights=void 0,a.descriptionHighlights=void 0,a.detailHighlights=void 0,a.hidden=!1;const l=a.index&&this._inputElements[a.index-1];a.item&&(a.separator=l&&l.type==="separator"&&!l.buttons?l:void 0)});else{let a;this._elementTree.forEach(l=>{var c,d,u,h;let f;this.matchOnLabelMode==="fuzzy"?f=this.matchOnLabel&&(c=Yv(e,Qh(l.saneLabel)))!==null&&c!==void 0?c:void 0:f=this.matchOnLabel&&(d=AZ(t,Qh(l.saneLabel)))!==null&&d!==void 0?d:void 0;const g=this.matchOnDescription&&(u=Yv(e,Qh(l.saneDescription||"")))!==null&&u!==void 0?u:void 0,m=this.matchOnDetail&&(h=Yv(e,Qh(l.saneDetail||"")))!==null&&h!==void 0?h:void 0;if(f||g||m?(l.labelHighlights=f,l.descriptionHighlights=g,l.detailHighlights=m,l.hidden=!1):(l.labelHighlights=void 0,l.descriptionHighlights=void 0,l.detailHighlights=void 0,l.hidden=l.item?!l.item.alwaysShow:!0),l.item?l.separator=void 0:l.separator&&(l.hidden=!0),!this.sortByLabel){const _=l.index&&this._inputElements[l.index-1];a=_&&_.type==="separator"?_:a,a&&!l.hidden&&(l.separator=a,a=void 0)}})}const i=this._elementTree.filter(a=>!a.hidden);if(this.sortByLabel&&e){const a=e.toLowerCase();i.sort((l,c)=>MZ(l,c,a))}let n;const o=i.reduce((a,l,c)=>(l instanceof dn?n?n.children.push(l):a.push(l):l instanceof Wa&&(l.children=[],n=l,a.push(l)),a),new Array),r=new Array;for(const a of o)a instanceof Wa?r.push({element:a,collapsible:!1,collapsed:!1,children:a.children.map(l=>({element:l,collapsible:!1,collapsed:!1}))}):r.push({element:a,collapsible:!1,collapsed:!1});return this._tree.setChildren(null,r),this._tree.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._shouldFireCheckedEvents=!1;const e=this._tree.getFocus().filter(i=>i instanceof dn),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)}finally{this._shouldFireCheckedEvents=!0,this._fireCheckedEvents()}}display(e){this._container.style.display=e?"":"none"}isDisplayed(){return this._container.style.display!=="none"}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!(e!=null&&e.saneTooltip)||!(e instanceof dn))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new pe;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof dn&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{this.linkOpenerDelegate(o)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};E1([Jt],yg.prototype,"onDidChangeFocus",null);E1([Jt],yg.prototype,"onDidChangeSelection",null);yg=E1([Cy(4,vt),Cy(5,Uo)],yg);function AZ(s,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return kI(s,t);const n=N0(t," "),o=t.length-n.length,r=kI(s,n);if(r)for(const a of r){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return r}function kI(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t!==-1?[{start:t,end:t+s.length}]:null}function MZ(s,e,t){const i=s.labelHighlights||[],n=e.labelHighlights||[];return i.length&&!n.length?-1:!i.length&&n.length?1:i.length===0&&n.length===0?0:EZ(s.saneSortLabel,e.saneSortLabel,t)}const n4={weight:200,when:st.and(st.equals(OR,"quickPick"),Xq),metadata:{description:p("quickPick","Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")}};function Gn(s,e={}){var t;Fc.registerCommandAndKeybindingRule({...n4,...s,secondary:RZ(s.primary,(t=s.secondary)!==null&&t!==void 0?t:[],e)})}const a0=Ye?256:2048;function RZ(s,e,t={}){return t.withAltMod&&e.push(512+s),t.withCtrlMod&&(e.push(a0+s),t.withAltMod&&e.push(512+a0+s)),t.withCmdMod&&Ye&&(e.push(2048+s),t.withCtrlMod&&e.push(2304+s),t.withAltMod&&(e.push(2560+s),t.withCtrlMod&&e.push(2816+s))),e}function fs(s,e){return t=>{const i=t.get(b1).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(s)}}Gn({id:"quickInput.pageNext",primary:12,handler:fs(Et.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Gn({id:"quickInput.pagePrevious",primary:11,handler:fs(Et.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Gn({id:"quickInput.first",primary:a0+14,handler:fs(Et.First)},{withAltMod:!0,withCmdMod:!0});Gn({id:"quickInput.last",primary:a0+13,handler:fs(Et.Last)},{withAltMod:!0,withCmdMod:!0});Gn({id:"quickInput.next",primary:18,handler:fs(Et.Next)},{withCtrlMod:!0});Gn({id:"quickInput.previous",primary:16,handler:fs(Et.Previous)},{withCtrlMod:!0});const DI=p("quickInput.nextSeparatorWithQuickAccessFallback","If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),xI=p("quickInput.previousSeparatorWithQuickAccessFallback","If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");Ye?(Gn({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:fs(Et.NextSeparator,Et.Next),metadata:{description:DI}}),Gn({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:fs(Et.NextSeparator)},{withCtrlMod:!0}),Gn({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:fs(Et.PreviousSeparator,Et.Previous),metadata:{description:xI}}),Gn({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:fs(Et.PreviousSeparator)},{withCtrlMod:!0})):(Gn({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:fs(Et.NextSeparator,Et.Next),metadata:{description:DI}}),Gn({id:"quickInput.nextSeparator",primary:2578,handler:fs(Et.NextSeparator)}),Gn({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:fs(Et.PreviousSeparator,Et.Previous),metadata:{description:xI}}),Gn({id:"quickInput.previousSeparator",primary:2576,handler:fs(Et.PreviousSeparator)}));Gn({id:"quickInput.acceptInBackground",when:st.and(n4.when,st.or(uZ.negate(),tG)),primary:17,weight:250,handler:s=>{const e=s.get(b1).currentQuickInput;e==null||e.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var PZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ub=function(s,e){return function(t,i){e(t,i,s)}},yy;const $n=De;let l0=yy=class extends G{get currentQuickInput(){var e;return(e=this.controller)!==null&&e!==void 0?e:void 0}get container(){return this._container}constructor(e,t,i,n){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.contextKeyService=n,this.enabled=!0,this.onDidAcceptEmitter=this._register(new O),this.onDidCustomEmitter=this._register(new O),this.onDidTriggerButtonEmitter=this._register(new O),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new O),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new O),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=Qq.bindTo(this.contextKeyService),this.quickInputTypeContext=Jq.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=eG.bindTo(this.contextKeyService),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(te.runAndSubscribe(M0,({window:o,disposables:r})=>this.registerKeyModsListeners(o,r),{window:wt,disposables:this._store})),this._register(EO(o=>{this.ui&&be(this.ui.container)===o&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=n=>{this.keyMods.ctrlCmd=n.ctrlKey||n.metaKey,this.keyMods.alt=n.altKey};for(const n of[J.KEY_DOWN,J.KEY_UP,J.MOUSE_DOWN])t.add(j(e,n,i,!0))}getUI(e){if(this.ui)return e&&be(this._container)!==be(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=he(this._container,$n(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=ys(t),n=he(t,$n(".quick-input-titlebar")),o=this._register(new Il(n,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=he(n,$n(".quick-input-title")),a=this._register(new Il(n,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=he(t,$n(".quick-input-header")),c=he(l,$n("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",p("quickInput.checkAll","Toggle all checkboxes")),this._register(Ai(c,J.CHANGE,P=>{const H=c.checked;R.setAllVisibleChecked(H)})),this._register(j(c,J.CLICK,P=>{(P.x||P.y)&&f.setFocus()}));const d=he(l,$n(".quick-input-description")),u=he(l,$n(".quick-input-and-message")),h=he(u,$n(".quick-input-filter")),f=this._register(new pG(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=he(h,$n(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const m=new oI(g,{countFormat:p({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),_=he(h,$n(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new oI(_,{countFormat:p({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),b=he(l,$n(".quick-input-action")),C=this._register(new my(b,this.styles.button));C.label=p("ok","OK"),this._register(C.onDidClick(P=>{this.onDidAcceptEmitter.fire()}));const w=he(l,$n(".quick-input-action")),y=this._register(new my(w,{...this.styles.button,supportIcons:!0}));y.label=p("custom","Custom"),this._register(y.onDidClick(P=>{this.onDidCustomEmitter.fire()}));const L=he(u,$n(`#${this.idPrefix}message.quick-input-message`)),k=this._register(new w1(t,this.styles.progressBar));k.getContainer().classList.add("quick-input-progress");const D=he(t,$n(".quick-input-html-widget"));D.tabIndex=-1;const N=he(t,$n(".quick-input-description")),W=this.idPrefix+"list",R=this._register(this.instantiationService.createInstance(yg,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,W));f.setAttribute("aria-controls",W),this._register(R.onDidChangeFocus(()=>{var P;f.setAttribute("aria-activedescendant",(P=R.getActiveDescendant())!==null&&P!==void 0?P:"")})),this._register(R.onChangedAllVisibleChecked(P=>{c.checked=P})),this._register(R.onChangedVisibleCount(P=>{m.setCount(P)})),this._register(R.onChangedCheckedCount(P=>{v.setCount(P)})),this._register(R.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof pg&&this.controller.canSelectMany&&R.clearFocus())},0)}));const A=Wf(t);return this._register(A),this._register(j(t,J.FOCUS,P=>{const H=this.getUI();if(Ni(P.relatedTarget,H.inputContainer)){const q=H.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==q&&this.endOfQuickInputBoxContext.set(q)}Ni(P.relatedTarget,H.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=Vi(P.relatedTarget)?P.relatedTarget:void 0)},!0)),this._register(A.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(Vu.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(P=>{const H=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==H&&this.endOfQuickInputBoxContext.set(H)})),this._register(j(t,J.FOCUS,P=>{f.setFocus()})),this._register(Ai(t,J.KEY_DOWN,P=>{if(!Ni(P.target,D))switch(P.keyCode){case 3:Ge.stop(P,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:Ge.stop(P,!0),this.hide(Vu.Gesture);break;case 2:if(!P.altKey&&!P.ctrlKey&&!P.metaKey){const H=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?H.push("input"):H.push("input[type=text]"),this.getUI().list.isDisplayed()&&H.push(".monaco-list"),this.getUI().message&&H.push(".quick-input-message a"),this.getUI().widget){if(Ni(P.target,this.getUI().widget))break;H.push(".quick-input-html-widget")}const q=t.querySelectorAll(H.join(", "));P.shiftKey&&P.target===q[0]?(Ge.stop(P,!0),R.clearFocus()):!P.shiftKey&&Ni(P.target,q[q.length-1])&&(Ge.stop(P,!0),q[0].focus())}break;case 10:P.ctrlKey&&(Ge.stop(P,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:n,title:r,description1:N,description2:d,widget:D,rightActionBar:a,checkAll:c,inputContainer:u,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:m,countContainer:_,count:v,okContainer:b,ok:C,message:L,customButtonContainer:w,customButton:y,list:R,progressBar:k,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:P=>this.show(P),hide:()=>this.hide(),setVisibilities:P=>this.setVisibilities(P),setEnabled:P=>this.setEnabled(P),setContextKey:P=>this.options.setContextKey(P),linkOpenerDelegate:P=>this.options.linkOpenerDelegate(P)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,he(this._container,this.ui.container))}pick(e,t={},i=ao.None){return new Promise((n,o)=>{let r=d=>{var u;r=n,(u=t.onKeyMods)===null||u===void 0||u.call(t,a.keyMods),n(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const u=d[0];u&&t.onDidFocus&&t.onDidFocus(u)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const u=d[0];u&&(r(u),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const u=a.items.indexOf(d.item);if(u!==-1){const h=a.items.slice(),f=h.splice(u,1),g=a.activeItems.filter(_=>_!==f[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=m}}})),a.onDidTriggerSeparatorButton(d=>{var u;return(u=t.onDidTriggerSeparatorButton)===null||u===void 0?void 0:u.call(t,d)}),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{Hi(c),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,u])=>{l=u,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}createQuickPick(){const e=this.getUI(!0);return new pg(e)}createInputBox(){const e=this.getUI(!0);return new iG(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",xn(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(fi.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),xn(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();fy.tooltip=n?p("quickInput.backWithKeybinding","Back ({0})",n):p("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i;const n=this.controller;if(!n)return;n.willHide(e);const o=(t=this.ui)===null||t===void 0?void 0:t.container,r=o&&!MT(o);if(this.controller=null,this.onHideEmitter.fire(),o&&(o.style.display="none"),!r){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(i=a.parentElement)!==null&&i!==void 0?i:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}n.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,yy.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` `);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}};l0.MAX_WIDTH=600;l0=yy=PZ([ub(1,Pl),ub(2,vt),ub(3,bt)],l0);var FZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Nh=function(s,e){return function(t,i){e(t,i,s)}};let Sy=class extends UB{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(hy))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=o,this._onShow=this._register(new O),this._onHide=this._register(new O),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(em).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(gy))},n=this._register(this.instantiationService.createInstance(l0,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{be(e.activeContainer)===be(n.container)&&n.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new me(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=ao.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ne(Zx),quickInputForeground:ne(Y6),quickInputTitleBackground:ne(Q6),widgetBorder:ne(W8),widgetShadow:ne(sl)},inputBox:TR,toggle:NR,countBadge:Sq,button:Cq,progressBar:wq,keybindingLabel:bq,list:sm({listBackground:Zx,listFocusBackground:lw,listFocusForeground:aw,listInactiveFocusForeground:aw,listInactiveSelectionIconForeground:BA,listInactiveFocusBackground:lw,listFocusOutline:si,listInactiveFocusOutline:si}),pickerGroup:{pickerGroupBorder:ne(X6),pickerGroupForeground:ne(OA)}}}};Sy=FZ([Nh(0,vt),Nh(1,bt),Nh(2,ho),Nh(3,Pl),Nh(4,Xt)],Sy);var s4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},cc=function(s,e){return function(t,i){e(t,i,s)}};let Ly=class extends Sy{constructor(e,t,i,n,o,r){super(t,i,n,new Aw(e.getContainerDomNode(),o),r),this.host=void 0;const a=zu.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return te.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return te.None},get onDidAddContainer(){return te.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};Ly=s4([cc(1,vt),cc(2,bt),cc(3,ho),cc(4,gi),cc(5,Xt)],Ly);let ky=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(Ly,e);this.mapEditorToService.set(e,t),wu(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=ao.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};ky=s4([cc(0,vt),cc(1,gi)],ky);class zu{static get(e){return e.getContribution(zu.ID)}constructor(e){this.editor=e,this.widget=new I1(this.editor)}dispose(){this.widget.dispose()}}zu.ID="editor.controller.quickInput";class I1{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return I1.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}I1.ID="editor.contrib.quickInputWidget";KT(zu.ID,zu,4);class OZ{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function BZ(s){if(!s||!Array.isArray(s))return[];const e=[];let t=0;for(let i=0,n=s.length;i{const h=$Z(d.token,u.token);return h!==0?h:d.index-u.index});let t=0,i="000000",n="ffffff";for(;s.length>=1&&s[0].token==="";){const d=s.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(n=d.background)}const o=new HZ;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(n),l=new KZ(t,r,a),c=new jZ(l);for(let d=0,u=s.length;d"u"){const n=this._match(t),o=UZ(t);i=(n.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const zZ=/\b(comment|string|regex|regexp)\b/;function UZ(s){const e=s.match(zZ);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function $Z(s,e){return se?1:0}let KZ=class r4{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new r4(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}},jZ=class a4{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,n;t===-1?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(n):this._mainRule}insert(e,t,i,n){if(e===""){this._mainRule.acceptOverwrite(t,i,n);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(r);typeof l>"u"&&(l=new a4(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,n)}};function qZ(s){const e=[];for(let t=1,i=s.length;t({format:n.format,location:n.location.toString()}))}}s.toJSONObject=e;function t(i){const n=o=>Jn(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Jn(o.format)&&Jn(o.location)))return{weight:n(i.weight),style:n(i.style),src:i.src.map(o=>({format:o.format,location:$e.parse(o.location)}))}}s.fromJSONObject=t})(II||(II={}));class JZ{constructor(){this._onDidChange=new O,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:p("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:p("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${et.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.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 o}const r={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return n&&(a.deprecationMessage=n),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}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;et.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of n.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${et.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(r=>!et.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` `)}}const ld=new JZ;zi.add(XZ.IconContribution,ld);function Bl(s,e,t,i){return ld.registerIcon(s,e,t,i)}function l4(){return ld}function eY(){const s=iT();for(const e in s){const t="\\"+s[e].toString(16);ld.registerIcon(e,{fontCharacter:t})}}eY();const c4="vscode://schemas/icons",d4=zi.as(G0.JSONContribution);d4.registerSchema(c4,ld.getIconSchema());const NI=new _n(()=>d4.notifySchemaChanged(c4),200);ld.onDidChange(()=>{NI.isScheduled()||NI.schedule()});const Zne=Bl("widget-close",ce.close,p("widgetClose","Icon for the close action in widgets."));Bl("goto-previous-location",ce.arrowUp,p("previousChangeIcon","Icon for goto previous editor location."));Bl("goto-next-location",ce.arrowDown,p("nextChangeIcon","Icon for goto next editor location."));et.modify(ce.sync,"spin");et.modify(ce.loading,"spin");function tY(s){const e=new pe,t=e.add(new O),i=l4();return e.add(i.onDidChange(()=>t.fire())),s&&e.add(s.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=s?s.getProductIconTheme():new u4,o={},r=[],a=[];for(const l of i.getIcons()){const c=n.getIcon(l);if(!c)continue;const d=c.font,u=`--vscode-icon-${l.id}-font-family`,h=`--vscode-icon-${l.id}-content`;d?(o[d.id]=d.definition,a.push(`${u}: ${nv(d.id)};`,`${h}: '${c.fontCharacter}';`),r.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${nv(d.id)}; }`)):(a.push(`${h}: '${c.fontCharacter}'; ${u}: 'codicon';`),r.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`))}for(const l in o){const c=o[l],d=c.weight?`font-weight: ${c.weight};`:"",u=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Sa(f.location)} format('${f.format}')`).join(", ");r.push(`@font-face { src: ${h}; font-family: ${nv(l)};${d}${u} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(` `)}}}class u4{getIcon(e){const t=l4();let i=e.defaults;for(;et.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const Qa="vs",If="vs-dark",mu="hc-black",pu="hc-light",h4=zi.as(IA.ColorContribution),iY=zi.as(KA.ThemingContribution);class f4{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(Vp(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,K.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=Dy(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,K.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=h4.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Qa:return Hs.LIGHT;case mu:return Hs.HIGH_CONTRAST_DARK;case pu:return Hs.HIGH_CONTRAST_LIGHT;default:return Hs.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=Dy(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const o={token:""};i&&(o.foreground=i),n&&(o.background=n),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=o4.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Zn.getForeground(o),a=Zn.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function Vp(s){return s===Qa||s===If||s===mu||s===pu}function Dy(s){switch(s){case Qa:return GZ;case If:return ZZ;case mu:return YZ;case pu:return QZ}}function ap(s){const e=Dy(s);return new f4(s,e)}class nY extends G{constructor(){super(),this._onColorThemeChange=this._register(new O),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new O),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new u4,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Qa,ap(Qa)),this._knownThemes.set(If,ap(If)),this._knownThemes.set(mu,ap(mu)),this._knownThemes.set(pu,ap(pu));const e=this._register(tY(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Qa),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),dT(wt,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return i_(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=ys(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),G.None}_registerShadowDomContainer(e){const t=ys(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Qa),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=wt.matchMedia("(forced-colors: active)").matches;if(e!==iu(this._theme.type)){let t;e1(this._theme.type)?t=e?mu:If:t=e?pu:Qa,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};iY.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of h4.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${hL(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(` `)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(qZ(o)),this._themeCSS=e.join(` `),this._updateCSS(),oi.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} ${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const fo=Qe("themeService");var sY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},hb=function(s,e){return function(t,i){e(t,i,s)}};let xy=class extends G{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new O,this._onDidChangeReducedMotion=new O,this._accessibilityModeEnabledContext=v8.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const o=wt.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(j(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};xy=sY([hb(0,bt),hb(1,Pl),hb(2,Xt)],xy);var N1=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},yr=function(s,e){return function(t,i){e(t,i,s)}},Ld,Va;let Ey=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new c0(i)}createMenu(e,t,i){return new Ny(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};Ey=N1([yr(0,Ls),yr(1,Zi),yr(2,m1)],Ey);let c0=Ld=class{constructor(e){this._storageService=e,this._disposables=new pe,this._onDidChange=new O,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(Ld._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,Ld._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(Ld._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,n;const o=this._isHiddenByDefault(e,t),r=(n=(i=this._data[e.id])===null||i===void 0?void 0:i.includes(t))!==null&&n!==void 0?n:!1;return o?!r:r}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&h5(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(Ld._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};c0._key="menu.hiddenCommands";c0=Ld=N1([yr(0,m1)],c0);let Iy=Va=class{constructor(e,t,i,n,o,r){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=n,this._keybindingService=o,this._contextKeyService=r,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=fr.getMenuItems(this._id);let t;e.sort(Va._compareMenuItems);for(const i of e){const n=i.group||"";(!t||t[0]!==n)&&(t=[n,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(Va._fillInKbExprKeys(e.when,this._structureContextKeys),Oh(e)){if(e.command.precondition&&Va._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Va._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&fr.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,o]=i;let r;for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=Oh(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=oY(this._id,l?a.command:a,this._hiddenStates);if(l){const d=g4(a.command.id,a.when,this._commandService,this._keybindingService);(r??(r=[])).push(new pa(a.command,a.alt,e,c,d,this._contextKeyService,this._commandService))}else{const d=new Va(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),u=qi.join(...d.map(h=>h[1]));u.length>0&&(r??(r=[])).push(new lf(a,c,u))}}r&&r.length>0&&t.push([n,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(i){if(!n)return-1}else return 1;if(i==="navigation")return-1;if(n==="navigation")return 1;const a=i.localeCompare(n);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:Va._compareTitles(Oh(e)?e.command.title:e.title,Oh(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,n=typeof t=="string"?t:t.original;return i.localeCompare(n)}};Iy=Va=N1([yr(3,Ls),yr(4,Zi),yr(5,bt)],Iy);let Ny=class{constructor(e,t,i,n,o,r){this._disposables=new pe,this._menuInfo=new Iy(e,t,i.emitEventsForSubmenuChanges,n,o,r);const a=new _n(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(fr.onDidChangeMenu(u=>{u.has(e)&&a.schedule()}));const l=this._disposables.add(new pe),c=u=>{let h=!1,f=!1,g=!1;for(const m of u)if(h=h||m.isStructuralChange,f=f||m.isEnablementChange,g=g||m.isToggleChange,h&&f&&g)break;return{menu:this,isStructuralChange:h,isEnablementChange:f,isToggleChange:g}},d=()=>{l.add(r.onDidChangeContext(u=>{const h=u.affectsSome(this._menuInfo.structureContextKeys),f=u.affectsSome(this._menuInfo.preconditionContextKeys),g=u.affectsSome(this._menuInfo.toggledContextKeys);(h||f||g)&&this._onDidChange.fire({menu:this,isStructuralChange:h,isEnablementChange:f,isToggleChange:g})})),l.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new qN({onWillAddFirstListener:d,onDidRemoveLastListener:l.clear.bind(l),delay:i.eventDebounceDelay,merge:c}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};Ny=N1([yr(3,Ls),yr(4,Zi),yr(5,bt)],Ny);function oY(s,e,t){const i=S7(e)?e.submenu.id:e.id,n=typeof e.title=="string"?e.title:e.title.value,o=Qd({id:`hide/${s.id}/${i}`,label:p("hide.label","Hide '{0}'",n),run(){t.updateHidden(s,i,!0)}}),r=Qd({id:`toggle/${s.id}/${i}`,label:n,get checked(){return!t.isHidden(s,i)},run(){t.updateHidden(s,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function g4(s,e=void 0,t,i){return Qd({id:`configureKeybinding/${s}`,label:p("configure keybinding","Configure Keybinding"),run(){const o=!!!i.lookupKeybinding(s)&&e?e.serialize():void 0;t.executeCommand("workbench.action.openGlobalKeybindings",`@command:${s}`+(o?` +when:${o}`:""))}})}var rY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},TI=function(s,e){return function(t,i){e(t,i,s)}},Ty;let d0=Ty=class extends G{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(ya||uT)&&this.installWebKitWriteTextWorkaround(),this._register(te.runAndSubscribe(M0,({window:i,disposables:n})=>{n.add(j(i.document,"copy",()=>this.clearResources()))},{window:wt,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new _T;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,vp().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(te.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(j(t,"click",e)),i.add(j(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.writeResources([]),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await vp().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=$S(),i=t.activeElement,n=t.body.appendChild(De("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),Vi(i)&&i.focus(),t.body.removeChild(n)}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await vp().navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async writeResources(e){e.length===0?this.clearResources():(this.resources=e,this.resourcesStateHash=await this.computeResourcesStateHash())}async readResources(){const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResources(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return xT(e.substring(0,Ty.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearResources(){this.resources=[],this.resourcesStateHash=void 0}};d0.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3;d0=Ty=rY([TI(0,Pl),TI(1,uo)],d0);const Sk=Qe("clipboardService");var aY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},lY=function(s,e){return function(t,i){e(t,i,s)}};const Nf="data-keybinding-context";class Lk{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}}class Uu extends Lk{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Uu.INSTANCE=new Uu;class Sg extends Lk{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=xf.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(n=>{if(n.source===7){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new MI(o))}else{const o=[];for(const r of n.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...ot.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new MI(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Sg._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Sg._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:Array.isArray(i)?n=JSON.stringify(i):n=i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}Sg._keyPrefix="config.";class cY{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class AI{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class MI{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class dY{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function uY(s,e){return s.allKeysContainedIn(new Set(Object.keys(e)))}class m4 extends G{constructor(e){super(),this._onDidChangeContext=this._register(new Rf({merge:t=>new dY(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new cY(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new hY(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new AI(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new AI(e))}getContext(e){return this._isDisposed?Uu.INSTANCE:this.getContextValuesContainer(fY(e))}dispose(){super.dispose(),this._isDisposed=!0}}let Ay=class extends m4{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new Sg(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?Uu.INSTANCE:this._contexts.get(e)||Uu.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new Lk(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};Ay=aY([lY(0,Xt)],Ay);class hY extends m4{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Ca),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(Nf)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(Nf,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;uY(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(Nf),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Uu.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function fY(s){for(;s;){if(s.hasAttribute(Nf)){const e=s.getAttribute(Nf);return e?parseInt(e,10):NaN}s=s.parentElement}return 0}function gY(s,e,t){s.get(bt).createKey(String(e),mY(t))}function mY(s){return MN(s,e=>{if(typeof e=="object"&&e.$mid===1)return $e.revive(e).toString();if(e instanceof $e)return e.toString()})}sn.registerCommand("_setContext",gY);sn.registerCommand({id:"getContextKeyInfo",handler(){return[...me.all()].sort((s,e)=>s.key.localeCompare(e.key))},metadata:{description:p("getContextKeyInfo","A command that returns information about context keys"),args:[]}});sn.registerCommand("_generateContextKeyInfo",function(){const s=[],e=new Set;for(const t of me.all())e.has(t.key)||(e.add(t.key),s.push(t));s.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(s,void 0,2))});let pY=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class RI{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new pY(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} (-> incoming)[${[...i.incoming.keys()].join(", ")}] (outgoing ->)[${[...i.outgoing.keys()].join(",")}] `);return e.join(` `)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(n,t);if(o)return o;t.delete(i)}}}const _Y=!1;class PI extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: ${e.toString()}`}}class u0{constructor(e=new Qg,t=!1,i,n=_Y){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(vt,this),this._globalGraph=n?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new RI(r=>r):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,Hi(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)KN(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends u0{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t==null||t.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=Fn.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw CS("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof or?(i=Fn.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Fn.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=No.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof or)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof or?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var n;const o=new RI(l=>l.id.toString());let r=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(o.lookupOrInsertNode(l),r++>1e3)throw new PI(o);for(const c of No.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(n=this._globalGraph)===null||n===void 0||n.insertEdge(String(l.id),String(c.id)),d instanceof or){const u={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};o.insertEdge(l,u),a.push(u)}}}for(;;){const l=o.roots();if(l.length===0){if(!o.isEmpty())throw new PI(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof or){const u=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,u)}o.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof or)return this._createServiceInstance(e,t,i,n,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,o,r){if(n){const a=new u0(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const l=new Map,c=new XF(()=>{const d=a._createInstance(t,i,o);for(const[u,h]of l){const f=d[u];if(typeof f=="function")for(const g of h)g.disposable=f.apply(d,g.listener)}return l.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,u){if(!c.isInitialized&&typeof u=="string"&&(u.startsWith("onDid")||u.startsWith("onWill"))){let g=l.get(u);return g||(g=new Qn,l.set(u,g)),(_,v,b)=>{if(c.isInitialized)return c.value[u](_,v,b);{const C={listener:[_,v,b],disposable:void 0},w=g.push(C);return Be(()=>{var L;w(),(L=C.disposable)===null||L===void 0||L.dispose()})}}}if(u in d)return d[u];const h=c.value;let f=h[u];return typeof f!="function"||(f=f.bind(h),d[u]=f),f},set(d,u,h){return c.value[u]=h,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,o);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Fn{static traceInvocation(e,t){return e?new Fn(2,t.name||new Error().stack.split(` `).slice(3,4).join(` `)):Fn._None}static traceCreation(e,t){return e?new Fn(1,t.name):Fn._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Fn(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Fn._totals+=e;let t=!1;function i(o,r){const a=[],l=new Array(o+1).join(" ");for(const[c,d,u]of r._dep)if(d&&u){t=!0,a.push(`${l}CREATES -> ${c}`);const h=i(o+1,u);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` `)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Fn._totals.toFixed(2)}ms)`];(e>2||t)&&Fn.all.add(n.join(` `))}}Fn.all=new Set;Fn._None=new class extends Fn{constructor(){super(0,null)}stop(){}branch(){return this}};Fn._totals=0;const vY=new Set([ze.inMemory,ze.vscodeSourceControl,ze.walkThrough,ze.walkThroughSnippet,ze.vscodeChatCodeBlock,ze.vscodeCopilotBackingChatCodeBlock]);class bY{constructor(){this._byResource=new pn,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new pn,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:ot.empty():$e.isUri(e)?(o=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&o!==void 0?o:ot.empty():ot.map(ot.concat(...this._byOwner.values()),r=>r[1])}}class CY{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new pn,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(vY.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Ps.Error?t.errors+=1:i===Ps.Warning?t.warnings+=1:i===Ps.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Ua{constructor(){this._onMarkerChanged=new qN({delay:0,merge:Ua._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new bY,this._stats=new CY(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(p5(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const r=Ua._toMarker(e,t,o);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,u=u>0?u:c,{resource:t,owner:e,code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const o of n){const r=ot.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(L0(t)){const o=new pn;for(const{resource:r,marker:a}of t){const l=Ua._toMarker(e,r,a);if(!l)continue;const c=o.get(r);c?c.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Ua._accept(l,n)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Ua._accept(l,n)){const c=r.push(l);if(o>0&&c===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const c of l)if(Ua._accept(c,n)){const d=a.push(c);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new pn;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}class wY extends G{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=Bi.createEmptyModel(this.logService)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=Bi.createEmptyModel(this.logService);const e=zi.as(td.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const o=i[n],r=t[n];o!==void 0?this._configurationModel.addValue(n,o):r?this._configurationModel.addValue(n,r.default):this._configurationModel.removeValue(n)}}}const ah=Qe("accessibilitySignalService");class ye{static register(e){return new ye(e.fileName)}constructor(e){this.fileName=e}}ye.error=ye.register({fileName:"error.mp3"});ye.warning=ye.register({fileName:"warning.mp3"});ye.success=ye.register({fileName:"success.mp3"});ye.foldedArea=ye.register({fileName:"foldedAreas.mp3"});ye.break=ye.register({fileName:"break.mp3"});ye.quickFixes=ye.register({fileName:"quickFixes.mp3"});ye.taskCompleted=ye.register({fileName:"taskCompleted.mp3"});ye.taskFailed=ye.register({fileName:"taskFailed.mp3"});ye.terminalBell=ye.register({fileName:"terminalBell.mp3"});ye.diffLineInserted=ye.register({fileName:"diffLineInserted.mp3"});ye.diffLineDeleted=ye.register({fileName:"diffLineDeleted.mp3"});ye.diffLineModified=ye.register({fileName:"diffLineModified.mp3"});ye.chatRequestSent=ye.register({fileName:"chatRequestSent.mp3"});ye.chatResponseReceived1=ye.register({fileName:"chatResponseReceived1.mp3"});ye.chatResponseReceived2=ye.register({fileName:"chatResponseReceived2.mp3"});ye.chatResponseReceived3=ye.register({fileName:"chatResponseReceived3.mp3"});ye.chatResponseReceived4=ye.register({fileName:"chatResponseReceived4.mp3"});ye.clear=ye.register({fileName:"clear.mp3"});ye.save=ye.register({fileName:"save.mp3"});ye.format=ye.register({fileName:"format.mp3"});ye.voiceRecordingStarted=ye.register({fileName:"voiceRecordingStarted.mp3"});ye.voiceRecordingStopped=ye.register({fileName:"voiceRecordingStopped.mp3"});ye.progress=ye.register({fileName:"progress.mp3"});class yY{constructor(e){this.randomOneOf=e}}class Ne{constructor(e,t,i,n,o,r,a){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r,this.delaySettingsKey=a}static register(e){const t=new yY("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new Ne(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.delaySettingsKey);return Ne._signals.add(i),i}}Ne._signals=new Set;Ne.errorAtPosition=Ne.register({name:p("accessibilitySignals.positionHasError.name","Error at Position"),sound:ye.error,announcementMessage:p("accessibility.signals.positionHasError","Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"});Ne.warningAtPosition=Ne.register({name:p("accessibilitySignals.positionHasWarning.name","Warning at Position"),sound:ye.warning,announcementMessage:p("accessibility.signals.positionHasWarning","Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"});Ne.errorOnLine=Ne.register({name:p("accessibilitySignals.lineHasError.name","Error on Line"),sound:ye.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:p("accessibility.signals.lineHasError","Error on Line"),settingsKey:"accessibility.signals.lineHasError"});Ne.warningOnLine=Ne.register({name:p("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:ye.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:p("accessibility.signals.lineHasWarning","Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"});Ne.foldedArea=Ne.register({name:p("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:ye.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:p("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"});Ne.break=Ne.register({name:p("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:ye.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:p("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"});Ne.inlineSuggestion=Ne.register({name:p("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:ye.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"});Ne.terminalQuickFix=Ne.register({name:p("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:ye.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:p("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"});Ne.onDebugBreak=Ne.register({name:p("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:ye.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:p("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"});Ne.noInlayHints=Ne.register({name:p("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:ye.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:p("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"});Ne.taskCompleted=Ne.register({name:p("accessibilitySignals.taskCompleted","Task Completed"),sound:ye.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:p("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"});Ne.taskFailed=Ne.register({name:p("accessibilitySignals.taskFailed","Task Failed"),sound:ye.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:p("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"});Ne.terminalCommandFailed=Ne.register({name:p("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:ye.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:p("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"});Ne.terminalCommandSucceeded=Ne.register({name:p("accessibilitySignals.terminalCommandSucceeded","Terminal Command Succeeded"),sound:ye.success,announcementMessage:p("accessibility.signals.terminalCommandSucceeded","Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"});Ne.terminalBell=Ne.register({name:p("accessibilitySignals.terminalBell","Terminal Bell"),sound:ye.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:p("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"});Ne.notebookCellCompleted=Ne.register({name:p("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:ye.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:p("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"});Ne.notebookCellFailed=Ne.register({name:p("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:ye.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:p("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"});Ne.diffLineInserted=Ne.register({name:p("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:ye.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"});Ne.diffLineDeleted=Ne.register({name:p("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:ye.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"});Ne.diffLineModified=Ne.register({name:p("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:ye.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"});Ne.chatRequestSent=Ne.register({name:p("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:ye.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:p("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"});Ne.chatResponseReceived=Ne.register({name:p("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[ye.chatResponseReceived1,ye.chatResponseReceived2,ye.chatResponseReceived3,ye.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"});Ne.progress=Ne.register({name:p("accessibilitySignals.progress","Progress"),sound:ye.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:p("accessibility.signals.progress","Progress"),settingsKey:"accessibility.signals.progress"});Ne.clear=Ne.register({name:p("accessibilitySignals.clear","Clear"),sound:ye.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:p("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"});Ne.save=Ne.register({name:p("accessibilitySignals.save","Save"),sound:ye.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:p("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"});Ne.format=Ne.register({name:p("accessibilitySignals.format","Format"),sound:ye.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:p("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"});Ne.voiceRecordingStarted=Ne.register({name:p("accessibilitySignals.voiceRecordingStarted","Voice Recording Started"),sound:ye.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"});Ne.voiceRecordingStopped=Ne.register({name:p("accessibilitySignals.voiceRecordingStopped","Voice Recording Stopped"),sound:ye.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});class SY extends G{constructor(e,t=[]){super(),this.logger=new D7([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(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)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const p4=[];function sse(s){p4.push(s)}function LY(){return p4.slice(0)}var Ia=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ii=function(s,e){return function(t,i){e(t,i,s)}};class kY{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new O}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let My=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new FP(new kY(t))):Promise.reject(new Error("Model not found"))}};My=Ia([Ii(0,ns)],My);class T1{show(){return T1.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}T1.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class DY{withProgress(e,t,i){return t({report:()=>{}})}}class xY{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class EY{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` `+t),wt.confirm(i)}async prompt(e){var t,i;let n;if(this.doConfirm(e.message,e.detail)){const r=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),n=await((i=r[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1}))}return{result:n}}async error(e,t){await this.prompt({type:fi.Error,message:e,detail:t})}}class Lg{info(e){return this.notify({severity:fi.Info,message:e})}warn(e){return this.notify({severity:fi.Warning,message:e})}error(e){return this.notify({severity:fi.Error,message:e})}notify(e){switch(e.severity){case fi.Error:console.error(e.message);break;case fi.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Lg.NO_OP}prompt(e,t,i,n){return Lg.NO_OP}status(e,t){return G.None}}Lg.NO_OP=new vU;let Ry=class{constructor(e){this._onWillExecuteCommand=new O,this._onDidExecuteCommand=new O,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=sn.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};Ry=Ia([Ii(0,vt)],Ry);let $u=class extends KK{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new pe;g.add(j(f,J.KEY_DOWN,m=>{const _=new Ot(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(j(f,J.KEY_UP,m=>{const _=new Ot(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new IY(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},d=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const u=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(u)),this._register(r.onDiffEditorRemove(h)),r.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,i,n){return br(sn.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>{var n;return{keybinding:xC(i.keybinding,to),command:(n=i.command)!==null&&n!==void 0?n:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Be(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return wt.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new ME(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=ug.resolveKeybinding(a,to);for(const c of l)i[n++]=new ME(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Ac(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new ug([t],to)}};$u=Ia([Ii(0,bt),Ii(1,Ls),Ii(2,Rl),Ii(3,$o),Ii(4,uo),Ii(5,gi)],$u);class IY extends G{constructor(e,t){super(),this.domNode=e,this._register(t)}}function FI(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource||s.resource instanceof $e)}let h0=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new O,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new wY(e);this._configuration=new a1(t.reload(),Bi.createEmptyModel(e),Bi.createEmptyModel(e),Bi.createEmptyModel(e),Bi.createEmptyModel(e),Bi.createEmptyModel(e),new pn,Bi.createEmptyModel(e),new pn,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,n=FI(e)?e:FI(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const n of e){const[o,r]=n;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const n=new HK({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);n.source=8,this._onDidChangeConfiguration.fire(n)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};h0=Ia([Ii(0,uo)],h0);let Py=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new O,this.configurationService.onDidChangeConfiguration(n=>{this._onDidChangeConfiguration.fire({affectedKeys:n.affectedKeys,affectsConfiguration:(o,r)=>n.affectsConfiguration(r)})})}getValue(e,t,i){const n=V.isIPosition(t)?t:null,o=n?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,n):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};Py=Ia([Ii(0,Xt),Ii(1,ns),Ii(2,Mi)],Py);let Fy=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Vn||Ye?` `:`\r `}};Fy=Ia([Ii(0,Xt)],Fy);class NY{publicLog2(){}}class kg{constructor(){const e=$e.from({scheme:kg.SCHEME,authority:"model",path:"/"});this.workspace={id:gR,folders:[new lj({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===kg.SCHEME?this.workspace.folders[0]:null}}kg.SCHEME="inmemory";function f0(s,e,t){if(!e||!(s instanceof h0))return;const i=[];Object.keys(e).forEach(n=>{FK(n)&&i.push([`editor.${n}`,e[n]]),t&&OK(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}let Oy=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:GL.convert(e),n=new Map;for(const a of i){if(!(a instanceof Ec))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=n.get(l);c||(c=[],n.set(l,c)),c.push(Gw.replaceMove(M.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,o+=l.length;return{ariaSummary:Xp(Yw.bulkEditServiceSummary,o,r),isApplied:o>0}}};Oy=Ia([Ii(0,ns)],Oy);class TY{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return xL(e)}}let By=class extends IK{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};By=Ia([Ii(0,Pl),Ii(1,gi)],By);class AY{constructor(){this._neverEmitter=new O,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class MY extends fg{constructor(){super()}}class RY extends SY{constructor(){super(new k7)}}let Wy=class extends oy{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r),this.configure({blockMouse:!1})}};Wy=Ia([Ii(0,Rl),Ii(1,$o),Ii(2,Jg),Ii(3,Zi),Ii(4,Jc),Ii(5,bt)],Wy);class PY{async playSignal(e,t){}}rt(uo,RY,0);rt(Xt,h0,0);rt(_A,Py,0);rt(vA,Fy,0);rt(sj,kg,0);rt(QK,TY,0);rt(Rl,NY,0);rt(WM,EY,0);rt($M,xY,0);rt($o,Lg,0);rt(rd,Ua,0);rt(Mi,MY,0);rt(fo,nY,0);rt(ns,J_,0);rt(xA,dy,0);rt(bt,Ay,0);rt(XK,DY,0);rt(YL,T1,0);rt(m1,_q,0);rt(od,QC,0);rt(MK,Oy,0);rt(dj,AY,0);rt(Bg,My,0);rt(Uo,xy,0);rt(Ar,hZ,0);rt(Ls,Ry,0);rt(Zi,$u,0);rt(b1,ky,0);rt(Jg,By,0);rt(em,cy,0);rt(Sk,d0,0);rt(Da,Wy,0);rt(Jc,Ey,0);rt(ah,PY,0);var Se;(function(s){const e=new Qg;for(const[l,c]of QD())e.set(l,c);const t=new u0(e,!0);e.set(vt,t);function i(l){n||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof or?t.invokeFunction(d=>d.get(l)):c}s.get=i;let n=!1;const o=new O;function r(l){if(n)return t;n=!0;for(const[d,u]of QD())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=Qe(d);e.get(u)instanceof or&&e.set(u,l[d])}const c=LY();for(const d of c)try{t.createInstance(d)}catch(u){At(u)}return o.fire(),t}s.initialize=r;function a(l){if(n)return l();const c=new pe,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}s.withServices=a})(Se||(Se={}));class Dg{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Dg(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new Dg(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;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,1)}}function kk(){return Db&&!!Db.VSCODE_DEV}function _4(s){if(kk()){const e=FY();return e.add(s),{dispose(){e.delete(s)}}}else return{dispose(){}}}function FY(){lp||(lp=new Set);const s=globalThis;return s.$hotReload_applyNewExports||(s.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e};for(const i of lp){const n=i(t);if(n)return n}}),lp}let lp;kk()&&_4(({oldExports:s,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{var n,o;for(const r in i){const a=i[r];if(console.log(`[hot-reload] Patching prototype methods of '${r}'`,{exportedItem:a}),typeof a=="function"&&a.prototype){const l=s[r];if(l){for(const c of Object.getOwnPropertyNames(a.prototype)){const d=Object.getOwnPropertyDescriptor(a.prototype,c),u=Object.getOwnPropertyDescriptor(l.prototype,c);((n=d==null?void 0:d.value)===null||n===void 0?void 0:n.toString())!==((o=u==null?void 0:u.value)===null||o===void 0?void 0:o.toString())&&console.log(`[hot-reload] Patching prototype method '${r}.${c}'`),Object.defineProperty(l.prototype,c,d)}i[r]=l}}}return!0}});function OY(s,e,t,i){if(s.length===0)return e;if(e.length===0)return s;const n=[];let o=0,r=0;for(;od?(n.push(l),r++):(n.push(i(a,l)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},n=>{const o=e.read(n);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function Jh(s,e){return s.appendChild(e),Be(()=>{s.removeChild(e)})}function BY(s,e){return s.prepend(e),Be(()=>{s.removeChild(e)})}class v4 extends G{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new EA(e,t)),this._width=lt(this,this.elementSizeObserver.getWidth()),this._height=lt(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>Ti(n=>{this._width.set(this.elementSizeObserver.getWidth(),n),this._height.set(this.elementSizeObserver.getHeight(),n)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function OI(s,e,t){let i=e.get(),n=i,o=i;const r=lt("animatedValue",i);let a=-1;const l=300;let c;t.add(h1({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(u,h)=>(u.didChange(e)&&(h.animate=h.animate||u.change),!0)},(u,h)=>{c!==void 0&&(s.cancelAnimationFrame(c),c=void 0),n=o,i=e.read(u),a=Date.now()-(h.animate?0:l),d()}));function d(){const u=Date.now()-a;o=Math.floor(WY(u,n,i-n,l)),u{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class A1{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${A1._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}A1._counter=0;function Nl(s,e){return _t(t=>{for(let[i,n]of Object.entries(e))n&&typeof n=="object"&&"read"in n&&(n=n.read(t)),typeof n=="number"&&(n=`${n}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),s.style[i]=n})}function Xs(s,e){return VY([s],e),s}function VY(s,e){kk()&&Rs("reload",i=>_4(({oldExports:n})=>{if([...Object.values(n)].some(o=>s.includes(o)))return o=>(i(void 0),!0)})).read(e)}function p0(s,e,t,i){const n=new pe,o=[];return n.add(kr((r,a)=>{const l=e.read(r),c=new Map,d=new Map;t&&t(!0),s.changeViewZones(u=>{for(const h of o)u.removeZone(h),i==null||i.delete(h);o.length=0;for(const h of l){const f=u.addZone(h);h.setZoneId&&h.setZoneId(f),o.push(f),i==null||i.add(f),c.set(h,f)}}),t&&t(!1),a.add(h1({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(u,h){const f=d.get(u.changedObservable);return f!==void 0&&h.zoneIds.push(f),!0}},(u,h)=>{for(const f of l)f.onChange&&(d.set(f.onChange,c.get(f)),f.onChange.read(u));t&&t(!0),s.changeViewZones(f=>{for(const g of h.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),n.add({dispose(){t&&t(!0),s.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i==null||i.clear(),t&&t(!1)}}),n}class gse extends Ho{dispose(){super.dispose(!0)}}function BI(s,e){const t=d_(e,n=>n.original.startLineNumber<=s.lineNumber);if(!t)return M.fromPositions(s);if(t.original.endLineNumberExclusive<=s.lineNumber){const n=s.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return M.fromPositions(new V(n,s.column))}if(!t.innerChanges)return M.fromPositions(new V(t.modified.startLineNumber,1));const i=d_(t.innerChanges,n=>n.originalRange.getStartPosition().isBeforeOrEqual(s));if(!i){const n=s.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return M.fromPositions(new V(n,s.column))}if(i.originalRange.containsPosition(s))return i.modifiedRange;{const n=HY(i.originalRange.getEndPosition(),s);return M.fromPositions(n.addToPosition(i.modifiedRange.getEndPosition()))}}function HY(s,e){return s.lineNumber===e.lineNumber?new Os(0,e.column-s.column):new Os(e.lineNumber-s.lineNumber,e.column-1)}function zY(s,e){let t;return s.filter(i=>{const n=e(i,t);return t=i,n})}var Dk=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},xk=function(s,e){return function(t,i){e(t,i,s)}};const UY=Bl("diff-review-insert",ce.add,p("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),$Y=Bl("diff-review-remove",ce.remove,p("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),KY=Bl("diff-review-close",ce.close,p("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let cl=class extends G{constructor(e,t,i,n,o,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=o,this._height=r,this._diffs=a,this._models=l,this._instantiationService=c,this._state=sh(this,(d,u)=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=u.add(this._instantiationService.createInstance(Vy,this._diffs,this._models,this._setVisible,this._canClose)),g=u.add(this._instantiationService.createInstance(Hy,this._parentNode,f,this._width,this._height,this._models));return{model:f,view:g}}).recomputeInitiallyAndOnChange(this._store)}next(){Ti(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){Ti(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){Ti(e=>{this._setVisible(!1,e)})}};cl._ttPolicy=ed("diffReview",{createHTML:s=>s});cl=Dk([xk(8,vt)],cl);let Vy=class extends G{constructor(e,t,i,n,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=o,this._groups=lt(this,[]),this._currentGroupIdx=lt(this,0),this._currentElementIdx=lt(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[r]}),this._register(_t(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=jY(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Ti(c=>{const d=this._models.getModifiedPosition();if(d){const u=l.findIndex(h=>(d==null?void 0:d.lineNumber){const a=this.currentElement.read(r);(a==null?void 0:a.type)===Ln.Deleted?this._accessibilitySignalService.playSignal(Ne.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===Ln.Added&&this._accessibilitySignalService.playSignal(Ne.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(_t(r=>{var a;const l=this.currentElement.read(r);if(l&&l.type!==Ln.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._models.modifiedSetSelection(M.fromPositions(new V(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||JL(t,n=>{this._currentGroupIdx.set(Re.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),n),this._currentElementIdx.set(0,n)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Ti(i=>{this._currentElementIdx.set(Re.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&Ti(n=>{this._currentElementIdx.set(i,n)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===Ln.Deleted?this._models.originalReveal(M.fromPositions(new V(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==Ln.Header?M.fromPositions(new V(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};Vy=Dk([xk(4,ah)],Vy);const Th=3;function jY(s,e,t){const i=[];for(const n of hS(s,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*Th)){const o=[];o.push(new GY);const r=new Me(Math.max(1,n[0].original.startLineNumber-Th),Math.min(n[n.length-1].original.endLineNumberExclusive+Th,e+1)),a=new Me(Math.max(1,n[0].modified.startLineNumber-Th),Math.min(n[n.length-1].modified.endLineNumberExclusive+Th,t+1));xN(n,(d,u)=>{const h=new Me(d?d.original.endLineNumberExclusive:r.startLineNumber,u?u.original.startLineNumber:r.endLineNumberExclusive),f=new Me(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new QY(g,f.startLineNumber+(g-h.startLineNumber)))}),u&&(u.original.forEach(g=>{o.push(new ZY(u,g))}),u.modified.forEach(g=>{o.push(new YY(u,g))}))});const l=n[0].modified.join(n[n.length-1].modified),c=n[0].original.join(n[n.length-1].original);i.push(new qY(new kn(l,c),o))}return i}var Ln;(function(s){s[s.Header=0]="Header",s[s.Unchanged=1]="Unchanged",s[s.Deleted=2]="Deleted",s[s.Added=3]="Added"})(Ln||(Ln={}));class qY{constructor(e,t){this.range=e,this.lines=t}}class GY{constructor(){this.type=Ln.Header}}class ZY{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=Ln.Deleted,this.modifiedLineNumber=void 0}}class YY{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=Ln.Added,this.originalLineNumber=void 0}}class QY{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=Ln.Unchanged}}let Hy=class extends G{constructor(e,t,i,n,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=o,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Il(a)),this._register(_t(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new ma("diffreview.close",p("label.close","Close"),"close-diff-review "+et.asClassName(KY),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new _L(this._content,{})),xn(this.domNode,this._scrollbar.getDomNode(),a),this._register(_t(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Be(()=>{xn(this.domNode)})),this._register(Nl(this.domNode,{width:this._width,height:this._height})),this._register(Nl(this._content,{width:this._width,height:this._height})),this._register(kr((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Ai(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",p("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),nn(n,i.get(50)),xn(this._content,n);const o=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!o||!r)return;const a=o.getOptions(),l=r.getOptions(),c=i.get(67),d=this._model.currentGroup.get();for(const u of(d==null?void 0:d.lines)||[]){if(!d)break;let h;if(u.type===Ln.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const m=d.range,_=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,b=L=>L===0?p("no_lines_changed","no lines changed"):L===1?p("one_line_changed","1 line changed"):p("more_lines_changed","{0} lines changed",L),C=b(m.original.length),w=b(m.modified.length);g.setAttribute("aria-label",p({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,v,m.original.startLineNumber,C,m.modified.startLineNumber,w));const y=document.createElement("div");y.className="diff-review-cell diff-review-summary",y.appendChild(document.createTextNode(`${_+1}/${v}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),g.appendChild(y),h=g}else h=this._createRow(u,c,this._width.get(),t,o,a,i,r,l);n.appendChild(h);const f=He(g=>this._model.currentElement.read(g)===u);e.add(_t(g=>{const m=f.read(g);h.tabIndex=m?0:-1,m&&h.focus()})),e.add(j(h,"focus",()=>{this._model.goToLine(u)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,o,r,a,l,c){const d=n.get(145),u=d.glyphMarginWidth+d.lineNumbersWidth,h=a.get(145),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",m="";const _="diff-review-spacer";let v=null;switch(e.type){case Ln.Added:g="diff-review-row line-insert",m=" char-insert",v=UY;break;case Ln.Deleted:g="diff-review-row line-delete",m=" char-delete",v=$Y;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=g,b.setAttribute("role","listitem"),b.ariaLevel="";const C=document.createElement("div");C.className="diff-review-cell",C.style.height=`${t}px`,b.appendChild(C);const w=document.createElement("span");w.style.width=u+"px",w.style.minWidth=u+"px",w.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?w.appendChild(document.createTextNode(String(e.originalLineNumber))):w.innerText=" ",C.appendChild(w);const y=document.createElement("span");y.style.width=f+"px",y.style.minWidth=f+"px",y.style.paddingRight="10px",y.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?y.appendChild(document.createTextNode(String(e.modifiedLineNumber))):y.innerText=" ",C.appendChild(y);const L=document.createElement("span");if(L.className=_,v){const N=document.createElement("span");N.className=et.asClassName(v),N.innerText="  ",L.appendChild(N)}else L.innerText="  ";C.appendChild(L);let k;if(e.modifiedLineNumber!==void 0){let N=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);cl._ttPolicy&&(N=cl._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),k=l.getLineContent(e.modifiedLineNumber)}else{let N=this._getLineHtml(o,n,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);cl._ttPolicy&&(N=cl._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),k=o.getLineContent(e.originalLineNumber)}k.length===0&&(k=p("blankLine","blank"));let D="";switch(e.type){case Ln.Unchanged:e.originalLineNumber===e.modifiedLineNumber?D=p({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",k,e.originalLineNumber):D=p("equalLine","{0} original line {1} modified line {2}",k,e.originalLineNumber,e.modifiedLineNumber);break;case Ln.Added:D=p("insertLine","+ {0} modified line {1}",k,e.modifiedLineNumber);break;case Ln.Deleted:D=p("deleteLine","- {0} original line {1}",k,e.originalLineNumber);break}return b.setAttribute("aria-label",D),b}_getLineHtml(e,t,i,n,o){const r=e.getLineContent(n),a=t.get(50),l=bn.createEmpty(r,o),c=Ss.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Ss.containsRTL(r,c,e.mightContainRTL());return Z0(new th(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,r,!1,c,d,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(117),t.get(99),t.get(94),t.get(51)!==Ns.OFF,null)).html}};Hy=Dk([xk(5,Mi)],Hy);class XY{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){var e;return(e=this.editors.modified.getPosition())!==null&&e!==void 0?e:void 0}}class bl extends G{constructor(e,t,i,n,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=o,this._originalScrollTop=wi(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=wi(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Rs("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=lt(this,0),this._modifiedViewZonesChangedSignal=Rs("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Rs("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=sh(this,(d,u)=>{var h;this._element.replaceChildren();const f=this._diffModel.read(d),g=(h=f==null?void 0:f.diff.read(d))===null||h===void 0?void 0:h.movedTexts;if(!g||g.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const m=this._originalEditorLayoutInfo.read(d),_=this._modifiedEditorLayoutInfo.read(d);if(!m||!_){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const v=g.map(D=>{function N(ve,se){const Ce=se.getTopForLineNumber(ve.startLineNumber,!0),Ee=se.getTopForLineNumber(ve.endLineNumberExclusive,!0);return(Ce+Ee)/2}const W=N(D.lineRangeMapping.original,this._editors.original),R=this._originalScrollTop.read(d),A=N(D.lineRangeMapping.modified,this._editors.modified),P=this._modifiedScrollTop.read(d),H=W-R,q=A-P,re=Math.min(W,A),de=Math.max(W,A);return{range:new Re(re,de),from:H,to:q,fromWithoutScroll:W,toWithoutScroll:A,move:D}});v.sort(b5(oo(D=>D.fromWithoutScroll>D.toWithoutScroll,C5),oo(D=>D.fromWithoutScroll>D.toWithoutScroll?D.fromWithoutScroll:-D.toWithoutScroll,ul)));const b=Ek.compute(v.map(D=>D.range)),C=10,w=m.verticalScrollbarWidth,y=(b.getTrackCount()-1)*10+C*2,L=w+y+(_.contentLeft-bl.movedCodeBlockPadding);let k=0;for(const D of v){const N=b.getTrack(k),W=w+C+N*10,R=15,A=15,P=L,H=_.glyphMarginWidth+_.lineNumbersWidth,q=18,re=document.createElementNS("http://www.w3.org/2000/svg","rect");re.classList.add("arrow-rectangle"),re.setAttribute("x",`${P-H}`),re.setAttribute("y",`${D.to-q/2}`),re.setAttribute("width",`${H}`),re.setAttribute("height",`${q}`),this._element.appendChild(re);const de=document.createElementNS("http://www.w3.org/2000/svg","g"),ve=document.createElementNS("http://www.w3.org/2000/svg","path");ve.setAttribute("d",`M 0 ${D.from} L ${W} ${D.from} L ${W} ${D.to} L ${P-A} ${D.to}`),ve.setAttribute("fill","none"),de.appendChild(ve);const se=document.createElementNS("http://www.w3.org/2000/svg","polygon");se.classList.add("arrow"),u.add(_t(Ce=>{ve.classList.toggle("currentMove",D.move===f.activeMovedText.read(Ce)),se.classList.toggle("currentMove",D.move===f.activeMovedText.read(Ce))})),se.setAttribute("points",`${P-A},${D.to-R/2} ${P},${D.to} ${P-A},${D.to+R/2}`),de.appendChild(se),this._element.appendChild(de),k++}this.width.set(y,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Be(()=>this._element.remove())),this._register(_t(d=>{const u=this._originalEditorLayoutInfo.read(d),h=this._modifiedEditorLayoutInfo.read(d);!u||!h||(this._element.style.left=`${u.width-u.verticalScrollbarWidth}px`,this._element.style.height=`${u.height}px`,this._element.style.width=`${u.verticalScrollbarWidth+u.contentLeft-bl.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(g1(this._state));const r=He(d=>{const u=this._diffModel.read(d),h=u==null?void 0:u.diff.read(d);return h?h.movedTexts.map(f=>({move:f,original:new m0(q_(f.lineRangeMapping.original.startLineNumber-1),18),modified:new m0(q_(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(p0(this._editors.original,r.map(d=>d.map(u=>u.original)))),this._register(p0(this._editors.modified,r.map(d=>d.map(u=>u.modified)))),this._register(kr((d,u)=>{const h=r.read(d);for(const f of h)u.add(new WI(this._editors.original,f.original,f.move,"original",this._diffModel.get())),u.add(new WI(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=Rs("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=Rs("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(h1({createEmptyChangeSummary:()=>{},handleChange:(d,u)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)},d=>{a.read(d),l.read(d);const u=this._diffModel.read(d);if(!u)return;const h=u.diff.read(d);let f;if(h&&c==="original"){const g=this._editors.originalCursor.read(d);g&&(f=h.movedTexts.find(m=>m.lineRangeMapping.original.contains(g.lineNumber)))}if(h&&c==="modified"){const g=this._editors.modifiedCursor.read(d);g&&(f=h.movedTexts.find(m=>m.lineRangeMapping.modified.contains(g.lineNumber)))}f!==u.movedTextToCompare.get()&&u.movedTextToCompare.set(void 0,void 0),u.setActiveMovedText(f)}))}}bl.movedCodeBlockPadding=4;class Ek{static compute(e){const t=[],i=[];for(const n of e){let o=t.findIndex(r=>!r.intersectsStrict(n));o===-1&&(t.length>=6?o=X9(t,oo(a=>a.intersectWithRangeLength(n),ul)):(o=t.length,t.push(new oL))),t[o].addRange(n),i.push(o)}return new Ek(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class WI extends b4{constructor(e,t,i,n,o){const r=dt("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=dt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[dt("div.text-content@textContent"),dt("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=wi(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Nl(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?p("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):p("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?p("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):p("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new Il(this._nodes.actionBar,{highlightToggledItems:!0})),d=new ma("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new ma("","Compare",et.asClassName(ce.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(_t(h=>{const f=this._diffModel.movedTextToCompare.read(h)===i;u.checked=f})),c.push(u,{icon:!1,label:!0})}}T("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},p("diffEditor.move.border","The border color for text that got moved in the diff editor."));T("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},p("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));T("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},p("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets."));const JY=Bl("diff-insert",ce.add,p("diffInsertIcon","Line decoration for inserts in the diff editor.")),C4=Bl("diff-remove",ce.remove,p("diffRemoveIcon","Line decoration for removals in the diff editor.")),VI=Ci.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+et.asClassName(JY),marginClassName:"gutter-insert"}),HI=Ci.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+et.asClassName(C4),marginClassName:"gutter-delete"}),zI=Ci.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),UI=Ci.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),$I=Ci.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),eQ=Ci.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),tQ=Ci.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),zy=Ci.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),iQ=Ci.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),nQ=Ci.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});class sQ extends G{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=He(this,o=>{var r;const a=(r=this._diffModel.read(o))===null||r===void 0?void 0:r.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),d=this._options.showEmptyDecorations.read(o),u=[],h=[];if(!l)for(const g of a.mappings)if(g.lineRangeMapping.original.isEmpty||u.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?HI:UI}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?VI:zI}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||u.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:iQ}),g.lineRangeMapping.modified.isEmpty||h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:eQ});else for(const m of g.lineRangeMapping.innerChanges||[])g.lineRangeMapping.original.contains(m.originalRange.startLineNumber)&&u.push({range:m.originalRange,options:m.originalRange.isEmpty()&&d?nQ:zy}),g.lineRangeMapping.modified.contains(m.modifiedRange.startLineNumber)&&h.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()&&d?tQ:$I});if(l)for(const g of l.changes){const m=g.original.toInclusiveRange();m&&u.push({range:m,options:c?HI:UI});const _=g.modified.toInclusiveRange();_&&h.push({range:_,options:c?VI:zI});for(const v of g.innerChanges||[])u.push({range:v.originalRange,options:zy}),h.push({range:v.modifiedRange,options:$I})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const g of a.movedTexts)u.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===f?" currentMove":""),blockPadding:[bl.movedCodeBlockPadding,0,bl.movedCodeBlockPadding,bl.movedCodeBlockPadding]}}),h.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:h}}),this._register(g0(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(g0(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class oQ{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=wR(this,i=>{var n;const o=(n=this._sashRatio.read(i))!==null&&n!==void 0?n:this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(o,i)},(i,n)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,n)}),this._sashRatio=lt(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,r=100;return i<=r*2?n:oi-r?i-r:o}}class w4 extends G{constructor(e,t,i,n,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new Is(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(_t(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(_t(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}var y4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Uy=function(s,e){return function(t,i){e(t,i,s)}},Jl;const S4=Qe("diffProviderFactoryService");let $y=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(_0,e)}};$y=y4([Uy(0,vt)],$y);rt(S4,$y,1);let _0=Jl=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new O,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}async computeDiff(e,t,i,n){var o,r;if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,n);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new ws(new Me(1,2),new Me(1,t.getLineCount()+1),[new Ao(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),c=Jl.diffCache.get(a);if(c&&c.context===l)return c.result;const d=qc.create(),u=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),h=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=u==null?void 0:u.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:i.computeMoves?(r=u==null?void 0:u.moves.length)!==null&&r!==void 0?r:0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!u)throw new Error("no diff result available");return Jl.diffCache.size>10&&Jl.diffCache.delete(Jl.diffCache.keys().next().value),Jl.diffCache.set(a,{result:u,context:l}),u}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};_0.diffCache=new Map;_0=Jl=y4([Uy(1,od),Uy(2,Rl)],_0);var rQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},aQ=function(s,e){return function(t,i){e(t,i,s)}};let Ky=class extends G{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=lt(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=lt(this,void 0),this.diff=this._diff,this._unchangedRegions=lt(this,void 0),this.unchangedRegions=He(this,a=>{var l,c;return this._options.hideUnchangedRegions.read(a)?(c=(l=this._unchangedRegions.read(a))===null||l===void 0?void 0:l.regions)!==null&&c!==void 0?c:[]:(Ti(d=>{var u;for(const h of((u=this._unchangedRegions.get())===null||u===void 0?void 0:u.regions)||[])h.collapseAll(d)}),[])}),this.movedTextToCompare=lt(this,void 0),this._activeMovedText=lt(this,void 0),this._hoveredMovedText=lt(this,void 0),this.activeMovedText=He(this,a=>{var l,c;return(c=(l=this.movedTextToCompare.read(a))!==null&&l!==void 0?l:this._hoveredMovedText.read(a))!==null&&c!==void 0?c:this._activeMovedText.read(a)}),this._cancellationTokenSource=new Ho,this._diffProvider=He(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=Rs("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(Be(()=>this._cancellationTokenSource.cancel()));const n=yR("contentChangedSignal"),o=this._register(new _n(()=>n.trigger(void 0),200));this._register(_t(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(g=>g.isDragged.read(a)))return;const c=l.originalDecorationIds.map(g=>e.original.getDecorationRange(g)).map(g=>g?Me.fromRangeInclusive(g):void 0),d=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?Me.fromRangeInclusive(g):void 0),u=l.regions.map((g,m)=>!c[m]||!d[m]?void 0:new dl(c[m].startLineNumber,d[m].startLineNumber,c[m].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(bu),h=[];let f=!1;for(const g of hS(u,(m,_)=>m.getHiddenModifiedRange(a).endLineNumberExclusive===_.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;const m=g.reduce((v,b)=>v+b.lineCount,0),_=new dl(g[0].originalLineNumber,g[0].modifiedLineNumber,m,g[0].visibleLineCountTop.get(),g[g.length-1].visibleLineCountBottom.get());h.push(_)}else h.push(g[0]);if(f){const g=e.original.deltaDecorations(l.originalDecorationIds,h.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations(l.modifiedDecorationIds,h.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));Ti(_=>{this._unchangedRegions.set({regions:h,originalDecorationIds:g,modifiedDecorationIds:m},_)})}}));const r=(a,l,c)=>{const d=dl.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let u;const h=this._unchangedRegions.get();if(h){const _=h.originalDecorationIds.map(w=>e.original.getDecorationRange(w)).map(w=>w?Me.fromRangeInclusive(w):void 0),v=h.modifiedDecorationIds.map(w=>e.modified.getDecorationRange(w)).map(w=>w?Me.fromRangeInclusive(w):void 0);let C=zY(h.regions.map((w,y)=>{if(!_[y]||!v[y])return;const L=_[y].length;return new dl(_[y].startLineNumber,v[y].startLineNumber,L,Math.min(w.visibleLineCountTop.get(),L),Math.min(w.visibleLineCountBottom.get(),L-w.visibleLineCountTop.get()))}).filter(bu),(w,y)=>!y||w.modifiedLineNumber>=y.modifiedLineNumber+y.lineCount&&w.originalLineNumber>=y.originalLineNumber+y.lineCount).map(w=>new kn(w.getHiddenOriginalRange(c),w.getHiddenModifiedRange(c)));C=kn.clip(C,Me.ofLength(1,e.original.getLineCount()),Me.ofLength(1,e.modified.getLineCount())),u=kn.inverse(C,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(u)for(const _ of d){const v=u.filter(b=>b.original.intersectsStrict(_.originalUnchangedRange)&&b.modified.intersectsStrict(_.modifiedUnchangedRange));f.push(..._.setVisibleRanges(v,l))}else f.push(...d);const g=e.original.deltaDecorations((h==null?void 0:h.originalDecorationIds)||[],f.map(_=>({range:_.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),m=e.modified.deltaDecorations((h==null?void 0:h.modifiedDecorationIds)||[],f.map(_=>({range:_.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:m},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=ua.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=ua.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(kr(async(a,l)=>{var c,d;this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),n.read(a);const u=this._diffProvider.read(a);u.onChangeSignal.read(a),Xs(gA,a),Xs(YC,a),this._isDiffUpToDate.set(!1,void 0);let h=[];l.add(e.original.onDidChangeContent(m=>{const _=ua.fromModelContentChanges(m.changes);h=E_(h,_)}));let f=[];l.add(e.modified.onDidChangeContent(m=>{const _=ua.fromModelContentChanges(m.changes);f=E_(f,_)}));let g=await u.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(g=lQ(g,e.original,e.modified),g=(c=(e.original,e.modified,void 0))!==null&&c!==void 0?c:g,g=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:g,Ti(m=>{r(g,m),this._lastDiff=g;const _=Ik.fromDiffResult(g);this._diff.set(_,m),this._isDiffUpToDate.set(!0,m);const v=this.movedTextToCompare.get();this.movedTextToCompare.set(v?this._lastDiff.moves.find(b=>b.lineRangeMapping.modified.intersect(v.lineRangeMapping.modified)):void 0,m)}))}))}ensureModifiedLineIsVisible(e,t,i){var n,o;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const r=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of r)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){var n,o;if(((n=this.diff.get())===null||n===void 0?void 0:n.mappings.length)===0)return;const r=((o=this._unchangedRegions.get())===null||o===void 0?void 0:o.regions)||[];for(const a of r)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,i);return}}async waitForDiff(){await qj(this.isDiffUpToDate,e=>e)}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:e==null?void 0:e.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var t;const i=(t=e.collapsedRegions)===null||t===void 0?void 0:t.map(o=>Me.deserialize(o.range)),n=this._unchangedRegions.get();!n||!i||Ti(o=>{for(const r of n.regions)for(const a of i)if(r.modifiedUnchangedRange.intersect(a)){r.setHiddenModifiedRange(a,o);break}})}};Ky=rQ([aQ(2,S4)],Ky);function lQ(s,e,t){return{changes:s.changes.map(i=>new ws(i.original,i.modified,i.innerChanges?i.innerChanges.map(n=>cQ(n,e,t)):void 0)),moves:s.moves,identical:s.identical,quitEarly:s.quitEarly}}function cQ(s,e,t){let i=s.originalRange,n=s.modifiedRange;return(i.endColumn!==1||n.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&i.endLineNumbernew L4(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class L4{constructor(e){this.lineRangeMapping=e}}class dl{static fromDiffs(e,t,i,n,o){const r=ws.inverse(e,t,i),a=[];for(const l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,u=l.original.length;const h=c===1&&d===1,f=c+u===t+1&&d+u===i+1;(h||f)&&u>=o+n?(h&&!f&&(u-=o),f&&!h&&(c+=o,d+=o,u-=o),a.push(new dl(c,d,u,0,0))):u>=o*2+n&&(c+=o,d+=o,u-=o*2,a.push(new dl(c,d,u,0,0)))}return a}get originalUnchangedRange(){return Me.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Me.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=lt(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=lt(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=He(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=lt(this,void 0);const r=Math.max(Math.min(n,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-n),0);zD(n===r),zD(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],n=new Ms(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(n.ranges.length===0)this.showAll(t),i.push(this);else{let l=0;for(const c of n.ranges){const d=l===n.ranges.length-1;l++;const u=(d?a:c.endLineNumberExclusive)-r,h=new dl(o,r,u,0,0);h.setHiddenModifiedRange(c,t),i.push(h),o=h.originalUnchangedRange.endLineNumberExclusive,r=h.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Me.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Me.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&n{var _;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(_=i.getDomNode())!==null&&_!==void 0?_:void 0,getAnchor:()=>({x:g,y:m}),getActions:()=>{const v=[],b=n.modified.isEmpty;return v.push(new ma("diff.clipboard.copyDeletedContent",b?n.original.length>1?p("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):p("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):n.original.length>1?p("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):p("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{const w=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());await this._clipboardService.writeText(w)})),n.original.length>1&&v.push(new ma("diff.clipboard.copyDeletedLineContent",b?p("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.original.startLineNumber+u):p("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.original.startLineNumber+u),void 0,!0,async()=>{let w=this._originalTextModel.getLineContent(n.original.startLineNumber+u);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r `),await this._clipboardService.writeText(w)})),i.getOption(91)||v.push(new ma("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Ai(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;const{top:m,height:_}=Fs(this._diffActions),v=Math.floor(d/3);g.preventDefault(),f(g.posx,m+_+v)})),this._register(i.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.leftButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),f(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:n}=Fs(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;cs});function uQ(s,e,t,i){nn(i,e.fontInfo);const n=t.length>0,o=new j0(1e4);let r=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Ss.isBasicASCII(l,n),d=Ss.containsRTL(l,c,o),u=cL(new th(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Ns.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var fQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qI=function(s,e){return function(t,i){e(t,i,s)}};let jy=class extends G{constructor(e,t,i,n,o,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=lt(this,0),this._originalScrollOffset=lt(this,0),this._originalScrollOffsetAnimated=OI(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=lt(this,0),this._modifiedScrollOffset=lt(this,0),this._modifiedScrollOffsetAnimated=OI(this._targetWindow,this._modifiedScrollOffset,this._store);const u=lt("invalidateAlignmentsState",0),h=this._register(new _n(()=>{u.set(u.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(C=>{(C.hasChanged(146)||C.hasChanged(67))&&h.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(C=>{(C.hasChanged(146)||C.hasChanged(67))&&h.schedule()}));const f=this._diffModel.map(C=>C?wi(C.model.original.onDidChangeTokens,()=>C.model.original.tokenization.backgroundTokenizationState===2):void 0).map((C,w)=>C==null?void 0:C.read(w)),g=He(C=>{const w=this._diffModel.read(C),y=w==null?void 0:w.diff.read(C);if(!w||!y)return null;u.read(C);const k=this._options.renderSideBySide.read(C);return GI(this._editors.original,this._editors.modified,y.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,k)}),m=He(C=>{var w;const y=(w=this._diffModel.read(C))===null||w===void 0?void 0:w.movedTextToCompare.read(C);if(!y)return null;u.read(C);const L=y.changes.map(k=>new L4(k));return GI(this._editors.original,this._editors.modified,L,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function _(){const C=document.createElement("div");return C.className="diagonal-fill",C}const v=this._register(new pe);this.viewZones=sh(this,(C,w)=>{var y,L,k,D,N,W,R,A;v.clear();const P=g.read(C)||[],H=[],q=[],re=this._modifiedTopPadding.read(C);re>0&&q.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:re,showInHiddenAreas:!0,suppressMouseDown:!0});const de=this._originalTopPadding.read(C);de>0&&H.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:de,showInHiddenAreas:!0,suppressMouseDown:!0});const ve=this._options.renderSideBySide.read(C),se=ve||(y=this._editors.modified._getViewModel())===null||y===void 0?void 0:y.createLineBreaksComputer();if(se){const it=this._editors.original.getModel();for(const ai of P)if(ai.diff)for(let Yi=ai.originalRange.startLineNumber;Yiit.getLineCount())return{orig:H,mod:q};se==null||se.addRequest(it.getLineContent(Yi),null,null)}}const Ce=(L=se==null?void 0:se.finalize())!==null&&L!==void 0?L:[];let Ee=0;const fe=this._editors.modified.getOption(67),X=(k=this._diffModel.read(C))===null||k===void 0?void 0:k.movedTextToCompare.read(C),ie=(N=(D=this._editors.original.getModel())===null||D===void 0?void 0:D.mightContainNonBasicASCII())!==null&&N!==void 0?N:!1,ut=(R=(W=this._editors.original.getModel())===null||W===void 0?void 0:W.mightContainRTL())!==null&&R!==void 0?R:!1,Mt=Nk.fromEditor(this._editors.modified);for(const it of P)if(it.diff&&!ve){if(!it.originalRange.isEmpty){f.read(C);const Yi=document.createElement("div");Yi.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const mi=this._editors.original.getModel();if(it.originalRange.endLineNumberExclusive-1>mi.getLineCount())return{orig:H,mod:q};const ke=new hQ(it.originalRange.mapToLineArray(li=>mi.tokenization.getLineTokens(li)),it.originalRange.mapToLineArray(li=>Ce[Ee++]),ie,ut),rn=[];for(const li of it.diff.innerChanges||[])rn.push(new df(li.originalRange.delta(-(it.diff.original.startLineNumber-1)),zy.className,0));const rs=uQ(ke,Mt,rn,Yi),Tn=document.createElement("div");if(Tn.className="inline-deleted-margin-view-zone",nn(Tn,Mt.fontInfo),this._options.renderIndicators.read(C))for(let li=0;liTN(Cn),Tn,this._editors.modified,it.diff,this._diffEditorWidget,rs.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let li=0;li1&&H.push({afterLineNumber:it.originalRange.startLineNumber+li,domNode:_(),heightInPx:(as-1)*fe,showInHiddenAreas:!0,suppressMouseDown:!0})}q.push({afterLineNumber:it.modifiedRange.startLineNumber-1,domNode:Yi,heightInPx:rs.heightInLines*fe,minWidthInPx:rs.minWidthInPx,marginDomNode:Tn,setZoneId(li){Cn=li},showInHiddenAreas:!0,suppressMouseDown:!0})}const ai=document.createElement("div");ai.className="gutter-delete",H.push({afterLineNumber:it.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:it.modifiedHeightInPx,marginDomNode:ai,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const ai=it.modifiedHeightInPx-it.originalHeightInPx;if(ai>0){if(X!=null&&X.lineRangeMapping.original.delta(-1).deltaLength(2).contains(it.originalRange.endLineNumberExclusive-1))continue;H.push({afterLineNumber:it.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ai,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Yi=function(){const ke=document.createElement("div");return ke.className="arrow-revert-change "+et.asClassName(ce.arrowRight),w.add(j(ke,"mousedown",rn=>rn.stopPropagation())),w.add(j(ke,"click",rn=>{rn.stopPropagation(),o.revert(it.diff)})),De("div",{},ke)};if(X!=null&&X.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(it.modifiedRange.endLineNumberExclusive-1))continue;let mi;it.diff&&it.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(C)&&(mi=Yi()),q.push({afterLineNumber:it.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ai,marginDomNode:mi,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const it of(A=m.read(C))!==null&&A!==void 0?A:[]){if(!(X!=null&&X.lineRangeMapping.original.intersect(it.originalRange))||!(X!=null&&X.lineRangeMapping.modified.intersect(it.modifiedRange)))continue;const ai=it.modifiedHeightInPx-it.originalHeightInPx;ai>0?H.push({afterLineNumber:it.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ai,showInHiddenAreas:!0,suppressMouseDown:!0}):q.push({afterLineNumber:it.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ai,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:H,mod:q}});let b=!1;this._register(this._editors.original.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.modified.setScrollLeft(C.scrollLeft),b=!1)})),this._register(this._editors.modified.onDidScrollChange(C=>{C.scrollLeftChanged&&!b&&(b=!0,this._editors.original.setScrollLeft(C.scrollLeft),b=!1)})),this._originalScrollTop=wi(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=wi(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(_t(C=>{const w=this._originalScrollTop.read(C)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(C))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(C));w!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(w,1)})),this._register(_t(C=>{const w=this._modifiedScrollTop.read(C)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(C))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(C));w!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(w,1)})),this._register(_t(C=>{var w;const y=(w=this._diffModel.read(C))===null||w===void 0?void 0:w.movedTextToCompare.read(C);let L=0;if(y){const k=this._editors.original.getTopForLineNumber(y.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();L=this._editors.modified.getTopForLineNumber(y.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-k}L>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(L,void 0)):L<0?(this._modifiedTopPadding.set(-L,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-L,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+L,void 0,!0)}))}};jy=fQ([qI(8,Sk),qI(9,Da)],jy);function GI(s,e,t,i,n,o){const r=new ba(ZI(s,i)),a=new ba(ZI(e,n)),l=s.getOption(67),c=e.getOption(67),d=[];let u=0,h=0;function f(g,m){for(;;){let _=r.peek(),v=a.peek();if(_&&_.lineNumber>=g&&(_=void 0),v&&v.lineNumber>=m&&(v=void 0),!_&&!v)break;const b=_?_.lineNumber-u:Number.MAX_VALUE,C=v?v.lineNumber-h:Number.MAX_VALUE;bC?(a.dequeue(),_={lineNumber:v.lineNumber-h+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Me.ofLength(_.lineNumber,1),modifiedRange:Me.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let C=function(w,y){var L,k,D,N;if(wH.lineNumberH+q.heightInPx,0))!==null&&k!==void 0?k:0,P=(N=(D=a.takeWhile(H=>H.lineNumberH+q.heightInPx,0))!==null&&N!==void 0?N:0;d.push({originalRange:W,modifiedRange:R,originalHeightInPx:W.length*l+A,modifiedHeightInPx:R.length*c+P,diff:g.lineRangeMapping}),b=w,v=y};const m=g.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let _=!0,v=m.modified.startLineNumber,b=m.original.startLineNumber;if(o)for(const w of m.innerChanges||[]){w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&C(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber);const y=s.getModel(),L=w.originalRange.endLineNumber<=y.getLineCount()?y.getLineMaxColumn(w.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;w.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of s.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new V(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return OY(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}class gQ extends G{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=wi(this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=wi(this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=Rs("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=Rs("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=yR("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(dt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{Ti(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Be(()=>o.disconnect())),this._register(_t(r=>{n.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(_t(r=>this.render(r)))}dispose(){super.dispose(),xn(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),n=new Set(this.views.keys()),o=Re.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new Me(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);Ti(c=>{for(const d of l){if(!d.range.intersect(a))continue;n.delete(d.id);let u=this.views.get(d.id);if(u)u.item.set(d,c);else{const m=document.createElement("div");this._domNode.appendChild(m);const _=lt("item",d),v=this.itemProvider.createView(_,m);u=new mQ(_,v,m),this.views.set(d.id,u)}const h=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t,g=(d.range.isEmpty?h:this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t)-h;u.domNode.style.top=`${h}px`,u.domNode.style.height=`${g}px`,u.gutterItemView.layout(Re.ofStartAndLength(h,g),o)}})}for(const r of n){const a=this.views.get(r);a.gutterItemView.dispose(),this._domNode.removeChild(a.domNode),this.views.delete(r)}}}class mQ{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class k4 extends Rc{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class YI extends uA{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new Os(e-1,t)}}class pQ extends G{constructor(e,t,i={orientation:0}){var n;super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new KP),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new pe),i.hoverDelegate=(n=i.hoverDelegate)!==null&&n!==void 0?n:this._register(XL()),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Ku(()=>{var o;return(o=this.toggleMenuActionViewItem)===null||o===void 0?void 0:o.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Il(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(o,r)=>{var a;if(o.id===Ku.ID)return this.toggleMenuActionViewItem=new Z_(o,o.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:et.asClassNameArray((a=i.moreIcon)!==null&&a!==void 0?a:ce.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const l=i.actionViewItemProvider(o,r);if(l)return l}if(o instanceof R0){const l=new Z_(o,o.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:o.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return l.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(l),this.disposables.add(this._onDidChangeDropdownVisibility.add(l.onDidChangeVisibility)),l}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(n=>{this.actionBar.push(n,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(n)})})}getKeybindingLabel(e){var t,i,n;const o=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(n=o==null?void 0:o.getLabel())!==null&&n!==void 0?n:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Ku extends ma{constructor(e,t){t=t||p("moreActions","More Actions..."),super(Ku.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Ku.ID="toolbar.toggle.more";var D4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},eo=function(s,e){return function(t,i){e(t,i,s)}};let qy=class extends pQ{constructor(e,t,i,n,o,r,a,l){super(e,o,{getKeyBinding:d=>{var u;return(u=r.lookupKeybinding(d.id))!==null&&u!==void 0?u:void 0},...t,allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new pe);const c=t==null?void 0:t.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],i){var n,o,r;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let d=0;const u=[];let h=!1;if(((n=this._options)===null||n===void 0?void 0:n.hiddenItemStrategy)!==-1)for(let f=0;f_==null?void 0:_.id)),g=this._options.overflowBehavior.maxItems-f.size;let m=0;for(let _=0;_=g&&(a[_]=void 0,u[_]=v))}}Qk(a),Qk(u),super.setActions(a,qi.join(u,l)),(c.length>0||a.length>0)&&this._sessionDisposables.add(j(this.getElement(),"contextmenu",f=>{var g,m,_,v,b;const C=new Io(be(this.getElement()),f),w=this.getItemAction(C.target);if(!w)return;C.preventDefault(),C.stopPropagation();const y=[];if(w instanceof pa&&w.menuKeybinding?y.push(w.menuKeybinding):w instanceof lf||w instanceof Ku||y.push(g4(w.id,void 0,this._commandService,this._keybindingService)),c.length>0){let k=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){k=!0;for(let D=0;Dthis._menuService.resetHiddenStates(i)}))),L.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>C,getActions:()=>L,menuId:(_=this._options)===null||_===void 0?void 0:_.contextMenu,menuActionOptions:{renderShortTitle:!0,...(v=this._options)===null||v===void 0?void 0:v.menuOptions},skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};qy=D4([eo(2,Jc),eo(3,bt),eo(4,Da),eo(5,Zi),eo(6,Ls),eo(7,Rl)],qy);let v0=class extends qy{constructor(e,t,i,n,o,r,a,l,c){super(e,{resetMenu:t,...i},n,o,r,a,l,c),this._onDidChangeMenuItems=this._store.add(new O),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0})),u=()=>{var h,f,g;const m=[],_=[];xq(d,i==null?void 0:i.menuOptions,{primary:m,secondary:_},(h=i==null?void 0:i.toolbarOptions)===null||h===void 0?void 0:h.primaryGroup,(f=i==null?void 0:i.toolbarOptions)===null||f===void 0?void 0:f.shouldInlineSubmenu,(g=i==null?void 0:i.toolbarOptions)===null||g===void 0?void 0:g.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",m.length===0&&_.length===0),super.setActions(m,_)};this._store.add(d.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new Dt("This toolbar is populated from a menu.")}};v0=D4([eo(3,Jc),eo(4,bt),eo(5,Da),eo(6,Zi),eo(7,Ls),eo(8,Rl)],v0);var x4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Hp=function(s,e){return function(t,i){e(t,i,s)}};const fb=[],cp=35;let Gy=class extends G{constructor(e,t,i,n,o,r,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(x.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=wi(this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=He(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=He(this,d=>this._hasActions.read(d)?cp:0),this.elements=dt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:cp+"px"}},[]),this._currentDiff=He(this,d=>{var u;const h=this._diffModel.read(d);if(!h)return;const f=(u=h.diff.read(d))===null||u===void 0?void 0:u.mappings,g=this._editors.modifiedCursor.read(d);if(g)return f==null?void 0:f.find(m=>m.lineRangeMapping.modified.contains(g.lineNumber))}),this._selectedDiffs=He(this,d=>{const u=this._diffModel.read(d),h=u==null?void 0:u.diff.read(d);if(!h)return fb;const f=this._editors.modifiedSelections.read(d);if(f.every(v=>v.isEmpty()))return fb;const g=new Ms(f.map(v=>Me.fromRangeInclusive(v))),_=h.mappings.filter(v=>v.lineRangeMapping.innerChanges&&g.intersects(v.lineRangeMapping.modified)).map(v=>({mapping:v,rangeMappings:v.lineRangeMapping.innerChanges.filter(b=>f.some(C=>M.areIntersecting(b.modifiedRange,C)))}));return _.length===0||_.every(v=>v.rangeMappings.length===0)?fb:_}),this._register(BY(e,this.elements.root)),this._register(j(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(Nl(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),tr(this,d=>this._showSash.read(d)?new w4(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,wR(this,h=>this._sashLayout.sashLeft.read(h)-cp,(h,f)=>this._sashLayout.sashLeft.set(h+cp,f)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new gQ(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(d,u)=>{const h=this._diffModel.read(u);if(!h)return[];const f=h.diff.read(u);if(!f)return[];const g=this._selectedDiffs.read(u);if(g.length>0){const _=ws.fromRangeMappings(g.flatMap(v=>v.rangeMappings));return[new QI(_,!0,x.DiffEditorSelectionToolbar,void 0,h.model.original.uri,h.model.modified.uri)]}const m=this._currentDiff.read(u);return f.mappings.map(_=>new QI(_.lineRangeMapping.withInnerChangesFromLineRanges(),_.lineRangeMapping===(m==null?void 0:m.lineRangeMapping),x.DiffEditorHunkToolbar,void 0,h.model.original.uri,h.model.modified.uri))},createView:(d,u)=>this._instantiationService.createInstance(Zy,d,u,this)})),this._register(j(this.elements.gutter,J.MOUSE_WHEEL,d=>{this._editors.modified.getOption(103).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(d)},{passive:!1}))}computeStagedValue(e){var t;const i=(t=e.innerChanges)!==null&&t!==void 0?t:[],n=new YI(this._editors.modifiedModel.get()),o=new YI(this._editors.original.getModel());return new e3(i.map(l=>l.toTextEdit(n))).apply(o)}layout(e){this.elements.gutter.style.left=e+"px"}};Gy=x4([Hp(6,vt),Hp(7,bt),Hp(8,Jc)],Gy);class QI{constructor(e,t,i,n,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){var e;return(e=this.rangeOverride)!==null&&e!==void 0?e:this.mapping.modified}}let Zy=class extends G{constructor(e,t,i,n){super(),this._item=e,this._elements=dt("div.gutterItem",{style:{height:"20px",width:"34px"}},[dt("div.background@background",{},[]),dt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=lt(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(lg,"element",!0,{position:{hoverPosition:1}}));this._register(Jh(t,this._elements.root)),this._register(_t(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(kr((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(n.createInstance(v0,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:o,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:new k4(()=>{const c=this._item.get(),d=c.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const n=e.length/2-i/2,o=i;let r=e.start+n;const a=Re.tryCreate(o,t.endExclusive-o-i),l=Re.tryCreate(e.start+o,e.endExclusive-i-o);l&&a&&l.start=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},vQ=function(s,e){return function(t,i){e(t,i,s)}},Yy;let b0=Yy=class extends G{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=tr(this,l=>{const c=this._editors.modifiedModel.read(l),d=Yy._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();Ti(d=>{for(const u of this._editors.original.getSelections()||[])c==null||c.ensureOriginalLineIsVisible(u.getStartPosition().lineNumber,0,d),c==null||c.ensureOriginalLineIsVisible(u.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();Ti(d=>{for(const u of this._editors.modified.getSelections()||[])c==null||c.ensureModifiedLineIsVisible(u.getStartPosition().lineNumber,0,d),c==null||c.ensureModifiedLineIsVisible(u.getEndPosition().lineNumber,0,d)})}));const o=this._diffModel.map((l,c)=>{var d,u;const h=(d=l==null?void 0:l.unchangedRegions.read(c))!==null&&d!==void 0?d:[];return h.length===1&&h[0].modifiedLineNumber===1&&h[0].lineCount===((u=this._editors.modifiedModel.read(c))===null||u===void 0?void 0:u.getLineCount())?[]:h});this.viewZones=sh(this,(l,c)=>{const d=this._modifiedOutlineSource.read(l);if(!d)return{origViewZones:[],modViewZones:[]};const u=[],h=[],f=this._options.renderSideBySide.read(l),g=o.read(l);for(const m of g)if(!m.shouldHideControls(l)){{const _=He(this,b=>m.getHiddenOriginalRange(b).startLineNumber-1),v=new m0(_,24);u.push(v),c.add(new XI(this._editors.original,v,m,m.originalUnchangedRange,!f,d,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,2,void 0),this._options))}{const _=He(this,b=>m.getHiddenModifiedRange(b).startLineNumber-1),v=new m0(_,24);h.push(v),c.add(new XI(this._editors.modified,v,m,m.modifiedUnchangedRange,!1,d,b=>this._diffModel.get().ensureModifiedLineIsVisible(b,2,void 0),this._options))}}return{origViewZones:u,modViewZones:h}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new cR(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(p("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+et.asClassName(ce.fold),zIndex:10001};this._register(g0(this._editors.original,He(this,l=>{const c=o.read(l),d=c.map(u=>({range:u.originalUnchangedRange.toInclusiveRange(),options:r}));for(const u of c)u.shouldHideControls(l)&&d.push({range:M.fromPositions(new V(u.originalLineNumber,1)),options:a});return d}))),this._register(g0(this._editors.modified,He(this,l=>{const c=o.read(l),d=c.map(u=>({range:u.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const u of c)u.shouldHideControls(l)&&d.push({range:Me.ofLength(u.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(_t(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(bu)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(bu))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&(!((c=l.target.element)===null||c===void 0)&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,u=this._diffModel.get();if(!u)return;const h=u.unchangedRegions.get().find(f=>f.modifiedUnchangedRange.includes(d));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&(!((c=l.target.element)===null||c===void 0)&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,u=this._diffModel.get();if(!u)return;const h=u.unchangedRegions.get().find(f=>f.originalUnchangedRange.includes(d));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}};b0._breadcrumbsSourceFactory=lt("breadcrumbsSourceFactory",void 0);b0=Yy=_Q([vQ(3,vt)],b0);class XI extends b4{constructor(e,t,i,n,o,r,a,l){const c=dt("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=dt("div.diff-hidden-lines",[dt("div.top@top",{title:p("diff.hiddenLines.top","Click or drag to show more above")}),dt("div.center@content",{style:{display:"flex"}},[dt("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[De("a",{title:p("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Dc("$(unfold)"))]),dt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),dt("div.bottom@bottom",{title:p("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const d=wi(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._hide?xn(this._nodes.first):this._register(Nl(this._nodes.first,{width:d.map(h=>h.contentLeft)})),this._register(_t(h=>{const f=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const g=this._unchangedRegion.isDragged.read(h),m=this._editor.getDomNode();m&&(m.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(m.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),m.classList.toggle("canMoveBottom",!f)):g==="bottom"?(m.classList.toggle("canMoveTop",!f),m.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(m.classList.toggle("canMoveTop",!1),m.classList.toggle("canMoveBottom",!1)))}));const u=this._editor;this._register(j(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const _=be(this._nodes.top),v=j(_,"mousemove",C=>{const y=C.clientY-f;g=g||Math.abs(y)>2;const L=Math.round(y/u.getOption(67)),k=Math.max(0,Math.min(m+L,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(k,void 0)}),b=j(_,"mouseup",C=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),v.dispose(),b.dispose()})})),this._register(j(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const _=be(this._nodes.bottom),v=j(_,"mousemove",C=>{const y=C.clientY-f;g=g||Math.abs(y)>2;const L=Math.round(y/u.getOption(67)),k=Math.max(0,Math.min(m-L,this._unchangedRegion.getMaxVisibleLineCountBottom())),D=this._unchangedRegionRange.endLineNumberExclusive>u.getModel().getLineCount()?u.getContentHeight():u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(k,void 0);const N=this._unchangedRegionRange.endLineNumberExclusive>u.getModel().getLineCount()?u.getContentHeight():u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(N-D))}),b=j(_,"mouseup",C=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const w=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const y=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(y-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),b.dispose()})})),this._register(_t(h=>{const f=[];if(!this._hide){const g=i.getHiddenModifiedRange(h).length,m=p("hiddenLines","{0} hidden lines",g),_=De("span",{title:p("diff.hiddenLines.expandAll","Double click to unfold")},m);_.addEventListener("dblclick",C=>{C.button===0&&(C.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(_);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){f.push(De("span",void 0,"  |  "));for(let C=0;C{this._revealModifiedHiddenLine(w.startLineNumber)}}}}xn(this._nodes.others,...f)}))}}var bQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},CQ=function(s,e){return function(t,i){e(t,i,s)}},Qs;let Uc=Qs=class extends G{constructor(e,t,i,n,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=Qs.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=wi(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=He(h=>{const f=l.read(h),g=f.getColor(O8)||(f.getColor(P8)||sw).transparent(2),m=f.getColor(B8)||(f.getColor(F8)||ow).transparent(2);return{insertColor:g,removeColor:m}}),d=nt(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const u=dt("div.diffOverview",{style:{position:"absolute",top:"0px",width:Qs.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(Jh(u,d.domNode)),this._register(Ai(u,J.POINTER_DOWN,h=>{this._editors.modified.delegateVerticalScrollbarPointerDown(h)})),this._register(j(u,J.MOUSE_WHEEL,h=>{this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1})),this._register(Jh(this._rootElement,u)),this._register(kr((h,f)=>{const g=this._diffModel.read(h),m=this._editors.original.createOverviewRuler("original diffOverviewRuler");m&&(f.add(m),f.add(Jh(u,m.getDomNode())));const _=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(_&&(f.add(_),f.add(Jh(u,_.getDomNode()))),!m||!_)return;const v=Rs("viewZoneChanged",this._editors.original.onDidChangeViewZones),b=Rs("viewZoneChanged",this._editors.modified.onDidChangeViewZones),C=Rs("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),w=Rs("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(_t(y=>{var L;v.read(y),b.read(y),C.read(y),w.read(y);const k=c.read(y),D=(L=g==null?void 0:g.diff.read(y))===null||L===void 0?void 0:L.mappings;function N(A,P,H){const q=H._getViewModel();return q?A.filter(re=>re.length>0).map(re=>{const de=q.coordinatesConverter.convertModelPositionToViewPosition(new V(re.startLineNumber,1)),ve=q.coordinatesConverter.convertModelPositionToViewPosition(new V(re.endLineNumberExclusive,1)),se=ve.lineNumber-de.lineNumber;return new fM(de.lineNumber,ve.lineNumber,se,P.toString())}):[]}const W=N((D||[]).map(A=>A.lineRangeMapping.original),k.removeColor,this._editors.original),R=N((D||[]).map(A=>A.lineRangeMapping.modified),k.insertColor,this._editors.modified);m==null||m.setZones(W),_==null||_.setZones(R)})),f.add(_t(y=>{const L=this._rootHeight.read(y),k=this._rootWidth.read(y),D=this._modifiedEditorLayoutInfo.read(y);if(D){const N=Qs.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Qs.ONE_OVERVIEW_WIDTH;m.setLayout({top:0,height:L,right:N+Qs.ONE_OVERVIEW_WIDTH,width:Qs.ONE_OVERVIEW_WIDTH}),_.setLayout({top:0,height:L,right:0,width:Qs.ONE_OVERVIEW_WIDTH});const W=this._editors.modifiedScrollTop.read(y),R=this._editors.modifiedScrollHeight.read(y),A=this._editors.modified.getOption(103),P=new Fu(A.verticalHasArrows?A.arrowSize:0,A.verticalScrollbarSize,0,D.height,R,W);d.setTop(P.getSliderPosition()),d.setHeight(P.getSliderSize())}else d.setTop(0),d.setHeight(0);u.style.height=L+"px",u.style.left=k-Qs.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(Qs.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};Uc.ONE_OVERVIEW_WIDTH=15;Uc.ENTIRE_DIFF_OVERVIEW_WIDTH=Qs.ONE_OVERVIEW_WIDTH*2;Uc=Qs=bQ([CQ(6,ho)],Uc);const gb=[];class wQ extends G{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=He(this,o=>{const r=this._diffModel.read(o),a=r==null?void 0:r.diff.read(o);if(!a)return gb;const l=this._editors.modifiedSelections.read(o);if(l.every(h=>h.isEmpty()))return gb;const c=new Ms(l.map(h=>Me.fromRangeInclusive(h))),u=a.mappings.filter(h=>h.lineRangeMapping.innerChanges&&c.intersects(h.lineRangeMapping.modified)).map(h=>({mapping:h,rangeMappings:h.lineRangeMapping.innerChanges.filter(f=>l.some(g=>M.areIntersecting(f.modifiedRange,g)))}));return u.length===0||u.every(h=>h.rangeMappings.length===0)?gb:u}),this._register(kr((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a==null?void 0:a.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const c=[],d=this._selectedDiffs.read(o),u=new Set(d.map(h=>h.mapping));if(d.length>0){const h=this._editors.modifiedSelections.read(o),f=r.add(new xg(h[h.length-1].positionLineNumber,this._widget,d.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}for(const h of l.mappings)if(!u.has(h)&&!h.lineRangeMapping.modified.isEmpty&&h.lineRangeMapping.innerChanges){const f=r.add(new xg(h.lineRangeMapping.modified.startLineNumber,this._widget,h.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}r.add(Be(()=>{for(const h of c)this._editors.modified.removeGlyphMarginWidget(h)}))}))}}class xg extends G{getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id=`revertButton${xg.counter++}`,this._domNode=dt("div.revertButton",{title:this._revertSelection?p("revertSelectedChanges","Revert Selected Changes"):p("revertChange","Revert Change")},[W_(ce.arrowRight)]).root,this._register(j(this._domNode,J.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(j(this._domNode,J.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(j(this._domNode,J.CLICK,o=>{this._diffs instanceof kn?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:kl.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}xg.counter=0;function Br(s,e,t){const i=s.bindTo(e);return ik({debugName:()=>`Set Context Key "${s.key}"`},n=>{i.set(t(n))})}function yQ(s){return vc.get(s)}class vc{static get(e){let t=vc._map.get(e);if(!t){t=new vc(e),vc._map.set(e,t);const i=e.onDidDispose(()=>{vc._map.delete(e),i.dispose()})}return t}constructor(e){this.editor=e,this.model=wi(this.editor.onDidChangeModel,()=>this.editor.getModel())}}vc._map=new Map;var SQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},JI=function(s,e){return function(t,i){e(t,i,s)}};let Qy=class extends G{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new O),this.modifiedScrollTop=wi(this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=wi(this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedModel=yQ(this.modified).model,this.modifiedSelections=wi(this.modified.onDidChangeCursorSelection,()=>{var l;return(l=this.modified.getSelections())!==null&&l!==void 0?l:[]}),this.modifiedCursor=tk({owner:this,equalsFn:V.equals},l=>{var c,d;return(d=(c=this.modifiedSelections.read(l)[0])===null||c===void 0?void 0:c.getPosition())!==null&&d!==void 0?d:new V(1,1)}),this.originalCursor=wi(this.original.onDidChangeCursorPosition,()=>{var l;return(l=this.original.getPosition())!==null&&l!==void 0?l:new V(1,1)}),this._argCodeEditorWidgetOptions=null,this._register(h1({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return n.setContextValue("isInDiffLeftEditor",!0),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return n.setContextValue("isInDiffRightEditor",!0),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Uc.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=jc.revealHorizontalRightPadding.defaultValue+Uc.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=p("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};Qy=SQ([JI(5,vt),JI(6,Zi)],Qy);class M1 extends G{constructor(){super(...arguments),this._id=++M1.idCounter,this._onDidDispose=this._register(new O),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}M1.idCounter=0;var LQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},kQ=function(s,e){return function(t,i){e(t,i,s)}};let Xy=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=lt(this,0),this._screenReaderMode=wi(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=He(this,n=>this._options.read(n).renderSideBySide&&this._diffEditorWidth.read(n)<=this._options.read(n).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=He(this,n=>this._options.read(n).renderOverviewRuler),this.renderSideBySide=He(this,n=>this._options.read(n).renderSideBySide&&!(this._options.read(n).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(n)&&!this._screenReaderMode.read(n))),this.readOnly=He(this,n=>this._options.read(n).readOnly),this.shouldRenderOldRevertArrows=He(this,n=>!(!this._options.read(n).renderMarginRevertIcon||!this.renderSideBySide.read(n)||this.readOnly.read(n)||this.shouldRenderGutterMenu.read(n))),this.shouldRenderGutterMenu=He(this,n=>this._options.read(n).renderGutterMenu),this.renderIndicators=He(this,n=>this._options.read(n).renderIndicators),this.enableSplitViewResizing=He(this,n=>this._options.read(n).enableSplitViewResizing),this.splitViewDefaultRatio=He(this,n=>this._options.read(n).splitViewDefaultRatio),this.ignoreTrimWhitespace=He(this,n=>this._options.read(n).ignoreTrimWhitespace),this.maxComputationTimeMs=He(this,n=>this._options.read(n).maxComputationTime),this.showMoves=He(this,n=>this._options.read(n).experimental.showMoves&&this.renderSideBySide.read(n)),this.isInEmbeddedEditor=He(this,n=>this._options.read(n).isInEmbeddedEditor),this.diffWordWrap=He(this,n=>this._options.read(n).diffWordWrap),this.originalEditable=He(this,n=>this._options.read(n).originalEditable),this.diffCodeLens=He(this,n=>this._options.read(n).diffCodeLens),this.accessibilityVerbose=He(this,n=>this._options.read(n).accessibilityVerbose),this.diffAlgorithm=He(this,n=>this._options.read(n).diffAlgorithm),this.showEmptyDecorations=He(this,n=>this._options.read(n).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=He(this,n=>this._options.read(n).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=He(this,n=>this._options.read(n).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=He(this,n=>this._options.read(n).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=He(this,n=>this._options.read(n).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=He(this,n=>this._options.read(n).hideUnchangedRegions.minimumLineCount);const i={...e,...eN(e,Qi)};this._options=lt(this,i)}updateOptions(e){const t=eN(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}};Xy=LQ([kQ(1,Uo)],Xy);function eN(s,e){var t,i,n,o,r,a,l,c;return{enableSplitViewResizing:le(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:U5(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:le(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:le(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:Gl(s.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:Gl(s.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:le(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:le(s.renderIndicators,e.renderIndicators),originalEditable:le(s.originalEditable,e.originalEditable),diffCodeLens:le(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:le(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:jt(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:jt(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:le(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:le((t=s.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:le((i=s.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:le((o=(n=s.hideUnchangedRegions)===null||n===void 0?void 0:n.enabled)!==null&&o!==void 0?o:(r=s.experimental)===null||r===void 0?void 0:r.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:Gl((a=s.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:Gl((l=s.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:Gl((c=s.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:le(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:le(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:Gl(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:le(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:le(s.renderGutterMenu,e.renderGutterMenu)}}var DQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ah=function(s,e){return function(t,i){e(t,i,s)}};let C0=class extends M1{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,o,r,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=dt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[dt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),dt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),dt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=lt(this,void 0),this._shouldDisposeDiffModel=!1,this.onDidChangeModel=te.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Qg([bt,this._contextKeyService]))),this._boundarySashes=lt(this,void 0),this._accessibleDiffViewerShouldBeVisible=lt(this,!1),this._accessibleDiffViewerVisible=He(this,y=>this._options.onlyShowAccessibleDiffViewer.read(y)?!0:this._accessibleDiffViewerShouldBeVisible.read(y)),this._movedBlocksLinesPart=lt(this,void 0),this._layoutInfo=He(this,y=>{var L,k,D,N,W;const R=this._rootSizeObserver.width.read(y),A=this._rootSizeObserver.height.read(y);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=A+"px";const P=this._sash.read(y),H=this._gutter.read(y),q=(L=H==null?void 0:H.width.read(y))!==null&&L!==void 0?L:0,re=(D=(k=this._overviewRulerPart.read(y))===null||k===void 0?void 0:k.width)!==null&&D!==void 0?D:0;let de,ve,se,Ce,Ee;if(!!P){const X=P.sashLeft.read(y),ie=(W=(N=this._movedBlocksLinesPart.read(y))===null||N===void 0?void 0:N.width.read(y))!==null&&W!==void 0?W:0;de=0,ve=X-q-ie,Ee=X-q,se=X,Ce=R-se-re}else Ee=0,de=q,ve=Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),se=q+ve,Ce=R-se-re;return this.elements.original.style.left=de+"px",this.elements.original.style.width=ve+"px",this._editors.original.layout({width:ve,height:A},!0),H==null||H.layout(Ee),this.elements.modified.style.left=se+"px",this.elements.modified.style.width=Ce+"px",this._editors.modified.layout({width:Ce,height:A},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((y,L)=>y==null?void 0:y.diff.read(L)),this.onDidUpdateDiff=te.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Be(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new v4(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=this._instantiationService.createInstance(Xy,t),this._register(_t(y=>{this._options.setWidth(this._rootSizeObserver.width.read(y))})),this._contextKeyService.createKey(ae.isEmbeddedDiffEditor.key,!1),this._register(Br(ae.isEmbeddedDiffEditor,this._contextKeyService,y=>this._options.isInEmbeddedEditor.read(y))),this._register(Br(ae.comparingMovedCode,this._contextKeyService,y=>{var L;return!!(!((L=this._diffModel.read(y))===null||L===void 0)&&L.movedTextToCompare.read(y))})),this._register(Br(ae.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,y=>this._options.couldShowInlineViewBecauseOfSize.read(y))),this._register(Br(ae.diffEditorInlineMode,this._contextKeyService,y=>!this._options.renderSideBySide.read(y))),this._register(Br(ae.hasChanges,this._contextKeyService,y=>{var L,k,D;return((D=(k=(L=this._diffModel.read(y))===null||L===void 0?void 0:L.diff.read(y))===null||k===void 0?void 0:k.mappings.length)!==null&&D!==void 0?D:0)>0})),this._editors=this._register(this._instantiationService.createInstance(Qy,this.elements.original,this.elements.modified,this._options,i,(y,L,k,D)=>this._createInnerEditor(y,L,k,D))),this._register(Br(ae.diffEditorOriginalWritable,this._contextKeyService,y=>this._options.originalEditable.read(y))),this._register(Br(ae.diffEditorModifiedWritable,this._contextKeyService,y=>!this._options.readOnly.read(y))),this._register(Br(ae.diffEditorOriginalUri,this._contextKeyService,y=>{var L,k;return(k=(L=this._diffModel.read(y))===null||L===void 0?void 0:L.model.original.uri.toString())!==null&&k!==void 0?k:""})),this._register(Br(ae.diffEditorModifiedUri,this._contextKeyService,y=>{var L,k;return(k=(L=this._diffModel.read(y))===null||L===void 0?void 0:L.model.modified.uri.toString())!==null&&k!==void 0?k:""})),this._overviewRulerPart=tr(this,y=>this._options.renderOverviewRuler.read(y)?this._instantiationService.createInstance(Xs(Uc,y),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(L=>L.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const d={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,L)=>{var k,D;return y-((D=(k=this._overviewRulerPart.read(L))===null||k===void 0?void 0:k.width)!==null&&D!==void 0?D:0)})};this._sashLayout=new oQ(this._options,d),this._sash=tr(this,y=>{const L=this._options.renderSideBySide.read(y);return this.elements.root.classList.toggle("side-by-side",L),L?new w4(this.elements.root,d,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const u=tr(this,y=>this._instantiationService.createInstance(Xs(b0,y),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);tr(this,y=>this._instantiationService.createInstance(Xs(sQ,y),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,f=new Set;let g=!1;const m=tr(this,y=>this._instantiationService.createInstance(Xs(jy,y),be(this._domElement),this._editors,this._diffModel,this._options,this,()=>g||u.get().isUpdatingHiddenAreas,h,f)).recomputeInitiallyAndOnChange(this._store),_=He(this,y=>{const L=m.read(y).viewZones.read(y).orig,k=u.read(y).viewZones.read(y).origViewZones;return L.concat(k)}),v=He(this,y=>{const L=m.read(y).viewZones.read(y).mod,k=u.read(y).viewZones.read(y).modViewZones;return L.concat(k)});this._register(p0(this._editors.original,_,y=>{g=y},h));let b;this._register(p0(this._editors.modified,v,y=>{g=y,g?b=Dg.capture(this._editors.modified):(b==null||b.restore(this._editors.modified),b=void 0)},f)),this._accessibleDiffViewer=tr(this,y=>this._instantiationService.createInstance(Xs(cl,y),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(L,k)=>this._accessibleDiffViewerShouldBeVisible.set(L,k),this._options.onlyShowAccessibleDiffViewer.map(L=>!L),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((L,k)=>{var D;return(D=L==null?void 0:L.diff.read(k))===null||D===void 0?void 0:D.mappings.map(N=>N.lineRangeMapping)}),new XY(this._editors))).recomputeInitiallyAndOnChange(this._store);const C=this._accessibleDiffViewerVisible.map(y=>y?"hidden":"visible");this._register(Nl(this.elements.modified,{visibility:C})),this._register(Nl(this.elements.original,{visibility:C})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._gutter=tr(this,y=>this._options.shouldRenderGutterMenu.read(y)?this._instantiationService.createInstance(Xs(Gy,y),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(g1(this._layoutInfo)),tr(this,y=>new(Xs(bl,y))(this.elements.root,this._diffModel,this._layoutInfo.map(L=>L.originalEditor),this._layoutInfo.map(L=>L.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,y=>{this._movedBlocksLinesPart.set(y,void 0)}),this._register(te.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,y=>this._handleCursorPositionChange(y,!0))),this._register(te.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,y=>this._handleCursorPositionChange(y,!1)));const w=this._diffModel.map(this,(y,L)=>{if(y)return y.diff.read(L)===void 0&&!y.isDiffUpToDate.read(L)});this._register(kr((y,L)=>{if(w.read(y)===!0){const k=this._editorProgressService.show(!0,1e3);L.add(Be(()=>k.done()))}})),this._register(Be(()=>{var y;this._shouldDisposeDiffModel&&((y=this._diffModel.get())===null||y===void 0||y.dispose())})),this._register(kr((y,L)=>{L.add(new(Xs(wQ,y))(this._editors,this._diffModel,this._options,this))}))}_createInnerEditor(e,t,i,n){return e.createInstance(ag,t,i,n)}_createDiffEditorContributions(){const e=Xd.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){At(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return $g.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),i=this._editors.modified.saveViewState();return{original:t,modified:i,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(Ky,e,this._options)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e,t){!e&&this._diffModel.get()&&this._accessibleDiffViewer.get().close();const i=e?"model"in e?{model:e,shouldDispose:!1}:{model:this.createViewModel(e),shouldDispose:!0}:void 0;this._diffModel.get()!==(i==null?void 0:i.model)&&JL(t,n=>{var o;wi.batchEventsGlobally(n,()=>{this._editors.original.setModel(i?i.model.model.original:null),this._editors.modified.setModel(i?i.model.model.modified:null)});const r=this._diffModel.get(),a=this._shouldDisposeDiffModel;this._shouldDisposeDiffModel=(o=i==null?void 0:i.shouldDispose)!==null&&o!==void 0?o:!1,this._diffModel.set(i==null?void 0:i.model,n),a&&(r==null||r.dispose())})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?xQ(t):null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(n=>({range:n.modifiedRange,text:t.model.original.getValueInRange(n.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new V(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var t,i,n,o;const r=(i=(t=this._diffModel.get())===null||t===void 0?void 0:t.diff.get())===null||i===void 0?void 0:i.mappings;if(!r||r.length===0)return;const a=this._editors.modified.getPosition().lineNumber;let l;e==="next"?l=(n=r.find(c=>c.lineRangeMapping.modified.startLineNumber>a))!==null&&n!==void 0?n:r[0]:l=(o=d_(r,c=>c.lineRangeMapping.modified.startLineNumber{var t;const i=(t=e.diff.get())===null||t===void 0?void 0:t.mappings;!i||i.length===0||this._goTo(i[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),n=i?this._editors.modified:this._editors.original,o=i?this._editors.original:this._editors.modified;let r;const a=n.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>i?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=BI(a.getStartPosition(),l),d=BI(a.getEndPosition(),l);r=M.plusRange(c,d)}}return{destination:o,destinationSelection:r}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Ti(i=>{for(const n of t)n.collapseAll(i)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Ti(i=>{for(const n of t)n.showAll(i)})}_handleCursorPositionChange(e,t){var i,n;if((e==null?void 0:e.reason)===3){const o=(n=(i=this._diffModel.get())===null||i===void 0?void 0:i.diff.get())===null||n===void 0?void 0:n.mappings.find(r=>t?r.lineRangeMapping.modified.contains(e.position.lineNumber):r.lineRangeMapping.original.contains(e.position.lineNumber));o!=null&&o.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Ne.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):o!=null&&o.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Ne.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):o&&this._accessibilitySignalService.playSignal(Ne.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};C0=DQ([Ah(3,bt),Ah(4,vt),Ah(5,gi),Ah(6,ah),Ah(7,YL)],C0);function xQ(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,a=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var Tk=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},xt=function(s,e){return function(t,i){e(t,i,s)}};let EQ=0,tN=!1;function IQ(s){if(!s){if(tN)return;tN=!0}h8(s||wt.document.body)}let w0=class extends ag{constructor(e,t,i,n,o,r,a,l,c,d,u,h,f){const g={...t};g.ariaLabel=g.ariaLabel||j_.editorViewAccessibleLabel,g.ariaLabel=g.ariaLabel+";"+j_.accessibilityHelpMessage,super(e,g,{},i,n,o,r,c,d,u,h,f),l instanceof $u?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,IQ(g.ariaContainerElement),wj((m,_)=>i.createInstance(lg,m,_,{})),yj(a)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++EQ,o=st.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),G.None;const t=e.id,i=e.label,n=st.and(st.equals("editorId",this.getId()),st.deserialize(e.precondition)),o=e.keybindings,r=st.and(n,st.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new pe,u=this.getId()+":"+t;if(d.add(sn.registerCommand(u,c)),a){const f={command:{id:u,title:i},when:n,group:a,order:l};d.add(fr.appendMenuItem(x.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,f,c,r));const h=new mM(u,i,i,void 0,n,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),d.add(Be(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof P_)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};w0=Tk([xt(2,vt),xt(3,gi),xt(4,Ls),xt(5,bt),xt(6,Xg),xt(7,Zi),xt(8,ho),xt(9,$o),xt(10,Uo),xt(11,Nr),xt(12,kt)],w0);let Jy=class extends w0{constructor(e,t,i,n,o,r,a,l,c,d,u,h,f,g,m,_){const v={...t};f0(u,v,!1);const b=c.registerEditorContainer(e);typeof v.theme=="string"&&c.setTheme(v.theme),typeof v.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!v.autoDetectHighContrast);const C=v.model;delete v.model,super(e,v,i,n,o,r,a,l,c,d,h,m,_),this._configurationService=u,this._standaloneThemeService=c,this._register(b);let w;if(typeof C>"u"){const y=g.getLanguageIdByMimeType(v.language)||v.language||ro;w=E4(f,g,v.value||"",y,void 0),this._ownsModel=!0}else w=C,this._ownsModel=!1;if(this._attachModel(w),w){const y={oldModelUrl:null,newModelUrl:w.uri};this._onDidChangeModel.fire(y)}}dispose(){super.dispose()}updateOptions(e){f0(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};Jy=Tk([xt(2,vt),xt(3,gi),xt(4,Ls),xt(5,bt),xt(6,Xg),xt(7,Zi),xt(8,fo),xt(9,$o),xt(10,Xt),xt(11,Uo),xt(12,ns),xt(13,Mi),xt(14,Nr),xt(15,kt)],Jy);let eS=class extends C0{constructor(e,t,i,n,o,r,a,l,c,d,u,h){const f={...t};f0(l,f,!0);const g=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},n,i,o,h,d),this._configurationService=l,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){f0(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(w0,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};eS=Tk([xt(2,vt),xt(3,bt),xt(4,gi),xt(5,fo),xt(6,$o),xt(7,Xt),xt(8,Da),xt(9,YL),xt(10,Sk),xt(11,ah)],eS);function E4(s,e,t,i,n){if(t=t||"",!i){const o=t.indexOf(` `);let r=t;return o!==-1&&(r=t.substring(0,o)),iN(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return iN(s,t,e.createById(i),n)}function iN(s,e,t,i){return s.createModel(e,t,i)}var NQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},TQ=function(s,e){return function(t,i){e(t,i,s)}};class AQ{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let y0=class extends G{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=lt(this,void 0),this._collapsed=He(this,r=>{var a;return(a=this._viewModel.read(r))===null||a===void 0?void 0:a.collapsed.read(r)}),this._editorContentHeight=lt(this,500),this.contentHeight=He(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=lt(this,0),this._modifiedWidth=lt(this,0),this._originalContentWidth=lt(this,0),this._originalWidth=lt(this,0),this.maxScroll=He(this,r=>{const a=this._modifiedContentWidth.read(r)-this._modifiedWidth.read(r),l=this._originalContentWidth.read(r)-this._originalWidth.read(r);return a>l?{maxScroll:a,width:this._modifiedWidth.read(r)}:{maxScroll:l,width:this._originalWidth.read(r)}}),this._elements=dt("div.multiDiffEntry",[dt("div.header@header",[dt("div.header-content",[dt("div.collapse-button@collapseButton"),dt("div.file-path",[dt("div.title.modified.show-file-icons@primaryPath",[]),dt("div.status.deleted@status",["R"]),dt("div.title.original.show-file-icons@secondaryPath",[])]),dt("div.actions@actions")])]),dt("div.editorParent",[dt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(C0,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=nN(this.editor.getModifiedEditor()),this.isOriginalFocused=nN(this.editor.getOriginalEditor()),this.isFocused=He(this,r=>this.isModifedFocused.read(r)||this.isOriginalFocused.read(r)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new pe,this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new my(this._elements.collapseButton,{});this._register(_t(r=>{o.element.className="",o.icon=this._collapsed.read(r)?ce.chevronRight:ce.chevronDown})),this._register(o.onDidClick(()=>{var r;(r=this._viewModel.get())===null||r===void 0||r.collapsed.set(!this._collapsed.get(),void 0)})),this._register(_t(r=>{this._elements.editor.style.display=this._collapsed.read(r)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(r=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(r=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(r=>{Rp(a=>{this._editorContentHeight.set(r.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(r=>{if(this._isSettingScrollTop||!r.scrollTopChanged||!this._data)return;const a=r.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(_t(r=>{var a;const l=(a=this._viewModel.read(r))===null||a===void 0?void 0:a.isActive.read(r);this._elements.root.classList.toggle("active",l)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._register(this._instantiationService.createInstance(v0,this._elements.actions,x.MultiDiffEditorFileToolbar,{actionRunner:this._register(new k4(()=>{var r;return(r=this._viewModel.get())===null||r===void 0?void 0:r.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:r=>r.startsWith("navigation")},actionViewItemProvider:(r,a)=>Eq(n,r,a)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(n){return{...n,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}const i=e.viewModel.entry.value;i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{var n;this.editor.updateOptions(t((n=i.options)!==null&&n!==void 0?n:{}))})),Rp(n=>{var o,r,a,l;(o=this._resourceLabel)===null||o===void 0||o.setUri((r=e.viewModel.modifiedUri)!==null&&r!==void 0?r:e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let c=!1,d=!1,u=!1,h="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(h="R",c=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(h="A",u=!0):(h="D",d=!0),this._elements.status.classList.toggle("renamed",c),this._elements.status.classList.toggle("deleted",d),this._elements.status.classList.toggle("added",u),this._elements.status.innerText=h,(a=this._resourceLabel2)===null||a===void 0||a.setUri(c?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setModel(e.viewModel.diffEditorViewModel,n),this.editor.updateOptions(t((l=i.options)!==null&&l!==void 0?l:{}))})}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,Rp(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};y0=NQ([TQ(3,vt)],y0);function nN(s){return wi(e=>{const t=new pe;return t.add(s.onDidFocusEditorWidget(()=>e(!0))),t.add(s.onDidBlurEditorWidget(()=>e(!1))),t},()=>s.hasTextFocus())}class MQ{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){var t;let i;if(this._unused.size===0)i=this._create(e),this._itemData.set(i,e);else{const n=[...this._unused.values()];i=(t=n.find(o=>this._itemData.get(o).getId()===e.getId()))!==null&&t!==void 0?t:n[0],this._unused.delete(i),this._itemData.set(i,e),i.setData(e)}return this._used.add(i),{object:i,dispose:()=>{this._used.delete(i),this._unused.size>5?i.dispose():this._unused.add(i)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var RQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},sN=function(s,e){return function(t,i){e(t,i,s)}};let tS=class extends G{constructor(e,t,i,n,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=dt("div.scrollContent",[dt("div@content",{style:{overflow:"hidden"}}),dt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new ih({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>is(be(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new t1(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=dt("div.monaco-component.multiDiffEditor",{},[dt("div",{},[this._scrollableElement.getDomNode()]),dt("div.placeholder@placeholder",{},[dt("div",[p("noChangedFiles","No Changed Files")])])]),this._sizeObserver=this._register(new v4(this._element,void 0)),this._objectPool=this._register(new MQ(l=>{const c=this._instantiationService.createInstance(y0,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this.scrollTop=wi(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=wi(this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=sh(this,(l,c)=>{const d=this._viewModel.read(l);if(!d)return{items:[],getItem:g=>{throw new Dt}};const u=d.items.read(l),h=new Map;return{items:u.map(g=>{var m;const _=c.add(new PQ(g,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),v=(m=this._lastDocStates)===null||m===void 0?void 0:m[_.getKey()];return v&&Ti(b=>{_.setViewState(v,b)}),h.set(g,_),_}),getItem:g=>h.get(g)}}),this._viewItems=this._viewItemsInfo.map(this,l=>l.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((d,u)=>d+u.contentHeight.read(c)+this._spaceBetweenPx,0)),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Qg([bt,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(ae.inMultiDiffEditor.key,!0),this._register(kr((l,c)=>{const d=this._viewModel.read(l);if(d&&d.contextKeys)for(const[u,h]of Object.entries(d.contextKeys)){const f=this._contextKeyService.createKey(u,void 0);f.set(h),c.add(Be(()=>f.reset()))}}));const a=this._parentContextKeyService.createKey(ae.multiDiffEditorAllCollapsed.key,!1);this._register(_t(l=>{const c=this._viewModel.read(l);if(c){const d=c.items.read(l).every(u=>u.collapsed.read(l));a.set(d)}})),this._register(_t(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._register(_t(l=>{const c=this._viewItems.read(l);this._elements.placeholder.classList.toggle("visible",c.length===0)})),this._scrollableElements.content.style.position="relative",this._register(_t(l=>{const c=this._sizeObserver.height.read(l);this._scrollableElements.root.style.height=`${c}px`;const d=this._totalHeight.read(l);this._scrollableElements.content.style.height=`${d}px`;const u=this._sizeObserver.width.read(l);let h=u;const f=this._viewItems.read(l),g=dA(f,oo(m=>m.maxScroll.read(l).maxScroll,ul));if(g){const m=g.maxScroll.read(l);h=u+m.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:c,scrollHeight:d,scrollWidth:h})})),e.replaceChildren(this._elements.root),this._register(Be(()=>{e.replaceChildren()})),this._register(this._register(_t(l=>{Rp(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let i=0,n=0,o=0;const r=this._sizeObserver.height.read(e),a=Re.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),u=Math.min(d,r),h=Re.ofStartAndLength(n,u),f=Re.ofStartAndLength(o,d);if(f.isBefore(a))i-=d-u,c.hide();else if(f.isAfter(a))c.hide();else{const g=Math.max(0,Math.min(a.start-f.start,d-u));i-=g;const m=Re.ofStartAndLength(t+i,r);c.render(h,g,l,m)}n+=u+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};tS=RQ([sN(4,bt),sN(5,vt)],tS);class PQ extends G{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(Hj(this,void 0)),this.contentHeight=He(this,o=>{var r,a,l;return(l=(a=(r=this._templateRef.read(o))===null||r===void 0?void 0:r.object.contentHeight)===null||a===void 0?void 0:a.read(o))!==null&&l!==void 0?l:this.viewModel.lastTemplateData.read(o).contentHeight}),this.maxScroll=He(this,o=>{var r,a;return(a=(r=this._templateRef.read(o))===null||r===void 0?void 0:r.object.maxScroll.read(o))!==null&&a!==void 0?a:{maxScroll:0,scrollWidth:0}}),this.template=He(this,o=>{var r;return(r=this._templateRef.read(o))===null||r===void 0?void 0:r.object}),this._isHidden=lt(this,!1),this._isFocused=He(this,o=>{var r,a;return(a=(r=this.template.read(o))===null||r===void 0?void 0:r.isFocused.read(o))!==null&&a!==void 0?a:!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(_t(o=>{var r;const a=this._scrollLeft.read(o);(r=this._templateRef.read(o))===null||r===void 0||r.object.setScrollLeft(a)})),this._register(_t(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.entry.value.modified)===null||e===void 0?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var i;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const n=this.viewModel.lastTemplateData.get(),o=(i=e.selections)===null||i===void 0?void 0:i.map(yt.liftSelection);this.viewModel.lastTemplateData.set({...n,selections:o},t);const r=this._templateRef.get();r&&o&&r.object.editor.setSelections(o)}_updateTemplateData(e){var t;const i=this._templateRef.get();i&&this.viewModel.lastTemplateData.set({contentHeight:i.object.contentHeight.get(),selections:(t=i.object.editor.getSelections())!==null&&t!==void 0?t:void 0},e)}_clear(){const e=this._templateRef.get();e&&Ti(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new AQ(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,n)}}T("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},p("multiDiffEditor.headerBackground","The background color of the diff editor's header"));T("multiDiffEditor.background",{dark:"editorBackground",light:"editorBackground",hcDark:"editorBackground",hcLight:"editorBackground"},p("multiDiffEditor.background","The background color of the multi file diff editor"));T("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},p("multiDiffEditor.border","The border color of the multi file diff editor"));var FQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},OQ=function(s,e){return function(t,i){e(t,i,s)}};let iS=class extends G{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=lt(this,void 0),this._viewModel=lt(this,void 0),this._widgetImpl=sh(this,(n,o)=>(Xs(y0,n),o.add(this._instantiationService.createInstance(Xs(tS,n),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(g1(this._widgetImpl))}};iS=FQ([OQ(2,vt)],iS);function BQ(s,e,t){return Se.initialize(t||{}).createInstance(Jy,s,e)}function WQ(s){return Se.get(gi).onCodeEditorAdd(t=>{s(t)})}function VQ(s){return Se.get(gi).onDiffEditorAdd(t=>{s(t)})}function HQ(){return Se.get(gi).listCodeEditors()}function zQ(){return Se.get(gi).listDiffEditors()}function UQ(s,e,t){return Se.initialize(t||{}).createInstance(eS,s,e)}function $Q(s,e){const t=Se.initialize(e||{});return new iS(s,{},t)}function KQ(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return sn.registerCommand(s.id,s.run)}function jQ(s){if(typeof s.id!="string"||typeof s.label!="string"||typeof s.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=st.deserialize(s.precondition),t=(n,...o)=>Sl.runEditorCommand(n,o,e,(r,a,l)=>Promise.resolve(s.run(a,...l))),i=new pe;if(i.add(sn.registerCommand(s.id,t)),s.contextMenuGroupId){const n={command:{id:s.id,title:s.label},when:e,group:s.contextMenuGroupId,order:s.contextMenuOrder||0};i.add(fr.appendMenuItem(x.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=Se.get(Zi);if(!(n instanceof $u))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=st.and(e,st.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(r=>({keybinding:r,command:s.id,when:o}))))}}return i}function qQ(s){return I4([s])}function I4(s){const e=Se.get(Zi);return e instanceof $u?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:st.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),G.None)}function GQ(s,e,t){const i=Se.get(Mi),n=i.getLanguageIdByMimeType(e)||e;return E4(Se.get(ns),i,s,n,t)}function ZQ(s,e){const t=Se.get(Mi),i=t.getLanguageIdByMimeType(e)||e||ro;s.setLanguage(t.createById(i))}function YQ(s,e,t){s&&Se.get(rd).changeOne(e,s.uri,t)}function QQ(s){Se.get(rd).changeAll(s,[])}function XQ(s){return Se.get(rd).read(s)}function JQ(s){return Se.get(rd).onMarkerChanged(s)}function eX(s){return Se.get(ns).getModel(s)}function tX(){return Se.get(ns).getModels()}function iX(s){return Se.get(ns).onModelAdded(s)}function nX(s){return Se.get(ns).onModelRemoved(s)}function sX(s){return Se.get(ns).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function oX(s){return W3(Se.get(ns),Se.get(Nr),s)}function rX(s,e){const t=Se.get(Mi),i=Se.get(fo);return uL.colorizeElement(i,t,s,e).then(()=>{i.registerEditorContainer(s)})}function aX(s,e,t){const i=Se.get(Mi);return Se.get(fo).registerEditorContainer(wt.document.body),uL.colorize(i,s,e,t)}function lX(s,e,t=4){return Se.get(fo).registerEditorContainer(wt.document.body),uL.colorizeModelLine(s,e,t)}function cX(s){const e=oi.get(s);return e||{getInitialState:()=>Kf,tokenize:(t,i,n)=>CA(s,n)}}function dX(s,e){oi.getOrCreate(e);const t=cX(e),i=Xu(s),n=[];let o=t.getInitialState();for(let r=0,a=i.length;r{var o;if(!i)return null;const r=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?a=r:r&&(a={lineNumber:r.startLineNumber,column:r.startColumn}),await s.openCodeEditor(i,t.resource,a)?i:null})}function _X(){return{create:BQ,getEditors:HQ,getDiffEditors:zQ,onDidCreateEditor:WQ,onDidCreateDiffEditor:VQ,createDiffEditor:UQ,addCommand:KQ,addEditorAction:jQ,addKeybindingRule:qQ,addKeybindingRules:I4,createModel:GQ,setModelLanguage:ZQ,setModelMarkers:YQ,getModelMarkers:XQ,removeAllMarkers:QQ,onDidChangeMarkers:JQ,getModels:tX,getModel:eX,onDidCreateModel:iX,onWillDisposeModel:nX,onDidChangeModelLanguage:sX,createWebWorker:oX,colorizeElement:rX,colorize:aX,colorizeModelLine:lX,tokenize:dX,defineTheme:uX,setTheme:hX,remeasureFonts:fX,registerCommand:gX,registerLinkOpener:mX,registerEditorOpener:pX,AccessibilitySupport:Tb,ContentWidgetPositionPreference:Ob,CursorChangeReason:Bb,DefaultEndOfLine:Wb,EditorAutoIndentStrategy:Hb,EditorOption:zb,EndOfLinePreference:Ub,EndOfLineSequence:$b,MinimapPosition:tC,MinimapSectionHeaderStyle:iC,MouseTargetType:nC,OverlayWidgetPositionPreference:rC,OverviewRulerLane:aC,GlyphMarginLane:Kb,RenderLineNumbersType:dC,RenderMinimap:uC,ScrollbarVisibility:fC,ScrollType:hC,TextEditorCursorBlinkingStyle:bC,TextEditorCursorStyle:CC,TrackedRangeStickiness:wC,WrappingIndent:yC,InjectedTextCursorStops:Gb,PositionAffinity:cC,ShowLightbulbIconMode:mC,ConfigurationChangedEvent:zN,BareFontInfo:wc,FontInfo:OC,TextModelResolvedOptions:wp,FindMatch:zf,ApplyUpdateResult:sf,EditorZoom:Ka,createMultiFileDiffEditor:$Q,EditorType:$g,EditorOptions:jc}}function vX(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function dp(s,e){return typeof s=="boolean"?s:e}function oN(s,e){return typeof s=="string"?s:e}function bX(s){const e={};for(const t of s)e[t]=!0;return e}function rN(s,e=!1){e&&(s=s.map(function(i){return i.toLowerCase()}));const t=bX(s);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function nS(s,e,t){e=e.replace(/@@/g,"");let i=0,n;do n=!1,e=e.replace(/@(\w+)/g,function(r,a){n=!0;let l="";if(typeof s[a]=="string")l=s[a];else if(s[a]&&s[a]instanceof RegExp)l=s[a].source;else throw s[a]===void 0?Pt(s,"language definition does not contain attribute '"+a+"', used at: "+e):Pt(s,"attribute reference '"+a+"' must be a string, used at: "+e);return ic(l)?"":"(?:"+l+")"}),i++;while(n&&i<5);e=e.replace(/\x01/g,"@");const o=(s.ignoreCase?"i":"")+(s.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(s8(s,e,c),o)),l)}return new RegExp(e,o)}function CX(s,e,t,i){if(i<0)return s;if(i=100){i=i-100;const n=t.split(".");if(n.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw Pt(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Pt(s,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!o8(s,ja(s,n,"",[],""))))throw Pt(s,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=n}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,s.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let n=0,o=t.length;n0&&i[0]==="^",this.name=this.name+": "+i,this.regex=nS(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=sS(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}};function N4(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=s,t.includeLF=dp(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=dp(e.ignoreCase,!1),t.unicode=dp(e.unicode,!1),t.tokenPostfix=oN(e.tokenPostfix,"."+t.languageId),t.defaultToken=oN(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=s,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function n(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Pt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Pt(t,"include target '"+d+"' is not defined at: "+r);n(r+"."+d,a,e.tokenizer[d])}else{const u=new yX(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],u.setAction(i,h)}else throw Pt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else u.setAction(i,c[1]);else{if(!c.regex)throw Pt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=dp(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Pt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,n("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Pt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Pt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:va(t,a.open),close:va(t,a.close)});else throw Pt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function SX(s){xu.registerLanguage(s)}function LX(){let s=[];return s=s.concat(xu.getLanguages()),s}function kX(s){return Se.get(Mi).languageIdCodec.encodeLanguageId(s)}function DX(s,e){return Se.withServices(()=>{const i=Se.get(Mi).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function xX(s,e){return Se.withServices(()=>{const i=Se.get(Mi).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function EX(s,e){if(!Se.get(Mi).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return Se.get(Nr).register(s,e,100)}class IX{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return Eg.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new I0(n.tokens,n.endState)}}class Eg{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,r=e.length;o0&&o[r-1]===h)continue;let f=u.startIndex;c===0?f=0:f{const i=await Promise.resolve(e.create());return i?NX(i)?A4(s,i):new Gf(Se.get(Mi),Se.get(fo),s,N4(s,i),Se.get(Xt)):null});return oi.registerFactory(s,t)}function MX(s,e){if(!Se.get(Mi).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return T4(e)?Ak(s,{create:()=>e}):oi.register(s,A4(s,e))}function RX(s,e){const t=i=>new Gf(Se.get(Mi),Se.get(fo),s,N4(s,i),Se.get(Xt));return T4(e)?Ak(s,{create:()=>e}):oi.register(s,t(e))}function PX(s,e){return Se.get(kt).referenceProvider.register(s,e)}function FX(s,e){return Se.get(kt).renameProvider.register(s,e)}function OX(s,e){return Se.get(kt).newSymbolNamesProvider.register(s,e)}function BX(s,e){return Se.get(kt).signatureHelpProvider.register(s,e)}function WX(s,e){return Se.get(kt).hoverProvider.register(s,{provideHover:async(i,n,o,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new M(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new M(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function VX(s,e){return Se.get(kt).documentSymbolProvider.register(s,e)}function HX(s,e){return Se.get(kt).documentHighlightProvider.register(s,e)}function zX(s,e){return Se.get(kt).linkedEditingRangeProvider.register(s,e)}function UX(s,e){return Se.get(kt).definitionProvider.register(s,e)}function $X(s,e){return Se.get(kt).implementationProvider.register(s,e)}function KX(s,e){return Se.get(kt).typeDefinitionProvider.register(s,e)}function jX(s,e){return Se.get(kt).codeLensProvider.register(s,e)}function qX(s,e,t){return Se.get(kt).codeActionProvider.register(s,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(n,o,r,a)=>{const c=Se.get(rd).read({resource:n.uri}).filter(d=>M.areIntersectingOrTouching(d,o));return e.provideCodeActions(n,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function GX(s,e){return Se.get(kt).documentFormattingEditProvider.register(s,e)}function ZX(s,e){return Se.get(kt).documentRangeFormattingEditProvider.register(s,e)}function YX(s,e){return Se.get(kt).onTypeFormattingEditProvider.register(s,e)}function QX(s,e){return Se.get(kt).linkProvider.register(s,e)}function XX(s,e){return Se.get(kt).completionProvider.register(s,e)}function JX(s,e){return Se.get(kt).colorProvider.register(s,e)}function eJ(s,e){return Se.get(kt).foldingRangeProvider.register(s,e)}function tJ(s,e){return Se.get(kt).declarationProvider.register(s,e)}function iJ(s,e){return Se.get(kt).selectionRangeProvider.register(s,e)}function nJ(s,e){return Se.get(kt).documentSemanticTokensProvider.register(s,e)}function sJ(s,e){return Se.get(kt).documentRangeSemanticTokensProvider.register(s,e)}function oJ(s,e){return Se.get(kt).inlineCompletionsProvider.register(s,e)}function rJ(s,e){return Se.get(kt).inlineEditProvider.register(s,e)}function aJ(s,e){return Se.get(kt).inlayHintsProvider.register(s,e)}function lJ(){return{register:SX,getLanguages:LX,onLanguage:DX,onLanguageEncountered:xX,getEncodedLanguageId:kX,setLanguageConfiguration:EX,setColorMap:AX,registerTokensProviderFactory:Ak,setTokensProvider:MX,setMonarchTokensProvider:RX,registerReferenceProvider:PX,registerRenameProvider:FX,registerNewSymbolNameProvider:OX,registerCompletionItemProvider:XX,registerSignatureHelpProvider:BX,registerHoverProvider:WX,registerDocumentSymbolProvider:VX,registerDocumentHighlightProvider:HX,registerLinkedEditingRangeProvider:zX,registerDefinitionProvider:UX,registerImplementationProvider:$X,registerTypeDefinitionProvider:KX,registerCodeLensProvider:jX,registerCodeActionProvider:qX,registerDocumentFormattingEditProvider:GX,registerDocumentRangeFormattingEditProvider:ZX,registerOnTypeFormattingEditProvider:YX,registerLinkProvider:QX,registerColorProvider:JX,registerFoldingRangeProvider:eJ,registerDeclarationProvider:tJ,registerSelectionRangeProvider:iJ,registerDocumentSemanticTokensProvider:nJ,registerDocumentRangeSemanticTokensProvider:sJ,registerInlineCompletionsProvider:oJ,registerInlineEditProvider:rJ,registerInlayHintsProvider:aJ,DocumentHighlightKind:Vb,CompletionItemKind:Rb,CompletionItemTag:Pb,CompletionItemInsertTextRule:Mb,SymbolKind:_C,SymbolTag:vC,IndentAction:qb,CompletionTriggerKind:Fb,SignatureHelpTriggerKind:pC,InlayHintKind:Zb,InlineCompletionTriggerKind:Yb,InlineEditTriggerKind:Qb,CodeActionTriggerType:Ab,NewSymbolNameTag:sC,NewSymbolNameTriggerKind:oC,PartialAcceptTriggerKind:lC,HoverVerbosityAction:jb,FoldingRangeKind:io,SelectedSuggestionInfo:bF}}const Mk=Qe("IEditorCancelService"),M4=new me("cancellableOperation",!1,p("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));rt(Mk,class{constructor(){this._tokens=new WeakMap}add(s,e){let t=this._tokens.get(s);t||(t=s.invokeWithinContext(n=>{const o=M4.bindTo(n.get(bt)),r=new Qn;return{key:o,tokens:r}}),this._tokens.set(s,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(s){const e=this._tokens.get(s);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class cJ extends Ho{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(Mk).add(e,this))}dispose(){this._unregister(),super.dispose()}}Fe(new class extends Sl{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:M4})}runEditorCommand(s,e){s.get(Mk).cancel(e)}});class oS{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?Xp("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof oS))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 oS(e,this.flags))}}class R4 extends cJ{constructor(e,t,i,n){super(e,n),this._listener=new pe,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!M.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!M.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class P4 extends Ho{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function Tl(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===$g.ICodeEditor:!1}function dJ(s){return s&&typeof s.getEditorType=="function"?s.getEditorType()===$g.IDiffEditor:!1}function uJ(s){return!!s&&typeof s=="object"&&typeof s.onDidChangeActiveEditor=="function"}function Bse(s){return Tl(s)?s:dJ(s)?s.getModifiedEditor():uJ(s)&&Tl(s.activeCodeEditor)?s.activeCodeEditor:null}class Ig{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&n.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(e,t,i){i&&e.pushUndoStop();const n=Dg.capture(e),o=Ig._handleEolEdits(e,t);o.length===1&&Ig._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>Gw.replace(M.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>Gw.replaceMove(M.lift(r.range),r.text))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class aN{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class hJ{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(aN.toKey(e))}has(e){return this._set.has(aN.toKey(e))}}function F4(s,e,t){const i=[],n=new hJ,o=s.ordered(t);for(const a of o)i.push(a),a.extensionId&&n.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(n.has(a.extensionId))continue;n.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}class $c{static setFormatterSelector(e){return{dispose:$c._selectors.unshift(e)}}static async select(e,t,i,n){if(e.length===0)return;const o=ot.first($c._selectors);if(o)return await o(e,t,i,n)}}$c._selectors=new Qn;async function Wse(s,e,t,i,n,o,r){const a=s.get(vt),{documentRangeFormattingEditProvider:l}=s.get(kt),c=Tl(e)?e.getModel():e,d=l.ordered(c),u=await $c.select(d,c,i,2);u&&(n.report(u),await a.invokeFunction(fJ,u,e,t,o,r))}async function fJ(s,e,t,i,n,o){var r,a;const l=s.get(od),c=s.get(uo),d=s.get(ah);let u,h;Tl(t)?(u=t.getModel(),h=new R4(t,5,void 0,n)):(u=t,h=new P4(t,n));const f=[];let g=0;for(const C of _5(i).sort(M.compareRangesUsingStarts))g>0&&M.areIntersectingOrTouching(f[g-1],C)?f[g-1]=M.fromPositions(f[g-1].getStartPosition(),C.getEndPosition()):g=f.push(C);const m=async C=>{var w,y;c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(w=e.extensionId)===null||w===void 0?void 0:w.value,C);const L=await e.provideDocumentRangeFormattingEdits(u,C,u.getFormattingOptions(),h.token)||[];return c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)===null||y===void 0?void 0:y.value,L),L},_=(C,w)=>{if(!C.length||!w.length)return!1;const y=C.reduce((L,k)=>M.plusRange(L,k.range),C[0].range);if(!w.some(L=>M.intersectRanges(y,L.range)))return!1;for(const L of C)for(const k of w)if(M.intersectRanges(L.range,k.range))return!0;return!1},v=[],b=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){c.trace("[format][provideDocumentRangeFormattingEdits] (request)",(r=e.extensionId)===null||r===void 0?void 0:r.value,f);const C=await e.provideDocumentRangesFormattingEdits(u,f,u.getFormattingOptions(),h.token)||[];c.trace("[format][provideDocumentRangeFormattingEdits] (response)",(a=e.extensionId)===null||a===void 0?void 0:a.value,C),b.push(C)}else{for(const C of f){if(h.token.isCancellationRequested)return!0;b.push(await m(C))}for(let C=0;C({text:y.text,range:M.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:L}of y)if(M.areIntersectingOrTouching(L,w))return[new yt(L.startLineNumber,L.startColumn,L.endLineNumber,L.endColumn)];return null})}return d.playSignal(Ne.format,{userGesture:o}),!0}async function Vse(s,e,t,i,n,o){const r=s.get(vt),a=s.get(kt),l=Tl(e)?e.getModel():e,c=F4(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await $c.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(gJ,d,e,t,n,o))}async function gJ(s,e,t,i,n,o){const r=s.get(od),a=s.get(ah);let l,c;Tl(t)?(l=t.getModel(),c=new R4(t,5,void 0,n)):(l=t,c=new P4(t,n));let d;try{const u=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,u),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(Tl(t))Ig.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:u}]=d,h=new yt(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);l.pushEditOperations([h],d.map(f=>({text:f.text,range:M.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:g}of f)if(M.areIntersectingOrTouching(g,h))return[new yt(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return a.playSignal(Ne.format,{userGesture:o}),!0}async function mJ(s,e,t,i,n,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(bS);if(L0(l))return await s.computeMoreMinimalEdits(t.uri,l)}}async function pJ(s,e,t,i,n){const o=F4(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,n)).catch(bS);if(L0(a))return await s.computeMoreMinimalEdits(t.uri,a)}}function _J(s,e,t,i,n,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,n,o,r)).catch(bS).then(l=>s.computeMoreMinimalEdits(t.uri,l))}sn.registerCommand("_executeFormatRangeProvider",async function(s,...e){const[t,i,n]=e;vr($e.isUri(t)),vr(M.isIRange(i));const o=s.get(Bg),r=s.get(od),a=s.get(kt),l=await o.createModelReference(t);try{return mJ(r,a,l.object.textEditorModel,M.lift(i),n,ao.None)}finally{l.dispose()}});sn.registerCommand("_executeFormatDocumentProvider",async function(s,...e){const[t,i]=e;vr($e.isUri(t));const n=s.get(Bg),o=s.get(od),r=s.get(kt),a=await n.createModelReference(t);try{return pJ(o,r,a.object.textEditorModel,i,ao.None)}finally{a.dispose()}});sn.registerCommand("_executeFormatOnTypeProvider",async function(s,...e){const[t,i,n,o]=e;vr($e.isUri(t)),vr(V.isIPosition(i)),vr(typeof n=="string");const r=s.get(Bg),a=s.get(od),l=s.get(kt),c=await r.createModelReference(t);try{return _J(a,l,c.object.textEditorModel,V.lift(i),n,o,ao.None)}finally{c.dispose()}});jc.wrappingIndent.defaultValue=0;jc.glyphMargin.defaultValue=!1;jc.autoIndent.defaultValue=3;jc.overviewRulerLanes.defaultValue=2;$c.setFormatterSelector((s,e,t)=>Promise.resolve(s[0]));const Nn=nT();Nn.editor=_X();Nn.languages=lJ();const vJ=Nn.CancellationTokenSource,bJ=Nn.Emitter,CJ=Nn.KeyCode,wJ=Nn.KeyMod,yJ=Nn.Position,SJ=Nn.Range,LJ=Nn.Selection,kJ=Nn.SelectionDirection,DJ=Nn.MarkerSeverity,xJ=Nn.MarkerTag,EJ=Nn.Uri,IJ=Nn.Token,zp=Nn.editor,Kn=Nn.languages,mb=globalThis.MonacoEnvironment;(mb!=null&&mb.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=Nn);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const lN=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:vJ,Emitter:bJ,KeyCode:CJ,KeyMod:wJ,MarkerSeverity:DJ,MarkerTag:xJ,Position:yJ,Range:SJ,Selection:LJ,SelectionDirection:kJ,Token:IJ,Uri:EJ,editor:zp,languages:Kn},Symbol.toStringTag,{value:"Module"}));var lh={},cm={},O4={exports:{}};(function(s,e){var t=function(){return typeof document<"u"&&document.currentScript&&document.currentScript.src,function(i){i=i||{};var n=typeof i<"u"?i:{},o={},r;for(r in n)n.hasOwnProperty(r)&&(o[r]=n[r]);var a=!1,l="";function c(oe){return n.locateFile?n.locateFile(oe,l):l+oe}var d;d=function(ge){var Pe;return typeof readbuffer=="function"?new Uint8Array(readbuffer(ge)):(Pe=read(ge,"binary"),v(typeof Pe=="object"),Pe)},typeof scriptArgs<"u"&&scriptArgs,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print);var u=n.print||console.log.bind(console),h=n.printErr||console.warn.bind(console);for(r in o)o.hasOwnProperty(r)&&(n[r]=o[r]);o=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram,n.quit&&n.quit;var f;n.wasmBinary&&(f=n.wasmBinary),n.noExitRuntime&&n.noExitRuntime,typeof WebAssembly!="object"&&h("no native wasm support detected");var g,m=new WebAssembly.Table({initial:244,maximum:244,element:"anyfunc"}),_=!1;function v(oe,ge){oe||Cn("Assertion failed: "+ge)}function b(oe){var ge=n["_"+oe];return v(ge,"Cannot call unknown function "+oe+", make sure it is exported"),ge}function C(oe,ge,Pe,ei,ci){var Ct={string:function(cs){var go=0;if(cs!=null&&cs!==0){var qs=(cs.length<<2)+1;go=zt(qs),D(cs,go,qs)}return go},array:function(cs){var go=zt(cs.length);return N(cs,go),go}};function ft(cs){return ge==="string"?L(cs):ge==="boolean"?!!cs:cs}var at=b(oe),Ui=[],yi=0;if(ei)for(var Ds=0;Ds=ei);)++ci;if(ci-ge>16&&oe.subarray&&w)return w.decode(oe.subarray(ge,ci));for(var Ct="";ge>10,56320|yi&1023)}}return Ct}function L(oe,ge){return oe?y(H,oe,ge):""}function k(oe,ge,Pe,ei){if(!(ei>0))return 0;for(var ci=Pe,Ct=Pe+ei-1,ft=0;ft=55296&&at<=57343){var Ui=oe.charCodeAt(++ft);at=65536+((at&1023)<<10)|Ui&1023}if(at<=127){if(Pe>=Ct)break;ge[Pe++]=at}else if(at<=2047){if(Pe+1>=Ct)break;ge[Pe++]=192|at>>6,ge[Pe++]=128|at&63}else if(at<=65535){if(Pe+2>=Ct)break;ge[Pe++]=224|at>>12,ge[Pe++]=128|at>>6&63,ge[Pe++]=128|at&63}else{if(Pe+3>=Ct)break;ge[Pe++]=240|at>>18,ge[Pe++]=128|at>>12&63,ge[Pe++]=128|at>>6&63,ge[Pe++]=128|at&63}}return ge[Pe]=0,Pe-ci}function D(oe,ge,Pe){return k(oe,H,ge,Pe)}typeof TextDecoder<"u"&&new TextDecoder("utf-16le");function N(oe,ge){P.set(oe,ge)}var W=65536;function R(oe,ge){return oe%ge>0&&(oe+=ge-oe%ge),oe}var A,P,H,q;function re(oe){A=oe,n.HEAP8=P=new Int8Array(oe),n.HEAP16=new Int16Array(oe),n.HEAP32=q=new Int32Array(oe),n.HEAPU8=H=new Uint8Array(oe),n.HEAPU16=new Uint16Array(oe),n.HEAPU32=new Uint32Array(oe),n.HEAPF32=new Float32Array(oe),n.HEAPF64=new Float64Array(oe)}var de=5507664,ve=264624,se=n.TOTAL_MEMORY||157286400;n.wasmMemory?g=n.wasmMemory:g=new WebAssembly.Memory({initial:se/W}),g&&(A=g.buffer),se=A.byteLength,re(A),q[ve>>2]=de;function Ce(oe){for(;oe.length>0;){var ge=oe.shift();if(typeof ge=="function"){ge();continue}var Pe=ge.func;typeof Pe=="number"?ge.arg===void 0?n.dynCall_v(Pe):n.dynCall_vi(Pe,ge.arg):Pe(ge.arg===void 0?null:ge.arg)}}var Ee=[],fe=[],X=[],ie=[];function ut(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Yi(n.preRun.shift());Ce(Ee)}function Mt(){Ce(fe)}function it(){Ce(X)}function ai(){if(n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)mi(n.postRun.shift());Ce(ie)}function Yi(oe){Ee.unshift(oe)}function mi(oe){ie.unshift(oe)}var ke=0,rn=null;function rs(oe){ke++,n.monitorRunDependencies&&n.monitorRunDependencies(ke)}function Tn(oe){if(ke--,n.monitorRunDependencies&&n.monitorRunDependencies(ke),ke==0&&rn){var ge=rn;rn=null,ge()}}n.preloadedImages={},n.preloadedAudios={};function Cn(oe){throw n.onAbort&&n.onAbort(oe),oe+="",u(oe),h(oe),_=!0,oe="abort("+oe+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(oe)}var li="data:application/octet-stream;base64,";function as(oe){return String.prototype.startsWith?oe.startsWith(li):oe.indexOf(li)===0}var ks="onigasm.wasm";as(ks)||(ks=c(ks));function cd(){try{if(f)return new Uint8Array(f);if(d)return d(ks);throw"both async and sync fetching of the wasm failed"}catch(oe){Cn(oe)}}function Q(){return!f&&a&&typeof fetch=="function"?fetch(ks,{credentials:"same-origin"}).then(function(oe){if(!oe.ok)throw"failed to load wasm binary file at '"+ks+"'";return oe.arrayBuffer()}).catch(function(){return cd()}):new Promise(function(oe,ge){oe(cd())})}function U(){var oe={env:St,wasi_unstable:St};function ge(ft,at){var Ui=ft.exports;n.asm=Ui,Tn()}rs();function Pe(ft){ge(ft.instance)}function ei(ft){return Q().then(function(at){return WebAssembly.instantiate(at,oe)}).then(ft,function(at){h("failed to asynchronously prepare wasm: "+at),Cn(at)})}function ci(){if(!f&&typeof WebAssembly.instantiateStreaming=="function"&&!as(ks)&&typeof fetch=="function")fetch(ks,{credentials:"same-origin"}).then(function(ft){var at=WebAssembly.instantiateStreaming(ft,oe);return at.then(Pe,function(Ui){h("wasm streaming compile failed: "+Ui),h("falling back to ArrayBuffer instantiation"),ei(Pe)})});else return ei(Pe)}if(n.instantiateWasm)try{var Ct=n.instantiateWasm(oe,ge);return Ct}catch(ft){return h("Module.instantiateWasm callback failed with error: "+ft),!1}return ci(),{}}fe.push({func:function(){Ie()}});function z(){Cn()}function E(){return P.length}function I(){return 264624}function B(oe,ge,Pe){H.set(H.subarray(ge,ge+Pe),oe)}function F(oe){try{return g.grow(oe-A.byteLength+65535>>16),re(g.buffer),1}catch{}}function Z(oe){var ge=E(),Pe=65536,ei=2147483648-Pe;if(oe>ei)return!1;for(var ci=16777216,Ct=Math.max(ge,ci);Ct>2];return ge},getStr:function(){var oe=L(ee.get());return oe},get64:function(){var oe=ee.get();return ee.get(),oe},getZero:function(){ee.get()}};function _e(oe){try{return 0}catch(ge){return(typeof FS>"u"||!(ge instanceof FS.ErrnoError))&&Cn(ge),ge.errno}}function we(oe,ge,Pe,ei,ci){try{return 0}catch(Ct){return(typeof FS>"u"||!(Ct instanceof FS.ErrnoError))&&Cn(Ct),Ct.errno}}function Oe(oe,ge,Pe,ei){try{for(var ci=0,Ct=0;Ct>2],at=q[ge+(Ct*8+4)>>2],Ui=0;Ui>2]=ci,0}catch(yi){return(typeof FS>"u"||!(yi instanceof FS.ErrnoError))&&Cn(yi),yi.errno}}function Ae(oe){}var St={abort:z,emscripten_get_sbrk_ptr:I,emscripten_memcpy_big:B,emscripten_resize_heap:Z,fd_close:_e,fd_seek:we,fd_write:Oe,memory:g,setTempRet0:Ae,table:m},ht=U();n.asm=ht;var Ie=n.___wasm_call_ctors=function(){return n.asm.__wasm_call_ctors.apply(null,arguments)};n._malloc=function(){return n.asm.malloc.apply(null,arguments)},n._free=function(){return n.asm.free.apply(null,arguments)},n._getLastError=function(){return n.asm.getLastError.apply(null,arguments)},n._compilePattern=function(){return n.asm.compilePattern.apply(null,arguments)},n._disposeCompiledPatterns=function(){return n.asm.disposeCompiledPatterns.apply(null,arguments)},n._findBestMatch=function(){return n.asm.findBestMatch.apply(null,arguments)},n.___cxa_demangle=function(){return n.asm.__cxa_demangle.apply(null,arguments)},n._setThrew=function(){return n.asm.setThrew.apply(null,arguments)};var Ut=n.stackSave=function(){return n.asm.stackSave.apply(null,arguments)},zt=n.stackAlloc=function(){return n.asm.stackAlloc.apply(null,arguments)},ls=n.stackRestore=function(){return n.asm.stackRestore.apply(null,arguments)};n.__growWasmMemory=function(){return n.asm.__growWasmMemory.apply(null,arguments)},n.dynCall_vi=function(){return n.asm.dynCall_vi.apply(null,arguments)},n.dynCall_iiii=function(){return n.asm.dynCall_iiii.apply(null,arguments)},n.dynCall_iiiii=function(){return n.asm.dynCall_iiiii.apply(null,arguments)},n.dynCall_iii=function(){return n.asm.dynCall_iii.apply(null,arguments)},n.dynCall_iidiiii=function(){return n.asm.dynCall_iidiiii.apply(null,arguments)},n.dynCall_vii=function(){return n.asm.dynCall_vii.apply(null,arguments)},n.dynCall_ii=function(){return n.asm.dynCall_ii.apply(null,arguments)},n.dynCall_i=function(){return n.asm.dynCall_i.apply(null,arguments)},n.dynCall_v=function(){return n.asm.dynCall_v.apply(null,arguments)},n.dynCall_viiiiii=function(){return n.asm.dynCall_viiiiii.apply(null,arguments)},n.dynCall_viiiii=function(){return n.asm.dynCall_viiiii.apply(null,arguments)},n.dynCall_viiii=function(){return n.asm.dynCall_viiii.apply(null,arguments)},n.dynCall_jiji=function(){return n.asm.dynCall_jiji.apply(null,arguments)},n.asm=ht,n.ccall=C;var Ze;n.then=function(oe){if(Ze)oe(n);else{var ge=n.onRuntimeInitialized;n.onRuntimeInitialized=function(){ge&&ge(),oe(n)}}return n},rn=function oe(){Ze||qt(),Ze||(rn=oe)};function qt(oe){if(ke>0||(ut(),ke>0))return;function ge(){Ze||(Ze=!0,!_&&(Mt(),it(),n.onRuntimeInitialized&&n.onRuntimeInitialized(),ai()))}n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),ge()},1)):ge()}if(n.run=qt,n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return qt(),i}}();s.exports=t})(O4);var NJ=O4.exports;Object.defineProperty(cm,"__esModule",{value:!0});const TJ=NJ;async function cN(s){return new Promise((e,t)=>{const{log:i,warn:n,error:o}=console;TJ({instantiateWasm(r,a){return WebAssembly.instantiate(s,r).then(l=>{a(l.instance)}).catch(l=>{throw l}),{}}}).then(r=>{cm.onigasmH=r,e()}),typeof print<"u"&&(console.log=i,console.error=o,console.warn=n)})}let dN=!1;async function AJ(s){if(dN)throw new Error("Onigasm#init has been called and was succesful, subsequent calls are not allowed once initialized");if(typeof s=="string"){const e=await(await fetch(s)).arrayBuffer();await cN(e)}else if(s instanceof ArrayBuffer)await cN(s);else throw new TypeError("Expected a string (URL of .wasm file) or ArrayBuffer (.wasm file itself) as first parameter");dN=!0}cm.loadWASM=AJ;var Rk={},dm={},pb,uN;function MJ(){return uN||(uN=1,pb=function(s){s.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),pb}var RJ=Ht;Ht.Node=Kc;Ht.create=Ht;function Ht(s){var e=this;if(e instanceof Ht||(e=new Ht),e.tail=null,e.head=null,e.length=0,s&&typeof s.forEach=="function")s.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var t=0,i=arguments.length;t1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)t=s(t,i.value,n),i=i.next;return t};Ht.prototype.reduceReverse=function(s,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)t=s(t,i.value,n),i=i.prev;return t};Ht.prototype.toArray=function(){for(var s=new Array(this.length),e=0,t=this.head;t!==null;e++)s[e]=t.value,t=t.next;return s};Ht.prototype.toArrayReverse=function(){for(var s=new Array(this.length),e=0,t=this.tail;t!==null;e++)s[e]=t.value,t=t.prev;return s};Ht.prototype.slice=function(s,e){e=e||this.length,e<0&&(e+=this.length),s=s||0,s<0&&(s+=this.length);var t=new Ht;if(ethis.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&ithis.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>s;i--,n=n.prev)t.push(n.value);return t};Ht.prototype.splice=function(s,e){s>this.length&&(s=this.length-1),s<0&&(s=this.length+s);for(var t=0,i=this.head;i!==null&&t1;let WJ=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[dc]=e.max||1/0;const t=e.length||_b;if(this[yd]=typeof t!="function"?_b:t,this[Tf]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[bc]=e.maxAge||0,this[Kr]=e.dispose,this[hN]=e.noDisposeOnSet||!1,this[B4]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[dc]=e||1/0,Mh(this)}get max(){return this[dc]}set allowStale(e){this[Tf]=!!e}get allowStale(){return this[Tf]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[bc]=e,Mh(this)}get maxAge(){return this[bc]}set lengthCalculator(e){typeof e!="function"&&(e=_b),e!==this[yd]&&(this[yd]=e,this[Zr]=0,this[hn].forEach(t=>{t.length=this[yd](t.value,t.key),this[Zr]+=t.length})),Mh(this)}get lengthCalculator(){return this[yd]}get length(){return this[Zr]}get itemCount(){return this[hn].length}rforEach(e,t){t=t||this;for(let i=this[hn].tail;i!==null;){const n=i.prev;fN(this,e,i,t),i=n}}forEach(e,t){t=t||this;for(let i=this[hn].head;i!==null;){const n=i.next;fN(this,e,i,t),i=n}}keys(){return this[hn].toArray().map(e=>e.key)}values(){return this[hn].toArray().map(e=>e.value)}reset(){this[Kr]&&this[hn]&&this[hn].length&&this[hn].forEach(e=>this[Kr](e.key,e.value)),this[wo]=new Map,this[hn]=new BJ,this[Zr]=0}dump(){return this[hn].map(e=>S0(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[hn]}set(e,t,i){if(i=i||this[bc],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const n=i?Date.now():0,o=this[yd](t,e);if(this[wo].has(e)){if(o>this[dc])return _u(this,this[wo].get(e)),!1;const l=this[wo].get(e).value;return this[Kr]&&(this[hN]||this[Kr](e,l.value)),l.now=n,l.maxAge=i,l.value=t,this[Zr]+=o-l.length,l.length=o,this.get(e),Mh(this),!0}const r=new VJ(e,t,o,n,i);return r.length>this[dc]?(this[Kr]&&this[Kr](e,t),!1):(this[Zr]+=r.length,this[hn].unshift(r),this[wo].set(e,this[hn].head),Mh(this),!0)}has(e){if(!this[wo].has(e))return!1;const t=this[wo].get(e).value;return!S0(this,t)}get(e){return vb(this,e,!0)}peek(e){return vb(this,e,!1)}pop(){const e=this[hn].tail;return e?(_u(this,e),e.value):null}del(e){_u(this,this[wo].get(e))}load(e){this.reset();const t=Date.now();for(let i=e.length-1;i>=0;i--){const n=e[i],o=n.e||0;if(o===0)this.set(n.k,n.v);else{const r=o-t;r>0&&this.set(n.k,n.v,r)}}}prune(){this[wo].forEach((e,t)=>vb(this,t,!1))}};const vb=(s,e,t)=>{const i=s[wo].get(e);if(i){const n=i.value;if(S0(s,n)){if(_u(s,i),!s[Tf])return}else t&&(s[B4]&&(i.value.now=Date.now()),s[hn].unshiftNode(i));return n.value}},S0=(s,e)=>{if(!e||!e.maxAge&&!s[bc])return!1;const t=Date.now()-e.now;return e.maxAge?t>e.maxAge:s[bc]&&t>s[bc]},Mh=s=>{if(s[Zr]>s[dc])for(let e=s[hn].tail;s[Zr]>s[dc]&&e!==null;){const t=e.prev;_u(s,e),e=t}},_u=(s,e)=>{if(e){const t=e.value;s[Kr]&&s[Kr](t.key,t.value),s[Zr]-=t.length,s[wo].delete(t.key),s[hn].removeNode(e)}};class VJ{constructor(e,t,i,n,o){this.key=e,this.value=t,this.length=i,this.now=n,this.maxAge=o||0}}const fN=(s,e,t,i)=>{let n=t.value;S0(s,n)&&(_u(s,t),s[Tf]||(n=void 0)),n&&e.call(i,n.value,n.key,s)};var HJ=WJ,R1={};Object.defineProperty(R1,"__esModule",{value:!0});class zJ{constructor(e){if(this.substring=(t,i)=>this.source.substring(t,i),this.toString=(t,i)=>this.source,typeof e!="string")throw new TypeError("Argument must be a string");this.source=e,this._utf8Bytes=null,this._utf8Indexes=null}get utf8Bytes(){return this._utf8Bytes||this.encode(),this._utf8Bytes}get utf8Indexes(){return this._utf8Bytes||this.encode(),this._utf8Indexes}get content(){return this.source}get length(){return this.source.length}get hasMultiByteCharacters(){return this.utf8Indexes!==null}convertUtf8OffsetToUtf16(e){if(e<0)return 0;const t=this._utf8Bytes;if(e>=t.length-1)return this.source.length;const i=this.utf8Indexes;return i&&e>=this._mappingTableStartOffset?UJ(i,e-this._mappingTableStartOffset)+this._mappingTableStartOffset:e}convertUtf16OffsetToUtf8(e){if(e<0)return 0;const t=this._utf8Bytes;if(e>=this.source.length)return t.length-1;const i=this.utf8Indexes;return i&&e>=this._mappingTableStartOffset?i[e-this._mappingTableStartOffset]+this._mappingTableStartOffset:e}encode(){const e=this.source,t=e.length;let i,n=0,o=0;function r(u){const h=(t-u)*3;h<=255?i=new Uint8Array(t-u):h<=65535?i=new Uint16Array(t-u):i=new Uint32Array(t-u),o=u,i[n++]=0}const a=new Uint8Array(t*3+1);let l=0,c=0;for(;c57343)u=h;else if(h>=56320)u=65533;else if(c===t-1)u=65533;else{const m=e.charCodeAt(c+1);if(56320<=m&&m<=57343){i||r(c);const _=h&1023,v=m&1023;u=65536+(_<<10)+v,c+=1,i[n++]=l-o}else u=65533}let f,g;if(u<=127?(f=1,g=0):u<=2047?(f=2,g=192):u<=65535?(f=3,g=224):(f=4,g=240),f===1)a[l++]=u;else for(i||r(l),a[l++]=(u>>6*--f)+g;f>0;){const m=u>>6*(f-1);a[l++]=128|m&63,f-=1}c+=1}const d=a.slice(0,l+1);d[l]=0,this._utf8Bytes=d,i&&(this._utf8Indexes=i,this._mappingTableStartOffset=o)}}function UJ(s,e){let t=0,i=s.length;if(i===0)return 0;for(;t=e?i=n:t=n+1}for(;t>0&&(t>=s.length||s[t]>e);)t--;return t>0&&s[t]===s[t-1]&&t--,t}R1.default=zJ;Object.defineProperty(dm,"__esModule",{value:!0});const $J=HJ,ii=cm,up=R1;function gN(s){const e=ii.onigasmH._malloc(s.utf8Bytes.length);return ii.onigasmH.HEAPU8.set(s.utf8Bytes,e),e}function rS(s){const e=[];let t=0;for(;ii.onigasmH.HEAPU8[s]!==0;)e[t++]=ii.onigasmH.HEAPU8[s++];return e.join()}const mN=new $J({dispose:(s,e)=>{const t=ii.onigasmH._malloc(e.regexTPtrs.length);if(ii.onigasmH.HEAPU8.set(e.regexTPtrs,t),ii.onigasmH._disposeCompiledPatterns(t,s.patterns.length)!==0){const n=rS(ii.onigasmH._getLastError());throw new Error(n)}ii.onigasmH._free(t)},max:1e3});class W4{constructor(e){if(ii.onigasmH===null)throw new Error("Onigasm has not been initialized, call loadWASM from 'onigasm' exports before using any other API");for(let t=0;t0){const h=new Uint32Array(ii.onigasmH.HEAPU32.buffer,d,u),f=[];let g=0,m=0;for(;g{});try{t(null,this.testSync(e))}catch(i){t(i)}}captureIndicesForMatch(e,t){if(t!=null){const{captureIndices:i}=t;let n;e=this.scanner.convertToString(e);for(let o=0;or&&(r=o));for(a=0;a<=r;a++)n[a]=null;for(l in e)if(l!=="$vscodeTextmateLocation"){o=parseInt(l,10);var c=0;e[l].patterns&&(c=s.getCompiledRuleId(e[l],t,i)),n[o]=s.createCaptureRule(t,e[l].$vscodeTextmateLocation,e[l].name,e[l].contentName,c)}}return n},s._compilePatterns=function(e,t,i){var n=[],o,r,a,l,c,d,u;if(e)for(r=0,a=e.length;r=0?(f=o.include.substring(0,m),g=o.include.substring(m+1)):f=o.include,c=t.getExternalGrammar(f,i),c)if(g){var _=c.repository[g];_&&(l=s.getCompiledRuleId(_,t,c.repository))}else l=s.getCompiledRuleId(c.repository.$self,t,c.repository)}else l=s.getCompiledRuleId(o,t,i);if(l!==-1){if(d=t.getRule(l),u=!1,(d instanceof aS||d instanceof lS||d instanceof cS)&&d.hasMissingPatterns&&d.patterns.length===0&&(u=!0),u)continue;n.push(l)}}return{patterns:n,hasMissingPatterns:(e?e.length:0)!==n.length}},s}();js.RuleFactory=hee;var Ok={};Object.defineProperty(Ok,"__esModule",{value:!0});function fee(s,e){for(var t=[],i=gee(s),n=i.next();n!==null;){var o=0;if(n.length===2&&n.charAt(1)===":"){switch(n.charAt(0)){case"R":o=1;break;case"L":o=-1;break;default:console.log("Unknown priority "+n+" in scope selector")}n=i.next()}var r=l();if(r&&t.push({matcher:r,priority:o}),n!==",")break;n=i.next()}return t;function a(){if(n==="-"){n=i.next();var d=a();return function(f){return d&&!d(f)}}if(n==="("){n=i.next();var u=c();return n===")"&&(n=i.next()),u}if(bN(n)){var h=[];do h.push(n),n=i.next();while(bN(n));return function(f){return e(h,f)}}return null}function l(){for(var d=[],u=a();u;)d.push(u),u=a();return function(h){return d.every(function(f){return f(h)})}}function c(){for(var d=[],u=l();u&&(d.push(u),n==="|"||n===",");){do n=i.next();while(n==="|"||n===",");u=l()}return function(h){return d.some(function(f){return f(h)})}}}Ok.createMatchers=fee;function bN(s){return s&&s.match(/[\w\.:]+/)}function gee(s){var e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,t=e.exec(s);return{next:function(){if(!t)return null;var i=t[0];return t=e.exec(s),i}}}var hm={},U4={};Object.defineProperty(hm,"__esModule",{value:!0});hm.CAPTURE_METADATA=typeof process>"u"?!1:!!U4.VSCODE_TEXTMATE_DEBUG;hm.IN_DEBUG_MODE=typeof process>"u"?!1:!!U4.VSCODE_TEXTMATE_DEBUG;Object.defineProperty(jo,"__esModule",{value:!0});var mee=ch,Ji=js,$4=Ok,Do=hm;function pee(s,e,t,i,n){return new q4(s,e,t,i,n)}jo.createGrammar=pee;function Bk(s,e){for(var t=0,i=e.length;t=0?s[n.substring(0,o)]=!0:s[n]=!0}}}function K4(s,e){for(var t in e){var i=e[t];i.patterns&&Array.isArray(i.patterns)&&Bk(s,i.patterns),i.repository&&K4(s,i.repository)}}function _ee(s,e){e.patterns&&Array.isArray(e.patterns)&&Bk(s,e.patterns),e.repository&&K4(s,e.repository),delete s[e.scopeName]}jo.collectIncludedScopes=_ee;function vee(s,e){if(!s)return!1;if(s===e)return!0;var t=e.length;return s.length>t&&s.substr(0,t)===e&&s[t]==="."}function j4(s,e){if(e.length>");continue}this._embeddedLanguages[a]=l}var c=Object.keys(this._embeddedLanguages).map(function(d){return s._escapeRegExpCharacters(d)});c.length===0?this._embeddedLanguagesRegex=null:(c.sort(),c.reverse(),this._embeddedLanguagesRegex=new RegExp("^(("+c.join(")|(")+"))($|\\.)",""))}return s.prototype.onDidChangeTheme=function(){this._cache=Object.create(null),this._defaultMetaData=new Up("",this._initialLanguage,0,[this._themeProvider.getDefaults()])},s.prototype.getDefaultMetadata=function(){return this._defaultMetaData},s._escapeRegExpCharacters=function(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")},s.prototype.getMetadataForScope=function(e){if(e===null)return s._NULL_SCOPE_METADATA;var t=this._cache[e];return t||(t=this._doGetMetadataForScope(e),this._cache[e]=t,t)},s.prototype._doGetMetadataForScope=function(e){var t=this._scopeToLanguage(e),i=this._toStandardTokenType(e),n=this._themeProvider.themeMatch(e);return new Up(e,t,i,n)},s.prototype._scopeToLanguage=function(e){if(!e||!this._embeddedLanguagesRegex)return 0;var t=e.match(this._embeddedLanguagesRegex);if(!t)return 0;var i=this._embeddedLanguages[t[1]]||0;return i||0},s.prototype._toStandardTokenType=function(e){var t=e.match(s.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 4;case"meta.embedded":return 8}throw new Error("Unexpected match for standard token type!")},s._NULL_SCOPE_METADATA=new Up("",0,0,null),s.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/,s}(),q4=function(){function s(e,t,i,n,o){if(this._scopeMetadataProvider=new bee(t,o,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[],this._includedGrammars={},this._grammarRepository=o,this._grammar=wN(e,null),this._tokenTypeMatchers=[],n)for(var r=0,a=Object.keys(n);rc)break;for(;l.length>0&&l[l.length-1].endPos<=h.start;)n.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?n.produceFromScopes(l[l.length-1].scopes,h.start):n.produce(i,h.start),u.retokenizeCapturedWithRuleId){var f=u.getName(Ji.getString(e),r),g=i.contentNameScopesList.push(s,f),m=u.getContentName(Ji.getString(e),r),_=g.push(s,m),v=i.push(u.retokenizeCapturedWithRuleId,h.start,null,g,_);G4(s,Ji.createOnigString(Ji.getString(e).substring(0,h.end)),t&&h.start===0,h.start,v,n);continue}var b=u.getName(Ji.getString(e),r);if(b!==null){var C=l.length>0?l[l.length-1].scopes:i.contentNameScopesList,w=C.push(s,b);l.push(new Z4(w,h.end))}}}}for(;l.length>0;)n.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}}function Wk(s){for(var e=[],t=0,i=s.rules.length;t=a)&&(a=v,l=_.captureIndices,c=m.rules[_.index],d=g.priority,a===n))break}}}return l?{priorityMatch:d===-1,captureIndices:l,matchedRuleId:c}:null}function wee(s,e,t,i,n,o){var r=n.getRule(s),a=r.compile(s,n.endRule,t,i===o),l=a.scanner.findNextMatchSync(e,i);return Do.IN_DEBUG_MODE&&(console.log(" scanning for"),console.log(Wk(a))),l?{captureIndices:l.captureIndices,matchedRuleId:a.rules[l.index]}:null}function yee(s,e,t,i,n,o){var r=wee(s,e,t,i,n,o),a=s.getInjections();if(a.length===0)return r;var l=Cee(a,s,e,t,i,n,o);if(!l)return r;if(!r)return l;var c=r.captureIndices[0].start,d=l.captureIndices[0].start;return di&&(i=h.captureIndices[0].end,t=!1))}else{n=d.stack.pop();break}}return{stack:n,linePos:i,anchorPosition:r,isFirstLine:t}}function G4(s,e,t,i,n,o){var r=Ji.getString(e).length,a=!1,l=See(s,e,t,i,n,o);n=l.stack,i=l.linePos,t=l.isFirstLine;for(var c=l.anchorPosition;!a;)d();function d(){Do.IN_DEBUG_MODE&&(console.log(""),console.log("@@scanNext: |"+Ji.getString(e).replace(/\n$/,"\\n").substr(i)+"|"));var u=yee(s,e,t,i,n,c);if(!u){Do.IN_DEBUG_MODE&&console.log(" no more matches."),o.produce(n,r),a=!0;return}var h=u.captureIndices,f=u.matchedRuleId,g=h&&h.length>0?h[0].end>i:!1;if(f===-1){var m=n.getRule(s);Do.IN_DEBUG_MODE&&console.log(" popping "+m.debugName+" - "+m.debugEndRegExp),o.produce(n,h[0].start),n=n.setContentNameScopesList(n.nameScopesList),tf(s,e,t,n,o,m.endCaptures,h),o.produce(n,h[0].end);var _=n;if(n=n.pop(),!g&&_.getEnterPos()===i){console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),n=_,o.produce(n,r),a=!0;return}}else{var v=s.getRule(f);o.produce(n,h[0].start);var b=n,C=v.getName(Ji.getString(e),h),w=n.contentNameScopesList.push(s,C);if(n=n.push(f,i,null,w,w),v instanceof Ji.BeginEndRule){var y=v;Do.IN_DEBUG_MODE&&console.log(" pushing "+y.debugName+" - "+y.debugBeginRegExp),tf(s,e,t,n,o,y.beginCaptures,h),o.produce(n,h[0].end),c=h[0].end;var L=y.getContentName(Ji.getString(e),h),k=w.push(s,L);if(n=n.setContentNameScopesList(k),y.endHasBackReferences&&(n=n.setEndRule(y.getEndWithResolvedBackReferences(Ji.getString(e),h))),!g&&b.hasSameRuleAs(n)){console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),n=n.pop(),o.produce(n,r),a=!0;return}}else if(v instanceof Ji.BeginWhileRule){var y=v;Do.IN_DEBUG_MODE&&console.log(" pushing "+y.debugName),tf(s,e,t,n,o,y.beginCaptures,h),o.produce(n,h[0].end),c=h[0].end;var L=y.getContentName(Ji.getString(e),h),k=w.push(s,L);if(n=n.setContentNameScopesList(k),y.whileHasBackReferences&&(n=n.setEndRule(y.getWhileWithResolvedBackReferences(Ji.getString(e),h))),!g&&b.hasSameRuleAs(n)){console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),n=n.pop(),o.produce(n,r),a=!0;return}}else{var D=v;if(Do.IN_DEBUG_MODE&&console.log(" matched "+D.debugName+" - "+D.debugMatchRegExp),tf(s,e,t,n,o,D.captures,h),o.produce(n,h[0].end),n=n.pop(),!g){console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),n=n.safePop(),o.produce(n,r),a=!0;return}}}h[0].end>i&&(i=h[0].end,t=!1)}return n}var F1=function(){function s(){}return s.toBinaryStr=function(e){for(var t=e.toString(2);t.length<32;)t="0"+t;return t},s.printMetadata=function(e){var t=s.getLanguageId(e),i=s.getTokenType(e),n=s.getFontStyle(e),o=s.getForeground(e),r=s.getBackground(e);console.log({languageId:t,tokenType:i,fontStyle:n,foreground:o,background:r})},s.getLanguageId=function(e){return(e&255)>>>0},s.getTokenType=function(e){return(e&1792)>>>8},s.getFontStyle=function(e){return(e&14336)>>>11},s.getForeground=function(e){return(e&8372224)>>>14},s.getBackground=function(e){return(e&4286578688)>>>23},s.set=function(e,t,i,n,o,r){var a=s.getLanguageId(e),l=s.getTokenType(e),c=s.getFontStyle(e),d=s.getForeground(e),u=s.getBackground(e);return t!==0&&(a=t),i!==0&&(l=i===8?0:i),n!==-1&&(c=n),o!==0&&(d=o),r!==0&&(u=r),(a<<0|l<<8|c<<11|d<<14|u<<23)>>>0},s}();jo.StackElementMetadata=F1;var dS=function(){function s(e,t,i){this.parent=e,this.scope=t,this.metadata=i}return s._equals=function(e,t){do{if(e===t)return!0;if(e.scope!==t.scope||e.metadata!==t.metadata)return!1;if(e=e.parent,t=t.parent,!e&&!t)return!0;if(!e||!t)return!1}while(!0)},s.prototype.equals=function(e){return s._equals(this,e)},s._matchesScope=function(e,t,i){return t===e||e.substring(0,i.length)===i},s._matches=function(e,t){if(t===null)return!0;for(var i=t.length,n=0,o=t[n],r=o+".";e;){if(this._matchesScope(e.scope,o,r)){if(n++,n===i)return!0;o=t[n],r=o+"."}e=e.parent}return!1},s.mergeMetadata=function(e,t,i){if(i===null)return e;var n=-1,o=0,r=0;if(i.themeData!==null)for(var a=0,l=i.themeData.length;a=0?s._push(this,e,t.split(/ /g)):s._push(this,e,[t])},s._generateScopes=function(e){for(var t=[],i=0;e;)t[i++]=e.scope,e=e.parent;return t.reverse(),t},s.prototype.generateScopes=function(){return s._generateScopes(this)},s}();jo.ScopeListElement=dS;var uS=function(){function s(e,t,i,n,o,r){this.parent=e,this.depth=this.parent?this.parent.depth+1:1,this.ruleId=t,this._enterPos=i,this.endRule=n,this.nameScopesList=o,this.contentNameScopesList=r}return s._structuralEquals=function(e,t){do{if(e===t)return!0;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;if(e=e.parent,t=t.parent,!e&&!t)return!0;if(!e||!t)return!1}while(!0)},s._equals=function(e,t){return e===t?!0:this._structuralEquals(e,t)?e.contentNameScopesList.equals(t.contentNameScopesList):!1},s.prototype.clone=function(){return this},s.prototype.equals=function(e){return e===null?!1:s._equals(this,e)},s._reset=function(e){for(;e;)e._enterPos=-1,e=e.parent},s.prototype.reset=function(){s._reset(this)},s.prototype.pop=function(){return this.parent},s.prototype.safePop=function(){return this.parent?this.parent:this},s.prototype.push=function(e,t,i,n,o){return new s(this,e,t,i,n,o)},s.prototype.getEnterPos=function(){return this._enterPos},s.prototype.getRule=function(e){return e.getRule(this.ruleId)},s.prototype._writeString=function(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]="("+this.ruleId+", TODO-"+this.nameScopesList+", TODO-"+this.contentNameScopesList+")",t},s.prototype.toString=function(){var e=[];return this._writeString(e,0),"["+e.join(",")+"]"},s.prototype.setContentNameScopesList=function(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this.endRule,this.nameScopesList,e)},s.prototype.setEndRule=function(e){return this.endRule===e?this:new s(this.parent,this.ruleId,this._enterPos,e,this.nameScopesList,this.contentNameScopesList)},s.prototype.hasSameRuleAs=function(e){return this.ruleId===e.ruleId},s.NULL=new s(null,0,0,null,null,null),s}();jo.StackElement=uS;var Z4=function(){function s(e,t){this.scopes=e,this.endPos=t}return s}();jo.LocalStackElement=Z4;var Lee=function(){function s(e,t,i){this._emitBinaryTokens=e,this._tokenTypeOverrides=i,Do.IN_DEBUG_MODE&&(this._lineText=t),this._emitBinaryTokens?this._binaryTokens=[]:this._tokens=[],this._lastTokenEndIndex=0}return s.prototype.produce=function(e,t){this.produceFromScopes(e.contentNameScopesList,t)},s.prototype.produceFromScopes=function(e,t){if(!(this._lastTokenEndIndex>=t)){if(this._emitBinaryTokens){for(var i=e.metadata,n=0,o=this._tokenTypeOverrides;n0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}var a=e.generateScopes();if(Do.IN_DEBUG_MODE){console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(var l=0;l0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens},s.prototype.getBinaryResult=function(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);for(var i=new Uint32Array(this._binaryTokens.length),n=0,o=this._binaryTokens.length;n0&&s.charCodeAt(0)===65279&&(n=1);function a(ie){if(t===null)n=n+ie;else for(;ie>0;){var ut=s.charCodeAt(n);ut===10?(n++,o++,r=0):(n++,r++),ie--}}function l(ie){t===null?n=ie:a(ie-n)}function c(){for(;n");var ie={};t!==null&&(ie[t]={filename:e,line:o,char:r}),g[v]=ie,v=null,b(1,ie)},enterArray:function(){if(v===null)return w("missing ");var ie=[];g[v]=ie,v=null,b(2,ie)}},L={enterDict:function(){var ie={};t!==null&&(ie[t]={filename:e,line:o,char:r}),g.push(ie),b(1,ie)},enterArray:function(){var ie=[];g.push(ie),b(2,ie)}};function k(){f===1?y.enterDict():f===2?L.enterDict():(g={},t!==null&&(g[t]={filename:e,line:o,char:r}),b(1,g))}function D(){if(f===1)C();else return w("unexpected ")}function N(){f===1?y.enterArray():f===2?L.enterArray():(g=[],b(2,g))}function W(){if(f===1)return w("unexpected ");if(f===2)C();else return w("unexpected ")}function R(ie){if(f===1){if(v!==null)return w("too many ");v=ie}else return w("unexpected ")}function A(ie){if(f===1){if(v===null)return w("missing ");g[v]=ie,v=null}else f===2?g.push(ie):g=ie}function P(ie){if(isNaN(ie))return w("cannot parse float");if(f===1){if(v===null)return w("missing ");g[v]=ie,v=null}else f===2?g.push(ie):g=ie}function H(ie){if(isNaN(ie))return w("cannot parse integer");if(f===1){if(v===null)return w("missing ");g[v]=ie,v=null}else f===2?g.push(ie):g=ie}function q(ie){if(f===1){if(v===null)return w("missing ");g[v]=ie,v=null}else f===2?g.push(ie):g=ie}function re(ie){if(f===1){if(v===null)return w("missing ");g[v]=ie,v=null}else f===2?g.push(ie):g=ie}function de(ie){if(f===1){if(v===null)return w("missing ");g[v]=ie,v=null}else f===2?g.push(ie):g=ie}function ve(ie){return ie.replace(/&#([0-9]+);/g,function(ut,Mt){return String.fromCodePoint(parseInt(Mt,10))}).replace(/&#x([0-9a-f]+);/g,function(ut,Mt){return String.fromCodePoint(parseInt(Mt,16))}).replace(/&|<|>|"|'/g,function(ut){switch(ut){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return ut})}function se(){var ie=h(">"),ut=!1;return ie.charCodeAt(ie.length-1)===47&&(ut=!0,ie=ie.substring(0,ie.length-1)),{name:ie.trim(),isClosed:ut}}function Ce(ie){if(ie.isClosed)return"";var ut=h(""),ve(ut)}for(;n=i));){var Ee=s.charCodeAt(n);if(a(1),Ee!==60)return w("expected <");if(n>=i)return w("unexpected end of input");var fe=s.charCodeAt(n);if(fe===63){a(1),u("?>");continue}if(fe===33){if(a(1),d("--")){u("-->");continue}u(">");continue}if(fe===47){if(a(1),c(),d("plist")){u(">");continue}if(d("dict")){u(">"),D();continue}if(d("array")){u(">"),W();continue}return w("unexpected closed tag")}var X=se();switch(X.name){case"dict":k(),X.isClosed&&D();continue;case"array":N(),X.isClosed&&W();continue;case"key":R(Ce(X));continue;case"string":A(Ce(X));continue;case"real":P(parseFloat(Ce(X)));continue;case"integer":H(parseInt(Ce(X),10));continue;case"date":q(new Date(Ce(X)));continue;case"data":re(Ce(X));continue;case"true":Ce(X),de(!0);continue;case"false":Ce(X),de(!1);continue}if(!/^plist/.test(X.name))return w("unexpected opened tag "+X.name)}return g}var Vk={};Object.defineProperty(Vk,"__esModule",{value:!0});function Q4(s,e){throw new Error("Near offset "+s.pos+": "+e+" ~~~"+s.source.substr(s.pos,50)+"~~~")}function Iee(s,e,t){var i=new Nee(s),n=new Tee,o=0,r=null,a=[],l=[];function c(){a.push(o),l.push(r)}function d(){o=a.pop(),r=l.pop()}function u(m){Q4(i,m)}for(;bb(i,n);){if(o===0){if(r!==null&&u("too many constructs in root"),n.type===3){r={},t&&(r.$vscodeTextmateLocation=n.toLocation(e)),c(),o=1;continue}if(n.type===2){r=[],c(),o=4;continue}u("unexpected token in root")}if(o===2){if(n.type===5){d();continue}if(n.type===7){o=3;continue}u("expected , or }")}if(o===1||o===3){if(o===1&&n.type===5){d();continue}if(n.type===1){var h=n.value;if((!bb(i,n)||n.type!==6)&&u("expected colon"),bb(i,n)||u("expected value"),o=2,n.type===1){r[h]=n.value;continue}if(n.type===8){r[h]=null;continue}if(n.type===9){r[h]=!0;continue}if(n.type===10){r[h]=!1;continue}if(n.type===11){r[h]=parseFloat(n.value);continue}if(n.type===2){var f=[];r[h]=f,c(),o=4,r=f;continue}if(n.type===3){var g={};t&&(g.$vscodeTextmateLocation=n.toLocation(e)),r[h]=g,c(),o=1,r=g;continue}}u("unexpected token in dict")}if(o===5){if(n.type===4){d();continue}if(n.type===7){o=6;continue}u("expected , or ]")}if(o===4||o===6){if(o===4&&n.type===4){d();continue}if(o=5,n.type===1){r.push(n.value);continue}if(n.type===8){r.push(null);continue}if(n.type===9){r.push(!0);continue}if(n.type===10){r.push(!1);continue}if(n.type===11){r.push(parseFloat(n.value));continue}if(n.type===2){var f=[];r.push(f),c(),o=4,r=f;continue}if(n.type===3){var g={};t&&(g.$vscodeTextmateLocation=n.toLocation(e)),r.push(g),c(),o=1,r=g;continue}u("unexpected token in array")}u("unknown state")}return l.length!==0&&u("unclosed constructs"),r}Vk.parse=Iee;var Nee=function(){function s(e){this.source=e,this.pos=0,this.len=e.length,this.line=1,this.char=0}return s}(),Tee=function(){function s(){this.value=null,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}return s.prototype.toLocation=function(e){return{filename:e,line:this.line,char:this.char}},s}();function bb(s,e){e.value=null,e.type=0,e.offset=-1,e.len=-1,e.line=-1,e.char=-1;var t=s.source,i=s.pos,n=s.len,o=s.line,r=s.char,a;do{if(i>=n)return!1;if(a=t.charCodeAt(i),a===32||a===9||a===13){i++,r++;continue}if(a===10){i++,o++,r=0;continue}break}while(!0);if(e.offset=i,e.line=o,e.char=r,a===34){e.type=1,i++,r++;do{if(i>=n)return!1;if(a=t.charCodeAt(i),i++,r++,a===92){i++,r++;continue}if(a===34)break}while(!0);e.value=t.substring(e.offset+1,i-1).replace(/\\u([0-9A-Fa-f]{4})/g,function(l,c){return String.fromCodePoint(parseInt(c,16))}).replace(/\\(.)/g,function(l,c){switch(c){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return` `;case"r":return"\r";case"t":return" ";default:Q4(s,"invalid escape sequence")}})}else if(a===91)e.type=2,i++,r++;else if(a===123)e.type=3,i++,r++;else if(a===93)e.type=4,i++,r++;else if(a===125)e.type=5,i++,r++;else if(a===58)e.type=6,i++,r++;else if(a===44)e.type=7,i++,r++;else if(a===110){if(e.type=8,i++,r++,a=t.charCodeAt(i),a!==117||(i++,r++,a=t.charCodeAt(i),a!==108)||(i++,r++,a=t.charCodeAt(i),a!==108))return!1;i++,r++}else if(a===116){if(e.type=9,i++,r++,a=t.charCodeAt(i),a!==114||(i++,r++,a=t.charCodeAt(i),a!==117)||(i++,r++,a=t.charCodeAt(i),a!==101))return!1;i++,r++}else if(a===102){if(e.type=10,i++,r++,a=t.charCodeAt(i),a!==97||(i++,r++,a=t.charCodeAt(i),a!==108)||(i++,r++,a=t.charCodeAt(i),a!==115)||(i++,r++,a=t.charCodeAt(i),a!==101))return!1;i++,r++}else{e.type=11;do{if(i>=n)return!1;if(a=t.charCodeAt(i),a===46||a>=48&&a<=57||a===101||a===69||a===45||a===43){i++,r++;continue}break}while(!0)}return e.len=i-e.offset,e.value===null&&(e.value=t.substr(e.offset,e.len)),s.pos=i,s.line=o,s.char=r,!0}Object.defineProperty(O1,"__esModule",{value:!0});var SN=Gu,X4=hm,Aee=Vk;function Mee(s,e){return X4.CAPTURE_METADATA?Aee.parse(s,e,!0):JSON.parse(s)}O1.parseJSONGrammar=Mee;function Ree(s,e){return X4.CAPTURE_METADATA?SN.parseWithLocation(s,e,"$vscodeTextmateLocation"):SN.parse(s)}O1.parsePLISTGrammar=Ree;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});var J4=function(){function s(e,t,i,n,o,r){this.scope=e,this.parentScopes=t,this.index=i,this.fontStyle=n,this.foreground=o,this.background=r}return s}();Mr.ParsedThemeRule=J4;function LN(s){return!!(/^#[0-9a-f]{6}$/i.test(s)||/^#[0-9a-f]{8}$/i.test(s)||/^#[0-9a-f]{3}$/i.test(s)||/^#[0-9a-f]{4}$/i.test(s))}function e5(s){if(!s)return[];if(!s.settings||!Array.isArray(s.settings))return[];for(var e=s.settings,t=[],i=0,n=0,o=e.length;n1&&(v=d.slice(0,d.length-1),v.reverse()),t[i++]=new J4(_,v,n,c,g,m)}}}return t}Mr.parseTheme=e5;function Pee(s){s.sort(function(u,h){var f=Hk(u.scope,h.scope);return f!==0||(f=zk(u.parentScopes,h.parentScopes),f!==0)?f:u.index-h.index});for(var e=0,t="#000000",i="#ffffff";s.length>=1&&s[0].scope==="";){var n=s.shift();n.fontStyle!==-1&&(e=n.fontStyle),n.foreground!==null&&(t=n.foreground),n.background!==null&&(i=n.background)}for(var o=new t5,r=new Ng(0,null,e,o.getId(t),o.getId(i)),a=new n5(new Ng(0,null,-1,0,0),[]),l=0,c=s.length;le?1:0}Mr.strcmp=Hk;function zk(s,e){if(s===null&&e===null)return 0;if(!s)return-1;if(!e)return 1;var t=s.length,i=e.length;if(t===i){for(var n=0;ne?console.log("how did this happen?"):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),i!==0&&(this.foreground=i),n!==0&&(this.background=n)},s}();Mr.ThemeTrieElementRule=Ng;var n5=function(){function s(e,t,i){t===void 0&&(t=[]),i===void 0&&(i={}),this._mainRule=e,this._rulesWithParentScopes=t,this._children=i}return s._sortBySpecificity=function(e){return e.length===1||e.sort(this._cmpBySpecificity),e},s._cmpBySpecificity=function(e,t){if(e.scopeDepth===t.scopeDepth){var i=e.parentScopes,n=t.parentScopes,o=i===null?0:i.length,r=n===null?0:n.length;if(o===r)for(var a=0;a0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]{let t="";for(let i=e[0].length-1;i>=0;i-=1){const n=e[0][i];if(n===".")break;t=n+t}for(let i=e.length-1;i>=0;i-=1){const n=e[i];for(let o=n.length-1;o>=0;o-=1)if(n[o]==="."){const a=n.slice(0,o);if(s._themeService._theme._tokenTheme._match(a+"."+t)._foreground>1)return a+"."+t;if(s._themeService._theme._tokenTheme._match(a)._foreground>1)return a}}return""};B1.TMToMonacoToken=Hee;Object.defineProperty(Uk,"__esModule",{value:!0});var s5=Uk.wireTmGrammars=void 0;const zee=P1,Uee=B1;class Tg{constructor(e){Zk(this,"_ruleStack");this._ruleStack=e}get ruleStack(){return this._ruleStack}clone(){return new Tg(this._ruleStack)}equals(e){return!(!e||!(e instanceof Tg)||e!==this||e._ruleStack!==this._ruleStack)}}function $ee(s,e,t,i){return Promise.all(Array.from(t.keys()).map(async n=>{const o=await e.loadGrammar(t.get(n));s.languages.setTokensProvider(n,{getInitialState:()=>new Tg(zee.INITIAL),tokenize:(r,a)=>{const l=o.tokenizeLine(r,a.ruleStack);return{endState:new Tg(l.ruleStack),tokens:l.tokens.map(c=>({...c,scopes:i?(0,Uee.TMToMonacoToken)(i,c.scopes):c.scopes[c.scopes.length-1]}))}}})}))}s5=Uk.wireTmGrammars=$ee;const Kee=s=>"__vue__"in s,jee=()=>{const s=document.getElementById("app");if(!s||!Kee(s))throw new Error("Vue app not found");return s.__vue__},qee=!0,Gee="vs-dark",Zee={"activityBar.background":"#1f2430","activityBar.border":"#1f2430","activityBar.foreground":"#707a8ccc","activityBar.inactiveForeground":"#707a8c99","activityBarBadge.background":"#ffcc66","activityBarBadge.foreground":"#1f2430","badge.background":"#ffcc6633","badge.foreground":"#ffcc66","button.background":"#ffcc66","button.foreground":"#1f2430","button.hoverBackground":"#fac761","debugExceptionWidget.background":"#232834","debugExceptionWidget.border":"#191e2a","debugToolBar.background":"#232834",descriptionForeground:"#707a8c","diffEditor.insertedTextBackground":"#bae67e26","diffEditor.removedTextBackground":"#f29e7426","dropdown.background":"#232834","dropdown.border":"#434957","dropdown.foreground":"#707a8c","editor.background":"#28282b","editor.findMatchBackground":"#ffcc660d","editor.findMatchBorder":"#ffcc66","editor.findMatchHighlightBackground":"#ffcc660d","editor.findMatchHighlightBorder":"#ffcc6659","editor.findRangeHighlightBackground":"#323a4c","editor.findRangeHighlightBorder":"#1f243000","editor.foreground":"#cbccc6","editor.inactiveSelectionBackground":"#323a4c","editor.lineHighlightBackground":"#3a3a3e","editor.rangeHighlightBackground":"#191e2a","editor.selectionBackground":"#33415e","editor.selectionHighlightBackground":"#323a4c","editor.selectionHighlightBorder":"#323a4c","editor.wordHighlightBackground":"#77a8d912","editor.wordHighlightBorder":"#77a8d980","editor.wordHighlightStrongBackground":"#a6cc7012","editor.wordHighlightStrongBorder":"#a6cc7080","editorBracketMatch.background":"#707a8c4d","editorBracketMatch.border":"#707a8c99","editorCodeLens.foreground":"#5c6773","editorCursor.foreground":"#ffcc66","editorError.foreground":"#ff3333","editorGroup.background":"#232834","editorGroup.border":"#191e2a","editorGroupHeader.noTabsBackground":"#1f2430","editorGroupHeader.tabsBackground":"#1f2430","editorGroupHeader.tabsBorder":"#1f2430","editorGutter.addedBackground":"#a6cc7099","editorGutter.deletedBackground":"#f2798399","editorGutter.modifiedBackground":"#77a8d999","editorHoverWidget.background":"#232834","editorHoverWidget.border":"#101521","editorIndentGuide.activeBackground":"#707a8cb3","editorIndentGuide.background":"#707a8c4d","editorLineNumber.activeForeground":"#707a8ccc","editorLineNumber.foreground":"#707a8c66","editorLink.activeForeground":"#ffcc66","editorMarkerNavigation.background":"#232834","editorOverviewRuler.addedForeground":"#a6cc7099","editorOverviewRuler.border":"#191e2a","editorOverviewRuler.deletedForeground":"#f2798399","editorOverviewRuler.errorForeground":"#ff3333","editorOverviewRuler.modifiedForeground":"#77a8d999","editorOverviewRuler.warningForeground":"#ffcc66","editorRuler.foreground":"#707a8c4d","editorSuggestWidget.background":"#232834","editorSuggestWidget.border":"#101521","editorSuggestWidget.highlightForeground":"#ffcc66","editorSuggestWidget.selectedBackground":"#191e2a","editorWarning.foreground":"#ffcc66","editorWhitespace.foreground":"#707a8c66","editorWidget.background":"#232834",errorForeground:"#ff3333","extensionButton.prominentBackground":"#ffcc66","extensionButton.prominentForeground":"#1f2430","extensionButton.prominentHoverBackground":"#fac761",focusBorder:"#596171",foreground:"#707a8c","gitDecoration.conflictingResourceForeground":"#ff0000","gitDecoration.deletedResourceForeground":"#f27983b3","gitDecoration.ignoredResourceForeground":"#525a69","gitDecoration.modifiedResourceForeground":"#77a8d9b3","gitDecoration.submoduleResourceForeground":"#d4bfffb3","gitDecoration.untrackedResourceForeground":"#a6cc70b3","icon.foreground":"#707a8c","input.background":"#1d222e","input.border":"#434957","input.foreground":"#cbccc6","input.placeholderForeground":"#5f6878","inputOption.activeBorder":"#ffcc66","inputValidation.errorBackground":"#1f2430","inputValidation.errorBorder":"#ff3333","inputValidation.infoBackground":"#1f2430","inputValidation.infoBorder":"#5ccfe6","inputValidation.warningBackground":"#1f2430","inputValidation.warningBorder":"#ffd580","list.activeSelectionBackground":"#191e2a","list.activeSelectionForeground":"#707a8c","list.errorForeground":"#f27983","list.filterMatchBackground":"#ffcc660d","list.filterMatchBorder":"#ffcc66","list.focusBackground":"#191e2a","list.focusForeground":"#707a8c","list.highlightForeground":"#ffcc66","list.hoverBackground":"#191e2a","list.hoverForeground":"#707a8c","list.inactiveSelectionBackground":"#191e2a","list.inactiveSelectionForeground":"#707a8c","list.invalidItemForeground":"#5f6878","listFilterWidget.background":"#232834","listFilterWidget.noMatchesOutline":"#ff3333","listFilterWidget.outline":"#ffcc66","panel.background":"#1f2430","panel.border":"#191e2a","panelTitle.activeBorder":"#ffcc66","panelTitle.activeForeground":"#cbccc6","panelTitle.inactiveForeground":"#707a8c","peekView.border":"#191e2a","peekViewEditor.background":"#232834","peekViewEditor.matchHighlightBackground":"#ffcc6633","peekViewResult.background":"#232834","peekViewResult.fileForeground":"#707a8c","peekViewResult.matchHighlightBackground":"#ffcc6633","peekViewTitle.background":"#232834","peekViewTitleDescription.foreground":"#707a8c","peekViewTitleLabel.foreground":"#707a8c","pickerGroup.border":"#191e2a","pickerGroup.foreground":"#525a69","progressBar.background":"#ffcc66","scrollbar.shadow":"#191e2a","scrollbarSlider.activeBackground":"#707a8cb3","scrollbarSlider.background":"#707a8c66","scrollbarSlider.hoverBackground":"#707a8c99","selection.background":"#33415efd","settings.headerForeground":"#cbccc6","settings.modifiedItemIndicator":"#77a8d9","sideBar.background":"#1f2430","sideBar.border":"#1f2430","sideBarSectionHeader.background":"#1f2430","sideBarSectionHeader.border":"#1f2430","sideBarSectionHeader.foreground":"#707a8c","sideBarTitle.foreground":"#707a8c","statusBar.background":"#1f2430","statusBar.border":"#1f2430","statusBar.debuggingBackground":"#f29e74","statusBar.debuggingForeground":"#1f2430","statusBar.foreground":"#707a8c","statusBar.noFolderBackground":"#232834","statusBarItem.activeBackground":"#191e2a","statusBarItem.hoverBackground":"#191e2a","statusBarItem.prominentBackground":"#191e2a","statusBarItem.prominentHoverBackground":"#00000030","tab.activeBackground":"#1f2430","tab.activeBorder":"#ffcc66","tab.activeForeground":"#cbccc6","tab.border":"#1f2430","tab.inactiveBackground":"#1f2430","tab.inactiveForeground":"#707a8c","tab.unfocusedActiveBorder":"#707a8c","tab.unfocusedActiveForeground":"#707a8c","tab.unfocusedInactiveForeground":"#707a8c","terminal.ansiBlack":"#191e2a","terminal.ansiBlue":"#6dcbfa","terminal.ansiBrightBlack":"#686868","terminal.ansiBrightBlue":"#73d0ff","terminal.ansiBrightCyan":"#95e6cb","terminal.ansiBrightGreen":"#bae67e","terminal.ansiBrightMagenta":"#d4bfff","terminal.ansiBrightRed":"#f28779","terminal.ansiBrightWhite":"#ffffff","terminal.ansiBrightYellow":"#ffd580","terminal.ansiCyan":"#90e1c6","terminal.ansiGreen":"#a6cc70","terminal.ansiMagenta":"#cfbafa","terminal.ansiRed":"#ed8274","terminal.ansiWhite":"#c7c7c7","terminal.ansiYellow":"#fad07b","terminal.background":"#1f2430","terminal.foreground":"#cbccc6","textBlockQuote.background":"#232834","textLink.activeForeground":"#ffcc66","textLink.foreground":"#ffcc66","textPreformat.foreground":"#cbccc6","titleBar.activeBackground":"#1f2430","titleBar.activeForeground":"#cbccc6","titleBar.border":"#1f2430","titleBar.inactiveBackground":"#1f2430","titleBar.inactiveForeground":"#707a8c","tree.indentGuidesStroke":"#707a8cb3","walkThrough.embeddedEditorBackground":"#232834","widget.shadow":"#141925","minimap.background":"#28282b"},Yee=[{foreground:"#6C7886",fontStyle:"italic",token:"comment"},{foreground:"#BAE67E",token:"string"},{foreground:"#BAE67E",token:"constant.other.symbol"},{foreground:"#95E6CB",token:"string.regexp"},{foreground:"#95E6CB",token:"constant.character"},{foreground:"#95E6CB",token:"constant.other"},{foreground:"#FFCC66",token:"constant.numeric"},{foreground:"#FFCC66",token:"constant.language"},{foreground:"#CBCCC6",token:"variable"},{foreground:"#F28779",token:"variable.member"},{foreground:"#5CCFE6",fontStyle:"italic",token:"variable.language"},{foreground:"#FFA759",token:"storage"},{foreground:"#FFA759",token:"keyword"},{foreground:"#F29E74",token:"keyword.operator"},{foreground:"#CBCCC6B3",token:"punctuation.separator"},{foreground:"#CBCCC6B3",token:"punctuation.terminator"},{foreground:"#CBCCC6",token:"punctuation.section"},{foreground:"#F29E74",token:"punctuation.accessor"},{foreground:"#73D0FF",token:"source.java storage.type"},{foreground:"#73D0FF",token:"source.haskell storage.type"},{foreground:"#73D0FF",token:"source.c storage.type"},{foreground:"#5CCFE6",token:"entity.other.inherited-class"},{foreground:"#FFA759",token:"storage.type.function"},{foreground:"#5CCFE6",token:"source.java storage.type.primitive"},{foreground:"#FFD580",token:"entity.name.function"},{foreground:"#D4BFFF",token:"variable.parameter"},{foreground:"#D4BFFF",token:"meta.parameter"},{foreground:"#FFD580",token:"variable.function"},{foreground:"#FFD580",token:"variable.annotation"},{foreground:"#FFD580",token:"meta.function-call.generic"},{foreground:"#FFD580",token:"support.function.go"},{foreground:"#F28779",token:"support.function"},{foreground:"#F28779",token:"support.macro"},{foreground:"#BAE67E",token:"entity.name.import"},{foreground:"#BAE67E",token:"entity.name.package"},{foreground:"#73D0FF",token:"entity.name"},{foreground:"#5CCFE6",token:"entity.name.tag"},{foreground:"#5CCFE6",token:"meta.tag.sgml"},{foreground:"#5CCFE680",token:"punctuation.definition.tag.end"},{foreground:"#5CCFE680",token:"punctuation.definition.tag.begin"},{foreground:"#5CCFE680",token:"punctuation.definition.tag"},{foreground:"#FFD580",token:"entity.other.attribute-name"},{foreground:"#F29E74",fontStyle:"italic",token:"support.constant"},{foreground:"#5CCFE6",token:"support.type"},{foreground:"#5CCFE6",token:"support.class"},{foreground:"#5CCFE6",token:"source.go storage.type"},{foreground:"#FFE6B3",token:"meta.decorator variable.other"},{foreground:"#FFE6B3",token:"meta.decorator punctuation.decorator"},{foreground:"#FFE6B3",token:"storage.type.annotation"},{foreground:"#FF3333",token:"invalid"},{foreground:"#C594C5",token:"meta.diff"},{foreground:"#C594C5",token:"meta.diff.header"},{foreground:"#FFD580",token:"source.ruby variable.other.readwrite"},{foreground:"#73D0FF",token:"source.css entity.name.tag"},{foreground:"#73D0FF",token:"source.sass entity.name.tag"},{foreground:"#73D0FF",token:"source.scss entity.name.tag"},{foreground:"#73D0FF",token:"source.less entity.name.tag"},{foreground:"#73D0FF",token:"source.stylus entity.name.tag"},{foreground:"#6C7886",token:"source.css support.type"},{foreground:"#6C7886",token:"source.sass support.type"},{foreground:"#6C7886",token:"source.scss support.type"},{foreground:"#6C7886",token:"source.less support.type"},{foreground:"#6C7886",token:"source.stylus support.type"},{foreground:"#5CCFE6",fontStyle:"normal",token:"support.type.property-name"},{foreground:"#6C7886",token:"constant.numeric.line-number.find-in-files - match"},{foreground:"#FFA759",token:"constant.numeric.line-number.match"},{foreground:"#BAE67E",token:"entity.name.filename.find-in-files"},{foreground:"#FF3333",token:"message.error"},{foreground:"#BAE67E",fontStyle:"bold",token:"markup.heading"},{foreground:"#BAE67E",fontStyle:"bold",token:"markup.heading entity.name"},{foreground:"#5CCFE6",token:"markup.underline.link"},{foreground:"#5CCFE6",token:"string.other.link"},{foreground:"#F28779",fontStyle:"italic",token:"markup.italic"},{foreground:"#F28779",fontStyle:"bold",token:"markup.bold"},{fontStyle:"bold italic",token:"markup.italic markup.bold"},{fontStyle:"bold italic",token:"markup.bold markup.italic"},{background:"#CBCCC605",token:"markup.raw"},{background:"#CBCCC60F",token:"markup.raw.inline"},{foreground:"#6C7886",background:"#CBCCC60F",fontStyle:"bold",token:"meta.separator"},{foreground:"#95E6CB",fontStyle:"italic",token:"markup.quote"},{foreground:"#FFD580",token:"markup.list punctuation.definition.list.begin"},{foreground:"#A6CC70",token:"markup.inserted"},{foreground:"#77A8D9",token:"markup.changed"},{foreground:"#F27983",token:"markup.deleted"},{foreground:"#FFE6B3",token:"markup.strike"},{foreground:"#5CCFE6",background:"#CBCCC60F",token:"markup.table"},{foreground:"#F29E74",token:"text.html.markdown markup.inline.raw"},{foreground:"#6C7886",background:"#5C6773",token:"text.html.markdown meta.dummy.line-break"},{foreground:"#6C7886",background:"#CBCCC6",token:"punctuation.definition.markdown"},{foreground:"#6796E6",token:"token.info-token"},{foreground:"#CD9731",token:"token.warn-token"},{foreground:"#F44747",token:"token.error-token"},{foreground:"#B267E6",token:"token.debug-token"}],Qee=[],Xee={inherit:qee,base:Gee,colors:Zee,rules:Yee,encodedTokensColors:Qee},Jee=!1,ete="vs-dark",tte={"activityBarBadge.background":"#007acc","editor.background":"#ffffff","editor.foreground":"#000000","editor.inactiveSelectionBackground":"#e5ebf1","editor.selectionHighlightBackground":"#add6ff80","editorIndentGuide.activeBackground":"#939393","editorIndentGuide.background":"#d3d3d3","editorSuggestWidget.background":"#f3f3f3","input.placeholderForeground":"#767676","list.hoverBackground":"#e8e8e8","notebook.cellBorderColor":"#e8e8e8","notebook.selectedCellBackground":"#c8ddf150","searchEditor.textInputBorder":"#cecece","settings.numberInputBorder":"#cecece","settings.textInputBorder":"#cecece","sideBarSectionHeader.background":"#00000000","sideBarSectionHeader.border":"#61616130","sideBarTitle.foreground":"#6f6f6f","statusBarItem.errorBackground":"#c72e0f","statusBarItem.remoteBackground":"#16825d","statusBarItem.remoteForeground":"#ffffff","tab.lastPinnedBorder":"#61616130","minimap.background":"#ffffff"},ite=[{foreground:"#000000",token:"meta.embedded"},{foreground:"#000000",token:"source.groovy.embedded"},{fontStyle:"italic",token:"emphasis"},{fontStyle:"bold",token:"strong"},{foreground:"#000080",token:"meta.diff.header"},{foreground:"#008000",token:"comment"},{foreground:"#0000FF",token:"constant.language"},{foreground:"#098658",token:"constant.numeric"},{foreground:"#098658",token:"variable.other.enummember"},{foreground:"#098658",token:"keyword.operator.plus.exponent"},{foreground:"#098658",token:"keyword.operator.minus.exponent"},{foreground:"#811F3F",token:"constant.regexp"},{foreground:"#800000",token:"entity.name.tag"},{foreground:"#800000",token:"entity.name.selector"},{foreground:"#FF0000",token:"entity.other.attribute-name"},{foreground:"#800000",token:"entity.other.attribute-name.class.css"},{foreground:"#800000",token:"entity.other.attribute-name.class.mixin.css"},{foreground:"#800000",token:"entity.other.attribute-name.id.css"},{foreground:"#800000",token:"entity.other.attribute-name.parent-selector.css"},{foreground:"#800000",token:"entity.other.attribute-name.pseudo-class.css"},{foreground:"#800000",token:"entity.other.attribute-name.pseudo-element.css"},{foreground:"#800000",token:"source.css.less entity.other.attribute-name.id"},{foreground:"#800000",token:"entity.other.attribute-name.scss"},{foreground:"#CD3131",token:"invalid"},{fontStyle:"underline",token:"markup.underline"},{foreground:"#000080",fontStyle:"bold",token:"markup.bold"},{foreground:"#800000",fontStyle:"bold",token:"markup.heading"},{fontStyle:"italic",token:"markup.italic"},{foreground:"#098658",token:"markup.inserted"},{foreground:"#A31515",token:"markup.deleted"},{foreground:"#0451A5",token:"markup.changed"},{foreground:"#0451A5",token:"punctuation.definition.quote.begin.markdown"},{foreground:"#0451A5",token:"punctuation.definition.list.begin.markdown"},{foreground:"#800000",token:"markup.inline.raw"},{foreground:"#800000",token:"punctuation.definition.tag"},{foreground:"#0000FF",token:"meta.preprocessor"},{foreground:"#0000FF",token:"entity.name.function.preprocessor"},{foreground:"#A31515",token:"meta.preprocessor.string"},{foreground:"#098658",token:"meta.preprocessor.numeric"},{foreground:"#0451A5",token:"meta.structure.dictionary.key.python"},{foreground:"#0000FF",token:"storage"},{foreground:"#0000FF",token:"storage.type"},{foreground:"#0000FF",token:"storage.modifier"},{foreground:"#0000FF",token:"keyword.operator.noexcept"},{foreground:"#A31515",token:"string"},{foreground:"#A31515",token:"meta.embedded.assembly"},{foreground:"#0000FF",token:"string.comment.buffered.block.pug"},{foreground:"#0000FF",token:"string.quoted.pug"},{foreground:"#0000FF",token:"string.interpolated.pug"},{foreground:"#0000FF",token:"string.unquoted.plain.in.yaml"},{foreground:"#0000FF",token:"string.unquoted.plain.out.yaml"},{foreground:"#0000FF",token:"string.unquoted.block.yaml"},{foreground:"#0000FF",token:"string.quoted.single.yaml"},{foreground:"#0000FF",token:"string.quoted.double.xml"},{foreground:"#0000FF",token:"string.quoted.single.xml"},{foreground:"#0000FF",token:"string.unquoted.cdata.xml"},{foreground:"#0000FF",token:"string.quoted.double.html"},{foreground:"#0000FF",token:"string.quoted.single.html"},{foreground:"#0000FF",token:"string.unquoted.html"},{foreground:"#0000FF",token:"string.quoted.single.handlebars"},{foreground:"#0000FF",token:"string.quoted.double.handlebars"},{foreground:"#811F3F",token:"string.regexp"},{foreground:"#0000FF",token:"punctuation.definition.template-expression.begin"},{foreground:"#0000FF",token:"punctuation.definition.template-expression.end"},{foreground:"#0000FF",token:"punctuation.section.embedded"},{foreground:"#000000",token:"meta.template.expression"},{foreground:"#0451A5",token:"support.constant.property-value"},{foreground:"#0451A5",token:"support.constant.font-name"},{foreground:"#0451A5",token:"support.constant.media-type"},{foreground:"#0451A5",token:"support.constant.media"},{foreground:"#0451A5",token:"constant.other.color.rgb-value"},{foreground:"#0451A5",token:"constant.other.rgb-value"},{foreground:"#0451A5",token:"support.constant.color"},{foreground:"#FF0000",token:"support.type.vendored.property-name"},{foreground:"#FF0000",token:"support.type.property-name"},{foreground:"#FF0000",token:"variable.css"},{foreground:"#FF0000",token:"variable.scss"},{foreground:"#FF0000",token:"variable.other.less"},{foreground:"#FF0000",token:"source.coffee.embedded"},{foreground:"#0451A5",token:"support.type.property-name.json"},{foreground:"#0000FF",token:"keyword"},{foreground:"#0000FF",token:"keyword.control"},{foreground:"#000000",token:"keyword.operator"},{foreground:"#0000FF",token:"keyword.operator.new"},{foreground:"#0000FF",token:"keyword.operator.expression"},{foreground:"#0000FF",token:"keyword.operator.cast"},{foreground:"#0000FF",token:"keyword.operator.sizeof"},{foreground:"#0000FF",token:"keyword.operator.alignof"},{foreground:"#0000FF",token:"keyword.operator.typeid"},{foreground:"#0000FF",token:"keyword.operator.alignas"},{foreground:"#0000FF",token:"keyword.operator.instanceof"},{foreground:"#0000FF",token:"keyword.operator.logical.python"},{foreground:"#0000FF",token:"keyword.operator.wordlike"},{foreground:"#098658",token:"keyword.other.unit"},{foreground:"#800000",token:"punctuation.section.embedded.begin.php"},{foreground:"#800000",token:"punctuation.section.embedded.end.php"},{foreground:"#0451A5",token:"support.function.git-rebase"},{foreground:"#098658",token:"constant.sha.git-rebase"},{foreground:"#000000",token:"storage.modifier.import.java"},{foreground:"#000000",token:"variable.language.wildcard.java"},{foreground:"#000000",token:"storage.modifier.package.java"},{foreground:"#0000FF",token:"variable.language"},{foreground:"#795E26",token:"entity.name.function"},{foreground:"#795E26",token:"support.function"},{foreground:"#795E26",token:"support.constant.handlebars"},{foreground:"#795E26",token:"source.powershell variable.other.member"},{foreground:"#795E26",token:"entity.name.operator.custom-literal"},{foreground:"#267F99",token:"meta.return-type"},{foreground:"#267F99",token:"support.class"},{foreground:"#267F99",token:"support.type"},{foreground:"#267F99",token:"entity.name.type"},{foreground:"#267F99",token:"entity.name.namespace"},{foreground:"#267F99",token:"entity.other.attribute"},{foreground:"#267F99",token:"entity.name.scope-resolution"},{foreground:"#267F99",token:"entity.name.class"},{foreground:"#267F99",token:"storage.type.numeric.go"},{foreground:"#267F99",token:"storage.type.byte.go"},{foreground:"#267F99",token:"storage.type.boolean.go"},{foreground:"#267F99",token:"storage.type.string.go"},{foreground:"#267F99",token:"storage.type.uintptr.go"},{foreground:"#267F99",token:"storage.type.error.go"},{foreground:"#267F99",token:"storage.type.rune.go"},{foreground:"#267F99",token:"storage.type.cs"},{foreground:"#267F99",token:"storage.type.generic.cs"},{foreground:"#267F99",token:"storage.type.modifier.cs"},{foreground:"#267F99",token:"storage.type.variable.cs"},{foreground:"#267F99",token:"storage.type.annotation.java"},{foreground:"#267F99",token:"storage.type.generic.java"},{foreground:"#267F99",token:"storage.type.java"},{foreground:"#267F99",token:"storage.type.object.array.java"},{foreground:"#267F99",token:"storage.type.primitive.array.java"},{foreground:"#267F99",token:"storage.type.primitive.java"},{foreground:"#267F99",token:"storage.type.token.java"},{foreground:"#267F99",token:"storage.type.groovy"},{foreground:"#267F99",token:"storage.type.annotation.groovy"},{foreground:"#267F99",token:"storage.type.parameters.groovy"},{foreground:"#267F99",token:"storage.type.generic.groovy"},{foreground:"#267F99",token:"storage.type.object.array.groovy"},{foreground:"#267F99",token:"storage.type.primitive.array.groovy"},{foreground:"#267F99",token:"storage.type.primitive.groovy"},{foreground:"#267F99",token:"meta.type.cast.expr"},{foreground:"#267F99",token:"meta.type.new.expr"},{foreground:"#267F99",token:"support.constant.math"},{foreground:"#267F99",token:"support.constant.dom"},{foreground:"#267F99",token:"support.constant.json"},{foreground:"#267F99",token:"entity.other.inherited-class"},{foreground:"#AF00DB",token:"keyword.control"},{foreground:"#AF00DB",token:"source.cpp keyword.operator.new"},{foreground:"#AF00DB",token:"source.cpp keyword.operator.delete"},{foreground:"#AF00DB",token:"keyword.other.using"},{foreground:"#AF00DB",token:"keyword.other.operator"},{foreground:"#AF00DB",token:"entity.name.operator"},{foreground:"#001080",token:"variable"},{foreground:"#001080",token:"meta.definition.variable.name"},{foreground:"#001080",token:"support.variable"},{foreground:"#001080",token:"entity.name.variable"},{foreground:"#0070C1",token:"variable.other.constant"},{foreground:"#0070C1",token:"variable.other.enummember"},{foreground:"#001080",token:"meta.object-literal.key"},{foreground:"#0451A5",token:"support.constant.property-value"},{foreground:"#0451A5",token:"support.constant.font-name"},{foreground:"#0451A5",token:"support.constant.media-type"},{foreground:"#0451A5",token:"support.constant.media"},{foreground:"#0451A5",token:"constant.other.color.rgb-value"},{foreground:"#0451A5",token:"constant.other.rgb-value"},{foreground:"#0451A5",token:"support.constant.color"},{foreground:"#D16969",token:"punctuation.definition.group.regexp"},{foreground:"#D16969",token:"punctuation.definition.group.assertion.regexp"},{foreground:"#D16969",token:"punctuation.definition.character-class.regexp"},{foreground:"#D16969",token:"punctuation.character.set.begin.regexp"},{foreground:"#D16969",token:"punctuation.character.set.end.regexp"},{foreground:"#D16969",token:"keyword.operator.negation.regexp"},{foreground:"#D16969",token:"support.other.parenthesis.regexp"},{foreground:"#811F3F",token:"constant.character.character-class.regexp"},{foreground:"#811F3F",token:"constant.other.character-class.set.regexp"},{foreground:"#811F3F",token:"constant.other.character-class.regexp"},{foreground:"#811F3F",token:"constant.character.set.regexp"},{foreground:"#000000",token:"keyword.operator.quantifier.regexp"},{foreground:"#EE0000",token:"keyword.operator.or.regexp"},{foreground:"#EE0000",token:"keyword.control.anchor.regexp"},{foreground:"#0000FF",token:"constant.character"},{foreground:"#EE0000",token:"constant.character.escape"},{foreground:"#000000",token:"entity.name.label"},{foreground:"#316BCD",token:"token.info-token"},{foreground:"#CD9731",token:"token.warn-token"},{foreground:"#CD3131",token:"token.error-token"},{foreground:"#800080",token:"token.debug-token"}],nte=[],ste={inherit:Jee,base:ete,colors:tte,rules:ite,encodedTokensColors:nte},ote=s=>["klipper","moonraker","moonraker-telegram-bot","crowsnest"].includes(s),rte=(s,e)=>{switch(s){case"klipper":if(e.startsWith("stepper_"))return"stepper";if(/^extruder\d{0,2}$/.test(e))return"extruder";break;case"moonraker":if(e.startsWith("include"))return"include-directives";break}return e};async function ate(){await Promise.all([GJ(XJ),c5(()=>import("./setupMonaco.features-Cu88WI8m.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)]);const s=new Vee({getGrammarDefinition:async i=>{const n=i.split(".").pop()??"";return{format:"json",content:await d5[n]()}}}),e=new Map;e.set("gcode","source.gcode"),e.set("klipper-config","source.klipper-config"),e.set("log","text.log"),Kn.register({id:"gcode",extensions:["gcode","g","gc","gco","ufp","nc"]}),Kn.register({id:"klipper-config",extensions:["cfg","conf"]}),Kn.register({id:"log",extensions:["log"]}),Kn.setLanguageConfiguration("gcode",{comments:{lineComment:";"}}),Kn.setLanguageConfiguration("klipper-config",{comments:{lineComment:"#"}});const t=jee();return zp.registerCommand("fluidd_open_docs",(i,n,o)=>{const r=n.replace(/-/g,"_"),a=t.$store.getters["printer/getKlippyApp"],l=t.$t(`app.file_system.url.${r}_config`,{hash:o,klipperDomain:a.domain}).toString();window.open(l)}),Kn.registerCodeLensProvider("klipper-config",{provideCodeLenses:i=>{const{service:n}=t.$store.getters["server/getConfigMapByFilename"](i.uri.path.split("/").pop());return ote(n)?{lenses:i.getLinesContent().reduce((a,l,c)=>{const d=/^\[([^\]]+)\]/.exec(l);if(d){const[u]=d[1].split(" ",1),h=rte(n,u);a.result.push(a.current={referenceSection:h,range:{startLineNumber:c+1,startColumn:i.getLineFirstNonWhitespaceColumn(c+1),endLineNumber:c+1,endColumn:i.getLineLastNonWhitespaceColumn(c+1)}})}else/^\s*[^#;]/.test(l)&&a.current&&(a.current.range={...a.current.range,endLineNumber:c+1,endColumn:i.getLineLastNonWhitespaceColumn(c+1)});return a},{result:[]}).result.map((a,l)=>({range:a.range,id:`docs${l}`,command:{id:"fluidd_open_docs",title:t.$t("app.file_system.label.view_section_documentation",{section:a.referenceSection}).toString(),arguments:[n,a.referenceSection]}})),dispose:()=>{}}:null},resolveCodeLens:(i,n)=>n}),Kn.registerFoldingRangeProvider("klipper-config",{provideFoldingRanges:i=>{const n=i.getLinesContent(),o=n.reduce((a,l,c)=>(/^\[([^\]]+)\]/.test(l)?a.result.push(a.current={kind:Kn.FoldingRangeKind.Region,start:c+1,end:c+1}):/^\s*[^#;]/.test(l)&&a.current&&(a.current.end=c+1),a),{result:[]}).result,r=n.reduce((a,l,c)=>(l=l.trim(),l.length>0&&(["#",";"].includes(l[0])?a.current?a.current.end=c+1:a.result.push(a.current={kind:Kn.FoldingRangeKind.Comment,start:c+1,end:c+1}):a.current=void 0),a),{result:[]}).result;return[...o,...r]}}),Kn.registerFoldingRangeProvider("gcode",{provideFoldingRanges:i=>{const n=i.getLinesContent(),o=n.reduce((c,d,u)=>(/^\s*SET_PRINT_STATS_INFO .*CURRENT_LAYER=/i.test(d)?c.result.push(c.current={kind:Kn.FoldingRangeKind.Region,start:u+1,end:u+1}):/^\s*[^;]/.test(d)&&c.current&&(c.current.end=u+1),c),{result:[]}).result,r=n.reduce((c,d,u)=>{if(d=d.trim(),d.length>0){const h=/^\s*EXCLUDE_OBJECT_(START|END) /i.exec(d);if(h)switch(h[1].toUpperCase()){case"START":c.result.push(c.current={kind:Kn.FoldingRangeKind.Region,start:u+1,end:u+1});break;case"END":c.current=void 0;break}else c.current&&(c.current.end=u+1)}return c},{result:[]}).result,a=n.reduce((c,d,u)=>{if(d.startsWith("; thumbnail"))switch(d.substring(11).split(" ")[1]){case"begin":c.result.push(c.current={kind:Kn.FoldingRangeKind.Comment,start:u+1,end:u+1});break;case"end":c.current&&c.current.start===c.current.end&&(c.current.end=u);break}return c},{result:[]}).result,l=n.reduce((c,d,u)=>(d=d.trim(),d.length>0&&(d.startsWith(";")?c.current?c.current.end=u+1:c.result.push(c.current={kind:Kn.FoldingRangeKind.Comment,start:u+1,end:u+1}):c.current=void 0),c),{result:[]}).result;return[...o,...r,...l,...a]}}),zp.defineTheme("dark-converted",Xee),zp.defineTheme("light-converted",ste),await s5(lN,s,e),lN}const lte=ate(),zse=Object.freeze(Object.defineProperty({__proto__:null,default:lte},Symbol.toStringTag,{value:"Module"}));export{De as $,L7 as A,zi as B,st as C,C0 as D,Ute as E,pR as F,Jr as G,sj as H,Xt as I,kt as J,GP as K,EN as L,x as M,Mie as N,c_ as O,V as P,ze as Q,me as R,yt as S,hD as T,$e as U,Ec as V,xte as W,vt as X,et as Y,j as Z,J as _,gi as a,Wf as a$,Ca as a0,IC as a1,em as a2,Sl as a3,Fe as a4,pe as a5,xc as a6,qL as a7,hR as a8,te as a9,bS as aA,x0 as aB,ns as aC,ao as aD,JK as aE,P4 as aF,Wi as aG,L0 as aH,Ls as aI,Rl as aJ,Ml as aK,Ke as aL,O as aM,Ft as aN,Rte as aO,aV as aP,Jg as aQ,yk as aR,to as aS,ne as aT,Bte as aU,Ho as aV,Ko as aW,oh as aX,t6 as aY,Qe as aZ,rt as a_,Ni as aa,Jn as ab,Da as ac,Zi as ad,MK as ae,$o as af,Be as ag,my as ah,Fs as ai,Qd as aj,Mg as ak,Sk as al,b1 as am,XK as an,$S as ao,Yu as ap,Wn as aq,fT as ar,R4 as as,n2 as at,Ete as au,nf as av,lo as aw,eL as ax,y_ as ay,FB as az,ce as b,MC as b$,Il as b0,Zc as b1,LH as b2,Hr as b3,rd as b4,YL as b5,ka as b6,tl as b7,Pd as b8,iu as b9,he as bA,zx as bB,Bl as bC,Td as bD,Y0 as bE,ho as bF,jn as bG,Ts as bH,Jc as bI,wi as bJ,He as bK,kr as bL,ma as bM,dt as bN,pa as bO,_t as bP,qi as bQ,nk as bR,mg as bS,Hne as bT,qy as bU,xq as bV,sh as bW,uD as bX,hne as bY,Is as bZ,cI as b_,At as ba,g_ as bb,wa as bc,td as bd,RK as be,vr as bf,m1 as bg,zg as bh,wm as bi,QE as bj,wt as bk,Dc as bl,xn as bm,BU as bn,Cs as bo,Dg as bp,Nr as bq,bA as br,K as bs,Je as bt,sse as bu,mL as bv,qc as bw,La as bx,s_ as by,be as bz,ae as c,br as c$,Uo as c0,l$ as c1,RC as c2,c$ as c3,zS as c4,Nte as c5,$te as c6,Mi as c7,Xg as c8,$$ as c9,xL as cA,pn as cB,Hi as cC,Vt as cD,LC as cE,Bg as cF,QK as cG,SI as cH,oI as cI,Sq as cJ,kH as cK,T$ as cL,Ic as cM,du as cN,ML as cO,IG as cP,El as cQ,ro as cR,uI as cS,Nie as cT,wI as cU,Fc as cV,uZ as cW,Tne as cX,gZ as cY,pZ as cZ,Ar as c_,_5 as ca,oo as cb,cD as cc,lg as cd,d$ as ce,u$ as cf,z_ as cg,ul as ch,Ye as ci,wl as cj,ag as ck,D5 as cl,Ha as cm,WO as cn,PC as co,dR as cp,Kg as cq,Vs as cr,tt as cs,si as ct,Ai as cu,Eq as cv,Po as cw,GS as cx,FC as cy,LE as cz,fr as d,xT as d$,AD as d0,Tl as d1,Nne as d2,Ste as d3,Oh as d4,_U as d5,Ja as d6,_D as d7,Gw as d8,Vi as d9,e6 as dA,i6 as dB,XL as dC,rG as dD,aG as dE,lG as dF,hG as dG,Ge as dH,C1 as dI,$s as dJ,gG as dK,US as dL,lie as dM,rie as dN,aie as dO,Og as dP,Xp as dQ,MO as dR,TR as dS,NR as dT,Vn as dU,TN as dV,Zne as dW,HS as dX,jte as dY,zte as dZ,bie as d_,og as da,oie as db,Iu as dc,vD as dd,hie as de,uie as df,die as dg,cie as dh,nl as di,il as dj,VL as dk,oi as dl,kl as dm,es as dn,ku as dp,lf as dq,R0 as dr,Cl as ds,one as dt,fie as du,xm as dv,Dte as dw,jC as dx,md as dy,MW as dz,p as e,cj as e$,Wc as e0,Le as e1,Rd as e2,Md as e3,qte as e4,io as e5,To as e6,Yn as e7,Zu as e8,Ka as e9,rH as eA,x2 as eB,dH as eC,hi as eD,xie as eE,Bn as eF,tH as eG,QS as eH,lA as eI,_T as eJ,Os as eK,gn as eL,ea as eM,Hj as eN,Ti as eO,lne as eP,tk as eQ,S$ as eR,ane as eS,KN as eT,Iie as eU,kS as eV,oF as eW,SF as eX,sne as eY,nne as eZ,oj as e_,od as ea,ah as eb,Zte as ec,_J as ed,Ne as ee,Ig as ef,Wse as eg,Vse as eh,vi as ei,e3 as ej,t3 as ek,Xu as el,Dt as em,ik as en,ed as eo,lt as ep,Rs as eq,Ff as er,bn as es,cL as et,th as eu,Ns as ev,nn as ew,no as ex,j0 as ey,AS as ez,Wg as f,Dn as f$,hte as f0,uo as f1,yR as f2,une as f3,rne as f4,bu as f5,g1 as f6,JL as f7,Qte as f8,kte as f9,sm as fA,NT as fB,Pn as fC,Pte as fD,Ac as fE,Tie as fF,dA as fG,bF as fH,dne as fI,fne as fJ,Ote as fK,c2 as fL,h1 as fM,Of as fN,bte as fO,qj as fP,q_ as fQ,cne as fR,oS as fS,Ps as fT,SC as fU,fi as fV,tn as fW,Wx as fX,sie as fY,oa as fZ,__ as f_,wb as fa,dD as fb,xf as fc,Qn as fd,p5 as fe,f5 as ff,aR as fg,cg as fh,Xie as fi,wD as fj,Qie as fk,Yk as fl,$M as fm,Lu as fn,Di as fo,_L as fp,Fte as fq,I_ as fr,bi as fs,zh as ft,aw as fu,BA as fv,lw as fw,Em as fx,pie as fy,Rf as fz,vn as g,v8 as g$,v_ as g0,NB as g1,xA as g2,tI as g3,R8 as g4,iM as g5,nM as g6,rc as g7,Lie as g8,kie as g9,mD as gA,_A as gB,F5 as gC,iL as gD,UU as gE,jie as gF,xd as gG,za as gH,zA as gI,Io as gJ,pte as gK,p_ as gL,Ue as gM,It as gN,dj as gO,gte as gP,mo as gQ,iU as gR,nU as gS,sU as gT,j9 as gU,gl as gV,Wl as gW,WM as gX,dJ as gY,H9 as gZ,GM as g_,eie as ga,ln as gb,Gc as gc,xi as gd,hw as ge,wie as gf,Zt as gg,kC as gh,Ite as gi,Rr as gj,Aie as gk,gie as gl,MA as gm,mie as gn,gD as go,bD as gp,fD as gq,sl as gr,W8 as gs,X8 as gt,J8 as gu,Q8 as gv,Ot as gw,pD as gx,Tr as gy,W_ as gz,sn as h,Ine as h0,Eu as h1,jc as h2,mt as h3,je as h4,yie as h5,b0 as h6,w5 as h7,gse as h8,Bse as h9,wu as ha,RR as hb,PE as hc,$p as hd,QM as he,y$ as hf,Yie as hg,V_ as hh,mne as hi,lR as hj,OE as hk,lN as hl,zse as hm,bt as i,KT as j,Kte as k,fte as l,cR as m,iw as n,tL as o,T as p,Ci as q,Vte as r,G as s,pd as t,_n as u,M as v,pt as w,qn as x,ot as y,Nc as z};