var e=Object.defineProperty,t=(t,i,n)=>(((t,i,n)=>{i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n})(t,"symbol"!=typeof i?i+"":i,n),n);import{b as i,u as n,a as o,_ as s,w as r,ae as a,af as l,ag as d,ah as h,ai as c,aj as u,ak as g,c as p,al as m,N as f,k as _,am as v,E as b,Y as C,r as w,an as y,ao as S,ap as x,J as k,aq as L,C as D,i as E,ar as N,x as I,as as T,at as M,M as O,D as A,au as R,av as P,aw as F,ax as B,ay as V,az as W,aA as H,aB as z,d as j,H as U,aC as $,F as K,aD as q,aE as G,Z,aF as Y,aG as X,aH as Q,aI as J,aJ as ee,j as te,q as ie,s as ne,t as oe,S as se,aK as re,aL as ae,z as le,B as de,A as he,U as ce,h as ue,aM as ge,aN as pe,aO as me,aP as fe,aQ as _e,aR as ve,aS as be,aT as Ce,G as we,aU as ye,aV as Se,aW as xe,a3 as ke,ac as Le,aX as De,W as Ee,aY as Ne,$ as Ie,a0 as Te,a8 as Me,a7 as Oe,a1 as Ae,L as Re,aZ as Pe,K as Fe,a6 as Be,ad as Ve,a_ as We,a4 as He,a5 as ze,a2 as je,ab as Ue,a$ as $e,aa as Ke}from"./useVisualData.9b99c843.js";import{n as qe,O as Ge,P as Ze,G as Ye,b as Xe,I as Qe,a as Je,c as et,Q as tt,L as it,R as nt,T as ot,E as st,H as rt,d as at,V as lt,W as dt,X as ht,Y as ct,Z as ut,_ as gt,$ as pt,a0 as mt,a1 as ft,a2 as _t,a3 as vt,a4 as bt,a5 as Ct,a6 as wt,a7 as yt,a8 as St,a9 as xt,h as kt,aa as Lt,N as Dt,ab as Et,ac as Nt,ad as It,ae as Tt,af as Mt,f as Ot,ag as At,ah as Rt,ai as Pt,aj as Ft,ak as Bt,al as Vt,am as Wt,an as Ht,g as zt,e as jt,ao as Ut}from"./index.7b4f7ca9.js";import{aV as $t,aW as Kt,aX as qt,aY as Gt,W as Zt,aw as Yt,aZ as Xt,a_ as Qt,a$ as Jt,V as ei,b0 as ti,X as ii,ax as ni,b1 as oi,E as si,av as ri,r as ai,b2 as li,b3 as di,s as hi,b4 as ci,aN as ui,L as gi,t as pi,aO as mi,u as fi,ay as _i,b5 as vi,n as bi,P as Ci,h as wi,m as yi,b6 as Si,b7 as xi,aD as ki,H as Li,aU as Di,b8 as Ei,b9 as Ni,C as Ii,aI as Ti,ba as Mi,bb as Oi,aH as Ai,bc as Ri,c as Pi,j as Fi,v as Bi,e as Vi,f as Wi,bd as Hi,be as zi,bf as ji,aL as Ui,bg as $i,M as Ki,y as qi,bh as Gi,d as Zi,bi as Yi,bj as Xi,bk as Qi,bl as Ji,q as en,bm as tn,aM as nn,G as on,bn as sn,bo as rn,i as an,bp as ln,bq as dn,R as hn,br as cn,D as un,K as gn,ad as pn,aF as mn,F as fn,ak as _n,aa as vn,bs as bn,o as Cn,bt as wn,bu as yn,bv as Sn,aE as xn,aG as kn,b as Ln,bw as Dn,p as En,bx as Nn,by as In,bz as Tn,N as Mn,g as On,x as An,al as Rn,l as Pn,bA as Fn,bB as Bn,bC as Vn,bD as Wn,bE as Hn,bF as zn,bG as jn,aK as Un,bH as $n,aq as Kn,bI as qn,ar as Gn,bJ as Zn,bK as Yn,aA as Xn,w as Qn,a as Jn,bL as eo,bM as to,bN as io,k as no,bO as oo,z as so,bP as ro,bQ as ao,T as lo,bR as ho,bS as co,S as uo,bT as go,bU as po,bV as mo,bW as fo,bX as _o,bY as vo,bZ as bo,b_ as Co,b$ as wo,c0 as yo,aJ as So,c1 as xo,aQ as ko,A as Lo,O as Do,B as Eo,I as No,Q as Io,c2 as To,aC as Mo,aB as Oo,c3 as Ao,az as Ro,au as Po,aT as Fo,aS as Bo}from"./preload-helper.fde915ab.js";import{i as Vo,U as Wo,a as Ho,e as zo,b as jo,D as Uo,E as $o,m as Ko,R as qo,c as Go,d as Zo,f as Yo,g as Xo,h as Qo,o as Jo,t as es,j as ts,k as is,l as ns,n as os,T as ss,p as rs,C as as,q as ls,r as ds,s as hs,u as cs,v as us,w as gs,S as ps,x as ms,y as fs,z as _s,A as vs,B as bs,F as Cs,G as ws,H as ys,I as Ss,J as xs,K as ks,L as Ls,M as Ds,N as Es,O as Ns,P as Is,Q as Ts,V as Ms,W as Os,X as As,Y as Rs,Z as Ps,_ as Fs,$ as Bs,a0 as Vs,a1 as Ws,a2 as Hs,a3 as zs,a4 as js,a5 as Us,a6 as $s,a7 as Ks,a8 as qs,a9 as Gs,aa as Zs,ab as Ys,ac as Xs,ad as Qs,ae as Js,af as er,ag as tr,ah as ir,ai as nr,aj as or,ak as sr,al as rr,am as ar,an as lr,ao as dr,ap as hr,aq as cr,ar as ur,as as gr,at as pr,au as mr,av as fr,aw as _r,ax as vr,ay as br,az as Cr,aA as wr,aB as yr,aC as Sr,aD as xr,aE as kr,aF as Lr,aG as Dr,aH as Er,aI as Nr,aJ as Ir,aK as Tr,aL as Mr,aM as Or,aN as Ar,aO as Rr,aP as Pr,aQ as Fr,aR as Br,aS as Vr,aT as Wr,aU as Hr,aV as zr,aW as jr,aX as Ur,aY as $r,aZ as Kr,a_ as qr,a$ as Gr,b0 as Zr,b1 as Yr,b2 as Xr,b3 as Qr,b4 as Jr,b5 as ea,b6 as ta,b7 as ia,b8 as na,b9 as oa,ba as sa,bb as ra,bc as aa,bd as la,be as da,bf as ha,bg as ca,bh as ua,bi as ga,bj as pa,bk as ma,bl as fa,bm as _a,bn as va,bo as ba,bp as Ca,bq as wa,br as ya,bs as Sa,bt as xa,bu as ka,bv as La,bw as Da,bx as Ea,by as Na,bz as Ia,bA as Ta,bB as Ma,bC as Oa,bD as Aa,bE as Ra,bF as Pa,bG as Fa,bH as Ba,bI as Va,bJ as Wa,bK as Ha,bL as za,bM as ja,bN as Ua,bO as $a,bP as Ka,bQ as qa,bR as Ga,bS as Za,bT as Ya,bU as Xa,bV as Qa,bW as Ja,bX as el,bY as tl,bZ as il,b_ as nl,b$ as ol,c0 as sl,c1 as rl,c2 as al,c3 as ll,c4 as dl,c5 as hl,c6 as cl,c7 as ul,c8 as gl,c9 as pl,ca as ml,cb as fl,cc as _l,cd as vl,ce as bl,cf as Cl,cg as wl,ch as yl,ci as Sl,cj as xl,ck as kl,cl as Ll,cm as Dl,cn as El,co as Nl,cp as Il,cq as Tl,cr as Ml,cs as Ol,ct as Al,cu as Rl,cv as Pl,cw as Fl,cx as Bl,cy as Vl,cz as Wl,cA as Hl,cB as zl,cC as jl,cD as Ul,cE as $l,cF as Kl,cG as ql,cH as Gl,cI as Zl,cJ as Yl,cK as Xl,cL as Ql,cM as Jl,cN as ed,cO as td,cP as id,cQ as nd,cR as od,cS as sd,cT as rd}from"./editorWorker.944419af.js";import{_ as ad}from"./plugin-vue_export-helper.21dcd24c.js";import{u as ld}from"./useAnimate.644289ba.js";var dd=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",compile:()=>{},EffectScope:$t,ReactiveEffect:Kt,customRef:qt,effect:Gt,effectScope:Zt,getCurrentScope:Yt,isProxy:Xt,isReactive:Qt,isReadonly:Jt,isRef:ei,isShallow:ti,markRaw:ii,onScopeDispose:ni,proxyRefs:oi,reactive:si,readonly:ri,ref:ai,shallowReactive:li,shallowReadonly:di,shallowRef:hi,stop:ci,toRaw:ui,toRef:gi,toRefs:pi,triggerRef:mi,unref:fi,camelize:_i,capitalize:vi,normalizeClass:bi,normalizeProps:Ci,normalizeStyle:wi,toDisplayString:yi,toHandlerKey:Si,BaseTransition:xi,Comment:ki,Fragment:Li,KeepAlive:Di,Static:Ei,Suspense:Ni,Teleport:Ii,Text:Ti,callWithAsyncErrorHandling:Mi,callWithErrorHandling:Oi,cloneVNode:Ai,compatUtils:Ri,computed:Pi,createBlock:Fi,createCommentVNode:Bi,createElementBlock:Vi,createElementVNode:Wi,createHydrationRenderer:Hi,createPropsRestProxy:zi,createRenderer:ji,createSlots:Ui,createStaticVNode:$i,createTextVNode:Ki,createVNode:qi,defineAsyncComponent:Gi,defineComponent:Zi,defineEmits:Yi,defineExpose:Xi,defineProps:Qi,get devtools(){return Ji},getCurrentInstance:en,getTransitionRawChildren:tn,guardReactiveProps:nn,h:on,handleError:sn,initCustomFormatter:rn,inject:an,isMemoSame:ln,isRuntimeOnly:dn,isVNode:hn,mergeDefaults:cn,mergeProps:un,nextTick:gn,onActivated:pn,onBeforeMount:mn,onBeforeUnmount:fn,onBeforeUpdate:_n,onDeactivated:vn,onErrorCaptured:bn,onMounted:Cn,onRenderTracked:wn,onRenderTriggered:yn,onServerPrefetch:Sn,onUnmounted:xn,onUpdated:kn,openBlock:Ln,popScopeId:Dn,provide:En,pushScopeId:Nn,queuePostFlushCb:In,registerRuntimeCompiler:Tn,renderList:Mn,renderSlot:On,resolveComponent:An,resolveDirective:Rn,resolveDynamicComponent:Pn,resolveFilter:Fn,resolveTransitionHooks:Bn,setBlockTracking:Vn,setDevtoolsHook:Wn,setTransitionHooks:Hn,ssrContextKey:zn,ssrUtils:jn,toHandlers:Un,transformVNodeArgs:$n,useAttrs:Kn,useSSRContext:qn,useSlots:Gn,useTransitionState:Zn,version:Yn,warn:Xn,watch:Qn,watchEffect:Jn,watchPostEffect:eo,watchSyncEffect:to,withAsyncContext:io,withCtx:no,withDefaults:oo,withDirectives:so,withMemo:ro,withScopeId:ao,Transition:lo,TransitionGroup:ho,VueElement:co,createApp:uo,createSSRApp:go,defineCustomElement:po,defineSSRCustomElement:mo,hydrate:fo,initDirectivesForSSR:_o,render:vo,useCssModule:bo,useCssVars:Co,vModelCheckbox:wo,vModelDynamic:yo,vModelRadio:So,vModelSelect:xo,vModelText:ko,vShow:Lo,withKeys:Do,withModifiers:Eo});function hd(e){return qe(e,5)}const cd=e=>[...new Set(e)],ud=e=>e||0===e?Array.isArray(e)?e:[e]:[],gd=Symbol("collapseContextKey"),pd=Symbol("tabsRootContextKey"),md=Symbol("uploadContextKey"),fd=i({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"}}),_d=["textContent"];const vd=r(s(Zi({name:"ElBadge",props:fd,setup(e,{expose:t}){const i=e,s=n("badge"),r=Pi((()=>i.isDot?"":o(i.value)&&o(i.max)&&i.max(Ln(),Vi("div",{class:bi(fi(s).b())},[On(e.$slots,"default"),qi(lo,{name:`${fi(s).namespace.value}-zoom-in-center`,persisted:""},{default:no((()=>[so(Wi("sup",{class:bi([fi(s).e("content"),fi(s).em("content",e.type),fi(s).is("fixed",!!e.$slots.default),fi(s).is("dot",e.isDot)]),textContent:yi(fi(r))},null,10,_d),[[Lo,!e.hidden&&(fi(r)||e.isDot)]])])),_:1},8,["name"])],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/badge/src/badge.vue"]]));var bd,Cd,wd,yd,Sd,xd,kd,Ld,Dd,Ed,Nd,Id,Td,Md,Od,Ad={beforeMount(e,t){let i,n=null;const o=()=>t.value&&t.value(),s=()=>{Date.now()-i<100&&o(),clearInterval(n),n=null};a(e,"mousedown",(e=>{0===e.button&&(i=Date.now(),l(document,"mouseup",s),clearInterval(n),n=setInterval(o,100))}))}},Rd=!1;function Pd(){if(!Rd){Rd=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),i=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(Id=/\b(iPhone|iP[ao]d)/.exec(e),Td=/\b(iP[ao]d)/.exec(e),Ed=/Android/i.exec(e),Md=/FBAN\/\w+;/i.exec(e),Od=/Mobile/i.exec(e),Nd=!!/Win64/.exec(e),t){(bd=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN)&&document&&document.documentMode&&(bd=document.documentMode);var n=/(?:Trident\/(\d+.\d+))/.exec(e);xd=n?parseFloat(n[1])+4:bd,Cd=t[2]?parseFloat(t[2]):NaN,wd=t[3]?parseFloat(t[3]):NaN,(yd=t[4]?parseFloat(t[4]):NaN)?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),Sd=t&&t[1]?parseFloat(t[1]):NaN):Sd=NaN}else bd=Cd=wd=Sd=yd=NaN;if(i){if(i[1]){var o=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);kd=!o||parseFloat(o[1].replace("_","."))}else kd=!1;Ld=!!i[2],Dd=!!i[3]}else kd=Ld=Dd=!1}}var Fd,Bd={ie:function(){return Pd()||bd},ieCompatibilityMode:function(){return Pd()||xd>bd},ie64:function(){return Bd.ie()&&Nd},firefox:function(){return Pd()||Cd},opera:function(){return Pd()||wd},webkit:function(){return Pd()||yd},safari:function(){return Bd.webkit()},chrome:function(){return Pd()||Sd},windows:function(){return Pd()||Ld},osx:function(){return Pd()||kd},linux:function(){return Pd()||Dd},iphone:function(){return Pd()||Id},mobile:function(){return Pd()||Id||Td||Ed||Od},nativeApp:function(){return Pd()||Md},android:function(){return Pd()||Ed},ipad:function(){return Pd()||Td}},Vd=Bd,Wd=!!(typeof window<"u"&&window.document&&window.document.createElement),Hd={canUseDOM:Wd,canUseWorkers:typeof Worker<"u",canUseEventListeners:Wd&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:Wd&&!!window.screen,isInWorker:!Wd};Hd.canUseDOM&&(Fd=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""));var zd=function(e,t){if(!Hd.canUseDOM||t&&!("addEventListener"in document))return!1;var i="on"+e,n=i in document;if(!n){var o=document.createElement("div");o.setAttribute(i,"return;"),n="function"==typeof o[i]}return!n&&Fd&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n};function jd(e){var t=0,i=0,n=0,o=0;return"detail"in e&&(i=e.detail),"wheelDelta"in e&&(i=-e.wheelDelta/120),"wheelDeltaY"in e&&(i=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=i,i=0),n=10*t,o=10*i,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||o)&&e.deltaMode&&(1==e.deltaMode?(n*=40,o*=40):(n*=800,o*=800)),n&&!t&&(t=n<1?-1:1),o&&!i&&(i=o<1?-1:1),{spinX:t,spinY:i,pixelX:n,pixelY:o}}jd.getEventType=function(){return Vd.firefox()?"DOMMouseScroll":zd("wheel")?"wheel":"mousewheel"};var Ud=jd; /** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @param {?boolean} capture Check if the capture phase is supported. * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */const $d={beforeMount(e,t){!function(e,t){if(e&&e.addEventListener){const i=function(e){const i=Ud(e);t&&Reflect.apply(t,this,[e,i])};e.addEventListener("wheel",i,{passive:!0})}}(e,t.value)}},Kd={modelValue:{type:Array,default:()=>[]},disabled:Boolean,min:{type:Number,default:void 0},max:{type:Number,default:void 0},size:d,id:{type:String,default:void 0},label:{type:String,default:void 0},fill:{type:String,default:void 0},textColor:{type:String,default:void 0},tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0}},qd={modelValue:{type:[Number,String,Boolean],default:()=>{}},label:{type:[String,Boolean,Number,Object]},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},controls:{type:String,default:void 0},border:Boolean,size:d,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0}},Gd=()=>{const e=an(h,{}),t=an(c,{}),i=an("CheckboxGroup",{}),n=Pi((()=>i&&"ElCheckboxGroup"===(null==i?void 0:i.name))),o=Pi((()=>t.size));return{isGroup:n,checkboxGroup:i,elForm:e,elFormItemSize:o,elFormItem:t}},Zd=(e,{model:t,isLimitExceeded:i,hasOwnLabel:n,isDisabled:o,isLabeledByFormItem:s})=>{const{elFormItem:r,checkboxGroup:a}=Gd(),{emit:l}=en();function d(t){var i,n;return t===e.trueLabel||!0===t?null==(i=e.trueLabel)||i:null!=(n=e.falseLabel)&&n}const h=Pi((()=>{var t;return(null==(t=a.validateEvent)?void 0:t.value)||e.validateEvent}));return Qn((()=>e.modelValue),(()=>{var e;h.value&&(null==(e=null==r?void 0:r.validate)||e.call(r,"change").catch((e=>f())))})),{handleChange:function(e){if(i.value)return;const t=e.target;l("change",d(t.checked),e)},onClickRoot:async function(r){i.value||n.value||o.value||!s.value||(t.value=d([!1,e.falseLabel].includes(t.value)),await gn(),function(e,t){l("change",d(e),t)}(t.value,r))}}},Yd={[g]:e=>No(e)||o(e)||p(e),change:e=>No(e)||o(e)||p(e)},Xd={[g]:e=>Io(e),change:e=>Io(e)},Qd=(e,t)=>{const{model:i,isGroup:n,isLimitExceeded:o,elFormItem:s}=(e=>{const t=ai(!1),{emit:i}=en(),{isGroup:n,checkboxGroup:o,elFormItem:s}=Gd(),r=ai(!1);return{model:Pi({get(){var i,s;return n.value?null==(i=o.modelValue)?void 0:i.value:null!=(s=e.modelValue)?s:t.value},set(e){var s;n.value&&Array.isArray(e)?(r.value=void 0!==o.max&&e.length>o.max.value,!1===r.value&&(null==(s=null==o?void 0:o.changeEvent)||s.call(o,e))):(i(g,e),t.value=e)}}),isGroup:n,isLimitExceeded:r,elFormItem:s}})(e),{focus:r,size:a,isChecked:l,checkboxSize:d,hasOwnLabel:h}=((e,t,{model:i})=>{const{isGroup:n,checkboxGroup:o}=Gd(),s=ai(!1),r=m(null==o?void 0:o.checkboxGroupSize,{prop:!0});return{isChecked:Pi((()=>{const t=i.value;return"[object Boolean]"===To(t)?t:Array.isArray(t)?t.includes(e.label):null!=t?t===e.trueLabel:!!t})),focus:s,size:r,checkboxSize:m(Pi((()=>{var e;return n.value?null==(e=null==o?void 0:o.checkboxGroupSize)?void 0:e.value:void 0}))),hasOwnLabel:Pi((()=>!(!t.default&&!e.label)))}})(e,t,{model:i}),{isDisabled:c}=((e,{model:t,isChecked:i})=>{const{elForm:n,isGroup:o,checkboxGroup:s}=Gd(),r=Pi((()=>{var e,n;const o=null==(e=s.max)?void 0:e.value,r=null==(n=s.min)?void 0:n.value;return!(!o&&!r)&&t.value.length>=o&&!i.value||t.value.length<=r&&i.value}));return{isDisabled:Pi((()=>{var t,i;const a=e.disabled||(null==n?void 0:n.disabled);return null!=(i=o.value?(null==(t=s.disabled)?void 0:t.value)||a||r.value:a)&&i})),isLimitDisabled:r}})(e,{model:i,isChecked:l}),{inputId:p,isLabeledByFormItem:f}=u(e,{formItemContext:s,disableIdGeneration:h,disableIdManagement:n}),{handleChange:_,onClickRoot:v}=Zd(e,{model:i,isLimitExceeded:o,hasOwnLabel:h,isDisabled:c,isLabeledByFormItem:f});return((e,{model:t})=>{e.checked&&(Array.isArray(t.value)&&!t.value.includes(e.label)?t.value.push(e.label):t.value=e.trueLabel||!0)})(e,{model:i}),{elFormItem:s,inputId:p,isLabeledByFormItem:f,isChecked:l,isDisabled:c,isGroup:n,checkboxSize:d,hasOwnLabel:h,model:i,handleChange:_,onClickRoot:v,focus:r,size:a}},Jd=["tabindex","role","aria-checked"],eh=["id","aria-hidden","name","tabindex","disabled","true-value","false-value"],th=["id","aria-hidden","disabled","value","name","tabindex"];var ih=s(Zi({name:"ElCheckbox",props:qd,emits:Yd,setup(e){const t=e,i=Gn(),{inputId:o,isLabeledByFormItem:s,isChecked:r,isDisabled:a,checkboxSize:l,hasOwnLabel:d,model:h,handleChange:c,onClickRoot:u,focus:g}=Qd(t,i),p=n("checkbox");return(e,t)=>(Ln(),Fi(Pn(!fi(d)&&fi(s)?"span":"label"),{class:bi([fi(p).b(),fi(p).m(fi(l)),fi(p).is("disabled",fi(a)),fi(p).is("bordered",e.border),fi(p).is("checked",fi(r))]),"aria-controls":e.indeterminate?e.controls:null,onClick:fi(u)},{default:no((()=>[Wi("span",{class:bi([fi(p).e("input"),fi(p).is("disabled",fi(a)),fi(p).is("checked",fi(r)),fi(p).is("indeterminate",e.indeterminate),fi(p).is("focus",fi(g))]),tabindex:e.indeterminate?0:void 0,role:e.indeterminate?"checkbox":void 0,"aria-checked":e.indeterminate?"mixed":void 0},[e.trueLabel||e.falseLabel?so((Ln(),Vi("input",{key:0,id:fi(o),"onUpdate:modelValue":t[0]||(t[0]=e=>ei(h)?h.value=e:null),class:bi(fi(p).e("original")),type:"checkbox","aria-hidden":e.indeterminate?"true":"false",name:e.name,tabindex:e.tabindex,disabled:fi(a),"true-value":e.trueLabel,"false-value":e.falseLabel,onChange:t[1]||(t[1]=(...e)=>fi(c)&&fi(c)(...e)),onFocus:t[2]||(t[2]=e=>g.value=!0),onBlur:t[3]||(t[3]=e=>g.value=!1)},null,42,eh)),[[wo,fi(h)]]):so((Ln(),Vi("input",{key:1,id:fi(o),"onUpdate:modelValue":t[4]||(t[4]=e=>ei(h)?h.value=e:null),class:bi(fi(p).e("original")),type:"checkbox","aria-hidden":e.indeterminate?"true":"false",disabled:fi(a),value:e.label,name:e.name,tabindex:e.tabindex,onChange:t[5]||(t[5]=(...e)=>fi(c)&&fi(c)(...e)),onFocus:t[6]||(t[6]=e=>g.value=!0),onBlur:t[7]||(t[7]=e=>g.value=!1)},null,42,th)),[[wo,fi(h)]]),Wi("span",{class:bi(fi(p).e("inner"))},null,2)],10,Jd),fi(d)?(Ln(),Vi("span",{key:0,class:bi(fi(p).e("label"))},[On(e.$slots,"default"),e.$slots.default?Bi("v-if",!0):(Ln(),Vi(Li,{key:0},[Ki(yi(e.label),1)],64))],2)):Bi("v-if",!0)])),_:3},8,["class","aria-controls","onClick"]))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/checkbox/src/checkbox.vue"]]);const nh=["name","tabindex","disabled","true-value","false-value"],oh=["name","tabindex","disabled","value"];var sh=s(Zi({name:"ElCheckboxButton",props:qd,emits:Yd,setup(e){const t=e,i=Gn(),{focus:o,isChecked:s,isDisabled:r,size:a,model:l,handleChange:d}=Qd(t,i),{checkboxGroup:h}=Gd(),c=n("checkbox"),u=Pi((()=>{var e,t,i,n;const o=null!=(t=null==(e=null==h?void 0:h.fill)?void 0:e.value)?t:"";return{backgroundColor:o,borderColor:o,color:null!=(n=null==(i=null==h?void 0:h.textColor)?void 0:i.value)?n:"",boxShadow:o?`-1px 0 0 0 ${o}`:void 0}}));return(e,t)=>(Ln(),Vi("label",{class:bi([fi(c).b("button"),fi(c).bm("button",fi(a)),fi(c).is("disabled",fi(r)),fi(c).is("checked",fi(s)),fi(c).is("focus",fi(o))])},[e.trueLabel||e.falseLabel?so((Ln(),Vi("input",{key:0,"onUpdate:modelValue":t[0]||(t[0]=e=>ei(l)?l.value=e:null),class:bi(fi(c).be("button","original")),type:"checkbox",name:e.name,tabindex:e.tabindex,disabled:fi(r),"true-value":e.trueLabel,"false-value":e.falseLabel,onChange:t[1]||(t[1]=(...e)=>fi(d)&&fi(d)(...e)),onFocus:t[2]||(t[2]=e=>o.value=!0),onBlur:t[3]||(t[3]=e=>o.value=!1)},null,42,nh)),[[wo,fi(l)]]):so((Ln(),Vi("input",{key:1,"onUpdate:modelValue":t[4]||(t[4]=e=>ei(l)?l.value=e:null),class:bi(fi(c).be("button","original")),type:"checkbox",name:e.name,tabindex:e.tabindex,disabled:fi(r),value:e.label,onChange:t[5]||(t[5]=(...e)=>fi(d)&&fi(d)(...e)),onFocus:t[6]||(t[6]=e=>o.value=!0),onBlur:t[7]||(t[7]=e=>o.value=!1)},null,42,oh)),[[wo,fi(l)]]),e.$slots.default||e.label?(Ln(),Vi("span",{key:2,class:bi(fi(c).be("button","inner")),style:wi(fi(s)?fi(u):void 0)},[On(e.$slots,"default",{},(()=>[Ki(yi(e.label),1)]))],6)):Bi("v-if",!0)],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/checkbox/src/checkbox-button.vue"]]);var rh=s(Zi({name:"ElCheckboxGroup",props:Kd,emits:Xd,setup(e,{emit:t}){const i=e,{elFormItem:o}=Gd(),{groupId:s,isLabeledByFormItem:r}=((e,{elFormItem:t})=>{const{inputId:i,isLabeledByFormItem:n}=u(e,{formItemContext:t});return{isLabeledByFormItem:n,groupId:i}})(i,{elFormItem:o}),a=m(),l=n("checkbox"),d=e=>{t(g,e),gn((()=>{t("change",e)}))},h=Pi({get:()=>i.modelValue,set(e){d(e)}});return En("CheckboxGroup",{name:"ElCheckboxGroup",modelValue:h,...pi(i),checkboxGroupSize:a,changeEvent:d}),Qn((()=>i.modelValue),(()=>{var e;i.validateEvent&&(null==(e=o.validate)||e.call(o,"change").catch((e=>f())))})),(e,t)=>(Ln(),Fi(Pn(e.tag),{id:fi(s),class:bi(fi(l).b("group")),role:"group","aria-label":fi(r)?void 0:e.label||"checkbox-group","aria-labelledby":fi(r)?fi(o).labelId:void 0},{default:no((()=>[On(e.$slots,"default")])),_:3},8,["id","class","aria-label","aria-labelledby"]))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/checkbox/src/checkbox-group.vue"]]);const ah=r(ih,{CheckboxButton:sh,CheckboxGroup:rh});_(sh);const lh=_(rh);var dh=Zi({name:"NodeContent",setup:()=>({ns:n("cascader-node")}),render(){const{ns:e}=this,{node:t,panel:i}=this.$parent,{data:n,label:o}=t,{renderLabelFn:s}=i;return on("span",{class:e.e("label")},s?s({node:t,data:n}):o)}}),hh=(e=>(e.CLICK="click",e.HOVER="hover",e))(hh||{});const ch=Symbol(),uh=Zi({name:"ElCascaderNode",components:{ElCheckbox:ah,ElRadio:v,NodeContent:dh,ElIcon:b,Check:Ze,Loading:Ye,ArrowRight:Xe},props:{node:{type:Object,required:!0},menuId:String},emits:["expand"],setup(e,{emit:t}){const i=an(ch),o=n("cascader-node"),s=Pi((()=>i.isHoverMenu)),r=Pi((()=>i.config.multiple)),a=Pi((()=>i.config.checkStrictly)),l=Pi((()=>{var e;return null==(e=i.checkedNodes[0])?void 0:e.uid})),d=Pi((()=>e.node.isDisabled)),h=Pi((()=>e.node.isLeaf)),c=Pi((()=>a.value&&!h.value||!d.value)),u=Pi((()=>p(i.expandingNode))),g=Pi((()=>a.value&&i.checkedNodes.some(p))),p=t=>{var i;const{level:n,uid:o}=e.node;return(null==(i=null==t?void 0:t.pathNodes[n-1])?void 0:i.uid)===o},m=()=>{u.value||i.expandNode(e.node)},f=t=>{const{node:n}=e;t!==n.checked&&i.handleCheckChange(n,t)},_=()=>{i.lazyLoad(e.node,(()=>{h.value||m()}))},v=()=>{const{node:t}=e;c.value&&!t.loading&&(t.loaded?m():_())},b=t=>{e.node.loaded?(f(t),!a.value&&m()):_()};return{panel:i,isHoverMenu:s,multiple:r,checkStrictly:a,checkedNodeId:l,isDisabled:d,isLeaf:h,expandable:c,inExpandingPath:u,inCheckedPath:g,ns:o,handleHoverExpand:e=>{s.value&&(v(),!h.value&&t("expand",e))},handleExpand:v,handleClick:()=>{s.value&&!h.value||(!h.value||d.value||a.value||r.value?v():b(!0))},handleCheck:b,handleSelectCheck:t=>{a.value?(f(t),e.node.loaded&&m()):b(t)}}}}),gh=["id","aria-haspopup","aria-owns","aria-expanded","tabindex"],ph=Wi("span",null,null,-1);var mh=s(Zi({name:"ElCascaderMenu",components:{Loading:Ye,ElIcon:b,ElScrollbar:C,ElCascaderNode:s(uh,[["render",function(e,t,i,n,o,s){const r=An("el-checkbox"),a=An("el-radio"),l=An("check"),d=An("el-icon"),h=An("node-content"),c=An("loading"),u=An("arrow-right");return Ln(),Vi("li",{id:`${e.menuId}-${e.node.uid}`,role:"menuitem","aria-haspopup":!e.isLeaf,"aria-owns":e.isLeaf?null:e.menuId,"aria-expanded":e.inExpandingPath,tabindex:e.expandable?-1:void 0,class:bi([e.ns.b(),e.ns.is("selectable",e.checkStrictly),e.ns.is("active",e.node.checked),e.ns.is("disabled",!e.expandable),e.inExpandingPath&&"in-active-path",e.inCheckedPath&&"in-checked-path"]),onMouseenter:t[2]||(t[2]=(...t)=>e.handleHoverExpand&&e.handleHoverExpand(...t)),onFocus:t[3]||(t[3]=(...t)=>e.handleHoverExpand&&e.handleHoverExpand(...t)),onClick:t[4]||(t[4]=(...t)=>e.handleClick&&e.handleClick(...t))},[Bi(" prefix "),e.multiple?(Ln(),Fi(r,{key:0,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:e.isDisabled,onClick:t[0]||(t[0]=Eo((()=>{}),["stop"])),"onUpdate:modelValue":e.handleSelectCheck},null,8,["model-value","indeterminate","disabled","onUpdate:modelValue"])):e.checkStrictly?(Ln(),Fi(a,{key:1,"model-value":e.checkedNodeId,label:e.node.uid,disabled:e.isDisabled,"onUpdate:modelValue":e.handleSelectCheck,onClick:t[1]||(t[1]=Eo((()=>{}),["stop"]))},{default:no((()=>[Bi("\n Add an empty element to avoid render label,\n do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485\n "),ph])),_:1},8,["model-value","label","disabled","onUpdate:modelValue"])):e.isLeaf&&e.node.checked?(Ln(),Fi(d,{key:2,class:bi(e.ns.e("prefix"))},{default:no((()=>[qi(l)])),_:1},8,["class"])):Bi("v-if",!0),Bi(" content "),qi(h),Bi(" postfix "),e.isLeaf?Bi("v-if",!0):(Ln(),Vi(Li,{key:3},[e.node.loading?(Ln(),Fi(d,{key:0,class:bi([e.ns.is("loading"),e.ns.e("postfix")])},{default:no((()=>[qi(c)])),_:1},8,["class"])):(Ln(),Fi(d,{key:1,class:bi(["arrow-right",e.ns.e("postfix")])},{default:no((()=>[qi(u)])),_:1},8,["class"]))],64))],42,gh)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/cascader-panel/src/node.vue"]])},props:{nodes:{type:Array,required:!0},index:{type:Number,required:!0}},setup(e){const t=en(),i=n("cascader-menu"),{t:o}=w(),s=y();let r=null,a=null;const l=an(ch),d=ai(null),h=Pi((()=>!e.nodes.length)),c=Pi((()=>!l.initialLoaded)),u=Pi((()=>`cascader-menu-${s}-${e.index}`)),g=()=>{a&&(clearTimeout(a),a=null)},p=()=>{d.value&&(d.value.innerHTML="",g())};return{ns:i,panel:l,hoverZone:d,isEmpty:h,isLoading:c,menuId:u,t:o,handleExpand:e=>{r=e.target},handleMouseMove:e=>{if(l.isHoverMenu&&r&&d.value)if(r.contains(e.target)){g();const i=t.vnode.el,{left:n}=i.getBoundingClientRect(),{offsetWidth:o,offsetHeight:s}=i,a=e.clientX-n,l=r.offsetTop,h=l+r.offsetHeight;d.value.innerHTML=`\n \n \n `}else a||(a=window.setTimeout(p,l.config.hoverThreshold))},clearHoverZone:p}}}),[["render",function(e,t,i,n,o,s){const r=An("el-cascader-node"),a=An("loading"),l=An("el-icon"),d=An("el-scrollbar");return Ln(),Fi(d,{key:e.menuId,tag:"ul",role:"menu",class:bi(e.ns.b()),"wrap-class":e.ns.e("wrap"),"view-class":[e.ns.e("list"),e.ns.is("empty",e.isEmpty)],onMousemove:e.handleMouseMove,onMouseleave:e.clearHoverZone},{default:no((()=>{var t;return[(Ln(!0),Vi(Li,null,Mn(e.nodes,(t=>(Ln(),Fi(r,{key:t.uid,node:t,"menu-id":e.menuId,onExpand:e.handleExpand},null,8,["node","menu-id","onExpand"])))),128)),e.isLoading?(Ln(),Vi("div",{key:0,class:bi(e.ns.e("empty-text"))},[qi(l,{size:"14",class:bi(e.ns.is("loading"))},{default:no((()=>[qi(a)])),_:1},8,["class"]),Ki(" "+yi(e.t("el.cascader.loading")),1)],2)):e.isEmpty?(Ln(),Vi("div",{key:1,class:bi(e.ns.e("empty-text"))},yi(e.t("el.cascader.noData")),3)):(null==(t=e.panel)?void 0:t.isHoverMenu)?(Ln(),Vi("svg",{key:2,ref:"hoverZone",class:bi(e.ns.e("hover-zone"))},null,2)):Bi("v-if",!0)]})),_:1},8,["class","wrap-class","view-class","onMousemove","onMouseleave"])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/cascader-panel/src/menu.vue"]]),fh=(e=>(e.CLICK="click",e.HOVER="hover",e))(fh||{});let _h=0;class vh{constructor(e,t,i,n=!1){this.data=e,this.config=t,this.parent=i,this.root=n,this.uid=_h++,this.checked=!1,this.indeterminate=!1,this.loading=!1;const{value:o,label:s,children:r}=t,a=e[r],l=(e=>{const t=[e];let{parent:i}=e;for(;i;)t.unshift(i),i=i.parent;return t})(this);this.level=n?0:i?i.level+1:1,this.value=e[o],this.label=e[s],this.pathNodes=l,this.pathValues=l.map((e=>e.value)),this.pathLabels=l.map((e=>e.label)),this.childrenData=a,this.children=(a||[]).map((e=>new vh(e,t,this))),this.loaded=!t.lazy||this.isLeaf||!S(a)}get isDisabled(){const{data:e,parent:t,config:i}=this,{disabled:n,checkStrictly:o}=i;return(Mo(n)?n(e,this):!!e[n])||!o&&(null==t?void 0:t.isDisabled)}get isLeaf(){const{data:e,config:t,childrenData:i,loaded:n}=this,{lazy:o,leaf:s}=t,r=Mo(s)?s(e,this):e[s];return x(r)?!(o&&!n)&&!(Array.isArray(i)&&i.length):!!r}get valueByOption(){return this.config.emitPath?this.pathValues:this.value}appendChild(e){const{childrenData:t,children:i}=this,n=new vh(e,this.config,this);return Array.isArray(t)?t.push(e):this.childrenData=[e],i.push(n),n}calcText(e,t){const i=e?this.pathLabels.join(t):this.label;return this.text=i,i}broadcast(e,...t){const i=`onParent${vi(e)}`;this.children.forEach((n=>{n&&(n.broadcast(e,...t),n[i]&&n[i](...t))}))}emit(e,...t){const{parent:i}=this,n=`onChild${vi(e)}`;i&&(i[n]&&i[n](...t),i.emit(e,...t))}onParentCheck(e){this.isDisabled||this.setCheckState(e)}onChildCheck(){const{children:e}=this,t=e.filter((e=>!e.isDisabled)),i=!!t.length&&t.every((e=>e.checked));this.setCheckState(i)}setCheckState(e){const t=this.children.length,i=this.children.reduce(((e,t)=>e+(t.checked?1:t.indeterminate?.5:0)),0);this.checked=this.loaded&&this.children.filter((e=>!e.isDisabled)).every((e=>e.loaded&&e.checked))&&e,this.indeterminate=this.loaded&&i!==t&&i>0}doCheck(e){if(this.checked===e)return;const{checkStrictly:t,multiple:i}=this.config;t||!i?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check"))}}const bh=(e,t)=>e.reduce(((e,i)=>(i.isLeaf?e.push(i):(!t&&e.push(i),e=e.concat(bh(i.children,t))),e)),[]);class Ch{constructor(e,t){this.config=t;const i=(e||[]).map((e=>new vh(e,this.config)));this.nodes=i,this.allNodes=bh(i,!1),this.leafNodes=bh(i,!0)}getNodes(){return this.nodes}getFlattedNodes(e){return e?this.leafNodes:this.allNodes}appendNode(e,t){const i=t?t.appendChild(e):new vh(e,this.config);t||this.nodes.push(i),this.allNodes.push(i),i.isLeaf&&this.leafNodes.push(i)}appendNodes(e,t){e.forEach((e=>this.appendNode(e,t)))}getNodeByValue(e,t=!1){if(!e&&0!==e)return null;return this.getFlattedNodes(t).find((t=>k(t.value,e)||k(t.pathValues,e)))||null}getSameNode(e){if(!e)return null;return this.getFlattedNodes(!1).find((({value:t,level:i})=>k(e.value,t)&&e.level===i))||null}}const wh={modelValue:[Number,String,Array],options:{type:Array,default:()=>[]},props:{type:Object,default:()=>({})}},yh={expandTrigger:fh.CLICK,multiple:!1,checkStrictly:!1,emitPath:!0,lazy:!1,lazyLoad:Oo,value:"value",label:"label",children:"children",leaf:"leaf",disabled:"disabled",hoverThreshold:500},Sh=e=>{if(!e)return 0;const t=e.id.split("-");return Number(t[t.length-2])};var xh=s(Zi({name:"ElCascaderPanel",components:{ElCascaderMenu:mh},props:{...wh,border:{type:Boolean,default:!0},renderLabel:Function},emits:[g,D,"close","expand-change"],setup(e,{emit:t,slots:i}){let o=!1;const s=n("cascader"),r=(e=>Pi((()=>({...yh,...e.props}))))(e);let a=null;const l=ai(!0),d=ai([]),h=ai(null),c=ai([]),u=ai(null),p=ai([]),m=Pi((()=>r.value.expandTrigger===fh.HOVER)),f=Pi((()=>e.renderLabel||i.default)),_=(e,t)=>{const i=r.value;(e=e||new vh({},i,void 0,!0)).loading=!0;i.lazyLoad(e,(i=>{const n=e,o=n.root?null:n;i&&(null==a||a.appendNodes(i,o)),n.loading=!1,n.loaded=!0,n.childrenData=n.childrenData||[],t&&t(i)}))},v=(e,i)=>{var n;const{level:o}=e,s=c.value.slice(0,o);let r;e.isLeaf?r=e.pathNodes[o-2]:(r=e,s.push(e.children)),(null==(n=u.value)?void 0:n.uid)!==(null==r?void 0:r.uid)&&(u.value=e,c.value=s,!i&&t("expand-change",(null==e?void 0:e.pathValues)||[]))},b=(e,i,n=!0)=>{const{checkStrictly:s,multiple:a}=r.value,l=p.value[0];o=!0,!a&&(null==l||l.doCheck(!1)),e.doCheck(i),x(),n&&!a&&!s&&t("close"),!n&&!a&&!s&&C(e)},C=e=>{e&&(e=e.parent,C(e),e&&v(e))},w=e=>null==a?void 0:a.getFlattedNodes(e),y=e=>{var t;return null==(t=w(e))?void 0:t.filter((e=>!1!==e.checked))},x=()=>{var e;const{checkStrictly:t,multiple:i}=r.value,n=((e,t)=>{const i=t.slice(0),n=i.map((e=>e.uid)),o=e.reduce(((e,t)=>{const o=n.indexOf(t.uid);return o>-1&&(e.push(t),i.splice(o,1),n.splice(o,1)),e}),[]);return o.push(...i),o})(p.value,y(!t)),o=n.map((e=>e.valueByOption));p.value=n,h.value=i?o:null!=(e=o[0])?e:null},O=(t=!1,i=!1)=>{const{modelValue:n}=e,{lazy:s,multiple:d,checkStrictly:c}=r.value,u=!c;var g;if(l.value&&!o&&(i||!k(n,h.value)))if(s&&!t){const e=cd(null!=(g=ud(n))&&g.length?Ge(g,1/0):[]).map((e=>null==a?void 0:a.getNodeByValue(e))).filter((e=>!!e&&!e.loaded&&!e.loading));e.length?e.forEach((e=>{_(e,(()=>O(!1,i)))})):O(!0,i)}else{const e=d?ud(n):[n],t=cd(e.map((e=>null==a?void 0:a.getNodeByValue(e,u))));A(t,!1),h.value=n}},A=(e,t=!0)=>{const{checkStrictly:i}=r.value,n=p.value,o=e.filter((e=>!!e&&(i||e.isLeaf))),s=null==a?void 0:a.getSameNode(u.value),l=t&&s||o[0];l?l.pathNodes.forEach((e=>v(e,!0))):u.value=null,n.forEach((e=>e.doCheck(!1))),o.forEach((e=>e.doCheck(!0))),p.value=o,gn(R)},R=()=>{E&&d.value.forEach((e=>{const t=null==e?void 0:e.$el;if(t){const e=t.querySelector(`.${s.namespace.value}-scrollbar__wrap`),i=t.querySelector(`.${s.b("node")}.${s.is("active")}`)||t.querySelector(`.${s.b("node")}.in-active-path`);N(e,i)}}))};return En(ch,si({config:r,expandingNode:u,checkedNodes:p,isHoverMenu:m,initialLoaded:l,renderLabelFn:f,lazyLoad:_,expandNode:v,handleCheckChange:b})),Qn([r,()=>e.options],(()=>{const{options:t}=e,i=r.value;o=!1,a=new Ch(t,i),c.value=[a.getNodes()],i.lazy&&S(e.options)?(l.value=!1,_(void 0,(e=>{e&&(a=new Ch(e,i),c.value=[a.getNodes()]),l.value=!0,O(!1,!0)}))):O(!1,!0)}),{deep:!0,immediate:!0}),Qn((()=>e.modelValue),(()=>{o=!1,O()})),Qn(h,(i=>{k(i,e.modelValue)||(t(g,i),t(D,i))})),_n((()=>d.value=[])),Cn((()=>!S(e.modelValue)&&O())),{ns:s,menuList:d,menus:c,checkedNodes:p,handleKeyDown:e=>{const t=e.target,{code:i}=e;switch(i){case I.up:case I.down:{e.preventDefault();const n=i===I.up?-1:1;T(M(t,n,`.${s.b("node")}[tabindex="-1"]`));break}case I.left:{e.preventDefault();const i=d.value[Sh(t)-1],n=null==i?void 0:i.$el.querySelector(`.${s.b("node")}[aria-expanded="true"]`);T(n);break}case I.right:{e.preventDefault();const i=d.value[Sh(t)+1],n=null==i?void 0:i.$el.querySelector(`.${s.b("node")}[tabindex="-1"]`);T(n);break}case I.enter:(e=>{if(!e)return;const t=e.querySelector("input");t?t.click():L(e)&&e.click()})(t)}},handleCheckChange:b,getFlattedNodes:w,getCheckedNodes:y,clearCheckedNodes:()=>{p.value.forEach((e=>e.doCheck(!1))),x()},calculateCheckedValue:x,scrollToExpandingNode:R}}}),[["render",function(e,t,i,n,o,s){const r=An("el-cascader-menu");return Ln(),Vi("div",{class:bi([e.ns.b("panel"),e.ns.is("bordered",e.border)]),onKeydown:t[0]||(t[0]=(...t)=>e.handleKeyDown&&e.handleKeyDown(...t))},[(Ln(!0),Vi(Li,null,Mn(e.menus,((t,i)=>(Ln(),Fi(r,{key:i,ref_for:!0,ref:t=>e.menuList[i]=t,index:i,nodes:[...t]},null,8,["index","nodes"])))),128))],34)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/cascader-panel/src/index.vue"]]);xh.install=e=>{e.component(xh.name,xh)};const kh={large:36,default:32,small:28},Lh={modifiers:[{name:"arrowPosition",enabled:!0,phase:"main",fn:({state:e})=>{const{modifiersData:t,placement:i}=e;["right","left","bottom","top"].includes(i)||(t.arrow.x=35)},requires:["arrow"]}]},Dh=Zi({name:"ElCascader",components:{ElCascaderPanel:xh,ElInput:O,ElTooltip:A,ElScrollbar:C,ElTag:R,ElIcon:b,CircleClose:Qe,Check:Ze,ArrowDown:Je},directives:{Clickoutside:P},props:{...wh,size:{type:String,validator:F},placeholder:{type:String},disabled:Boolean,clearable:Boolean,filterable:Boolean,filterMethod:{type:Function,default:(e,t)=>e.text.includes(t)},separator:{type:String,default:" / "},showAllLevels:{type:Boolean,default:!0},collapseTags:Boolean,collapseTagsTooltip:{type:Boolean,default:!1},debounce:{type:Number,default:300},beforeFilter:{type:Function,default:()=>!0},popperClass:{type:String,default:""},teleported:B.teleported,tagType:{...V.type,default:"info"},validateEvent:{type:Boolean,default:!0}},emits:[g,D,"focus","blur","visible-change","expand-change","remove-tag"],setup(e,{emit:t}){let i=0,o=0;const s=n("cascader"),r=n("input"),{t:a}=w(),l=an(h,{}),d=an(c,{}),u=ai(null),p=ai(null),_=ai(null),v=ai(null),b=ai(null),C=ai(!1),y=ai(!1),S=ai(!1),x=ai(""),k=ai(""),L=ai([]),N=ai([]),O=ai([]),A=ai(!1),R=Pi((()=>e.disabled||l.disabled)),P=Pi((()=>e.placeholder||a("el.cascader.placeholder"))),F=m(),B=Pi((()=>["small"].includes(F.value)?"small":"default")),V=Pi((()=>!!e.props.multiple)),j=Pi((()=>!e.filterable||V.value)),U=Pi((()=>V.value?k.value:x.value)),$=Pi((()=>{var e;return(null==(e=v.value)?void 0:e.checkedNodes)||[]})),K=Pi((()=>!(!e.clearable||R.value||S.value||!y.value)&&!!$.value.length)),q=Pi((()=>{const{showAllLevels:t,separator:i}=e,n=$.value;return n.length?V.value?" ":n[0].calcText(t,i):""})),G=Pi({get:()=>e.modelValue,set(i){var n;t(g,i),t(D,i),e.validateEvent&&(null==(n=d.validate)||n.call(d,"change").catch((e=>f())))}}),Z=Pi((()=>{var e,t;return null==(t=null==(e=u.value)?void 0:e.popperRef)?void 0:t.contentRef})),Y=i=>{var n,o,s;if(!R.value&&(i=null!=i?i:!C.value)!==C.value){if(C.value=i,null==(o=null==(n=p.value)?void 0:n.input)||o.setAttribute("aria-expanded",`${i}`),i)X(),gn(null==(s=v.value)?void 0:s.scrollToExpandingNode);else if(e.filterable){const{value:e}=q;x.value=e,k.value=e}t("visible-change",i)}},X=()=>{gn((()=>{var e;null==(e=u.value)||e.updatePopper()}))},Q=()=>{S.value=!1},J=t=>{const{showAllLevels:i,separator:n}=e;return{node:t,key:t.uid,text:t.calcText(i,n),hitState:!1,closable:!R.value&&!t.isDisabled,isCollapseTag:!1}},ee=e=>{var i;const n=e.node;n.doCheck(!1),null==(i=v.value)||i.calculateCheckedValue(),t("remove-tag",n.valueByOption)},te=()=>{var t,i;const{filterMethod:n,showAllLevels:o,separator:s}=e,r=null==(i=null==(t=v.value)?void 0:t.getFlattedNodes(!e.props.checkStrictly))?void 0:i.filter((e=>!e.isDisabled&&(e.calcText(o,s),n(e,U.value))));V.value&&(L.value.forEach((e=>{e.hitState=!1})),N.value.forEach((e=>{e.hitState=!1}))),S.value=!0,O.value=r,X()},ie=()=>{var e;let t;t=S.value&&b.value?b.value.$el.querySelector(`.${s.e("suggestion-item")}`):null==(e=v.value)?void 0:e.$el.querySelector(`.${s.b("node")}[tabindex="-1"]`),t&&(t.focus(),!S.value&&t.click())},ne=()=>{var e,t;const n=null==(e=p.value)?void 0:e.input,o=_.value,r=null==(t=b.value)?void 0:t.$el;if(E&&n){if(r){r.querySelector(`.${s.e("suggestion-list")}`).style.minWidth=`${n.offsetWidth}px`}if(o){const{offsetHeight:e}=o,t=L.value.length>0?`${Math.max(e+6,i)}px`:`${i}px`;n.style.height=t,X()}}},oe=W((()=>{const{value:t}=U;if(!t)return;const i=e.beforeFilter(t);Ao(i)?i.then(te).catch((()=>{})):!1!==i?te():Q()}),e.debounce),se=(e,t)=>{!C.value&&Y(!0),(null==t?void 0:t.isComposing)||(e?oe():Q())};return Qn(S,X),Qn([$,R],(()=>{if(!V.value)return;const t=$.value,i=[],n=[];if(t.forEach((e=>n.push(J(e)))),N.value=n,t.length){const[n,...o]=t,s=o.length;i.push(J(n)),s&&(e.collapseTags?i.push({key:-1,text:`+ ${s}`,closable:!1,isCollapseTag:!0}):o.forEach((e=>i.push(J(e)))))}L.value=i})),Qn(L,(()=>{gn((()=>ne()))})),Qn(q,(e=>x.value=e),{immediate:!0}),Cn((()=>{var e;const t=null==(e=p.value)?void 0:e.$el;i=(null==t?void 0:t.offsetHeight)||kh[F.value]||40,H(t,ne)})),{popperOptions:Lh,tooltipRef:u,popperPaneRef:Z,input:p,tagWrapper:_,panel:v,suggestionPanel:b,popperVisible:C,inputHover:y,inputPlaceholder:P,filtering:S,presentText:q,checkedValue:G,inputValue:x,searchInputValue:k,presentTags:L,allPresentTags:N,suggestions:O,isDisabled:R,isOnComposition:A,realSize:F,tagSize:B,multiple:V,readonly:j,clearBtnVisible:K,nsCascader:s,nsInput:r,t:a,togglePopperVisible:Y,hideSuggestionPanel:Q,deleteTag:ee,focusFirstNode:ie,getCheckedNodes:e=>{var t;return null==(t=v.value)?void 0:t.getCheckedNodes(e)},handleExpandChange:e=>{X(),t("expand-change",e)},handleKeyDown:e=>{if(!A.value)switch(e.code){case I.enter:Y();break;case I.down:Y(!0),gn(ie),e.preventDefault();break;case I.esc:!0===C.value&&(e.preventDefault(),e.stopPropagation(),Y(!1));break;case I.tab:Y(!1)}},handleComposition:e=>{var t;const i=null==(t=e.target)?void 0:t.value;if("compositionend"===e.type)A.value=!1,gn((()=>se(i)));else{const e=i[i.length-1]||"";A.value=!z(e)}},handleClear:()=>{var e;null==(e=v.value)||e.clearCheckedNodes(),Y(!1)},handleSuggestionClick:e=>{var t,i;const{checked:n}=e;V.value?null==(t=v.value)||t.handleCheckChange(e,!n,!1):(!n&&(null==(i=v.value)||i.handleCheckChange(e,!0,!1)),Y(!1))},handleSuggestionKeyDown:e=>{const t=e.target,{code:i}=e;switch(i){case I.up:case I.down:{const e=i===I.up?-1:1;T(M(t,e,`.${s.e("suggestion-item")}[tabindex="-1"]`));break}case I.enter:t.click()}},handleDelete:()=>{const e=L.value,t=e[e.length-1];o=k.value?0:o+1,t&&o&&(t.hitState?ee(t):t.hitState=!0)},handleInput:se}}}),Eh={key:0},Nh={class:"el-cascader__collapse-tags"},Ih=["placeholder"],Th=["onClick"];var Mh=s(Dh,[["render",function(e,t,i,n,o,s){const r=An("circle-close"),a=An("el-icon"),l=An("arrow-down"),d=An("el-input"),h=An("el-tag"),c=An("el-tooltip"),u=An("el-cascader-panel"),g=An("check"),p=An("el-scrollbar"),m=Rn("clickoutside");return Ln(),Fi(c,{ref:"tooltipRef",visible:e.popperVisible,"onUpdate:visible":t[17]||(t[17]=t=>e.popperVisible=t),teleported:e.teleported,"popper-class":[e.nsCascader.e("dropdown"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":["bottom-start","bottom","top-start","top","right","left"],"stop-popper-mouse-event":!1,"gpu-acceleration":!1,placement:"bottom-start",transition:`${e.nsCascader.namespace.value}-zoom-in-top`,effect:"light",pure:"",persistent:"",onHide:e.hideSuggestionPanel},{default:no((()=>[so((Ln(),Vi("div",{class:bi([e.nsCascader.b(),e.nsCascader.m(e.realSize),e.nsCascader.is("disabled",e.isDisabled),e.$attrs.class]),style:wi(e.$attrs.style),onClick:t[11]||(t[11]=()=>e.togglePopperVisible(!e.readonly||void 0)),onKeydown:t[12]||(t[12]=(...t)=>e.handleKeyDown&&e.handleKeyDown(...t)),onMouseenter:t[13]||(t[13]=t=>e.inputHover=!0),onMouseleave:t[14]||(t[14]=t=>e.inputHover=!1)},[qi(d,{ref:"input",modelValue:e.inputValue,"onUpdate:modelValue":t[1]||(t[1]=t=>e.inputValue=t),placeholder:e.searchInputValue?"":e.inputPlaceholder,readonly:e.readonly,disabled:e.isDisabled,"validate-event":!1,size:e.realSize,class:bi(e.nsCascader.is("focus",e.popperVisible)),onCompositionstart:e.handleComposition,onCompositionupdate:e.handleComposition,onCompositionend:e.handleComposition,onFocus:t[2]||(t[2]=t=>e.$emit("focus",t)),onBlur:t[3]||(t[3]=t=>e.$emit("blur",t)),onInput:e.handleInput},{suffix:no((()=>[e.clearBtnVisible?(Ln(),Fi(a,{key:"clear",class:bi([e.nsInput.e("icon"),"icon-circle-close"]),onClick:Eo(e.handleClear,["stop"])},{default:no((()=>[qi(r)])),_:1},8,["class","onClick"])):(Ln(),Fi(a,{key:"arrow-down",class:bi([e.nsInput.e("icon"),"icon-arrow-down",e.nsCascader.is("reverse",e.popperVisible)]),onClick:t[0]||(t[0]=Eo((t=>e.togglePopperVisible()),["stop"]))},{default:no((()=>[qi(l)])),_:1},8,["class"]))])),_:1},8,["modelValue","placeholder","readonly","disabled","size","class","onCompositionstart","onCompositionupdate","onCompositionend","onInput"]),e.multiple?(Ln(),Vi("div",{key:0,ref:"tagWrapper",class:bi(e.nsCascader.e("tags"))},[(Ln(!0),Vi(Li,null,Mn(e.presentTags,(t=>(Ln(),Fi(h,{key:t.key,type:e.tagType,size:e.tagSize,hit:t.hitState,closable:t.closable,"disable-transitions":"",onClose:i=>e.deleteTag(t)},{default:no((()=>[!1===t.isCollapseTag?(Ln(),Vi("span",Eh,yi(t.text),1)):(Ln(),Fi(c,{key:1,teleported:!1,disabled:e.popperVisible||!e.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],placement:"bottom",effect:"light"},{default:no((()=>[Wi("span",null,yi(t.text),1)])),content:no((()=>[Wi("div",Nh,[(Ln(!0),Vi(Li,null,Mn(e.allPresentTags,((t,i)=>(Ln(),Vi("div",{key:i,class:"el-cascader__collapse-tag"},[(Ln(),Fi(h,{key:t.key,class:"in-tooltip",type:e.tagType,size:e.tagSize,hit:t.hitState,closable:t.closable,"disable-transitions":"",onClose:i=>e.deleteTag(t)},{default:no((()=>[Wi("span",null,yi(t.text),1)])),_:2},1032,["type","size","hit","closable","onClose"]))])))),128))])])),_:2},1032,["disabled"]))])),_:2},1032,["type","size","hit","closable","onClose"])))),128)),e.filterable&&!e.isDisabled?so((Ln(),Vi("input",{key:0,"onUpdate:modelValue":t[4]||(t[4]=t=>e.searchInputValue=t),type:"text",class:bi(e.nsCascader.e("search-input")),placeholder:e.presentText?"":e.inputPlaceholder,onInput:t[5]||(t[5]=t=>e.handleInput(e.searchInputValue,t)),onClick:t[6]||(t[6]=Eo((t=>e.togglePopperVisible(!0)),["stop"])),onKeydown:t[7]||(t[7]=Do(((...t)=>e.handleDelete&&e.handleDelete(...t)),["delete"])),onCompositionstart:t[8]||(t[8]=(...t)=>e.handleComposition&&e.handleComposition(...t)),onCompositionupdate:t[9]||(t[9]=(...t)=>e.handleComposition&&e.handleComposition(...t)),onCompositionend:t[10]||(t[10]=(...t)=>e.handleComposition&&e.handleComposition(...t))},null,42,Ih)),[[ko,e.searchInputValue]]):Bi("v-if",!0)],2)):Bi("v-if",!0)],38)),[[m,()=>e.togglePopperVisible(!1),e.popperPaneRef]])])),content:no((()=>[so(qi(u,{ref:"panel",modelValue:e.checkedValue,"onUpdate:modelValue":t[15]||(t[15]=t=>e.checkedValue=t),options:e.options,props:e.props,border:!1,"render-label":e.$slots.default,onExpandChange:e.handleExpandChange,onClose:t[16]||(t[16]=t=>e.$nextTick((()=>e.togglePopperVisible(!1))))},null,8,["modelValue","options","props","render-label","onExpandChange"]),[[Lo,!e.filtering]]),e.filterable?so((Ln(),Fi(p,{key:0,ref:"suggestionPanel",tag:"ul",class:bi(e.nsCascader.e("suggestion-panel")),"view-class":e.nsCascader.e("suggestion-list"),onKeydown:e.handleSuggestionKeyDown},{default:no((()=>[e.suggestions.length?(Ln(!0),Vi(Li,{key:0},Mn(e.suggestions,(t=>(Ln(),Vi("li",{key:t.uid,class:bi([e.nsCascader.e("suggestion-item"),e.nsCascader.is("checked",t.checked)]),tabindex:-1,onClick:i=>e.handleSuggestionClick(t)},[Wi("span",null,yi(t.text),1),t.checked?(Ln(),Fi(a,{key:0},{default:no((()=>[qi(g)])),_:1})):Bi("v-if",!0)],10,Th)))),128)):On(e.$slots,"empty",{key:1},(()=>[Wi("li",{class:bi(e.nsCascader.e("empty-text"))},yi(e.t("el.cascader.noMatch")),3)]))])),_:3},8,["class","view-class","onKeydown"])),[[Lo,e.filtering]]):Bi("v-if",!0)])),_:3},8,["visible","teleported","popper-class","popper-options","transition","onHide"])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/cascader/src/index.vue"]]);Mh.install=e=>{e.component(Mh.name,Mh)};const Oh=Mh,Ah=e=>typeof o(e);var Rh=s(Zi({name:"ElCollapse",props:i({accordion:Boolean,modelValue:{type:j([Array,String,Number]),default:()=>U([])}}),emits:{[g]:Ah,[D]:Ah},setup(e,{expose:t,emit:i}){const o=e,s=n("collapse"),r=ai($(o.modelValue)),a=e=>{r.value=e;const t=o.accordion?r.value[0]:r.value;i(g,t),i(D,t)};return Qn((()=>o.modelValue),(()=>r.value=$(o.modelValue)),{deep:!0}),En(gd,{activeNames:r,handleItemClick:e=>{if(o.accordion)a([!r.value[0]&&0!==r.value[0]||r.value[0]!==e?e:""]);else{const t=[...r.value],i=t.indexOf(e);i>-1?t.splice(i,1):t.push(e),a(t)}}}),t({activeNames:r,setActiveNames:a}),(e,t)=>(Ln(),Vi("div",{class:bi(fi(s).b()),role:"tablist","aria-multiselectable":"true"},[On(e.$slots,"default")],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse.vue"]]);const Ph=i({title:{type:String,default:""},name:{type:j([String,Number]),default:()=>y()},disabled:Boolean}),Fh=["aria-expanded","aria-controls","aria-describedby"],Bh=["id","tabindex","onKeypress"],Vh=["id","aria-hidden","aria-labelledby"];var Wh=s(Zi({name:"ElCollapseItem",props:Ph,setup(e,{expose:t}){const i=e,o=an(gd),s=n("collapse"),r=ai(!1),a=ai(!1),l=ai(y()),d=Pi((()=>null==o?void 0:o.activeNames.value.includes(i.name))),h=()=>{setTimeout((()=>{a.value?a.value=!1:r.value=!0}),50)},c=()=>{i.disabled||(null==o||o.handleItemClick(i.name),r.value=!1,a.value=!0)},u=()=>{null==o||o.handleItemClick(i.name)};return t({isActive:d}),(e,t)=>(Ln(),Vi("div",{class:bi([fi(s).b("item"),fi(s).is("active",fi(d)),fi(s).is("disabled",e.disabled)])},[Wi("div",{role:"tab","aria-expanded":fi(d),"aria-controls":fi(s).b(`content-${l.value}`),"aria-describedby":fi(s).b(`content-${l.value}`)},[Wi("div",{id:fi(s).b(`head-${l.value}`),class:bi([fi(s).be("item","header"),fi(s).is("active",fi(d)),{focusing:r.value&&!e.disabled}]),role:"button",tabindex:e.disabled?-1:0,onClick:c,onKeypress:Do(Eo(u,["stop","prevent"]),["space","enter"]),onFocus:h,onBlur:t[0]||(t[0]=e=>r.value=!1)},[On(e.$slots,"title",{},(()=>[Ki(yi(e.title),1)])),qi(fi(b),{class:bi([fi(s).be("item","arrow"),fi(s).is("active",fi(d))])},{default:no((()=>[qi(fi(Xe))])),_:1},8,["class"])],42,Bh)],8,Fh),qi(fi(K),null,{default:no((()=>[so(Wi("div",{id:fi(s).b(`content-${l.value}`),class:bi(fi(s).be("item","wrap")),role:"tabpanel","aria-hidden":!fi(d),"aria-labelledby":fi(s).b(`head-${l.value}`)},[Wi("div",{class:bi(fi(s).be("item","content"))},[On(e.$slots,"default")],2)],10,Vh),[[Lo,fi(d)]])])),_:3})],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse-item.vue"]]);const Hh=r(Rh,{CollapseItem:Wh}),zh=_(Wh);let jh=!1;function Uh(e,t){if(!E)return;const i=function(e){var i;null==(i=t.drag)||i.call(t,e)},n=function(e){var o;q(document,"mousemove",i),q(document,"mouseup",n),q(document,"touchmove",i),q(document,"touchend",n),document.onselectstart=null,document.ondragstart=null,jh=!1,null==(o=t.end)||o.call(t,e)},o=function(e){var o;jh||(e.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,a(document,"mousemove",i),a(document,"mouseup",n),a(document,"touchmove",i),a(document,"touchend",n),jh=!0,null==(o=t.start)||o.call(t,e))};a(e,"mousedown",o),a(e,"touchstart",o)}var $h=s(Zi({name:"ElColorAlphaSlider",props:{color:{type:Object,required:!0},vertical:{type:Boolean,default:!1}},setup(e){const t=en(),i=hi(null),n=hi(null),o=ai(0),s=ai(0),r=ai(null);function a(n){const o=t.vnode.el.getBoundingClientRect(),{clientX:s,clientY:r}=G(n);if(e.vertical){let t=r-o.top;t=Math.max(i.value.offsetHeight/2,t),t=Math.min(t,o.height-i.value.offsetHeight/2),e.color.set("alpha",Math.round((t-i.value.offsetHeight/2)/(o.height-i.value.offsetHeight)*100))}else{let t=s-o.left;t=Math.max(i.value.offsetWidth/2,t),t=Math.min(t,o.width-i.value.offsetWidth/2),e.color.set("alpha",Math.round((t-i.value.offsetWidth/2)/(o.width-i.value.offsetWidth)*100))}}function l(){o.value=function(){if(e.vertical)return 0;const n=t.vnode.el,o=e.color.get("alpha");return n?Math.round(o*(n.offsetWidth-i.value.offsetWidth/2)/100):0}(),s.value=function(){const n=t.vnode.el;if(!e.vertical)return 0;const o=e.color.get("alpha");return n?Math.round(o*(n.offsetHeight-i.value.offsetHeight/2)/100):0}(),r.value=function(){if(e.color&&e.color.value){const{r:t,g:i,b:n}=e.color.toRgb();return`linear-gradient(to right, rgba(${t}, ${i}, ${n}, 0) 0%, rgba(${t}, ${i}, ${n}, 1) 100%)`}return null}()}return Qn((()=>e.color.get("alpha")),(()=>{l()})),Qn((()=>e.color.value),(()=>{l()})),Cn((()=>{const e={drag:e=>{a(e)},end:e=>{a(e)}};Uh(n.value,e),Uh(i.value,e),l()})),{thumb:i,bar:n,thumbLeft:o,thumbTop:s,background:r,handleClick:function(e){e.target!==i.value&&a(e)},update:l}}}),[["render",function(e,t,i,n,o,s){return Ln(),Vi("div",{class:bi(["el-color-alpha-slider",{"is-vertical":e.vertical}])},[Wi("div",{ref:"bar",class:"el-color-alpha-slider__bar",style:wi({background:e.background}),onClick:t[0]||(t[0]=(...t)=>e.handleClick&&e.handleClick(...t))},null,4),Wi("div",{ref:"thumb",class:"el-color-alpha-slider__thumb",style:wi({left:e.thumbLeft+"px",top:e.thumbTop+"px"})},null,4)],2)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/alpha-slider.vue"]]);var Kh=s(Zi({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(e){const t=en(),i=ai(null),n=ai(null),o=ai(0),s=ai(0),r=Pi((()=>e.color.get("hue")));function a(n){const o=t.vnode.el.getBoundingClientRect(),{clientX:s,clientY:r}=G(n);let a;if(e.vertical){let e=r-o.top;e=Math.min(e,o.height-i.value.offsetHeight/2),e=Math.max(i.value.offsetHeight/2,e),a=Math.round((e-i.value.offsetHeight/2)/(o.height-i.value.offsetHeight)*360)}else{let e=s-o.left;e=Math.min(e,o.width-i.value.offsetWidth/2),e=Math.max(i.value.offsetWidth/2,e),a=Math.round((e-i.value.offsetWidth/2)/(o.width-i.value.offsetWidth)*360)}e.color.set("hue",a)}function l(){o.value=function(){const n=t.vnode.el;if(e.vertical)return 0;const o=e.color.get("hue");return n?Math.round(o*(n.offsetWidth-i.value.offsetWidth/2)/360):0}(),s.value=function(){const n=t.vnode.el;if(!e.vertical)return 0;const o=e.color.get("hue");return n?Math.round(o*(n.offsetHeight-i.value.offsetHeight/2)/360):0}()}return Qn((()=>r.value),(()=>{l()})),Cn((()=>{const e={drag:e=>{a(e)},end:e=>{a(e)}};Uh(n.value,e),Uh(i.value,e),l()})),{bar:n,thumb:i,thumbLeft:o,thumbTop:s,hueValue:r,handleClick:function(e){e.target!==i.value&&a(e)},update:l}}}),[["render",function(e,t,i,n,o,s){return Ln(),Vi("div",{class:bi(["el-color-hue-slider",{"is-vertical":e.vertical}])},[Wi("div",{ref:"bar",class:"el-color-hue-slider__bar",onClick:t[0]||(t[0]=(...t)=>e.handleClick&&e.handleClick(...t))},null,512),Wi("div",{ref:"thumb",class:"el-color-hue-slider__thumb",style:wi({left:e.thumbLeft+"px",top:e.thumbTop+"px"})},null,4)],2)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/hue-slider.vue"]]);const qh=Symbol(),Gh=function(e,t,i){return[e,t*i/((e=(2-t)*i)<1?e:2-e)||0,e/2]},Zh=function(e,t){var i;"string"==typeof(i=e)&&i.includes(".")&&1===Number.parseFloat(i)&&(e="100%");const n=function(e){return"string"==typeof e&&e.includes("%")}(e);return e=Math.min(t,Math.max(0,Number.parseFloat(`${e}`))),n&&(e=Number.parseInt(""+e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/Number.parseFloat(t)},Yh={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Xh=function(e){e=Math.min(Math.round(e),255);const t=Math.floor(e/16),i=e%16;return`${Yh[t]||t}${Yh[i]||i}`},Qh=function({r:e,g:t,b:i}){return Number.isNaN(+e)||Number.isNaN(+t)||Number.isNaN(+i)?"":`#${Xh(e)}${Xh(t)}${Xh(i)}`},Jh={A:10,B:11,C:12,D:13,E:14,F:15},ec=function(e){return 2===e.length?16*(Jh[e[0].toUpperCase()]||+e[0])+(Jh[e[1].toUpperCase()]||+e[1]):Jh[e[1].toUpperCase()]||+e[1]},tc=function(e,t,i){e=Zh(e,255),t=Zh(t,255),i=Zh(i,255);const n=Math.max(e,t,i),o=Math.min(e,t,i);let s;const r=n,a=n-o,l=0===n?0:a/n;if(n===o)s=0;else{switch(n){case e:s=(t-i)/a+(t{this._hue=Math.max(0,Math.min(360,e)),this._saturation=Math.max(0,Math.min(100,t)),this._value=Math.max(0,Math.min(100,i)),this.doOnChange()};if(e.includes("hsl")){const i=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter((e=>""!==e)).map(((e,t)=>t>2?Number.parseFloat(e):Number.parseInt(e,10)));if(4===i.length?this._alpha=100*Number.parseFloat(i[3]):3===i.length&&(this._alpha=100),i.length>=3){const{h:e,s:n,v:o}=function(e,t,i){i/=100;let n=t/=100;const o=Math.max(i,.01);return t*=(i*=2)<=1?i:2-i,n*=o<=1?o:2-o,{h:e,s:100*(0===i?2*n/(o+n):2*t/(i+t)),v:(i+t)/2*100}}(i[0],i[1],i[2]);t(e,n,o)}}else if(e.includes("hsv")){const i=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter((e=>""!==e)).map(((e,t)=>t>2?Number.parseFloat(e):Number.parseInt(e,10)));4===i.length?this._alpha=100*Number.parseFloat(i[3]):3===i.length&&(this._alpha=100),i.length>=3&&t(i[0],i[1],i[2])}else if(e.includes("rgb")){const i=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter((e=>""!==e)).map(((e,t)=>t>2?Number.parseFloat(e):Number.parseInt(e,10)));if(4===i.length?this._alpha=100*Number.parseFloat(i[3]):3===i.length&&(this._alpha=100),i.length>=3){const{h:e,s:n,v:o}=tc(i[0],i[1],i[2]);t(e,n,o)}}else if(e.includes("#")){const i=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(i))return;let n,o,s;3===i.length?(n=ec(i[0]+i[0]),o=ec(i[1]+i[1]),s=ec(i[2]+i[2])):6!==i.length&&8!==i.length||(n=ec(i.slice(0,2)),o=ec(i.slice(2,4)),s=ec(i.slice(4,6))),8===i.length?this._alpha=ec(i.slice(6))/255*100:3!==i.length&&6!==i.length||(this._alpha=100);const{h:r,s:a,v:l}=tc(n,o,s);t(r,a,l)}}compare(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1}doOnChange(){const{_hue:e,_saturation:t,_value:i,_alpha:n,format:o}=this;if(this.enableAlpha)switch(o){case"hsl":{const n=Gh(e,t/100,i/100);this.value=`hsla(${e}, ${Math.round(100*n[1])}%, ${Math.round(100*n[2])}%, ${this.get("alpha")/100})`;break}case"hsv":this.value=`hsva(${e}, ${Math.round(t)}%, ${Math.round(i)}%, ${this.get("alpha")/100})`;break;case"hex":this.value=`${Qh(ic(e,t,i))}${Xh(255*n/100)}`;break;default:{const{r:n,g:o,b:s}=ic(e,t,i);this.value=`rgba(${n}, ${o}, ${s}, ${this.get("alpha")/100})`}}else switch(o){case"hsl":{const n=Gh(e,t/100,i/100);this.value=`hsl(${e}, ${Math.round(100*n[1])}%, ${Math.round(100*n[2])}%)`;break}case"hsv":this.value=`hsv(${e}, ${Math.round(t)}%, ${Math.round(i)}%)`;break;case"rgb":{const{r:n,g:o,b:s}=ic(e,t,i);this.value=`rgb(${n}, ${o}, ${s})`;break}default:this.value=Qh(ic(e,t,i))}}}const oc=Zi({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0}},setup(e){const{currentColor:t}=an(qh),i=ai(n(e.colors,e.color));function n(e,t){return e.map((e=>{const i=new nc;return i.enableAlpha=!0,i.format="rgba",i.fromString(e),i.selected=i.value===t.value,i}))}return Qn((()=>t.value),(e=>{const t=new nc;t.fromString(e),i.value.forEach((e=>{e.selected=t.compare(e)}))})),Jn((()=>{i.value=n(e.colors,e.color)})),{rgbaColors:i,handleSelect:function(t){e.color.fromString(e.colors[t])}}}}),sc={class:"el-color-predefine"},rc={class:"el-color-predefine__colors"},ac=["onClick"];var lc=s(oc,[["render",function(e,t,i,n,o,s){return Ln(),Vi("div",sc,[Wi("div",rc,[(Ln(!0),Vi(Li,null,Mn(e.rgbaColors,((t,i)=>(Ln(),Vi("div",{key:e.colors[i],class:bi(["el-color-predefine__color-selector",{selected:t.selected,"is-alpha":t._alpha<100}]),onClick:t=>e.handleSelect(i)},[Wi("div",{style:wi({backgroundColor:t.value})},null,4)],10,ac)))),128))])])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/predefine.vue"]]);const dc=Zi({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(e){const t=en(),i=ai(0),n=ai(0),o=ai("hsl(0, 100%, 50%)"),s=Pi((()=>({hue:e.color.get("hue"),value:e.color.get("value")})));function r(){const s=e.color.get("saturation"),r=e.color.get("value"),a=t.vnode.el,{clientWidth:l,clientHeight:d}=a;n.value=s*l/100,i.value=(100-r)*d/100,o.value=`hsl(${e.color.get("hue")}, 100%, 50%)`}function a(o){const s=t.vnode.el.getBoundingClientRect(),{clientX:r,clientY:a}=G(o);let l=r-s.left,d=a-s.top;l=Math.max(0,l),l=Math.min(l,s.width),d=Math.max(0,d),d=Math.min(d,s.height),n.value=l,i.value=d,e.color.set({saturation:l/s.width*100,value:100-d/s.height*100})}return Qn((()=>s.value),(()=>{r()})),Cn((()=>{Uh(t.vnode.el,{drag:e=>{a(e)},end:e=>{a(e)}}),r()})),{cursorTop:i,cursorLeft:n,background:o,colorValue:s,handleDrag:a,update:r}}}),hc=Wi("div",{class:"el-color-svpanel__white"},null,-1),cc=Wi("div",{class:"el-color-svpanel__black"},null,-1),uc=[Wi("div",null,null,-1)];const gc=Zi({name:"ElColorPicker",components:{ElButton:Z,ElTooltip:A,ElInput:O,ElIcon:b,Close:et,ArrowDown:Je,SvPanel:s(dc,[["render",function(e,t,i,n,o,s){return Ln(),Vi("div",{class:"el-color-svpanel",style:wi({backgroundColor:e.background})},[hc,cc,Wi("div",{class:"el-color-svpanel__cursor",style:wi({top:e.cursorTop+"px",left:e.cursorLeft+"px"})},uc,4)],4)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/sv-panel.vue"]]),HueSlider:Kh,AlphaSlider:$h,Predefine:lc},directives:{ClickOutside:P},props:{modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:{type:String,validator:F},popperClass:String,label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},predefine:Array,validateEvent:{type:Boolean,default:!0}},emits:["change","active-change",g],setup(e,{emit:t}){const{t:i}=w(),o=n("color"),s=an(h,{}),r=an(c,{}),{inputId:a,isLabeledByFormItem:l}=u(e,{formItemContext:r}),d=ai(),p=ai(),_=ai(),v=ai(null);let b=!0;const C=si(new nc({enableAlpha:e.showAlpha,format:e.colorFormat||"",value:e.modelValue})),y=ai(!1),S=ai(!1),x=ai(""),k=Pi((()=>e.modelValue||S.value?function(e,t){if(!(e instanceof nc))throw new TypeError("color should be instance of _color Class");const{r:i,g:n,b:o}=e.toRgb();return t?`rgba(${i}, ${n}, ${o}, ${e.get("alpha")/100})`:`rgb(${i}, ${n}, ${o})`}(C,e.showAlpha):"transparent")),L=m(),D=Pi((()=>!(!e.disabled&&!s.disabled))),E=Pi((()=>e.modelValue||S.value?C.value:"")),N=Pi((()=>l.value?void 0:e.label||i("el.colorpicker.defaultLabel"))),I=Pi((()=>l.value?r.labelId:void 0));Qn((()=>e.modelValue),(e=>{e?e&&e!==C.value&&(b=!1,C.fromString(e)):S.value=!1})),Qn((()=>E.value),(e=>{x.value=e,b&&t("active-change",e),b=!0})),Qn((()=>C.value),(()=>{e.modelValue||S.value||(S.value=!0)}));const T=W((function(e){y.value=e}),100);function M(){gn((()=>{e.modelValue?C.fromString(e.modelValue):(C.value="",gn((()=>{S.value=!1})))}))}return Cn((()=>{e.modelValue&&(x.value=E.value)})),Qn((()=>y.value),(()=>{gn((()=>{var e,t,i;null==(e=d.value)||e.update(),null==(t=p.value)||t.update(),null==(i=_.value)||i.update()}))})),En(qh,{currentColor:E}),{color:C,colorDisabled:D,colorSize:L,displayedColor:k,showPanelColor:S,showPicker:y,customInput:x,buttonId:a,buttonAriaLabel:N,buttonAriaLabelledby:I,handleConfirm:function(){C.fromString(x.value)},hide:function(){T(!1),M()},handleTrigger:function(){D.value||T(!y.value)},clear:function(){var i;T(!1),t(g,null),t("change",null),null!==e.modelValue&&e.validateEvent&&(null==(i=r.validate)||i.call(r,"change").catch((e=>f()))),M()},confirmValue:function(){var i;const n=C.value;t(g,n),t("change",n),e.validateEvent&&(null==(i=r.validate)||i.call(r,"change").catch((e=>f()))),T(!1),gn((()=>{const t=new nc({enableAlpha:e.showAlpha,format:e.colorFormat||"",value:e.modelValue});C.compare(t)||M()}))},t:i,ns:o,hue:d,svPanel:p,alpha:_,popper:v}}}),pc=["id","aria-label","aria-labelledby","aria-description","tabindex"];var mc=s(gc,[["render",function(e,t,i,n,o,s){const r=An("hue-slider"),a=An("sv-panel"),l=An("alpha-slider"),d=An("predefine"),h=An("el-input"),c=An("el-button"),u=An("arrow-down"),g=An("el-icon"),p=An("close"),m=An("el-tooltip"),f=Rn("click-outside");return Ln(),Fi(m,{ref:"popper",visible:e.showPicker,"onUpdate:visible":t[3]||(t[3]=t=>e.showPicker=t),"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[e.ns.be("picker","panel"),e.ns.b("dropdown"),e.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",transition:"el-zoom-in-top",persistent:""},{content:no((()=>[so((Ln(),Vi("div",null,[Wi("div",{class:bi(e.ns.be("dropdown","main-wrapper"))},[qi(r,{ref:"hue",class:"hue-slider",color:e.color,vertical:""},null,8,["color"]),qi(a,{ref:"svPanel",color:e.color},null,8,["color"])],2),e.showAlpha?(Ln(),Fi(l,{key:0,ref:"alpha",color:e.color},null,8,["color"])):Bi("v-if",!0),e.predefine?(Ln(),Fi(d,{key:1,ref:"predefine",color:e.color,colors:e.predefine},null,8,["color","colors"])):Bi("v-if",!0),Wi("div",{class:bi(e.ns.be("dropdown","btns"))},[Wi("span",{class:bi(e.ns.be("dropdown","value"))},[qi(h,{modelValue:e.customInput,"onUpdate:modelValue":t[0]||(t[0]=t=>e.customInput=t),"validate-event":!1,size:"small",onKeyup:Do(e.handleConfirm,["enter"]),onBlur:e.handleConfirm},null,8,["modelValue","onKeyup","onBlur"])],2),qi(c,{class:bi(e.ns.be("dropdown","link-btn")),text:"",size:"small",onClick:e.clear},{default:no((()=>[Ki(yi(e.t("el.colorpicker.clear")),1)])),_:1},8,["class","onClick"]),qi(c,{plain:"",size:"small",class:bi(e.ns.be("dropdown","btn")),onClick:e.confirmValue},{default:no((()=>[Ki(yi(e.t("el.colorpicker.confirm")),1)])),_:1},8,["class","onClick"])],2)])),[[f,e.hide]])])),default:no((()=>[Wi("div",{id:e.buttonId,class:bi([e.ns.b("picker"),e.ns.is("disabled",e.colorDisabled),e.ns.bm("picker",e.colorSize)]),role:"button","aria-label":e.buttonAriaLabel,"aria-labelledby":e.buttonAriaLabelledby,"aria-description":e.t("el.colorpicker.description",{color:e.modelValue||""}),tabindex:e.tabindex,onKeydown:t[2]||(t[2]=Do(((...t)=>e.handleTrigger&&e.handleTrigger(...t)),["enter"]))},[e.colorDisabled?(Ln(),Vi("div",{key:0,class:bi(e.ns.be("picker","mask"))},null,2)):Bi("v-if",!0),Wi("div",{class:bi(e.ns.be("picker","trigger")),onClick:t[1]||(t[1]=(...t)=>e.handleTrigger&&e.handleTrigger(...t))},[Wi("span",{class:bi([e.ns.be("picker","color"),e.ns.is("alpha",e.showAlpha)])},[Wi("span",{class:bi(e.ns.be("picker","color-inner")),style:wi({backgroundColor:e.displayedColor})},[so(qi(g,{class:bi([e.ns.be("picker","icon"),e.ns.is("icon-arrow-down")])},{default:no((()=>[qi(u)])),_:1},8,["class"]),[[Lo,e.modelValue||e.showPanelColor]]),e.modelValue||e.showPanelColor?Bi("v-if",!0):(Ln(),Fi(g,{key:0,class:bi([e.ns.be("picker","empty"),e.ns.is("icon-close")])},{default:no((()=>[qi(p)])),_:1},8,["class"]))],6)],2)],2)],42,pc)])),_:1},8,["visible","popper-class"])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/index.vue"]]);mc.install=e=>{e.component(mc.name,mc)};const fc=mc;var _c=s(Zi({name:"ElContainer",props:{direction:{type:String}},setup(e){const t=e,i=Gn(),o=n("container"),s=Pi((()=>{if("vertical"===t.direction)return!0;if("horizontal"===t.direction)return!1;if(i&&i.default){return i.default().some((e=>{const t=e.type.name;return"ElHeader"===t||"ElFooter"===t}))}return!1}));return(e,t)=>(Ln(),Vi("section",{class:bi([fi(o).b(),fi(o).is("vertical",fi(s))])},[On(e.$slots,"default")],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/container/src/container.vue"]]);var vc=s(Zi({name:"ElAside",props:{width:{type:String,default:null}},setup(e){const t=e,i=n("aside"),o=Pi((()=>t.width?i.cssVarBlock({width:t.width}):{}));return(e,t)=>(Ln(),Vi("aside",{class:bi(fi(i).b()),style:wi(fi(o))},[On(e.$slots,"default")],6))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/container/src/aside.vue"]]);var bc=s(Zi({name:"ElFooter",props:{height:{type:String,default:null}},setup(e){const t=e,i=n("footer"),o=Pi((()=>t.height?i.cssVarBlock({height:t.height}):{}));return(e,t)=>(Ln(),Vi("footer",{class:bi(fi(i).b()),style:wi(fi(o))},[On(e.$slots,"default")],6))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/container/src/footer.vue"]]);var Cc=s(Zi({name:"ElHeader",props:{height:{type:String,default:null}},setup(e){const t=e,i=n("header"),o=Pi((()=>t.height?i.cssVarBlock({height:t.height}):{}));return(e,t)=>(Ln(),Vi("header",{class:bi(fi(i).b()),style:wi(fi(o))},[On(e.$slots,"default")],6))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/container/src/header.vue"]]);var wc=s(Zi({name:"ElMain",setup(e){const t=n("main");return(e,i)=>(Ln(),Vi("main",{class:bi(fi(t).b())},[On(e.$slots,"default")],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/container/src/main.vue"]]);const yc=r(_c,{Aside:vc,Footer:bc,Header:Cc,Main:wc}),Sc=_(vc);_(bc);const xc=_(Cc),kc=_(wc),Lc=i({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,disabled:Boolean,size:d,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:e=>null===e||o(e)||["min","max"].includes(e),default:null},name:String,label:String,placeholder:String,precision:{type:Number,validator:e=>e>=0&&e===Number.parseInt(`${e}`,10)},validateEvent:{type:Boolean,default:!0}}),Dc=["aria-label","onKeydown"],Ec=["aria-label","onKeydown"];const Nc=r(s(Zi({name:"ElInputNumber",props:Lc,emits:{[D]:(e,t)=>e!==t,blur:e=>e instanceof FocusEvent,focus:e=>e instanceof FocusEvent,[Y]:e=>o(e)||X(e),[g]:e=>o(e)||X(e)},setup(e,{expose:t,emit:i}){const s=e,{t:r}=w(),a=n("input-number"),l=ai(),d=si({currentValue:s.modelValue,userInput:null}),{formItem:h}=Q(),c=Pi((()=>o(s.modelValue)&&k(s.modelValue,-1)o(s.modelValue)&&k(s.modelValue)>s.max)),g=Pi((()=>{const e=S(s.step);return x(s.precision)?Math.max(S(s.modelValue),e):(s.precision,s.precision)})),p=Pi((()=>s.controls&&"right"===s.controlsPosition)),_=m(),v=J(),C=Pi((()=>{if(null!==d.userInput)return d.userInput;let e=d.currentValue;if(X(e))return"";if(o(e)){if(Number.isNaN(e))return"";x(s.precision)||(e=e.toFixed(s.precision))}return e})),y=(e,t)=>{if(x(t)&&(t=g.value),0===t)return Math.round(e);let i=String(e);const n=i.indexOf(".");if(-1===n)return e;if(!i.replace(".","").split("")[n+t])return e;const o=i.length;return"5"===i.charAt(o-1)&&(i=`${i.slice(0,Math.max(0,o-1))}6`),Number.parseFloat(Number(i).toFixed(t))},S=e=>{if(X(e))return 0;const t=e.toString(),i=t.indexOf(".");let n=0;return-1!==i&&(n=t.length-i-1),n},k=(e,t=1)=>o(e)?y(e+s.step*t):d.currentValue,L=()=>{if(v.value||u.value)return;const e=s.modelValue||0,t=k(e);N(t)},D=()=>{if(v.value||c.value)return;const e=s.modelValue||0,t=k(e,-1);N(t)},E=(e,t)=>{const{max:n,min:o,step:r,precision:a,stepStrictly:l,valueOnClear:d}=s;let h=Number(e);if(X(e)||Number.isNaN(h))return null;if(""===e){if(null===d)return null;h=No(d)?{min:o,max:n}[d]:d}return l&&(h=y(Math.round(h/r)*r,a)),x(a)||(h=y(h,a)),(h>n||hn?n:o,t&&i("update:modelValue",h)),h},N=e=>{var t;const n=d.currentValue,o=E(e);n!==o&&(d.userInput=null,i("update:modelValue",o),i("input",o),i("change",o,n),s.validateEvent&&(null==(t=null==h?void 0:h.validate)||t.call(h,"change").catch((e=>f()))),d.currentValue=o)},I=e=>d.userInput=e,T=e=>{const t=""!==e?Number(e):"";(o(t)&&!Number.isNaN(t)||""===e)&&N(t),d.userInput=null},M=e=>{i("focus",e)},A=e=>{var t;i("blur",e),s.validateEvent&&(null==(t=null==h?void 0:h.validate)||t.call(h,"blur").catch((e=>f())))};return Qn((()=>s.modelValue),(e=>{d.currentValue=E(e,!0),d.userInput=null}),{immediate:!0}),Cn((()=>{var e;const{min:t,max:n,modelValue:r}=s,a=null==(e=l.value)?void 0:e.input;if(a.setAttribute("role","spinbutton"),Number.isFinite(n)?a.setAttribute("aria-valuemax",String(n)):a.removeAttribute("aria-valuemax"),Number.isFinite(t)?a.setAttribute("aria-valuemin",String(t)):a.removeAttribute("aria-valuemin"),a.setAttribute("aria-valuenow",String(d.currentValue)),a.setAttribute("aria-disabled",String(v.value)),!o(r)&&null!=r){let e=Number(r);Number.isNaN(e)&&(e=null),i("update:modelValue",e)}})),kn((()=>{var e;const t=null==(e=l.value)?void 0:e.input;null==t||t.setAttribute("aria-valuenow",`${d.currentValue}`)})),t({focus:()=>{var e,t;null==(t=null==(e=l.value)?void 0:e.focus)||t.call(e)},blur:()=>{var e,t;null==(t=null==(e=l.value)?void 0:e.blur)||t.call(e)}}),(e,t)=>(Ln(),Vi("div",{class:bi([fi(a).b(),fi(a).m(fi(_)),fi(a).is("disabled",fi(v)),fi(a).is("without-controls",!e.controls),fi(a).is("controls-right",fi(p))]),onDragstart:t[0]||(t[0]=Eo((()=>{}),["prevent"]))},[e.controls?so((Ln(),Vi("span",{key:0,role:"button","aria-label":fi(r)("el.inputNumber.decrease"),class:bi([fi(a).e("decrease"),fi(a).is("disabled",fi(c))]),onKeydown:Do(D,["enter"])},[qi(fi(b),null,{default:no((()=>[fi(p)?(Ln(),Fi(fi(Je),{key:0})):(Ln(),Fi(fi(tt),{key:1}))])),_:1})],42,Dc)),[[fi(Ad),D]]):Bi("v-if",!0),e.controls?so((Ln(),Vi("span",{key:1,role:"button","aria-label":fi(r)("el.inputNumber.increase"),class:bi([fi(a).e("increase"),fi(a).is("disabled",fi(u))]),onKeydown:Do(L,["enter"])},[qi(fi(b),null,{default:no((()=>[fi(p)?(Ln(),Fi(fi(it),{key:0})):(Ln(),Fi(fi(nt),{key:1}))])),_:1})],42,Ec)),[[fi(Ad),L]]):Bi("v-if",!0),qi(fi(O),{id:e.id,ref_key:"input",ref:l,type:"number",step:e.step,"model-value":fi(C),placeholder:e.placeholder,disabled:fi(v),size:fi(_),max:e.max,min:e.min,name:e.name,label:e.label,"validate-event":!1,onKeydown:[Do(Eo(L,["prevent"]),["up"]),Do(Eo(D,["prevent"]),["down"])],onBlur:A,onFocus:M,onInput:I,onChange:T},null,8,["id","step","model-value","placeholder","disabled","size","max","min","name","label","onKeydown"])],34))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/input-number/src/input-number.vue"]]));const Ic=r(s(Zi({name:"ElPopconfirm",props:i({title:String,confirmButtonText:String,cancelButtonText:String,confirmButtonType:{type:String,values:ee,default:"primary"},cancelButtonType:{type:String,values:ee,default:"text"},icon:{type:te,default:ot},iconColor:{type:String,default:"#f90"},hideIcon:{type:Boolean,default:!1},hideAfter:{type:Number,default:200},onConfirm:{type:j(Function)},onCancel:{type:j(Function)},teleported:B.teleported,persistent:B.persistent}),setup(e){const t=e,{t:i}=w(),o=n("popconfirm"),s=ai(),r=()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.onClose)||t.call(e)},a=e=>{var i;null==(i=t.onConfirm)||i.call(t,e),r()},l=e=>{var i;null==(i=t.onCancel)||i.call(t,e),r()},d=Pi((()=>t.confirmButtonText||i("el.popconfirm.confirmButtonText"))),h=Pi((()=>t.cancelButtonText||i("el.popconfirm.cancelButtonText")));return(e,t)=>(Ln(),Fi(fi(A),{ref_key:"tooltipRef",ref:s,trigger:"click",effect:"light","popper-class":`${fi(o).namespace.value}-popover`,teleported:e.teleported,"fallback-placements":["bottom","top","right","left"],"hide-after":e.hideAfter,persistent:e.persistent},{content:no((()=>[Wi("div",{class:bi(fi(o).b())},[Wi("div",{class:bi(fi(o).e("main"))},[!e.hideIcon&&e.icon?(Ln(),Fi(fi(b),{key:0,class:bi(fi(o).e("icon")),style:wi({color:e.iconColor})},{default:no((()=>[(Ln(),Fi(Pn(e.icon)))])),_:1},8,["class","style"])):Bi("v-if",!0),Ki(" "+yi(e.title),1)],2),Wi("div",{class:bi(fi(o).e("action"))},[qi(fi(Z),{size:"small",type:"text"===e.cancelButtonType?"":e.cancelButtonType,text:"text"===e.cancelButtonType,onClick:l},{default:no((()=>[Ki(yi(fi(h)),1)])),_:1},8,["type","text"]),qi(fi(Z),{size:"small",type:"text"===e.confirmButtonType?"":e.confirmButtonType,text:"text"===e.confirmButtonType,onClick:a},{default:no((()=>[Ki(yi(fi(d)),1)])),_:1},8,["type","text"])],2)],2)])),default:no((()=>[e.$slots.reference?On(e.$slots,"reference",{key:0}):Bi("v-if",!0)])),_:3},8,["popper-class","teleported","hide-after","persistent"]))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/popconfirm/src/popconfirm.vue"]])),Tc=i({type:{type:String,default:"line",values:["line","circle","dashboard"]},percentage:{type:Number,default:0,validator:e=>e>=0&&e<=100},status:{type:String,default:"",values:["","success","exception","warning"]},indeterminate:{type:Boolean,default:!1},duration:{type:Number,default:3},strokeWidth:{type:Number,default:6},strokeLinecap:{type:j(String),default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:j([String,Array,Function]),default:""},format:{type:j(Function),default:e=>`${e}%`}}),Mc=["aria-valuenow"],Oc={viewBox:"0 0 100 100"},Ac=["d","stroke","stroke-width"],Rc=["d","stroke","opacity","stroke-linecap","stroke-width"],Pc={key:0};const Fc=r(s(Zi({name:"ElProgress",props:Tc,setup(e){const t=e,i={success:"#13ce66",exception:"#ff4949",warning:"#e6a23c",default:"#20a0ff"},o=n("progress"),s=Pi((()=>({width:`${t.percentage}%`,animationDuration:`${t.duration}s`,backgroundColor:v(t.percentage)}))),r=Pi((()=>(t.strokeWidth/t.width*100).toFixed(1))),a=Pi((()=>["circle","dashboard"].includes(t.type)?Number.parseInt(""+(50-Number.parseFloat(r.value)/2),10):0)),l=Pi((()=>{const e=a.value,i="dashboard"===t.type;return`\n M 50 50\n m 0 ${i?"":"-"}${e}\n a ${e} ${e} 0 1 1 0 ${i?"-":""}${2*e}\n a ${e} ${e} 0 1 1 0 ${i?"":"-"}${2*e}\n `})),d=Pi((()=>2*Math.PI*a.value)),h=Pi((()=>"dashboard"===t.type?.75:1)),c=Pi((()=>`${-1*d.value*(1-h.value)/2}px`)),u=Pi((()=>({strokeDasharray:`${d.value*h.value}px, ${d.value}px`,strokeDashoffset:c.value}))),g=Pi((()=>({strokeDasharray:`${d.value*h.value*(t.percentage/100)}px, ${d.value}px`,strokeDashoffset:c.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"}))),p=Pi((()=>{let e;return e=t.color?v(t.percentage):i[t.status]||i.default,e})),m=Pi((()=>"warning"===t.status?st:"line"===t.type?"success"===t.status?rt:Qe:"success"===t.status?Ze:et)),f=Pi((()=>"line"===t.type?12+.4*t.strokeWidth:.111111*t.width+2)),_=Pi((()=>t.format(t.percentage)));const v=e=>{var i;const{color:n}=t;if(Mo(n))return n(e);if(No(n))return n;{const t=function(e){const t=100/e.length;return e.map(((e,i)=>No(e)?{color:e,percentage:(i+1)*t}:e)).sort(((e,t)=>e.percentage-t.percentage))}(n);for(const i of t)if(i.percentage>e)return i.color;return null==(i=t[t.length-1])?void 0:i.color}};return(e,t)=>(Ln(),Vi("div",{class:bi([fi(o).b(),fi(o).m(e.type),fi(o).is(e.status),{[fi(o).m("without-text")]:!e.showText,[fi(o).m("text-inside")]:e.textInside}]),role:"progressbar","aria-valuenow":e.percentage,"aria-valuemin":"0","aria-valuemax":"100"},["line"===e.type?(Ln(),Vi("div",{key:0,class:bi(fi(o).b("bar"))},[Wi("div",{class:bi(fi(o).be("bar","outer")),style:wi({height:`${e.strokeWidth}px`})},[Wi("div",{class:bi([fi(o).be("bar","inner"),{[fi(o).bem("bar","inner","indeterminate")]:e.indeterminate}]),style:wi(fi(s))},[(e.showText||e.$slots.default)&&e.textInside?(Ln(),Vi("div",{key:0,class:bi(fi(o).be("bar","innerText"))},[On(e.$slots,"default",{percentage:e.percentage},(()=>[Wi("span",null,yi(fi(_)),1)]))],2)):Bi("v-if",!0)],6)],6)],2)):(Ln(),Vi("div",{key:1,class:bi(fi(o).b("circle")),style:wi({height:`${e.width}px`,width:`${e.width}px`})},[(Ln(),Vi("svg",Oc,[Wi("path",{class:bi(fi(o).be("circle","track")),d:fi(l),stroke:`var(${fi(o).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-width":fi(r),fill:"none",style:wi(fi(u))},null,14,Ac),Wi("path",{class:bi(fi(o).be("circle","path")),d:fi(l),stroke:fi(p),fill:"none",opacity:e.percentage?1:0,"stroke-linecap":e.strokeLinecap,"stroke-width":fi(r),style:wi(fi(g))},null,14,Rc)]))],6)),!e.showText&&!e.$slots.default||e.textInside?Bi("v-if",!0):(Ln(),Vi("div",{key:2,class:bi(fi(o).e("text")),style:wi({fontSize:`${fi(f)}px`})},[On(e.$slots,"default",{percentage:e.percentage},(()=>[e.status?(Ln(),Fi(fi(b),{key:1},{default:no((()=>[(Ln(),Fi(Pn(fi(m))))])),_:1})):(Ln(),Vi("span",Pc,yi(fi(_)),1))]))],6))],10,Mc))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/progress/src/progress.vue"]])),Bc=i({modelValue:{type:[Boolean,String,Number],default:!1},value:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},width:{type:[String,Number],default:""},inlinePrompt:{type:Boolean,default:!1},activeIcon:{type:te,default:""},inactiveIcon:{type:te,default:""},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},borderColor:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},id:String,loading:{type:Boolean,default:!1},beforeChange:{type:j(Function)},size:{type:String,validator:F},tabindex:{type:[String,Number]}}),Vc=["onClick"],Wc=["id","aria-checked","aria-disabled","name","true-value","false-value","disabled","tabindex","onKeydown"],Hc=["aria-hidden"],zc=["aria-hidden"],jc=["aria-hidden"],Uc=["aria-hidden"];const $c=r(s(Zi({name:"ElSwitch",props:Bc,emits:{[g]:e=>p(e)||No(e)||o(e),[D]:e=>p(e)||No(e)||o(e),[Y]:e=>p(e)||No(e)||o(e)},setup(e,{expose:t,emit:i}){const o=e,s="ElSwitch",r=en(),{formItem:a}=Q(),l=m(),d=n("switch");ie({from:'"value"',replacement:'"model-value" or "v-model"',scope:s,version:"2.3.0",ref:"https://element-plus.org/en-US/component/switch.html#attributes",type:"Attribute"},Pi((()=>{var e;return!!(null==(e=r.vnode.props)?void 0:e.value)})));const{inputId:h}=u(o,{formItemContext:a}),c=J(Pi((()=>o.loading))),_=ai(!1!==o.modelValue),v=ai(),C=ai(),w=Pi((()=>[d.b(),d.m(l.value),d.is("disabled",c.value),d.is("checked",x.value)])),y=Pi((()=>({width:ne(o.width)})));Qn((()=>o.modelValue),(()=>{_.value=!0})),Qn((()=>o.value),(()=>{_.value=!1}));const S=Pi((()=>_.value?o.modelValue:o.value)),x=Pi((()=>S.value===o.activeValue));[o.activeValue,o.inactiveValue].includes(S.value)||(i(g,o.inactiveValue),i(D,o.inactiveValue),i(Y,o.inactiveValue)),Qn(x,(e=>{var t;v.value.checked=e,o.validateEvent&&(null==(t=null==a?void 0:a.validate)||t.call(a,"change").catch((e=>f())))}));const k=()=>{const e=x.value?o.inactiveValue:o.activeValue;i(g,e),i(D,e),i(Y,e),gn((()=>{v.value.checked=x.value}))},L=()=>{if(c.value)return;const{beforeChange:e}=o;if(!e)return void k();const t=e();[Ao(t),p(t)].includes(!0)||oe(s,"beforeChange must return type `Promise` or `boolean`"),Ao(t)?t.then((e=>{e&&k()})).catch((e=>{})):t&&k()},E=Pi((()=>d.cssVarBlock({...o.activeColor?{"on-color":o.activeColor}:null,...o.inactiveColor?{"off-color":o.inactiveColor}:null,...o.borderColor?{"border-color":o.borderColor}:null})));return Cn((()=>{v.value.checked=x.value})),t({focus:()=>{var e,t;null==(t=null==(e=v.value)?void 0:e.focus)||t.call(e)}}),(e,t)=>(Ln(),Vi("div",{class:bi(fi(w)),style:wi(fi(E)),onClick:Eo(L,["prevent"])},[Wi("input",{id:fi(h),ref_key:"input",ref:v,class:bi(fi(d).e("input")),type:"checkbox",role:"switch","aria-checked":fi(x),"aria-disabled":fi(c),name:e.name,"true-value":e.activeValue,"false-value":e.inactiveValue,disabled:fi(c),tabindex:e.tabindex,onChange:k,onKeydown:Do(L,["enter"])},null,42,Wc),e.inlinePrompt||!e.inactiveIcon&&!e.inactiveText?Bi("v-if",!0):(Ln(),Vi("span",{key:0,class:bi([fi(d).e("label"),fi(d).em("label","left"),fi(d).is("active",!fi(x))])},[e.inactiveIcon?(Ln(),Fi(fi(b),{key:0},{default:no((()=>[(Ln(),Fi(Pn(e.inactiveIcon)))])),_:1})):Bi("v-if",!0),!e.inactiveIcon&&e.inactiveText?(Ln(),Vi("span",{key:1,"aria-hidden":fi(x)},yi(e.inactiveText),9,Hc)):Bi("v-if",!0)],2)),Wi("span",{ref_key:"core",ref:C,class:bi(fi(d).e("core")),style:wi(fi(y))},[e.inlinePrompt?(Ln(),Vi("div",{key:0,class:bi(fi(d).e("inner"))},[e.activeIcon||e.inactiveIcon?(Ln(),Vi(Li,{key:0},[e.activeIcon?(Ln(),Fi(fi(b),{key:0,class:bi([fi(d).is("icon"),fi(x)?fi(d).is("show"):fi(d).is("hide")])},{default:no((()=>[(Ln(),Fi(Pn(e.activeIcon)))])),_:1},8,["class"])):Bi("v-if",!0),e.inactiveIcon?(Ln(),Fi(fi(b),{key:1,class:bi([fi(d).is("icon"),fi(x)?fi(d).is("hide"):fi(d).is("show")])},{default:no((()=>[(Ln(),Fi(Pn(e.inactiveIcon)))])),_:1},8,["class"])):Bi("v-if",!0)],64)):e.activeText||e.inactiveIcon?(Ln(),Vi(Li,{key:1},[e.activeText?(Ln(),Vi("span",{key:0,class:bi([fi(d).is("text"),fi(x)?fi(d).is("show"):fi(d).is("hide")]),"aria-hidden":!fi(x)},yi(e.activeText.substring(0,3)),11,zc)):Bi("v-if",!0),e.inactiveText?(Ln(),Vi("span",{key:1,class:bi([fi(d).is("text"),fi(x)?fi(d).is("hide"):fi(d).is("show")]),"aria-hidden":fi(x)},yi(e.inactiveText.substring(0,3)),11,jc)):Bi("v-if",!0)],64)):Bi("v-if",!0)],2)):Bi("v-if",!0),Wi("div",{class:bi(fi(d).e("action"))},[e.loading?(Ln(),Fi(fi(b),{key:0,class:bi(fi(d).is("loading"))},{default:no((()=>[qi(fi(Ye))])),_:1},8,["class"])):Bi("v-if",!0)],2)],6),e.inlinePrompt||!e.activeIcon&&!e.activeText?Bi("v-if",!0):(Ln(),Vi("span",{key:1,class:bi([fi(d).e("label"),fi(d).em("label","right"),fi(d).is("active",fi(x))])},[e.activeIcon?(Ln(),Fi(fi(b),{key:0},{default:no((()=>[(Ln(),Fi(Pn(e.activeIcon)))])),_:1})):Bi("v-if",!0),!e.activeIcon&&e.activeText?(Ln(),Vi("span",{key:1,"aria-hidden":!fi(x)},yi(e.activeText),9,Uc)):Bi("v-if",!0)],2))],14,Vc))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/switch/src/switch.vue"]])); /*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed */var Kc=/["'&<>]/,qc=function(e){var t,i=""+e,n=Kc.exec(i);if(!n)return i;var o="",s=0,r=0;for(s=n.index;s"string"==typeof t?ae(i,t):t(i,n,e)))):("$key"!==t&&Zc(i)&&"$value"in i&&(i=i.$value),[Zc(i)?ae(i,t):i])};return e.map(((e,t)=>({value:e,index:t,key:s?s(e,t):null}))).sort(((e,t)=>{let o=function(e,t){if(n)return n(e.value,t.value);for(let i=0,n=e.key.length;it.key[i])return 1}return 0}(e,t);return o||(o=e.index-t.index),o*+i})).map((e=>e.value))},Xc=function(e,t){let i=null;return e.columns.forEach((e=>{e.id===t&&(i=e)})),i},Qc=function(e,t,i){const n=(t.className||"").match(new RegExp(`${i}-table_[^\\s]+`,"gm"));return n?Xc(e,n[0]):null},Jc=(e,t)=>{if(!e)throw new Error("Row is required when get row identity");if("string"==typeof t){if(!t.includes("."))return`${e[t]}`;const i=t.split(".");let n=e;for(const e of i)n=n[e];return`${n}`}if("function"==typeof t)return t.call(null,e)},eu=function(e,t){const i={};return(e||[]).forEach(((e,n)=>{i[Jc(e,t)]={row:e,index:n}})),i};function tu(e){return""===e||void 0!==e&&(e=Number.parseInt(e,10),Number.isNaN(e)&&(e="")),e}function iu(e){return""===e||void 0!==e&&(e=tu(e),Number.isNaN(e)&&(e=80)),e}function nu(e){return"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null}function ou(e,t,i){let n=!1;const o=e.indexOf(t),s=-1!==o,r=()=>{e.push(t),n=!0},a=()=>{e.splice(o,1),n=!0};return"boolean"==typeof i?i&&!s?r():!i&&s&&a():s?a():r(),n}function su(e,t,i="children",n="hasChildren"){const o=e=>!(Array.isArray(e)&&e.length);function s(e,r,a){t(e,r,a),r.forEach((e=>{if(e[n])return void t(e,null,a+1);const r=e[i];o(r)||s(e,r,a+1)}))}e.forEach((e=>{if(e[n])return void t(e,null,0);const r=e[i];o(r)||s(e,r,0)}))}let ru;const au=(e,t,i,n)=>{let o,s=0,r=e;if(n){if(n[e].colSpan>1)return{};for(let t=0;t=a.value.length-i.states.rightFixedLeafColumnsLength.value&&(o="right");break;default:r=a.value.length-i.states.rightFixedLeafColumnsLength.value&&(o="right")}return o?{direction:o,start:s,after:r}:{}},lu=(e,t,i,n,o)=>{const s=[],{direction:r,start:a}=au(t,i,n,o);if(r){const t="left"===r;s.push(`${e}-fixed-column--${r}`),t&&a===n.states.fixedLeafColumnsLength.value-1?s.push("is-last-column"):t||a!==n.states.columns.value.length-n.states.rightFixedLeafColumnsLength.value||s.push("is-first-column")}return s};function du(e,t){return e+(null===t.realWidth||Number.isNaN(t.realWidth)?Number(t.width):t.realWidth)}const hu=(e,t,i,n)=>{const{direction:o,start:s=0}=au(e,t,i,n);if(!o)return;const r={},a="left"===o,l=i.states.columns.value;return a?r.left=l.slice(0,e).reduce(du,0):r.right=l.slice(s+1).reverse().reduce(du,0),r},cu=(e,t)=>{e&&(Number.isNaN(e[t])||(e[t]=`${e[t]}px`))};const uu=e=>{const t=[];return e.forEach((e=>{e.children?t.push.apply(t,uu(e.children)):t.push(e)})),t};function gu(){var e;const t=en(),{size:i}=pi(null==(e=t.proxy)?void 0:e.$props),n=ai(null),o=ai([]),s=ai([]),r=ai(!1),a=ai([]),l=ai([]),d=ai([]),h=ai([]),c=ai([]),u=ai([]),g=ai([]),p=ai([]),m=ai(0),f=ai(0),_=ai(0),v=ai(!1),b=ai([]),C=ai(!1),w=ai(!1),y=ai(null),S=ai({}),x=ai(null),k=ai(null),L=ai(null),D=ai(null),E=ai(null);Qn(o,(()=>t.state&&I(!1)),{deep:!0});const N=()=>{h.value=a.value.filter((e=>!0===e.fixed||"left"===e.fixed)),c.value=a.value.filter((e=>"right"===e.fixed)),h.value.length>0&&a.value[0]&&"selection"===a.value[0].type&&!a.value[0].fixed&&(a.value[0].fixed=!0,h.value.unshift(a.value[0]));const e=a.value.filter((e=>!e.fixed));l.value=[].concat(h.value).concat(e).concat(c.value);const t=uu(e),i=uu(h.value),n=uu(c.value);m.value=t.length,f.value=i.length,_.value=n.length,d.value=[].concat(i).concat(t).concat(n),r.value=h.value.length>0||c.value.length>0},I=(e,i=!1)=>{e&&N(),i?t.state.doLayout():t.state.debouncedUpdateLayout()},T=e=>{var i;if(!t||!t.store)return 0;const{treeData:n}=t.store.states;let o=0;const s=null==(i=n.value[e])?void 0:i.children;return s&&(o+=s.length,s.forEach((e=>{o+=T(e)}))),o},M=(e,t,i)=>{k.value&&k.value!==e&&(k.value.order=null),k.value=e,L.value=t,D.value=i},O=()=>{let e=fi(s);Object.keys(S.value).forEach((t=>{const i=S.value[t];if(!i||0===i.length)return;const n=Xc({columns:d.value},t);n&&n.filterMethod&&(e=e.filter((e=>i.some((t=>n.filterMethod.call(null,t,e,n))))))})),x.value=e},A=()=>{o.value=((e,t)=>{const i=t.sortingColumn;return i&&"string"!=typeof i.sortable?Yc(e,t.sortProp,t.sortOrder,i.sortMethod,i.sortBy):e})(x.value,{sortingColumn:k.value,sortProp:L.value,sortOrder:D.value})},{setExpandRowKeys:R,toggleRowExpansion:P,updateExpandRows:F,states:B,isRowExpanded:V}=function(e){const t=en(),i=ai(!1),n=ai([]);return{updateExpandRows:()=>{const t=e.data.value||[],o=e.rowKey.value;if(i.value)n.value=t.slice();else if(o){const e=eu(n.value,o);n.value=t.reduce(((t,i)=>{const n=Jc(i,o);return e[n]&&t.push(i),t}),[])}else n.value=[]},toggleRowExpansion:(e,i)=>{ou(n.value,e,i)&&t.emit("expand-change",e,n.value.slice())},setExpandRowKeys:i=>{t.store.assertRowKey();const o=e.data.value||[],s=e.rowKey.value,r=eu(o,s);n.value=i.reduce(((e,t)=>{const i=r[t];return i&&e.push(i.row),e}),[])},isRowExpanded:t=>{const i=e.rowKey.value;return i?!!eu(n.value,i)[Jc(t,i)]:n.value.includes(t)},states:{expandRows:n,defaultExpandAll:i}}}({data:o,rowKey:n}),{updateTreeExpandKeys:W,toggleTreeExpansion:H,updateTreeData:z,loadOrToggle:j,states:U}=function(e){const t=ai([]),i=ai({}),n=ai(16),o=ai(!1),s=ai({}),r=ai("hasChildren"),a=ai("children"),l=en(),d=Pi((()=>{if(!e.rowKey.value)return{};const t=e.data.value||[];return c(t)})),h=Pi((()=>{const t=e.rowKey.value,i=Object.keys(s.value),n={};return i.length?(i.forEach((e=>{if(s.value[e].length){const i={children:[]};s.value[e].forEach((e=>{const o=Jc(e,t);i.children.push(o),e[r.value]&&!n[o]&&(n[o]={children:[]})})),n[e]=i}})),n):n})),c=t=>{const i=e.rowKey.value,n={};return su(t,((e,t,s)=>{const r=Jc(e,i);Array.isArray(t)?n[r]={children:t.map((e=>Jc(e,i))),level:s}:o.value&&(n[r]={children:[],lazy:!0,level:s})}),a.value,r.value),n},u=(e=!1,n=(e=>null==(e=l.store)?void 0:e.states.defaultExpandAll.value)())=>{var s;const r=d.value,a=h.value,c=Object.keys(r),u={};if(c.length){const s=fi(i),l=[],d=(i,o)=>{if(e)return t.value?n||t.value.includes(o):!(!n&&!(null==i?void 0:i.expanded));{const e=n||t.value&&t.value.includes(o);return!(!(null==i?void 0:i.expanded)&&!e)}};c.forEach((e=>{const t=s[e],i={...r[e]};if(i.expanded=d(t,e),i.lazy){const{loaded:n=!1,loading:o=!1}=t||{};i.loaded=!!n,i.loading=!!o,l.push(e)}u[e]=i}));const h=Object.keys(a);o.value&&h.length&&l.length&&h.forEach((e=>{const t=s[e],i=a[e].children;if(l.includes(e)){if(0!==u[e].children.length)throw new Error("[ElTable]children must be an empty array.");u[e].children=i}else{const{loaded:n=!1,loading:o=!1}=t||{};u[e]={lazy:!0,loaded:!!n,loading:!!o,expanded:d(t,e),children:i,level:""}}}))}i.value=u,null==(s=l.store)||s.updateTableScrollY()};Qn((()=>t.value),(()=>{u(!0)})),Qn((()=>d.value),(()=>{u()})),Qn((()=>h.value),(()=>{u()}));const g=(t,n)=>{l.store.assertRowKey();const o=e.rowKey.value,s=Jc(t,o),r=s&&i.value[s];if(s&&r&&"expanded"in r){const e=r.expanded;n=void 0===n?!r.expanded:n,i.value[s].expanded=n,e!==n&&l.emit("expand-change",t,n),l.store.updateTableScrollY()}},p=(e,t,n)=>{const{load:o}=l.props;o&&!i.value[t].loaded&&(i.value[t].loading=!0,o(e,n,(n=>{if(!Array.isArray(n))throw new TypeError("[ElTable] data must be an array");i.value[t].loading=!1,i.value[t].loaded=!0,i.value[t].expanded=!0,n.length&&(s.value[t]=n),l.emit("expand-change",e,!0)})))};return{loadData:p,loadOrToggle:t=>{l.store.assertRowKey();const n=e.rowKey.value,s=Jc(t,n),r=i.value[s];o.value&&r&&"loaded"in r&&!r.loaded?p(t,s,r):g(t,void 0)},toggleTreeExpansion:g,updateTreeExpandKeys:e=>{t.value=e,u()},updateTreeData:u,normalize:c,states:{expandRowKeys:t,treeData:i,indent:n,lazy:o,lazyTreeNodeMap:s,lazyColumnIdentifier:r,childrenColumnName:a}}}({data:o,rowKey:n}),{updateCurrentRowData:$,updateCurrentRow:K,setCurrentRowKey:q,states:G}=function(e){const t=en(),i=ai(null),n=ai(null),o=()=>{i.value=null},s=i=>{const{data:o,rowKey:s}=e;let r=null;s.value&&(r=(fi(o)||[]).find((e=>Jc(e,s.value)===i))),n.value=r,t.emit("current-change",n.value,null)};return{setCurrentRowKey:e=>{t.store.assertRowKey(),i.value=e,s(e)},restoreCurrentRowKey:o,setCurrentRowByKey:s,updateCurrentRow:e=>{const i=n.value;if(e&&e!==i)return n.value=e,void t.emit("current-change",n.value,i);!e&&i&&(n.value=null,t.emit("current-change",null,i))},updateCurrentRowData:()=>{const r=e.rowKey.value,a=e.data.value||[],l=n.value;if(!a.includes(l)&&l){if(r){const e=Jc(l,r);s(e)}else n.value=null;null===n.value&&t.emit("current-change",null,l)}else i.value&&(s(i.value),o())},states:{_currentRowKey:i,currentRow:n}}}({data:o,rowKey:n});return{assertRowKey:()=>{if(!n.value)throw new Error("[ElTable] prop row-key is required")},updateColumns:N,scheduleLayout:I,isSelected:e=>b.value.includes(e),clearSelection:()=>{v.value=!1;b.value.length&&(b.value=[],t.emit("selection-change",[]))},cleanSelection:()=>{let e;if(n.value){e=[];const t=eu(b.value,n.value),i=eu(o.value,n.value);for(const n in t)Ro(t,n)&&!i[n]&&e.push(t[n].row)}else e=b.value.filter((e=>!o.value.includes(e)));if(e.length){const i=b.value.filter((t=>!e.includes(t)));b.value=i,t.emit("selection-change",i.slice())}},getSelectionRows:()=>(b.value||[]).slice(),toggleRowSelection:(e,i,n=!0)=>{if(ou(b.value,e,i)){const i=(b.value||[]).slice();n&&t.emit("select",i,e),t.emit("selection-change",i)}},_toggleAllSelection:()=>{var e,i;const n=w.value?!v.value:!(v.value||b.value.length);v.value=n;let s=!1,r=0;const a=null==(i=null==(e=null==t?void 0:t.store)?void 0:e.states)?void 0:i.rowKey.value;o.value.forEach(((e,t)=>{const i=t+r;y.value?y.value.call(null,e,i)&&ou(b.value,e,n)&&(s=!0):ou(b.value,e,n)&&(s=!0),r+=T(Jc(e,a))})),s&&t.emit("selection-change",b.value?b.value.slice():[]),t.emit("select-all",b.value)},toggleAllSelection:null,updateSelectionByRowKey:()=>{const e=eu(b.value,n.value);o.value.forEach((t=>{const i=Jc(t,n.value),o=e[i];o&&(b.value[o.index]=t)}))},updateAllSelected:()=>{var e,i,s;if(0===(null==(e=o.value)?void 0:e.length))return void(v.value=!1);let r;n.value&&(r=eu(b.value,n.value));let a=!0,l=0,d=0;for(let c=0,u=(o.value||[]).length;c{Array.isArray(e)||(e=[e]);const i={};return e.forEach((e=>{S.value[e.id]=t,i[e.columnKey||e.id]=t})),i},updateCurrentRow:K,updateSort:M,execFilter:O,execSort:A,execQuery:e=>{e&&e.filter||O(),A()},clearFilter:e=>{const{tableHeaderRef:i}=t.refs;if(!i)return;const n=Object.assign({},i.filterPanels),o=Object.keys(n);if(o.length)if("string"==typeof e&&(e=[e]),Array.isArray(e)){const i=e.map((e=>function(e,t){let i=null;for(let n=0;n{const t=i.find((t=>t.id===e));t&&(t.filteredValue=[])})),t.store.commit("filterChange",{column:i,values:[],silent:!0,multi:!0})}else o.forEach((e=>{const t=d.value.find((t=>t.id===e));t&&(t.filteredValue=[])})),S.value={},t.store.commit("filterChange",{column:{},values:[],silent:!0})},clearSort:()=>{k.value&&(M(null,null,null),t.store.commit("changeSortCondition",{silent:!0}))},toggleRowExpansion:P,setExpandRowKeysAdapter:e=>{R(e),W(e)},setCurrentRowKey:q,toggleRowExpansionAdapter:(e,t)=>{d.value.some((({type:e})=>"expand"===e))?P(e,t):H(e,t)},isRowExpanded:V,updateExpandRows:F,updateCurrentRowData:$,loadOrToggle:j,updateTreeData:z,states:{tableSize:i,rowKey:n,data:o,_data:s,isComplex:r,_columns:a,originColumns:l,columns:d,fixedColumns:h,rightFixedColumns:c,leafColumns:u,fixedLeafColumns:g,rightFixedLeafColumns:p,leafColumnsLength:m,fixedLeafColumnsLength:f,rightFixedLeafColumnsLength:_,isAllSelected:v,selection:b,reserveSelection:C,selectOnIndeterminate:w,selectable:y,filters:S,filteredData:x,sortingColumn:k,sortProp:L,sortOrder:D,hoverRow:E,...B,...U,...G}}}function pu(e,t){return e.map((e=>{var i;return e.id===t.id?t:((null==(i=e.children)?void 0:i.length)&&(e.children=pu(e.children,t)),e)}))}function mu(e){e.forEach((e=>{var t,i;e.no=null==(t=e.getColumnIndex)?void 0:t.call(e),(null==(i=e.children)?void 0:i.length)&&mu(e.children)})),e.sort(((e,t)=>e.no-t.no))}function fu(){const e=en(),t=gu();return{ns:n("table"),...t,mutations:{setData(t,i){const n=fi(t._data)!==i;t.data.value=i,t._data.value=i,e.store.execQuery(),e.store.updateCurrentRowData(),e.store.updateExpandRows(),e.store.updateTreeData(e.store.states.defaultExpandAll.value),fi(t.reserveSelection)?(e.store.assertRowKey(),e.store.updateSelectionByRowKey()):n?e.store.clearSelection():e.store.cleanSelection(),e.store.updateAllSelected(),e.$ready&&e.store.scheduleLayout()},insertColumn(t,i,n){const o=fi(t._columns);let s=[];n?(n&&!n.children&&(n.children=[]),n.children.push(i),s=pu(o,n)):(o.push(i),s=o),mu(s),t._columns.value=s,"selection"===i.type&&(t.selectable.value=i.selectable,t.reserveSelection.value=i.reserveSelection),e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},removeColumn(t,i,n){const o=fi(t._columns)||[];if(n)n.children.splice(n.children.findIndex((e=>e.id===i.id)),1),0===n.children.length&&delete n.children,t._columns.value=pu(o,n);else{const e=o.indexOf(i);e>-1&&(o.splice(e,1),t._columns.value=o)}e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},sort(t,i){const{prop:n,order:o,init:s}=i;if(n){const i=fi(t.columns).find((e=>e.property===n));i&&(i.order=o,e.store.updateSort(i,n,o),e.store.commit("changeSortCondition",{init:s}))}},changeSortCondition(t,i){const{sortingColumn:n,sortProp:o,sortOrder:s}=t;null===fi(s)&&(t.sortingColumn.value=null,t.sortProp.value=null);e.store.execQuery({filter:!0}),i&&(i.silent||i.init)||e.emit("sort-change",{column:fi(n),prop:fi(o),order:fi(s)}),e.store.updateTableScrollY()},filterChange(t,i){const{column:n,values:o,silent:s}=i,r=e.store.updateFilters(n,o);e.store.execQuery(),s||e.emit("filter-change",r),e.store.updateTableScrollY()},toggleAllSelection(){e.store.toggleAllSelection()},rowSelectedChanged(t,i){e.store.toggleRowSelection(i),e.store.updateAllSelected()},setHoverRow(e,t){e.hoverRow.value=t},setCurrentRow(t,i){e.store.updateCurrentRow(i)}},commit:function(t,...i){const n=e.store.mutations;if(!n[t])throw new Error(`Action not found: ${t}`);n[t].apply(e,[e.store.states].concat(i))},updateTableScrollY:function(){gn((()=>e.layout.updateScrollY.apply(e.layout)))}}}const _u={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data","treeProps.hasChildren":{key:"lazyColumnIdentifier",default:"hasChildren"},"treeProps.children":{key:"childrenColumnName",default:"children"}};function vu(e,t){if(!e)throw new Error("Table is required.");const i=fu();return i.toggleAllSelection=W(i._toggleAllSelection,10),Object.keys(_u).forEach((e=>{bu(Cu(t,e),e,i)})),function(e,t){Object.keys(_u).forEach((i=>{Qn((()=>Cu(t,i)),(t=>{bu(t,i,e)}))}))}(i,t),i}function bu(e,t,i){let n=e,o=_u[t];"object"==typeof _u[t]&&(o=o.key,n=n||_u[t].default),i.states[o].value=n}function Cu(e,t){if(t.includes(".")){const i=t.split(".");let n=e;return i.forEach((e=>{n=n[e]})),n}return e[t]}class wu{constructor(e){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=ai(null),this.scrollX=ai(!1),this.scrollY=ai(!1),this.bodyWidth=ai(null),this.fixedWidth=ai(null),this.rightFixedWidth=ai(null),this.tableHeight=ai(null),this.headerHeight=ai(44),this.appendHeight=ai(0),this.footerHeight=ai(44),this.viewportHeight=ai(null),this.bodyHeight=ai(null),this.bodyScrollHeight=ai(0),this.fixedBodyHeight=ai(null),this.gutterWidth=0;for(const t in e)Ro(e,t)&&(ei(this[t])?this[t].value=e[t]:this[t]=e[t]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(null===this.height.value)return!1;const e=this.table.refs.bodyWrapper;if(this.table.vnode.el&&e){let t=!0;const i=this.scrollY.value;return t=null!==this.bodyHeight.value&&e.scrollHeight>this.bodyHeight.value,this.scrollY.value=t,i!==t}return!1}setHeight(e,t="height"){if(!E)return;const i=this.table.vnode.el;if(e=nu(e),this.height.value=Number(e),!i&&(e||0===e))return gn((()=>this.setHeight(e,t)));"number"==typeof e?(i.style[t]=`${e}px`,this.updateElsHeight()):"string"==typeof e&&(i.style[t]=e,this.updateElsHeight())}setMaxHeight(e){this.setHeight(e,"max-height")}getFlattenColumns(){const e=[];return this.table.store.states.columns.value.forEach((t=>{t.isColumnGroup?e.push.apply(e,t.columns):e.push(t)})),e}updateElsHeight(){var e,t;if(!this.table.$ready)return gn((()=>this.updateElsHeight()));const{tableWrapper:i,headerWrapper:n,appendWrapper:o,footerWrapper:s,tableHeader:r,tableBody:a}=this.table.refs;if(i&&"none"===i.style.display)return;const{tableLayout:l}=this.table.props;if(this.appendHeight.value=o?o.offsetHeight:0,this.showHeader&&!n&&"fixed"===l)return;const d=r||null,h=this.headerDisplayNone(d),c=(null==n?void 0:n.offsetHeight)||0,u=this.headerHeight.value=this.showHeader?c:0;if(this.showHeader&&!h&&c>0&&(this.table.store.states.columns.value||[]).length>0&&u<2)return gn((()=>this.updateElsHeight()));const g=this.tableHeight.value=null==(t=null==(e=this.table)?void 0:e.vnode.el)?void 0:t.clientHeight,p=this.footerHeight.value=s?s.offsetHeight:0;null!==this.height.value&&(null===this.bodyHeight.value&&requestAnimationFrame((()=>this.updateElsHeight())),this.bodyHeight.value=g-u-p+(s?1:0),this.bodyScrollHeight.value=null==a?void 0:a.scrollHeight),this.fixedBodyHeight.value=this.scrollX.value?this.bodyHeight.value-this.gutterWidth:this.bodyHeight.value,this.viewportHeight.value=this.scrollX.value?g-this.gutterWidth:g,this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(e){if(!e)return!0;let t=e;for(;"DIV"!==t.tagName;){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1}updateColumnsWidth(){if(!E)return;const e=this.fit,t=this.table.vnode.el.clientWidth;let i=0;const n=this.getFlattenColumns(),o=n.filter((e=>"number"!=typeof e.width));if(n.forEach((e=>{"number"==typeof e.width&&e.realWidth&&(e.realWidth=null)})),o.length>0&&e){if(n.forEach((e=>{i+=Number(e.width||e.minWidth||80)})),i<=t){this.scrollX.value=!1;const e=t-i;if(1===o.length)o[0].realWidth=Number(o[0].minWidth||80)+e;else{const t=e/o.reduce(((e,t)=>e+Number(t.minWidth||80)),0);let i=0;o.forEach(((e,n)=>{if(0===n)return;const o=Math.floor(Number(e.minWidth||80)*t);i+=o,e.realWidth=Number(e.minWidth||80)+o})),o[0].realWidth=Number(o[0].minWidth||80)+e-i}}else this.scrollX.value=!0,o.forEach((e=>{e.realWidth=Number(e.minWidth)}));this.bodyWidth.value=Math.max(i,t),this.table.state.resizeState.value.width=this.bodyWidth.value}else n.forEach((e=>{e.width||e.minWidth?e.realWidth=Number(e.width||e.minWidth):e.realWidth=80,i+=e.realWidth})),this.scrollX.value=i>t,this.bodyWidth.value=i;const s=this.store.states.fixedColumns.value;if(s.length>0){let e=0;s.forEach((t=>{e+=Number(t.realWidth||t.width)})),this.fixedWidth.value=e}const r=this.store.states.rightFixedColumns.value;if(r.length>0){let e=0;r.forEach((t=>{e+=Number(t.realWidth||t.width)})),this.rightFixedWidth.value=e}this.notifyObservers("columns")}addObserver(e){this.observers.push(e)}removeObserver(e){const t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)}notifyObservers(e){this.observers.forEach((t=>{var i,n;switch(e){case"columns":null==(i=t.state)||i.onColumnsChange(this);break;case"scrollable":null==(n=t.state)||n.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${e}.`)}}))}}const{CheckboxGroup:yu}=ah,Su=Zi({name:"ElTableFilterPanel",components:{ElCheckbox:ah,ElCheckboxGroup:yu,ElScrollbar:C,ElTooltip:A,ElIcon:b,ArrowDown:Je,ArrowUp:it},directives:{ClickOutside:P},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(e){const t=en(),{t:i}=w(),o=n("table-filter"),s=null==t?void 0:t.parent;s.filterPanels.value[e.column.id]||(s.filterPanels.value[e.column.id]=t);const r=ai(!1),a=ai(null),l=Pi((()=>e.column&&e.column.filters)),d=Pi({get:()=>{var t;return((null==(t=e.column)?void 0:t.filteredValue)||[])[0]},set:e=>{h.value&&(null!=e?h.value.splice(0,1,e):h.value.splice(0,1))}}),h=Pi({get:()=>e.column&&e.column.filteredValue||[],set(t){e.column&&e.upDataColumn("filteredValue",t)}}),c=Pi((()=>!e.column||e.column.filterMultiple)),u=()=>{r.value=!1},g=t=>{e.store.commit("filterChange",{column:e.column,values:t}),e.store.updateAllSelected()};Qn(r,(t=>{e.column&&e.upDataColumn("filterOpened",t)}),{immediate:!0});const p=Pi((()=>{var e,t;return null==(t=null==(e=a.value)?void 0:e.popperRef)?void 0:t.contentRef}));return{tooltipVisible:r,multiple:c,filteredValue:h,filterValue:d,filters:l,handleConfirm:()=>{g(h.value),u()},handleReset:()=>{h.value=[],g(h.value),u()},handleSelect:e=>{d.value=e,g(null!=e?h.value:[]),u()},isActive:e=>e.value===d.value,t:i,ns:o,showFilterPanel:e=>{e.stopPropagation(),r.value=!r.value},hideFilterPanel:()=>{r.value=!1},popperPaneRef:p,tooltip:a}}}),xu={key:0},ku=["disabled"],Lu=["label","onClick"];var Du=s(Su,[["render",function(e,t,i,n,o,s){const r=An("el-checkbox"),a=An("el-checkbox-group"),l=An("el-scrollbar"),d=An("arrow-up"),h=An("arrow-down"),c=An("el-icon"),u=An("el-tooltip"),g=Rn("click-outside");return Ln(),Fi(u,{ref:"tooltip",visible:e.tooltipVisible,"onUpdate:visible":t[5]||(t[5]=t=>e.tooltipVisible=t),offset:0,placement:e.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":e.ns.b(),persistent:""},{content:no((()=>[e.multiple?(Ln(),Vi("div",xu,[Wi("div",{class:bi(e.ns.e("content"))},[qi(l,{"wrap-class":e.ns.e("wrap")},{default:no((()=>[qi(a,{modelValue:e.filteredValue,"onUpdate:modelValue":t[0]||(t[0]=t=>e.filteredValue=t),class:bi(e.ns.e("checkbox-group"))},{default:no((()=>[(Ln(!0),Vi(Li,null,Mn(e.filters,(e=>(Ln(),Fi(r,{key:e.value,label:e.value},{default:no((()=>[Ki(yi(e.text),1)])),_:2},1032,["label"])))),128))])),_:1},8,["modelValue","class"])])),_:1},8,["wrap-class"])],2),Wi("div",{class:bi(e.ns.e("bottom"))},[Wi("button",{class:bi({[e.ns.is("disabled")]:0===e.filteredValue.length}),disabled:0===e.filteredValue.length,type:"button",onClick:t[1]||(t[1]=(...t)=>e.handleConfirm&&e.handleConfirm(...t))},yi(e.t("el.table.confirmFilter")),11,ku),Wi("button",{type:"button",onClick:t[2]||(t[2]=(...t)=>e.handleReset&&e.handleReset(...t))},yi(e.t("el.table.resetFilter")),1)],2)])):(Ln(),Vi("ul",{key:1,class:bi(e.ns.e("list"))},[Wi("li",{class:bi([e.ns.e("list-item"),{[e.ns.is("active")]:void 0===e.filterValue||null===e.filterValue}]),onClick:t[3]||(t[3]=t=>e.handleSelect(null))},yi(e.t("el.table.clearFilter")),3),(Ln(!0),Vi(Li,null,Mn(e.filters,(t=>(Ln(),Vi("li",{key:t.value,class:bi([e.ns.e("list-item"),e.ns.is("active",e.isActive(t))]),label:t.value,onClick:i=>e.handleSelect(t.value)},yi(t.text),11,Lu)))),128))],2))])),default:no((()=>[so((Ln(),Vi("span",{class:bi([`${e.ns.namespace.value}-table__column-filter-trigger`,`${e.ns.namespace.value}-none-outline`]),onClick:t[4]||(t[4]=(...t)=>e.showFilterPanel&&e.showFilterPanel(...t))},[qi(c,null,{default:no((()=>[e.column.filterOpened?(Ln(),Fi(d,{key:0})):(Ln(),Fi(h,{key:1}))])),_:1})],2)),[[g,e.hideFilterPanel,e.popperPaneRef]])])),_:1},8,["visible","placement","popper-class"])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/filter-panel.vue"]]);function Eu(e){const t=en();mn((()=>{i.value.addObserver(t)})),Cn((()=>{n(i.value),o(i.value)})),kn((()=>{n(i.value),o(i.value)})),xn((()=>{i.value.removeObserver(t)}));const i=Pi((()=>{const t=e.layout;if(!t)throw new Error("Can not find table layout.");return t})),n=t=>{var i;const n=(null==(i=e.vnode.el)?void 0:i.querySelectorAll("colgroup > col"))||[];if(!n.length)return;const o=t.getFlattenColumns(),s={};o.forEach((e=>{s[e.id]=e}));for(let e=0,r=n.length;e{var i,n;const o=(null==(i=e.vnode.el)?void 0:i.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let e=0,r=o.length;e{const t=[];return e.forEach((e=>{e.children?(t.push(e),t.push.apply(t,Iu(e.children))):t.push(e)})),t};function Tu(e){const t=an(Nu),i=Pi((()=>(e=>{let t=1;const i=(e,n)=>{if(n&&(e.level=n.level+1,t{i(n,e),t+=n.colSpan})),e.colSpan=t}else e.colSpan=1};e.forEach((e=>{e.level=1,i(e,void 0)}));const n=[];for(let o=0;o{e.children?(e.rowSpan=1,e.children.forEach((e=>e.isSubColumn=!0))):e.rowSpan=t-e.level+1,n[e.level-1].push(e)})),n})(e.store.states.originColumns.value)));return{isGroup:Pi((()=>{const e=i.value.length>1;return e&&t&&(t.state.isGroup.value=!0),e})),toggleAllSelection:e=>{e.stopPropagation(),null==t||t.store.commit("toggleAllSelection")},columnRows:i}}var Mu=Zi({name:"ElTableHeader",components:{ElCheckbox:ah},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e,{emit:t}){const i=en(),o=an(Nu),s=n("table"),r=ai({}),{onColumnsChange:a,onScrollableChange:l}=Eu(o);Cn((async()=>{await gn(),await gn();const{prop:t,order:i}=e.defaultSort;null==o||o.store.commit("sort",{prop:t,order:i,init:!0})}));const{handleHeaderClick:d,handleHeaderContextMenu:h,handleMouseDown:c,handleMouseMove:u,handleMouseOut:g,handleSortClick:p,handleFilterClick:m}=function(e,t){const i=en(),n=an(Nu),o=e=>{e.stopPropagation()},s=ai(null),r=ai(!1),a=ai({}),l=(t,i,o)=>{t.stopPropagation();const s=i.order===o?null:o||(({order:e,sortOrders:t})=>{if(""===e)return t[0];const i=t.indexOf(e||null);return t[i>t.length-2?0:i+1]})(i);let r=t.target;for(;r&&"TH"!==r.tagName;)r=r.parentNode;if(r&&"TH"===r.tagName&&de(r,"noclick"))return void he(r,"noclick");if(!i.sortable)return;const a=e.store.states;let l,d=a.sortProp.value;const h=a.sortingColumn.value;(h!==i||h===i&&null===h.order)&&(h&&(h.order=null),a.sortingColumn.value=i,d=i.property),l=i.order=s||null,a.sortProp.value=d,a.sortOrder.value=l,null==n||n.store.commit("changeSortCondition")};return{handleHeaderClick:(e,t)=>{!t.filters&&t.sortable?l(e,t,!1):t.filterable&&!t.sortable&&o(e),null==n||n.emit("header-click",t,e)},handleHeaderContextMenu:(e,t)=>{null==n||n.emit("header-contextmenu",t,e)},handleMouseDown:(o,l)=>{if(E&&!(l.children&&l.children.length>0)&&s.value&&e.border){r.value=!0;const d=n;t("set-drag-visible",!0);const h=(null==d?void 0:d.vnode.el).getBoundingClientRect().left,c=i.vnode.el.querySelector(`th.${l.id}`),u=c.getBoundingClientRect(),g=u.left-h+30;le(c,"noclick"),a.value={startMouseLeft:o.clientX,startLeft:u.right-h,startColumnLeft:u.left-h,tableLeft:h};const p=null==d?void 0:d.refs.resizeProxy;p.style.left=`${a.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const m=e=>{const t=e.clientX-a.value.startMouseLeft,i=a.value.startLeft+t;p.style.left=`${Math.max(g,i)}px`},f=()=>{if(r.value){const{startColumnLeft:i,startLeft:n}=a.value,h=Number.parseInt(p.style.left,10)-i;l.width=l.realWidth=h,null==d||d.emit("header-dragend",l.width,n-i,l,o),requestAnimationFrame((()=>{e.store.scheduleLayout(!1,!0)})),document.body.style.cursor="",r.value=!1,s.value=null,a.value={},t("set-drag-visible",!1)}document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",f),document.onselectstart=null,document.ondragstart=null,setTimeout((()=>{he(c,"noclick")}),0)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",f)}},handleMouseMove:(t,i)=>{if(i.children&&i.children.length>0)return;let n=t.target;for(;n&&"TH"!==n.tagName;)n=n.parentNode;if(i&&i.resizable&&!r.value&&e.border){const e=n.getBoundingClientRect(),o=document.body.style;e.width>12&&e.right-t.pageX<8?(o.cursor="col-resize",de(n,"is-sortable")&&(n.style.cursor="col-resize"),s.value=i):r.value||(o.cursor="",de(n,"is-sortable")&&(n.style.cursor="pointer"),s.value=null)}},handleMouseOut:()=>{E&&(document.body.style.cursor="")},handleSortClick:l,handleFilterClick:o}}(e,t),{getHeaderRowStyle:f,getHeaderRowClass:_,getHeaderCellStyle:v,getHeaderCellClass:b}=function(e){const t=an(Nu),i=n("table");return{getHeaderRowStyle:e=>{const i=null==t?void 0:t.props.headerRowStyle;return"function"==typeof i?i.call(null,{rowIndex:e}):i},getHeaderRowClass:e=>{const i=[],n=null==t?void 0:t.props.headerRowClassName;return"string"==typeof n?i.push(n):"function"==typeof n&&i.push(n.call(null,{rowIndex:e})),i.join(" ")},getHeaderCellStyle:(i,n,o,s)=>{var r;let a=null!=(r=null==t?void 0:t.props.headerCellStyle)?r:{};"function"==typeof a&&(a=a.call(null,{rowIndex:i,columnIndex:n,row:o,column:s}));const l=s.isSubColumn?null:hu(n,s.fixed,e.store,o);return cu(l,"left"),cu(l,"right"),Object.assign({},a,l)},getHeaderCellClass:(n,o,s,r)=>{const a=r.isSubColumn?[]:lu(i.b(),o,r.fixed,e.store,s),l=[r.id,r.order,r.headerAlign,r.className,r.labelClassName,...a];r.children||l.push("is-leaf"),r.sortable&&l.push("is-sortable");const d=null==t?void 0:t.props.headerCellClassName;return"string"==typeof d?l.push(d):"function"==typeof d&&l.push(d.call(null,{rowIndex:n,columnIndex:o,row:s,column:r})),l.push(i.e("cell")),l.filter((e=>Boolean(e))).join(" ")}}}(e),{isGroup:C,toggleAllSelection:w,columnRows:y}=Tu(e);return i.state={onColumnsChange:a,onScrollableChange:l},i.filterPanels=r,{ns:s,filterPanels:r,onColumnsChange:a,onScrollableChange:l,columnRows:y,getHeaderRowClass:_,getHeaderRowStyle:f,getHeaderCellClass:b,getHeaderCellStyle:v,handleHeaderClick:d,handleHeaderContextMenu:h,handleMouseDown:c,handleMouseMove:u,handleMouseOut:g,handleSortClick:p,handleFilterClick:m,isGroup:C,toggleAllSelection:w}},render(){const{ns:e,isGroup:t,columnRows:i,getHeaderCellStyle:n,getHeaderCellClass:o,getHeaderRowClass:s,getHeaderRowStyle:r,handleHeaderClick:a,handleHeaderContextMenu:l,handleMouseDown:d,handleMouseMove:h,handleSortClick:c,handleMouseOut:u,store:g,$parent:p}=this;let m=1;return on("thead",{class:{[e.is("group")]:t}},i.map(((e,t)=>on("tr",{class:s(t),key:t,style:r(t)},e.map(((i,s)=>(i.rowSpan>m&&(m=i.rowSpan),on("th",{class:o(t,s,e,i),colspan:i.colSpan,key:`${i.id}-thead`,rowspan:i.rowSpan,style:n(t,s,e,i),onClick:e=>a(e,i),onContextmenu:e=>l(e,i),onMousedown:e=>d(e,i),onMousemove:e=>h(e,i),onMouseout:u},[on("div",{class:["cell",i.filteredValue&&i.filteredValue.length>0?"highlight":"",i.labelClassName]},[i.renderHeader?i.renderHeader({column:i,$index:s,store:g,_self:p}):i.label,i.sortable&&on("span",{onClick:e=>c(e,i),class:"caret-wrapper"},[on("i",{onClick:e=>c(e,i,"ascending"),class:"sort-caret ascending"}),on("i",{onClick:e=>c(e,i,"descending"),class:"sort-caret descending"})]),i.filterable&&on(Du,{store:g,placement:i.filterPlacement||"bottom-start",column:i,upDataColumn:(e,t)=>{i[e]=t}})])]))))))))}});function Ou(e){const t=an(Nu),i=ai(""),n=ai(on("div")),o=(i,n,o)=>{var s;const r=t,a=Gc(i);let l;const d=null==(s=null==r?void 0:r.vnode.el)?void 0:s.dataset.prefix;a&&(l=Qc({columns:e.store.states.columns.value},a,d),l&&(null==r||r.emit(`cell-${o}`,n,l,a,i))),null==r||r.emit(`row-${o}`,n,l,i)};return{handleDoubleClick:(e,t)=>{o(e,t,"dblclick")},handleClick:(t,i)=>{e.store.commit("setCurrentRow",i),o(t,i,"click")},handleContextMenu:(e,t)=>{o(e,t,"contextmenu")},handleMouseEnter:W((t=>{e.store.commit("setHoverRow",t)}),30),handleMouseLeave:W((()=>{e.store.commit("setHoverRow",null)}),30),handleCellMouseEnter:(i,n)=>{var o;const s=t,r=Gc(i),l=null==(o=null==s?void 0:s.vnode.el)?void 0:o.dataset.prefix;if(r){const t=Qc({columns:e.store.states.columns.value},r,l),o=s.hoverState={cell:r,column:t,row:n};null==s||s.emit("cell-mouse-enter",o.row,o.column,o.cell,i)}const d=i.target.querySelector(".cell");if(!de(d,`${l}-tooltip`)||!d.childNodes.length)return;const h=document.createRange();h.setStart(d,0),h.setEnd(d,d.childNodes.length);(h.getBoundingClientRect().width+((Number.parseInt(ce(d,"paddingLeft"),10)||0)+(Number.parseInt(ce(d,"paddingRight"),10)||0))>d.offsetWidth||d.scrollWidth>d.offsetWidth)&&function(e,t,i,n,o){const{nextZIndex:s}=se(),r=null==e?void 0:e.dataset.prefix,l=null==e?void 0:e.querySelector(`.${r}-scrollbar__wrap`);function d(){h&&h.update()}ru=()=>{try{h&&h.destroy(),c&&(null==e||e.removeChild(c)),q(t,"mouseenter",d),q(t,"mouseleave",ru),l&&q(l,"scroll",ru),ru=void 0}catch(i){}};let h=null;const c=function(){const t="light"===o,n=document.createElement("div");return n.className=`${r}-popper ${t?"is-light":"is-dark"}`,i=qc(i),n.innerHTML=i,n.style.zIndex=String(s()),null==e||e.appendChild(n),n}(),u=function(){const e=document.createElement("div");return e.className=`${r}-popper__arrow`,e}();c.appendChild(u),h=re(t,c,{strategy:"absolute",modifiers:[{name:"offset",options:{offset:[0,8]}},{name:"arrow",options:{element:u,padding:10}}],...n}),a(t,"mouseenter",d),a(t,"mouseleave",ru),l&&a(l,"scroll",ru)}(null==t?void 0:t.refs.tableWrapper,r,r.innerText||r.textContent,{placement:"top",strategy:"fixed"},n.tooltipEffect)},handleCellMouseLeave:e=>{if(!Gc(e))return;const i=null==t?void 0:t.hoverState;null==t||t.emit("cell-mouse-leave",null==i?void 0:i.row,null==i?void 0:i.column,null==i?void 0:i.cell,e)},tooltipContent:i,tooltipTrigger:n}}function Au(e){const t=an(Nu),i=n("table"),{handleDoubleClick:o,handleClick:s,handleContextMenu:r,handleMouseEnter:a,handleMouseLeave:l,handleCellMouseEnter:d,handleCellMouseLeave:h,tooltipContent:c,tooltipTrigger:u}=Ou(e),{getRowStyle:g,getRowClass:p,getCellStyle:m,getCellClass:f,getSpan:_,getColspanRealWidth:v}=function(e){const t=an(Nu),i=n("table");return{getRowStyle:(e,i)=>{const n=null==t?void 0:t.props.rowStyle;return"function"==typeof n?n.call(null,{row:e,rowIndex:i}):n||null},getRowClass:(n,o)=>{const s=[i.e("row")];(null==t?void 0:t.props.highlightCurrentRow)&&n===e.store.states.currentRow.value&&s.push("current-row"),e.stripe&&o%2==1&&s.push(i.em("row","striped"));const r=null==t?void 0:t.props.rowClassName;return"string"==typeof r?s.push(r):"function"==typeof r&&s.push(r.call(null,{row:n,rowIndex:o})),s},getCellStyle:(i,n,o,s)=>{const r=null==t?void 0:t.props.cellStyle;let a=null!=r?r:{};"function"==typeof r&&(a=r.call(null,{rowIndex:i,columnIndex:n,row:o,column:s}));const l=s.isSubColumn?null:hu(n,null==e?void 0:e.fixed,e.store);return cu(l,"left"),cu(l,"right"),Object.assign({},a,l)},getCellClass:(n,o,s,r)=>{const a=r.isSubColumn?[]:lu(i.b(),o,null==e?void 0:e.fixed,e.store),l=[r.id,r.align,r.className,...a],d=null==t?void 0:t.props.cellClassName;return"string"==typeof d?l.push(d):"function"==typeof d&&l.push(d.call(null,{rowIndex:n,columnIndex:o,row:s,column:r})),l.push(i.e("cell")),l.filter((e=>Boolean(e))).join(" ")},getSpan:(e,i,n,o)=>{let s=1,r=1;const a=null==t?void 0:t.props.spanMethod;if("function"==typeof a){const t=a({row:e,column:i,rowIndex:n,columnIndex:o});Array.isArray(t)?(s=t[0],r=t[1]):"object"==typeof t&&(s=t.rowspan,r=t.colspan)}return{rowspan:s,colspan:r}},getColspanRealWidth:(e,t,i)=>{if(t<1)return e[i].realWidth;const n=e.map((({realWidth:e,width:t})=>e||t)).slice(i,i+t);return Number(n.reduce(((e,t)=>Number(e)+Number(t)),-1))}}}(e),b=Pi((()=>e.store.states.columns.value.findIndex((({type:e})=>"default"===e)))),C=(e,i)=>{const n=t.props.rowKey;return n?Jc(e,n):i},w=(n,c,u,w=!1)=>{const{tooltipEffect:S,store:x}=e,{indent:k,columns:L}=x.states,D=p(n,c);let E=!0;u&&(D.push(i.em("row",`level-${u.level}`)),E=u.display);return on("tr",{style:[E?null:{display:"none"},g(n,c)],class:D,key:C(n,c),onDblclick:e=>o(e,n),onClick:e=>s(e,n),onContextmenu:e=>r(e,n),onMouseenter:()=>a(c),onMouseleave:l},L.value.map(((i,o)=>{const{rowspan:s,colspan:r}=_(n,i,c,o);if(!s||!r)return null;const a={...i};a.realWidth=v(L.value,r,o);const l={store:e.store,_self:e.context||t,column:a,row:n,$index:c,cellIndex:o,expanded:w};o===b.value&&u&&(l.treeNode={indent:u.level*k.value,level:u.level},"boolean"==typeof u.expanded&&(l.treeNode.expanded=u.expanded,"loading"in u&&(l.treeNode.loading=u.loading),"noLazyChildren"in u&&(l.treeNode.noLazyChildren=u.noLazyChildren)));const g=`${c},${o}`,p=a.columnKey||a.rawColumnKey||"",C=y(o,i,l);return on("td",{style:m(c,o,n,i),class:f(c,o,n,i),key:`${p}${g}`,rowspan:s,colspan:r,onMouseenter:e=>d(e,{...n,tooltipEffect:S}),onMouseleave:h},[C])})))},y=(e,t,i)=>t.renderCell(i);return{wrappedRowRender:(i,n)=>{const o=e.store,{isRowExpanded:s,assertRowKey:r}=o,{treeData:a,lazyTreeNodeMap:l,childrenColumnName:d,rowKey:h}=o.states,c=o.states.columns.value;if(c.some((({type:e})=>"expand"===e))){const e=s(i),r=w(i,n,void 0,e),a=t.renderExpanded;return e?a?[[r,on("tr",{key:`expanded-row__${r.key}`},[on("td",{colspan:c.length,class:"el-table__cell el-table__expanded-cell"},[a({row:i,$index:n,store:o,expanded:e})])])]]:r:[[r]]}if(Object.keys(a.value).length){r();const e=Jc(i,h.value);let t=a.value[e],o=null;t&&(o={expanded:t.expanded,level:t.level,display:!0},"boolean"==typeof t.lazy&&("boolean"==typeof t.loaded&&t.loaded&&(o.noLazyChildren=!(t.children&&t.children.length)),o.loading=t.loading));const s=[w(i,n,o)];if(t){let o=0;const r=(e,i)=>{e&&e.length&&i&&e.forEach((e=>{const c={display:i.display&&i.expanded,level:i.level+1,expanded:!1,noLazyChildren:!1,loading:!1},u=Jc(e,h.value);if(null==u)throw new Error("For nested data item, row-key is required.");if(t={...a.value[u]},t&&(c.expanded=t.expanded,t.level=t.level||c.level,t.display=!(!t.expanded||!c.display),"boolean"==typeof t.lazy&&("boolean"==typeof t.loaded&&t.loaded&&(c.noLazyChildren=!(t.children&&t.children.length)),c.loading=t.loading)),o++,s.push(w(e,n+o,c)),t){const i=l.value[u]||e[d.value];r(i,t)}}))};t.display=!0;const c=l.value[e]||i[d.value];r(c,t)}return s}return w(i,n,void 0)},tooltipContent:c,tooltipTrigger:u}}var Ru=Zi({name:"ElTableBody",props:{store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean},setup(e){const t=en(),i=an(Nu),o=n("table"),{wrappedRowRender:s,tooltipContent:r,tooltipTrigger:a}=Au(e),{onColumnsChange:l,onScrollableChange:d}=Eu(i);return Qn(e.store.states.hoverRow,((i,n)=>{if(!e.store.states.isComplex.value||!E)return;let s=window.requestAnimationFrame;s||(s=e=>window.setTimeout(e,16)),s((()=>{var e;const s=null==(e=null==t?void 0:t.vnode.el)?void 0:e.querySelectorAll(`.${o.e("row")}`),r=s[n],a=s[i];r&&he(r,"hover-row"),a&&le(a,"hover-row")}))})),xn((()=>{var e;null==(e=ru)||e()})),kn((()=>{var e;null==(e=ru)||e()})),{ns:o,onColumnsChange:l,onScrollableChange:d,wrappedRowRender:s,tooltipContent:r,tooltipTrigger:a}},render(){const{wrappedRowRender:e,store:t}=this,i=t.states.data.value||[];return on("tbody",{},[i.reduce(((t,i)=>t.concat(e(i,t.length))),[])])}});function Pu(e){const t="auto"===e.tableLayout;let i=e.columns||[];t&&i.every((e=>void 0===e.width))&&(i=[]);return on("colgroup",{},i.map((i=>on("col",(i=>{const n={key:`${e.tableLayout}_${i.id}`,style:{},name:void 0};return t?n.style={width:`${i.width}px`}:n.name=i.id,n})(i)))))}function Fu(e){const{columns:t}=function(){const e=an(Nu),t=null==e?void 0:e.store;return{leftFixedLeafCount:Pi((()=>t.states.fixedLeafColumnsLength.value)),rightFixedLeafCount:Pi((()=>t.states.rightFixedColumns.value.length)),columnsCount:Pi((()=>t.states.columns.value.length)),leftFixedCount:Pi((()=>t.states.fixedColumns.value.length)),rightFixedCount:Pi((()=>t.states.rightFixedColumns.value.length)),columns:t.states.columns}}(),i=n("table");return{getCellClasses:(t,n)=>{const o=t[n],s=[i.e("cell"),o.id,o.align,o.labelClassName,...lu(i.b(),n,o.fixed,e.store)];return o.className&&s.push(o.className),o.children||s.push(i.is("leaf")),s},getCellStyles:(t,i)=>{const n=hu(i,t.fixed,e.store);return cu(n,"left"),cu(n,"right"),n},columns:t}}Pu.props=["columns","tableLayout"];var Bu=Zi({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e){const{getCellClasses:t,getCellStyles:i,columns:o}=Fu(e);return{ns:n("table"),getCellClasses:t,getCellStyles:i,columns:o}},render(){const{columns:e,getCellStyles:t,getCellClasses:i,summaryMethod:n,sumText:o,ns:s}=this,r=this.store.states.data.value;let a=[];return n?a=n({columns:e,data:r}):e.forEach(((e,t)=>{if(0===t)return void(a[t]=o);const i=r.map((t=>Number(t[e.property]))),n=[];let s=!0;i.forEach((e=>{if(!Number.isNaN(+e)){s=!1;const t=`${e}`.split(".")[1];n.push(t?t.length:0)}}));const l=Math.max.apply(null,n);a[t]=s?"":i.reduce(((e,t)=>{const i=Number(t);return Number.isNaN(+i)?e:Number.parseFloat((e+t).toFixed(Math.min(l,20)))}),0)})),on("table",{class:s.e("footer"),cellspacing:"0",cellpadding:"0",border:"0"},[Pu({columns:e}),on("tbody",[on("tr",{},[...e.map(((n,o)=>on("td",{key:o,colspan:n.colSpan,rowspan:n.rowSpan,class:i(e,o),style:t(n,o)},[on("div",{class:["cell",n.labelClassName]},[a[o]])])))])])])}});function Vu(e,t,i,n){const s=ai(!1),r=ai(null),a=ai(!1),l=ai({width:null,height:null}),d=ai(!1),h=ai();Jn((()=>{t.setHeight(e.height)})),Jn((()=>{t.setMaxHeight(e.maxHeight)})),Qn((()=>[e.currentRowKey,i.states.rowKey]),(([e,t])=>{fi(t)&&i.setCurrentRowKey(`${e}`)}),{immediate:!0}),Qn((()=>e.data),(e=>{n.store.commit("setData",e)}),{immediate:!0,deep:!0}),Jn((()=>{e.expandRowKeys&&i.setExpandRowKeysAdapter(e.expandRowKeys)}));const c=Pi((()=>e.height||e.maxHeight||i.states.fixedColumns.value.length>0||i.states.rightFixedColumns.value.length>0)),u=Pi((()=>({width:t.bodyWidth.value?`${t.bodyWidth.value}px`:""}))),g=()=>{c.value&&t.updateElsHeight(),t.updateColumnsWidth(),requestAnimationFrame(f)};Cn((async()=>{await gn(),i.updateColumns(),_(),requestAnimationFrame(g);const t=n.vnode.el;e.flexible&&t&&t.parentElement&&(t.parentElement.style.minWidth="0"),l.value={width:h.value=t.offsetWidth,height:t.offsetHeight},i.states.columns.value.forEach((e=>{e.filteredValue&&e.filteredValue.length&&n.store.commit("filterChange",{column:e,values:e.filteredValue,silent:!0})})),n.$ready=!0}));const p=e=>{const{tableWrapper:i}=n.refs;((e,i)=>{if(!e)return;const n=Array.from(e.classList).filter((e=>!e.startsWith("is-scrolling-")));n.push(t.scrollX.value?i:"is-scrolling-none"),e.className=n.join(" ")})(i,e)},f=function(){if(!n.refs.scrollBarRef)return;if(!t.scrollX.value){const e="is-scrolling-none";return void((e=>{const{tableWrapper:t}=n.refs;return!(!t||!t.classList.contains(e))})(e)||p(e))}const e=n.refs.scrollBarRef.wrap$;if(!e)return;const{scrollLeft:i,offsetWidth:o,scrollWidth:s}=e,{headerWrapper:r,footerWrapper:a}=n.refs;r&&(r.scrollLeft=i),a&&(a.scrollLeft=i);p(i>=s-o-1?"is-scrolling-right":0===i?"is-scrolling-left":"is-scrolling-middle")},_=()=>{n.refs.scrollBarRef&&(n.refs.scrollBarRef.wrap$&&ue(n.refs.scrollBarRef.wrap$,"scroll",f,{passive:!0}),e.fit?H(n.vnode.el,v):ue(window,"resize",v))},v=()=>{if(!n.$ready)return;let t=!1;const i=n.vnode.el,{width:o,height:s}=l.value,r=h.value=i.offsetWidth;o!==r&&(t=!0);const a=i.offsetHeight;(e.height||c.value)&&s!==a&&(t=!0),t&&(l.value={width:r,height:a},g())},b=m(),C=Pi((()=>{const{bodyWidth:e,scrollY:i,gutterWidth:n}=t;return e.value?e.value-(i.value?n:0)+"px":""})),w=Pi((()=>e.maxHeight?"fixed":e.tableLayout));function y(t,i,n){const o=nu(t),s=e.showHeader?n:0;if(null!==o)return No(o)?`calc(${o} - ${i}px - ${s}px)`:o-i-s}const S=Pi((()=>{const i=t.headerHeight.value||0,n=t.bodyHeight.value,o=t.footerHeight.value||0;return e.height?n||void 0:e.maxHeight?y(e.maxHeight,o,i):void 0}));return{isHidden:s,renderExpanded:r,setDragVisible:e=>{a.value=e},isGroup:d,handleMouseLeave:()=>{n.store.commit("setHoverRow",null),n.hoverState&&(n.hoverState=null)},handleHeaderFooterMousewheel:(e,t)=>{const{pixelX:i,pixelY:o}=t;Math.abs(i)>=Math.abs(o)&&(n.refs.bodyWrapper.scrollLeft+=t.pixelX/5)},tableSize:b,bodyHeight:Pi((()=>{const i=t.headerHeight.value||0,n=t.bodyHeight.value,s=t.footerHeight.value||0;if(e.height)return{height:n?`${n}px`:""};if(e.maxHeight){const t=y(e.maxHeight,s,i);if(null!==t)return{"max-height":`${t}${o(t)?"px":""}`}}return{}})),height:S,emptyBlockStyle:Pi((()=>{if(e.data&&e.data.length)return null;let i="100%";return t.appendHeight.value&&(i=`calc(100% - ${t.appendHeight.value}px)`),{width:h.value?`${h.value}px`:"",height:i}})),handleFixedMousewheel:(e,t)=>{const i=n.refs.bodyWrapper;if(Math.abs(t.spinY)>0){const n=i.scrollTop;t.pixelY<0&&0!==n&&e.preventDefault(),t.pixelY>0&&i.scrollHeight-i.clientHeight>n&&e.preventDefault(),i.scrollTop+=Math.ceil(t.pixelY/5)}else i.scrollLeft+=Math.ceil(t.pixelX/5)},fixedHeight:Pi((()=>e.maxHeight?e.showSummary?{bottom:0}:{bottom:t.scrollX.value&&e.data.length?`${t.gutterWidth}px`:""}:e.showSummary?{height:t.tableHeight.value?`${t.tableHeight.value}px`:""}:{height:t.viewportHeight.value?`${t.viewportHeight.value}px`:""})),fixedBodyHeight:Pi((()=>{if(e.height)return{height:t.fixedBodyHeight.value?`${t.fixedBodyHeight.value}px`:""};if(e.maxHeight){let i=nu(e.maxHeight);if("number"==typeof i)return i=t.scrollX.value?i-t.gutterWidth:i,e.showHeader&&(i-=t.headerHeight.value),i-=t.footerHeight.value,{"max-height":`${i}px`}}return{}})),resizeProxyVisible:a,bodyWidth:C,resizeState:l,doLayout:g,tableBodyStyles:u,tableLayout:w,scrollbarViewStyle:{display:"block",verticalAlign:"middle"}}}var Wu={data:{type:Array,default:()=>[]},size:String,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:{type:Boolean,default:!1},flexible:Boolean};let Hu=1;const zu=Zi({name:"ElTable",directives:{Mousewheel:$d},components:{TableHeader:Mu,TableBody:Ru,TableFooter:Bu,ElScrollbar:C,hColgroup:Pu},props:Wu,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(e){const{t:t}=w(),i=n("table"),s=en();En(Nu,s);const r=vu(s,e);s.store=r;const a=new wu({store:s.store,table:s,fit:e.fit,showHeader:e.showHeader});s.layout=a;const l=Pi((()=>0===(r.states.data.value||[]).length)),{setCurrentRow:d,getSelectionRows:h,toggleRowSelection:c,clearSelection:u,clearFilter:g,toggleAllSelection:p,toggleRowExpansion:m,clearSort:f,sort:_}=function(e){return{setCurrentRow:t=>{e.commit("setCurrentRow",t)},getSelectionRows:()=>e.getSelectionRows(),toggleRowSelection:(t,i)=>{e.toggleRowSelection(t,i,!1),e.updateAllSelected()},clearSelection:()=>{e.clearSelection()},clearFilter:t=>{e.clearFilter(t)},toggleAllSelection:()=>{e.commit("toggleAllSelection")},toggleRowExpansion:(t,i)=>{e.toggleRowExpansionAdapter(t,i)},clearSort:()=>{e.clearSort()},sort:(t,i)=>{e.commit("sort",{prop:t,order:i})}}}(r),{isHidden:v,renderExpanded:b,setDragVisible:C,isGroup:y,handleMouseLeave:S,handleHeaderFooterMousewheel:x,tableSize:k,bodyHeight:L,height:D,emptyBlockStyle:E,handleFixedMousewheel:N,fixedHeight:I,fixedBodyHeight:T,resizeProxyVisible:M,bodyWidth:O,resizeState:A,doLayout:R,tableBodyStyles:P,tableLayout:F,scrollbarViewStyle:B}=Vu(e,a,r,s),{scrollBarRef:V,scrollTo:H,setScrollLeft:z,setScrollTop:j}=(()=>{const e=ai(),t=(t,i)=>{const n=e.value;n&&o(i)&&["Top","Left"].includes(t)&&n[`setScroll${t}`](i)};return{scrollBarRef:e,scrollTo:(t,i)=>{const n=e.value;n&&n.scrollTo(t,i)},setScrollTop:e=>t("Top",e),setScrollLeft:e=>t("Left",e)}})(),U=W(R,50),$="el-table_"+Hu++;s.tableId=$,s.state={isGroup:y,resizeState:A,doLayout:R,debouncedUpdateLayout:U};const K=Pi((()=>e.sumText||t("el.table.sumText"))),q=Pi((()=>e.emptyText||t("el.table.emptyText")));return{ns:i,layout:a,store:r,handleHeaderFooterMousewheel:x,handleMouseLeave:S,tableId:$,tableSize:k,isHidden:v,isEmpty:l,renderExpanded:b,resizeProxyVisible:M,resizeState:A,isGroup:y,bodyWidth:O,bodyHeight:L,height:D,tableBodyStyles:P,emptyBlockStyle:E,debouncedUpdateLayout:U,handleFixedMousewheel:N,fixedHeight:I,fixedBodyHeight:T,setCurrentRow:d,getSelectionRows:h,toggleRowSelection:c,clearSelection:u,clearFilter:g,toggleAllSelection:p,toggleRowExpansion:m,clearSort:f,doLayout:R,sort:_,t:t,setDragVisible:C,context:s,computedSumText:K,computedEmptyText:q,tableLayout:F,scrollbarViewStyle:B,scrollBarRef:V,scrollTo:H,setScrollLeft:z,setScrollTop:j}}}),ju=["data-prefix"],Uu={ref:"hiddenColumns",class:"hidden-columns"};var $u=s(zu,[["render",function(e,t,i,n,o,s){const r=An("hColgroup"),a=An("table-header"),l=An("table-body"),d=An("el-scrollbar"),h=An("table-footer"),c=Rn("mousewheel");return Ln(),Vi("div",{ref:"tableWrapper",class:bi([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:0!==(e.store.states.data.value||[]).length&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:wi(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:t[0]||(t[0]=t=>e.handleMouseLeave())},[Wi("div",{class:bi(e.ns.e("inner-wrapper"))},[Wi("div",Uu,[On(e.$slots,"default")],512),e.showHeader&&"fixed"===e.tableLayout?so((Ln(),Vi("div",{key:0,ref:"headerWrapper",class:bi(e.ns.e("header-wrapper"))},[Wi("table",{ref:"tableHeader",class:bi(e.ns.e("header")),style:wi(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[qi(r,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),qi(a,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[c,e.handleHeaderFooterMousewheel]]):Bi("v-if",!0),Wi("div",{ref:"bodyWrapper",style:wi(e.bodyHeight),class:bi(e.ns.e("body-wrapper"))},[qi(d,{ref:"scrollBarRef",height:e.maxHeight?void 0:e.height,"max-height":e.maxHeight?e.height:void 0,"view-style":e.scrollbarViewStyle,always:e.scrollbarAlwaysOn},{default:no((()=>[Wi("table",{ref:"tableBody",class:bi(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:wi({width:e.bodyWidth,tableLayout:e.tableLayout})},[qi(r,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&"auto"===e.tableLayout?(Ln(),Fi(a,{key:0,border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])):Bi("v-if",!0),qi(l,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","row-style","store","stripe"])],6),e.isEmpty?(Ln(),Vi("div",{key:0,ref:"emptyBlock",style:wi(e.emptyBlockStyle),class:bi(e.ns.e("empty-block"))},[Wi("span",{class:bi(e.ns.e("empty-text"))},[On(e.$slots,"empty",{},(()=>[Ki(yi(e.computedEmptyText),1)]))],2)],6)):Bi("v-if",!0),e.$slots.append?(Ln(),Vi("div",{key:1,ref:"appendWrapper",class:bi(e.ns.e("append-wrapper"))},[On(e.$slots,"append")],2)):Bi("v-if",!0)])),_:3},8,["height","max-height","view-style","always"])],6),e.border||e.isGroup?(Ln(),Vi("div",{key:1,class:bi(e.ns.e("border-left-patch"))},null,2)):Bi("v-if",!0)],2),e.showSummary?so((Ln(),Vi("div",{key:0,ref:"footerWrapper",class:bi(e.ns.e("footer-wrapper"))},[qi(h,{border:e.border,"default-sort":e.defaultSort,store:e.store,style:wi(e.tableBodyStyles),"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","style","sum-text","summary-method"])],2)),[[Lo,!e.isEmpty],[c,e.handleHeaderFooterMousewheel]]):Bi("v-if",!0),so(Wi("div",{ref:"resizeProxy",class:bi(e.ns.e("column-resize-proxy"))},null,2),[[Lo,e.resizeProxyVisible]])],46,ju)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/table.vue"]]);const Ku={selection:"table-column--selection",expand:"table__expand-column"},qu={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},Gu={selection:{renderHeader:({store:e})=>on(ah,{disabled:e.states.data.value&&0===e.states.data.value.length,size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value}),renderCell:({row:e,column:t,store:i,$index:n})=>on(ah,{disabled:!!t.selectable&&!t.selectable.call(null,e,n),size:i.states.tableSize.value,onChange:()=>{i.commit("rowSelectedChanged",e)},onClick:e=>e.stopPropagation(),modelValue:i.isSelected(e)}),sortable:!1,resizable:!1},index:{renderHeader:({column:e})=>e.label||"#",renderCell({column:e,$index:t}){let i=t+1;const n=e.index;return"number"==typeof n?i=t+n:"function"==typeof n&&(i=n(t)),on("div",{},[i])},sortable:!1},expand:{renderHeader:({column:e})=>e.label||"",renderCell({row:e,store:t,expanded:i}){const{ns:n}=t,o=[n.e("expand-icon")];i&&o.push(n.em("expand-icon","expanded"));return on("div",{class:o,onClick:function(i){i.stopPropagation(),t.toggleRowExpansion(e)}},{default:()=>[on(b,null,{default:()=>[on(Xe)]})]})},sortable:!1,resizable:!1}};function Zu({row:e,column:t,$index:i}){var n;const o=t.property,s=o&&ge(e,o).value;return t&&t.formatter?t.formatter(e,t,s,i):(null==(n=null==s?void 0:s.toString)?void 0:n.call(s))||""}function Yu(e,t){return e.reduce(((e,t)=>(e[t]=t,e)),t)}function Xu(e,t,i){const o=en(),s=ai(""),r=ai(!1),a=ai(),l=ai(),d=n("table");Jn((()=>{a.value=e.align?`is-${e.align}`:null,a.value})),Jn((()=>{l.value=e.headerAlign?`is-${e.headerAlign}`:a.value,l.value}));const h=Pi((()=>{let e=o.vnode.vParent||o.parent;for(;e&&!e.tableId&&!e.columnId;)e=e.vnode.vParent||e.parent;return e})),c=Pi((()=>{const{store:e}=o.parent;if(!e)return!1;const{treeData:t}=e.states,i=t.value;return i&&Object.keys(i).length>0})),u=ai(tu(e.width)),g=ai(iu(e.minWidth));return{columnId:s,realAlign:a,isSubColumn:r,realHeaderAlign:l,columnOrTableParent:h,setColumnWidth:e=>(u.value&&(e.width=u.value),g.value&&(e.minWidth=g.value),e.minWidth||(e.minWidth=80),e.realWidth=Number(void 0===e.width?e.minWidth:e.width),e),setColumnForcedProps:e=>{const t=e.type,i=Gu[t]||{};Object.keys(i).forEach((t=>{const n=i[t];"className"!==t&&void 0!==n&&(e[t]=n)}));const n=(e=>Ku[e]||"")(t);if(n){const t=`${fi(d.namespace)}-${n}`;e.className=e.className?`${e.className} ${t}`:t}return e},setColumnRenders:n=>{e.renderHeader||"selection"!==n.type&&(n.renderHeader=e=>{o.columnConfig.value.label;const i=t.header;return i?i(e):n.label});let s=n.renderCell;const r=c.value;return"expand"===n.type?(n.renderCell=e=>on("div",{class:"cell"},[s(e)]),i.value.renderExpanded=e=>t.default?t.default(e):t.default):(s=s||Zu,n.renderCell=e=>{let i=null;if(t.default){const n=t.default(e);i=n.some((e=>e.type!==ki))?n:s(e)}else i=s(e);const a=function({row:e,treeNode:t,store:i},n=!1){const{ns:o}=i;if(!t)return n?[on("span",{class:o.e("placeholder")})]:null;const s=[],r=function(t){t.stopPropagation(),i.loadOrToggle(e)};if(t.indent&&s.push(on("span",{class:o.e("indent"),style:{"padding-left":`${t.indent}px`}})),"boolean"!=typeof t.expanded||t.noLazyChildren)s.push(on("span",{class:o.e("placeholder")}));else{const e=[o.e("expand-icon"),t.expanded?o.em("expand-icon","expanded"):""];let i=Xe;t.loading&&(i=Ye),s.push(on("div",{class:e,onClick:r},{default:()=>[on(b,{class:{[o.is("loading")]:t.loading}},{default:()=>[on(i)]})]}))}return s}(e,r&&0===e.cellIndex),l={class:"cell",style:{}};return n.showOverflowTooltip&&(l.class=`${l.class} ${fi(d.namespace)}-tooltip`,l.style={width:(e.column.realWidth||Number(e.column.width))-1+"px"}),(e=>{function t(e){var t;"ElTableColumn"===(null==(t=null==e?void 0:e.type)?void 0:t.name)&&(e.vParent=o)}Array.isArray(e)?e.forEach((e=>t(e))):t(e)})(i),on("div",l,[a,i])}),n},getPropsData:(...t)=>t.reduce(((t,i)=>(Array.isArray(i)&&i.forEach((i=>{t[i]=e[i]})),t)),{}),getColumnElIndex:(e,t)=>Array.prototype.indexOf.call(e,t)}}var Qu={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showTooltipWhenOverflow:Boolean,showOverflowTooltip:Boolean,fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every((e=>["ascending","descending",null].includes(e)))}};let Ju=1;var eg=Zi({name:"ElTableColumn",components:{ElCheckbox:ah},props:Qu,setup(e,{slots:t}){const i=en(),n=ai({}),o=Pi((()=>{let e=i.parent;for(;e&&!e.tableId;)e=e.parent;return e})),{registerNormalWatchers:s,registerComplexWatchers:r}=function(e,t){const i=en();return{registerComplexWatchers:()=>{const n={realWidth:"width",realMinWidth:"minWidth"},o=Yu(["fixed"],n);Object.keys(o).forEach((o=>{const s=n[o];Ro(t,s)&&Qn((()=>t[s]),(t=>{let n=t;"width"===s&&"realWidth"===o&&(n=tu(t)),"minWidth"===s&&"realMinWidth"===o&&(n=iu(t)),i.columnConfig.value[s]=n,i.columnConfig.value[o]=n;const r="fixed"===s;e.value.store.scheduleLayout(r)}))}))},registerNormalWatchers:()=>{const e={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},n=Yu(["label","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"],e);Object.keys(n).forEach((n=>{const o=e[n];Ro(t,o)&&Qn((()=>t[o]),(e=>{i.columnConfig.value[n]=e}))}))}}}(o,e),{columnId:a,isSubColumn:l,realHeaderAlign:d,columnOrTableParent:h,setColumnWidth:c,setColumnForcedProps:u,setColumnRenders:g,getPropsData:p,getColumnElIndex:m,realAlign:f}=Xu(e,t,o),_=h.value;a.value=`${_.tableId||_.columnId}_column_${Ju++}`,mn((()=>{l.value=o.value!==_;const t=e.type||"default",h=""===e.sortable||e.sortable,m={...qu[t],id:a.value,type:t,property:e.prop||e.property,align:f,headerAlign:d,showOverflowTooltip:e.showOverflowTooltip||e.showTooltipWhenOverflow,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:h,index:e.index,rawColumnKey:i.vnode.key};let v=p(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);v=function(e,t){const i={};let n;for(n in e)i[n]=e[n];for(n in t)if(Ro(t,n)){const e=t[n];void 0!==e&&(i[n]=e)}return i}(m,v);v=function(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...i)=>e(t(...i))))}(g,c,u)(v),n.value=v,s(),r()})),Cn((()=>{var e;const t=h.value,s=l.value?t.vnode.el.children:null==(e=t.refs.hiddenColumns)?void 0:e.children,r=()=>m(s||[],i.vnode.el);n.value.getColumnIndex=r;r()>-1&&o.value.store.commit("insertColumn",n.value,l.value?t.columnConfig.value:null)})),fn((()=>{o.value.store.commit("removeColumn",n.value,l.value?_.columnConfig.value:null)})),i.columnId=a.value,i.columnConfig=n},render(){var e,t,i;try{const n=null==(t=(e=this.$slots).default)?void 0:t.call(e,{row:{},column:{},$index:-1}),o=[];if(Array.isArray(n))for(const e of n)"ElTableColumn"===(null==(i=e.type)?void 0:i.name)||2&e.shapeFlag?o.push(e):e.type===Li&&Array.isArray(e.children)&&e.children.forEach((e=>{1024===(null==e?void 0:e.patchFlag)||No(null==e?void 0:e.children)||o.push(e)}));return on("div",o)}catch(n){return on("div",[])}}});const tg=r($u,{TableColumn:eg}),ig=_(eg);var ng=s(Zi({name:"ElTabBar",props:i({tabs:{type:j(Array),default:()=>U([])}}),setup(e,{expose:t}){const i=e,o=en(),s=an(pd);s||oe("ElTabBar","");const r=n("tabs"),a=ai(),l=ai(),d=()=>l.value=(()=>{let e=0,t=0;const n=["top","bottom"].includes(s.props.tabPosition)?"width":"height",r="width"===n?"x":"y";return i.tabs.every((s=>{var a,l,d,h;const c=null==(l=null==(a=o.parent)?void 0:a.refs)?void 0:l[`tab-${s.paneName}`];if(!c)return!1;if(!s.active)return!0;t=c[`client${vi(n)}`];const u="x"===r?"left":"top";e=c.getBoundingClientRect()[u]-(null!=(h=null==(d=c.parentElement)?void 0:d.getBoundingClientRect()[u])?h:0);const g=window.getComputedStyle(c);return"width"===n&&(i.tabs.length>1&&(t-=Number.parseFloat(g.paddingLeft)+Number.parseFloat(g.paddingRight)),e+=Number.parseFloat(g.paddingLeft)),!1})),{[n]:`${t}px`,transform:`translate${vi(r)}(${e}px)`}})();return Qn((()=>i.tabs),(async()=>{await gn(),d()}),{immediate:!0}),H(a,(()=>d())),t({ref:a,update:d}),(e,t)=>(Ln(),Vi("div",{ref_key:"barRef",ref:a,class:bi([fi(r).e("active-bar"),fi(r).is(fi(s).props.tabPosition)]),style:wi(l.value)},null,6))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-bar.vue"]]);const og=i({panes:{type:j(Array),default:()=>U([])},currentName:{type:[String,Number],default:""},editable:Boolean,onTabClick:{type:j(Function),default:Oo},onTabRemove:{type:j(Function),default:Oo},type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),sg=Zi({name:"ElTabNav",props:og,setup(e,{expose:t}){const i=en(),o=an(pd);o||oe("ElTabNav","");const s=n("tabs"),r=pe(),a=me(),l=ai(),d=ai(),h=ai(),c=ai(!1),u=ai(0),g=ai(!1),p=ai(!0),m=Pi((()=>["top","bottom"].includes(o.props.tabPosition)?"width":"height")),f=Pi((()=>({transform:`translate${"width"===m.value?"X":"Y"}(-${u.value}px)`}))),_=()=>{if(!l.value)return;const e=l.value[`offset${vi(m.value)}`],t=u.value;if(!t)return;const i=t>e?t-e:0;u.value=i},v=()=>{if(!l.value||!d.value)return;const e=d.value[`offset${vi(m.value)}`],t=l.value[`offset${vi(m.value)}`],i=u.value;if(e-i<=t)return;const n=e-i>2*t?i+t:e-t;u.value=n},C=async()=>{const e=d.value;if(!(c.value&&h.value&&l.value&&e))return;await gn();const t=h.value.querySelector(".is-active");if(!t)return;const i=l.value,n=["top","bottom"].includes(o.props.tabPosition),s=t.getBoundingClientRect(),r=i.getBoundingClientRect(),a=n?e.offsetWidth-r.width:e.offsetHeight-r.height,g=u.value;let p=g;n?(s.leftr.right&&(p=g+s.right-r.right)):(s.topr.bottom&&(p=g+(s.bottom-r.bottom))),p=Math.max(p,0),u.value=Math.min(p,a)},w=()=>{if(!d.value||!l.value)return;const e=d.value[`offset${vi(m.value)}`],t=l.value[`offset${vi(m.value)}`],i=u.value;if(t0&&(u.value=0)},y=e=>{const t=e.code,{up:i,down:n,left:o,right:s}=I;if(![i,n,o,s].includes(t))return;const r=Array.from(e.currentTarget.querySelectorAll("[role=tab]")),a=r.indexOf(e.target);let l;l=t===o||t===i?0===a?r.length-1:a-1:a{p.value&&(g.value=!0)},x=()=>g.value=!1;return Qn(r,(e=>{"hidden"===e?p.value=!1:"visible"===e&&setTimeout((()=>p.value=!0),50)})),Qn(a,(e=>{e?setTimeout((()=>p.value=!0),50):p.value=!1})),H(h,w),Cn((()=>setTimeout((()=>C()),0))),kn((()=>w())),t({scrollToActiveTab:C,removeFocus:x}),Qn((()=>e.panes),(()=>i.update()),{flush:"post"}),()=>{const t=c.value?[qi("span",{class:[s.e("nav-prev"),s.is("disabled",!c.value.prev)],onClick:_},[qi(b,null,{default:()=>[qi(at,null,null)]})]),qi("span",{class:[s.e("nav-next"),s.is("disabled",!c.value.next)],onClick:v},[qi(b,null,{default:()=>[qi(Xe,null,null)]})])]:null,i=e.panes.map(((t,i)=>{var n,r,a,l;const d=null!=(r=null!=(n=t.props.name)?n:t.index)?r:`${i}`,h=t.isClosable||e.editable;t.index=`${i}`;const c=h?qi(b,{class:"is-icon-close",onClick:i=>e.onTabRemove(t,i)},{default:()=>[qi(et,null,null)]}):null,u=(null==(l=(a=t.slots).label)?void 0:l.call(a))||t.props.label,p=t.active?0:-1;return qi("div",{ref:`tab-${d}`,class:[s.e("item"),s.is(o.props.tabPosition),s.is("active",t.active),s.is("disabled",t.props.disabled),s.is("closable",h),s.is("focus",g.value)],id:`tab-${d}`,key:`tab-${d}`,"aria-controls":`pane-${d}`,role:"tab","aria-selected":t.active,tabindex:p,onFocus:()=>S(),onBlur:()=>x(),onClick:i=>{x(),e.onTabClick(t,d,i)},onKeydown:i=>{!h||i.code!==I.delete&&i.code!==I.backspace||e.onTabRemove(t,i)}},[u,c])}));return qi("div",{ref:h,class:[s.e("nav-wrap"),s.is("scrollable",!!c.value),s.is(o.props.tabPosition)]},[t,qi("div",{class:s.e("nav-scroll"),ref:l},[qi("div",{class:[s.e("nav"),s.is(o.props.tabPosition),s.is("stretch",e.stretch&&["top","bottom"].includes(o.props.tabPosition))],ref:d,style:f.value,role:"tablist",onKeydown:y},[e.type?null:qi(ng,{tabs:[...e.panes]},null),i])])])}}}),rg=i({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:j(Function),default:()=>!0},stretch:Boolean}),ag=e=>No(e)||o(e);var lg=Zi({name:"ElTabs",props:rg,emits:{[g]:e=>ag(e),"tab-click":(e,t)=>t instanceof Event,"tab-change":e=>ag(e),edit:(e,t)=>["remove","add"].includes(t),"tab-remove":e=>ag(e),"tab-add":()=>!0},setup(e,{emit:t,slots:i,expose:o}){var s,r;const a=n("tabs"),l=ai(),d=si({}),h=ai(null!=(r=null!=(s=e.modelValue)?s:e.activeName)?r:"0"),c=async i=>{var n,o,s;if(h.value!==i&&!x(i))try{!1!==await(null==(n=e.beforeLeave)?void 0:n.call(e,i,h.value))&&((e=>{h.value=e,t(g,e),t("tab-change",e)})(i),null==(s=null==(o=l.value)?void 0:o.removeFocus)||s.call(o))}catch(r){}},u=(e,i,n)=>{e.props.disabled||(c(i),t("tab-click",e,n))},p=(e,i)=>{e.props.disabled||x(e.props.name)||(i.stopPropagation(),t("edit",e.props.name,"remove"),t("tab-remove",e.props.name))},m=()=>{t("edit",void 0,"add"),t("tab-add")};ie({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},Pi((()=>!!e.activeName))),Qn((()=>e.activeName),(e=>c(e))),Qn((()=>e.modelValue),(e=>c(e))),Qn(h,(async()=>{var e;await gn(),null==(e=l.value)||e.scrollToActiveTab()}));En(pd,{props:e,currentName:h,registerPane:e=>d[e.uid]=e,unregisterPane:e=>delete d[e]});return o({currentName:h}),()=>{const t=e.editable||e.addable?qi("span",{class:a.e("new-tab"),tabindex:"0",onClick:m,onKeydown:e=>{e.code===I.enter&&m()}},[qi(b,{class:a.is("icon-plus")},{default:()=>[qi(nt,null,null)]})]):null,n=qi("div",{class:[a.e("header"),a.is(e.tabPosition)]},[t,qi(sg,{ref:l,currentName:h.value,editable:e.editable,type:e.type,panes:Object.values(d),stretch:e.stretch,onTabClick:u,onTabRemove:p},null)]),o=qi("div",{class:a.e("content")},[On(i,"default")]);return qi("div",{class:[a.b(),a.m(e.tabPosition),{[a.m("card")]:"card"===e.type,[a.m("border-card")]:"border-card"===e.type}]},[..."bottom"!==e.tabPosition?[n,o]:[o,n]])}}});const dg=i({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),hg=["id","aria-hidden","aria-labelledby"];var cg=s(Zi({name:"ElTabPane",props:dg,setup(e){const t=e,i=en(),o=Gn(),s=an(pd);s||oe("ElTabPane","usage: ");const r=n("tab-pane"),a=ai(),l=Pi((()=>t.closable||s.props.closable)),d=fe((()=>{var e;return s.currentName.value===(null!=(e=t.name)?e:a.value)})),h=ai(d.value),c=Pi((()=>{var e;return null!=(e=t.name)?e:a.value})),u=fe((()=>!t.lazy||h.value||d.value));Qn(d,(e=>{e&&(h.value=!0)}));const g=si({uid:i.uid,slots:o,props:t,paneName:c,active:d,index:a,isClosable:l});return Cn((()=>{s.registerPane(g)})),xn((()=>{s.unregisterPane(g.uid)})),(e,t)=>fi(u)?so((Ln(),Vi("div",{key:0,id:`pane-${fi(c)}`,class:bi(fi(r).b()),role:"tabpanel","aria-hidden":!fi(d),"aria-labelledby":`tab-${fi(c)}`},[On(e.$slots,"default")],10,hg)),[[Lo,fi(d)]]):Bi("v-if",!0)}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-pane.vue"]]);const ug=r(lg,{TabPane:cg}),gg=_(cg),pg="$treeNodeId",mg=function(e,t){t&&!t[pg]&&Object.defineProperty(t,pg,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},fg=function(e,t){return e?t[e]:t[pg]},_g=e=>{let t=!0,i=!0,n=!0;for(let o=0,s=e.length;o0&&e.lazy&&e.defaultExpandAll&&this.expand(),Array.isArray(this.data)||mg(this,this.data),!this.data)return;const i=e.defaultExpandedKeys,n=e.key;n&&i&&i.includes(this.key)&&this.expand(null,e.autoExpandParent),n&&void 0!==e.currentNodeKey&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),!this.parent||1!==this.level&&!0!==this.parent.expanded||(this.canFocus=!0)}setData(e){let t;Array.isArray(e)||mg(this,e),this.data=e,this.childNodes=[],t=0===this.level&&Array.isArray(this.data)?this.data:bg(this,"children")||[];for(let i=0,n=t.length;i-1)return e.childNodes[t+1]}return null}get previousSibling(){const e=this.parent;if(e){const t=e.childNodes.indexOf(this);if(t>-1)return t>0?e.childNodes[t-1]:null}return null}contains(e,t=!0){return(this.childNodes||[]).some((i=>i===e||t&&i.contains(e)))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,t,i){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof wg)){if(!i){const i=this.getChildren(!0);i.includes(e.data)||(void 0===t||t<0?i.push(e.data):i.splice(t,0,e.data))}Object.assign(e,{parent:this,store:this.store}),(e=si(new wg(e)))instanceof wg&&e.initialize()}e.level=this.level+1,void 0===t||t<0?this.childNodes.push(e):this.childNodes.splice(t,0,e),this.updateLeafState()}insertBefore(e,t){let i;t&&(i=this.childNodes.indexOf(t)),this.insertChild(e,i)}insertAfter(e,t){let i;t&&(i=this.childNodes.indexOf(t),-1!==i&&(i+=1)),this.insertChild(e,i)}removeChild(e){const t=this.getChildren()||[],i=t.indexOf(e.data);i>-1&&t.splice(i,1);const n=this.childNodes.indexOf(e);n>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(n,1)),this.updateLeafState()}removeChildByData(e){let t=null;for(let i=0;i{if(t){let e=this.parent;for(;e.level>0;)e.expanded=!0,e=e.parent}this.expanded=!0,e&&e(),this.childNodes.forEach((e=>{e.canFocus=!0}))};this.shouldLoadData()?this.loadData((e=>{Array.isArray(e)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||vg(this),i())})):i()}doCreateChildren(e,t={}){e.forEach((e=>{this.insertChild(Object.assign({data:e},t),void 0,!0)}))}collapse(){this.expanded=!1,this.childNodes.forEach((e=>{e.canFocus=!1}))}shouldLoadData(){return!0===this.store.lazy&&this.store.load&&!this.loaded}updateLeafState(){if(!0===this.store.lazy&&!0!==this.loaded&&void 0!==this.isLeafByUser)return void(this.isLeaf=this.isLeafByUser);const e=this.childNodes;!this.store.lazy||!0===this.store.lazy&&!0===this.loaded?this.isLeaf=!e||0===e.length:this.isLeaf=!1}setChecked(e,t,i,n){if(this.indeterminate="half"===e,this.checked=!0===e,this.store.checkStrictly)return;if(!this.shouldLoadData()||this.store.checkDescendants){const{all:i,allWithoutDisable:o}=_g(this.childNodes);this.isLeaf||i||!o||(this.checked=!1,e=!1);const s=()=>{if(t){const i=this.childNodes;for(let r=0,a=i.length;r{s(),vg(this)}),{checked:!1!==e});s()}const o=this.parent;o&&0!==o.level&&(i||vg(o))}getChildren(e=!1){if(0===this.level)return this.data;const t=this.data;if(!t)return null;const i=this.store.props;let n="children";return i&&(n=i.children||"children"),void 0===t[n]&&(t[n]=null),e&&!t[n]&&(t[n]=[]),t[n]}updateChildren(){const e=this.getChildren()||[],t=this.childNodes.map((e=>e.data)),i={},n=[];e.forEach(((e,o)=>{const s=e[pg];!!s&&t.findIndex((e=>e[pg]===s))>=0?i[s]={index:o,data:e}:n.push({index:o,data:e})})),this.store.lazy||t.forEach((e=>{i[e[pg]]||this.removeChildByData(e)})),n.forEach((({index:e,data:t})=>{this.insertChild({data:t},e)})),this.updateLeafState()}loadData(e,t={}){if(!0!==this.store.lazy||!this.store.load||this.loaded||this.loading&&!Object.keys(t).length)e&&e.call(this);else{this.loading=!0;const i=i=>{this.loaded=!0,this.loading=!1,this.childNodes=[],this.doCreateChildren(i,t),this.updateLeafState(),e&&e.call(this,i)};this.store.load(this,i)}}}class yg{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const t in e)Ro(e,t)&&(this[t]=e[t]);this.nodesMap={}}initialize(){if(this.root=new wg({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){(0,this.load)(this.root,(e=>{this.root.doCreateChildren(e),this._initDefaultCheckedNodes()}))}else this._initDefaultCheckedNodes()}filter(e){const t=this.filterNodeMethod,i=this.lazy,n=function(o){const s=o.root?o.root.childNodes:o.childNodes;if(s.forEach((i=>{i.visible=t.call(i,e,i.data,i),n(i)})),!o.visible&&s.length){let e=!0;e=!s.some((e=>e.visible)),o.root?o.root.visible=!1===e:o.visible=!1===e}e&&(!o.visible||o.isLeaf||i||o.expand())};n(this)}setData(e){e!==this.root.data?(this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof wg)return e;const t="object"!=typeof e?e:fg(this.key,e);return this.nodesMap[t]||null}insertBefore(e,t){const i=this.getNode(t);i.parent.insertBefore({data:e},i)}insertAfter(e,t){const i=this.getNode(t);i.parent.insertAfter({data:e},i)}remove(e){const t=this.getNode(e);t&&t.parent&&(t===this.currentNode&&(this.currentNode=null),t.parent.removeChild(t))}append(e,t){const i=t?this.getNode(t):this.root;i&&i.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],t=this.nodesMap;e.forEach((e=>{const i=t[e];i&&i.setChecked(!0,!this.checkStrictly)}))}_initDefaultCheckedNode(e){(this.defaultCheckedKeys||[]).includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const t=this.key;if(e&&e.data)if(t){void 0!==e.key&&(this.nodesMap[e.key]=e)}else this.nodesMap[e.id]=e}deregisterNode(e){this.key&&e&&e.data&&(e.childNodes.forEach((e=>{this.deregisterNode(e)})),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,t=!1){const i=[],n=function(o){(o.root?o.root.childNodes:o.childNodes).forEach((o=>{(o.checked||t&&o.indeterminate)&&(!e||e&&o.isLeaf)&&i.push(o.data),n(o)}))};return n(this),i}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map((e=>(e||{})[this.key]))}getHalfCheckedNodes(){const e=[],t=function(i){(i.root?i.root.childNodes:i.childNodes).forEach((i=>{i.indeterminate&&e.push(i.data),t(i)}))};return t(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map((e=>(e||{})[this.key]))}_getAllNodes(){const e=[],t=this.nodesMap;for(const i in t)Ro(t,i)&&e.push(t[i]);return e}updateChildren(e,t){const i=this.nodesMap[e];if(!i)return;const n=i.childNodes;for(let o=n.length-1;o>=0;o--){const e=n[o];this.remove(e.data)}for(let o=0,s=t.length;ot.level-e.level)),o=Object.create(null),s=Object.keys(i);n.forEach((e=>e.setChecked(!1,!1)));for(let r=0,a=n.length;r0;)o[l.data[e]]=!0,l=l.parent;if(i.isLeaf||this.checkStrictly)i.setChecked(!0,!1);else if(i.setChecked(!0,!0),t){i.setChecked(!1,!1);const e=function(t){t.childNodes.forEach((t=>{t.isLeaf||t.setChecked(!1,!1),e(t)}))};e(i)}}}setCheckedNodes(e,t=!1){const i=this.key,n={};e.forEach((e=>{n[(e||{})[i]]=!0})),this._setCheckedKeys(i,t,n)}setCheckedKeys(e,t=!1){this.defaultCheckedKeys=e;const i=this.key,n={};e.forEach((e=>{n[e]=!0})),this._setCheckedKeys(i,t,n)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach((e=>{const t=this.getNode(e);t&&t.expand(null,this.autoExpandParent)}))}setChecked(e,t,i){const n=this.getNode(e);n&&n.setChecked(!!t,i)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,t=!0){const i=e[this.key],n=this.nodesMap[i];this.setCurrentNode(n),t&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,t=!0){if(null==e)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);const i=this.getNode(e);i&&(this.setCurrentNode(i),t&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}var Sg=s(Zi({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=n("tree"),i=an("NodeInstance"),o=an("RootTree");return()=>{const n=e.node,{data:s,store:r}=n;return e.renderContent?e.renderContent(on,{_self:i,node:n,data:s,store:r}):o.ctx.slots.default?o.ctx.slots.default({node:n,data:s}):on("span",{class:t.be("node","label")},[n.label])}}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node-content.vue"]]);function xg(e){const t=an("TreeNodeMap",null),i={treeNodeExpand:t=>{e.node!==t&&e.node.collapse()},children:[]};return t&&t.children.push(i),En("TreeNodeMap",i),{broadcastExpanded:t=>{if(e.accordion)for(const e of i.children)e.treeNodeExpand(t)}}}const kg=Symbol("dragEvents");const Lg=Zi({name:"ElTreeNode",components:{ElCollapseTransition:K,ElCheckbox:ah,NodeContent:Sg,ElIcon:b,Loading:Ye},props:{node:{type:wg,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const i=n("tree"),{broadcastExpanded:o}=xg(e),s=an("RootTree"),r=ai(!1),a=ai(!1),l=ai(null),d=ai(null),h=ai(null),c=an(kg),u=en();En("NodeInstance",u),e.node.expanded&&(r.value=!0,a.value=!0);const g=s.props.children||"children";Qn((()=>{const t=e.node.data[g];return t&&[...t]}),(()=>{e.node.updateChildren()})),Qn((()=>e.node.indeterminate),(t=>{p(e.node.checked,t)})),Qn((()=>e.node.checked),(t=>{p(t,e.node.indeterminate)})),Qn((()=>e.node.expanded),(e=>{gn((()=>r.value=e)),e&&(a.value=!0)}));const p=(t,i)=>{l.value===t&&d.value===i||s.ctx.emit("check-change",e.node.data,t,i),l.value=t,d.value=i},m=()=>{e.node.isLeaf||(r.value?(s.ctx.emit("node-collapse",e.node.data,e.node,u),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,u)))},f=(t,i)=>{e.node.setChecked(i.target.checked,!s.props.checkStrictly),gn((()=>{const t=s.store.value;s.ctx.emit("check",e.node.data,{checkedNodes:t.getCheckedNodes(),checkedKeys:t.getCheckedKeys(),halfCheckedNodes:t.getHalfCheckedNodes(),halfCheckedKeys:t.getHalfCheckedKeys()})}))};return{ns:i,node$:h,tree:s,expanded:r,childNodeRendered:a,oldChecked:l,oldIndeterminate:d,getNodeKey:e=>fg(s.props.nodeKey,e.data),getNodeClass:t=>{const i=e.props.class;if(!i)return{};let n;if(Mo(i)){const{data:e}=t;n=i(e,t)}else n=i;return No(n)?{[n]:!0}:n},handleSelectChange:p,handleClick:t=>{const i=s.store.value;i.setCurrentNode(e.node),s.ctx.emit("current-change",i.currentNode?i.currentNode.data:null,i.currentNode),s.currentNode.value=e.node,s.props.expandOnClickNode&&m(),s.props.checkOnClickNode&&!e.node.disabled&&f(null,{target:{checked:!e.node.checked}}),s.ctx.emit("node-click",e.node.data,e.node,u,t)},handleContextMenu:t=>{s.instance.vnode.props.onNodeContextmenu&&(t.stopPropagation(),t.preventDefault()),s.ctx.emit("node-contextmenu",t,e.node.data,e.node,u)},handleExpandIconClick:m,handleCheckChange:f,handleChildNodeExpand:(e,t,i)=>{o(t),s.ctx.emit("node-expand",e,t,i)},handleDragStart:t=>{s.props.draggable&&c.treeNodeDragStart({event:t,treeNode:e})},handleDragOver:t=>{t.preventDefault(),s.props.draggable&&c.treeNodeDragOver({event:t,treeNode:{$el:h.value,node:e.node}})},handleDrop:e=>{e.preventDefault()},handleDragEnd:e=>{s.props.draggable&&c.treeNodeDragEnd(e)},CaretRight:lt}}}),Dg=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],Eg=["aria-expanded"];var Ng=s(Zi({name:"ElTree",components:{ElTreeNode:s(Lg,[["render",function(e,t,i,n,o,s){const r=An("el-icon"),a=An("el-checkbox"),l=An("loading"),d=An("node-content"),h=An("el-tree-node"),c=An("el-collapse-transition");return so((Ln(),Vi("div",{ref:"node$",class:bi([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=Eo(((...t)=>e.handleClick&&e.handleClick(...t)),["stop"])),onContextmenu:t[2]||(t[2]=(...t)=>e.handleContextMenu&&e.handleContextMenu(...t)),onDragstart:t[3]||(t[3]=Eo(((...t)=>e.handleDragStart&&e.handleDragStart(...t)),["stop"])),onDragover:t[4]||(t[4]=Eo(((...t)=>e.handleDragOver&&e.handleDragOver(...t)),["stop"])),onDragend:t[5]||(t[5]=Eo(((...t)=>e.handleDragEnd&&e.handleDragEnd(...t)),["stop"])),onDrop:t[6]||(t[6]=Eo(((...t)=>e.handleDrop&&e.handleDrop(...t)),["stop"]))},[Wi("div",{class:bi(e.ns.be("node","content")),style:wi({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(Ln(),Fi(r,{key:0,class:bi([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:Eo(e.handleExpandIconClick,["stop"])},{default:no((()=>[(Ln(),Fi(Pn(e.tree.props.icon||e.CaretRight)))])),_:1},8,["class","onClick"])):Bi("v-if",!0),e.showCheckbox?(Ln(),Fi(a,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=Eo((()=>{}),["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):Bi("v-if",!0),e.node.loading?(Ln(),Fi(r,{key:2,class:bi([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:no((()=>[qi(l)])),_:1},8,["class"])):Bi("v-if",!0),qi(d,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),qi(c,null,{default:no((()=>[!e.renderAfterExpand||e.childNodeRendered?so((Ln(),Vi("div",{key:0,class:bi(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[(Ln(!0),Vi(Li,null,Mn(e.node.childNodes,(t=>(Ln(),Fi(h,{key:e.getNodeKey(t),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:t,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"])))),128))],10,Eg)),[[Lo,e.expanded]]):Bi("v-if",!0)])),_:1})],42,Dg)),[[Lo,e.node.visible]])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node.vue"]])},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:[String,Object]},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:i}=w(),o=n("tree"),s=ai(new yg({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));s.value.initialize();const r=ai(s.value.root),l=ai(null),d=ai(null),h=ai(null),{broadcastExpanded:u}=xg(e),{dragState:g}=function({props:e,ctx:t,el$:i,dropIndicator$:o,store:s}){const r=n("tree"),a=ai({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null});return En(kg,{treeNodeDragStart:({event:i,treeNode:n})=>{if("function"==typeof e.allowDrag&&!e.allowDrag(n.node))return i.preventDefault(),!1;i.dataTransfer.effectAllowed="move";try{i.dataTransfer.setData("text/plain","")}catch(o){}a.value.draggingNode=n,t.emit("node-drag-start",n.node,i)},treeNodeDragOver:({event:n,treeNode:s})=>{const l=s,d=a.value.dropNode;d&&d!==l&&he(d.$el,r.is("drop-inner"));const h=a.value.draggingNode;if(!h||!l)return;let c=!0,u=!0,g=!0,p=!0;"function"==typeof e.allowDrop&&(c=e.allowDrop(h.node,l.node,"prev"),p=u=e.allowDrop(h.node,l.node,"inner"),g=e.allowDrop(h.node,l.node,"next")),n.dataTransfer.dropEffect=u||c||g?"move":"none",(c||u||g)&&d!==l&&(d&&t.emit("node-drag-leave",h.node,d.node,n),t.emit("node-drag-enter",h.node,l.node,n)),(c||u||g)&&(a.value.dropNode=l),l.node.nextSibling===h.node&&(g=!1),l.node.previousSibling===h.node&&(c=!1),l.node.contains(h.node,!1)&&(u=!1),(h.node===l.node||h.node.contains(l.node))&&(c=!1,u=!1,g=!1);const m=l.$el.getBoundingClientRect(),f=i.value.getBoundingClientRect();let _;const v=c?u?.25:g?.45:1:-1,b=g?u?.75:c?.55:0:1;let C=-9999;const w=n.clientY-m.top;_=wm.height*b?"after":u?"inner":"none";const y=l.$el.querySelector(`.${r.be("node","expand-icon")}`).getBoundingClientRect(),S=o.value;"before"===_?C=y.top-f.top:"after"===_&&(C=y.bottom-f.top),S.style.top=`${C}px`,S.style.left=y.right-f.left+"px","inner"===_?le(l.$el,r.is("drop-inner")):he(l.$el,r.is("drop-inner")),a.value.showDropIndicator="before"===_||"after"===_,a.value.allowDrop=a.value.showDropIndicator||p,a.value.dropType=_,t.emit("node-drag-over",h.node,l.node,n)},treeNodeDragEnd:e=>{const{draggingNode:i,dropType:n,dropNode:o}=a.value;if(e.preventDefault(),e.dataTransfer.dropEffect="move",i&&o){const a={data:i.node.data};"none"!==n&&i.node.remove(),"before"===n?o.node.parent.insertBefore(a,o.node):"after"===n?o.node.parent.insertAfter(a,o.node):"inner"===n&&o.node.insertChild(a),"none"!==n&&s.value.registerNode(a),he(o.$el,r.is("drop-inner")),t.emit("node-drag-end",i.node,o.node,n,e),"none"!==n&&t.emit("node-drop",i.node,o.node,n,e)}i&&!o&&t.emit("node-drag-end",i.node,null,n,e),a.value.showDropIndicator=!1,a.value.draggingNode=null,a.value.dropNode=null,a.value.allowDrop=!0}}),{dragState:a}}({props:e,ctx:t,el$:d,dropIndicator$:h,store:s});!function({el$:e},t){const i=n("tree"),o=hi([]),s=hi([]);Cn((()=>{l(),a(e.value,"keydown",r)})),fn((()=>{q(e.value,"keydown",r)})),kn((()=>{o.value=Array.from(e.value.querySelectorAll("[role=treeitem]")),s.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"))})),Qn(s,(e=>{e.forEach((e=>{e.setAttribute("tabindex","-1")}))}));const r=n=>{const s=n.target;if(!s.className.includes(i.b("node")))return;const r=n.code;o.value=Array.from(e.value.querySelectorAll(`.${i.is("focusable")}[role=treeitem]`));const a=o.value.indexOf(s);let l;if([I.up,I.down].includes(r)){if(n.preventDefault(),r===I.up){l=-1===a?0:0!==a?a-1:o.value.length-1;const e=l;for(;!t.value.getNode(o.value[l].dataset.key).canFocus;){if(l--,l===e){l=-1;break}l<0&&(l=o.value.length-1)}}else{l=-1===a?0:a=o.value.length&&(l=0)}}-1!==l&&o.value[l].focus()}[I.left,I.right].includes(r)&&(n.preventDefault(),s.click());const d=s.querySelector('[type="checkbox"]');[I.enter,I.space].includes(r)&&d&&(n.preventDefault(),d.click())},l=()=>{var t;o.value=Array.from(e.value.querySelectorAll(`.${i.is("focusable")}[role=treeitem]`)),s.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"));const n=e.value.querySelectorAll(`.${i.is("checked")}[role=treeitem]`);n.length?n[0].setAttribute("tabindex","0"):null==(t=o.value[0])||t.setAttribute("tabindex","0")}}({el$:d},s);const p=Pi((()=>{const{childNodes:e}=r.value;return!e||0===e.length||e.every((({visible:e})=>!e))}));Qn((()=>e.defaultCheckedKeys),(e=>{s.value.setDefaultCheckedKey(e)})),Qn((()=>e.defaultExpandedKeys),(e=>{s.value.setDefaultExpandedKeys(e)})),Qn((()=>e.data),(e=>{s.value.setData(e)}),{deep:!0}),Qn((()=>e.checkStrictly),(e=>{s.value.checkStrictly=e}));const m=()=>{const e=s.value.getCurrentNode();return e?e.data:null};return En("RootTree",{ctx:t,props:e,store:s,root:r,currentNode:l,instance:en()}),En(c,void 0),{ns:o,store:s,root:r,currentNode:l,dragState:g,el$:d,dropIndicator$:h,isEmpty:p,filter:t=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");s.value.filter(t)},getNodeKey:t=>fg(e.nodeKey,t.data),getNodePath:t=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const i=s.value.getNode(t);if(!i)return[];const n=[i.data];let o=i.parent;for(;o&&o!==r.value;)n.push(o.data),o=o.parent;return n.reverse()},getCheckedNodes:(e,t)=>s.value.getCheckedNodes(e,t),getCheckedKeys:e=>s.value.getCheckedKeys(e),getCurrentNode:m,getCurrentKey:()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const t=m();return t?t[e.nodeKey]:null},setCheckedNodes:(t,i)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");s.value.setCheckedNodes(t,i)},setCheckedKeys:(t,i)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");s.value.setCheckedKeys(t,i)},setChecked:(e,t,i)=>{s.value.setChecked(e,t,i)},getHalfCheckedNodes:()=>s.value.getHalfCheckedNodes(),getHalfCheckedKeys:()=>s.value.getHalfCheckedKeys(),setCurrentNode:(t,i=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");s.value.setUserCurrentNode(t,i)},setCurrentKey:(t,i=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");s.value.setCurrentNodeKey(t,i)},t:i,getNode:e=>s.value.getNode(e),remove:e=>{s.value.remove(e)},append:(e,t)=>{s.value.append(e,t)},insertBefore:(e,t)=>{s.value.insertBefore(e,t)},insertAfter:(e,t)=>{s.value.insertAfter(e,t)},handleNodeExpand:(e,i,n)=>{u(i),t.emit("node-expand",e,i,n)},updateKeyChildren:(t,i)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");s.value.updateChildren(t,i)}}}}),[["render",function(e,t,i,n,o,s){var r;const a=An("el-tree-node");return Ln(),Vi("div",{ref:"el$",class:bi([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner","inner"===e.dragState.dropType),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(Ln(!0),Vi(Li,null,Mn(e.root.childNodes,(t=>(Ln(),Fi(a,{key:e.getNodeKey(t),node:t,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"])))),128)),e.isEmpty?(Ln(),Vi("div",{key:0,class:bi(e.ns.e("empty-block"))},[Wi("span",{class:bi(e.ns.e("empty-text"))},yi(null!=(r=e.emptyText)?r:e.t("el.tree.emptyText")),3)],2)):Bi("v-if",!0),so(Wi("div",{ref:"dropIndicator$",class:bi(e.ns.e("drop-indicator"))},null,2),[[Lo,e.dragState.showDropIndicator]])],2)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree.vue"]]);Ng.install=e=>{e.component(Ng.name,Ng)};const Ig=Ng;class Tg extends Error{constructor(e,t,i,n){super(e),this.name="UploadAjaxError",this.status=t,this.method=i,this.url=n}}function Mg(e,t,i){let n;return n=i.response?`${i.response.error||i.response}`:i.responseText?`${i.responseText}`:`fail to ${t.method} ${e} ${i.status}`,new Tg(n,i.status,t.method,e)}const Og=["text","picture","picture-card"];let Ag=1;const Rg=()=>Date.now()+Ag++,Pg=i({action:{type:String,default:"#"},headers:{type:j(Object)},method:{type:String,default:"post"},data:{type:Object,default:()=>U({})},multiple:{type:Boolean,default:!1},name:{type:String,default:"file"},drag:{type:Boolean,default:!1},withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},type:{type:String,default:"select"},fileList:{type:j(Array),default:()=>U([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:Og,default:"text"},httpRequest:{type:j(Function),default:e=>{"undefined"==typeof XMLHttpRequest&&oe("ElUpload","XMLHttpRequest is undefined");const t=new XMLHttpRequest,i=e.action;t.upload&&t.upload.addEventListener("progress",(t=>{const i=t;i.percent=t.total>0?t.loaded/t.total*100:0,e.onProgress(i)}));const n=new FormData;if(e.data)for(const[s,r]of Object.entries(e.data))Array.isArray(r)?n.append(s,...r):n.append(s,r);n.append(e.filename,e.file,e.file.name),t.addEventListener("error",(()=>{e.onError(Mg(i,e,t))})),t.addEventListener("load",(()=>{if(t.status<200||t.status>=300)return e.onError(Mg(i,e,t));e.onSuccess(function(e){const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(i){return t}}(t))})),t.open(e.method,i,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const o=e.headers||{};if(o instanceof Headers)o.forEach(((e,i)=>t.setRequestHeader(i,e)));else for(const[s,r]of Object.entries(o))X(r)||t.setRequestHeader(s,String(r));return t.send(n),t}},disabled:Boolean,limit:Number}),Fg=i({...Pg,beforeUpload:{type:j(Function),default:Oo},beforeRemove:{type:j(Function)},onRemove:{type:j(Function),default:Oo},onChange:{type:j(Function),default:Oo},onPreview:{type:j(Function),default:Oo},onSuccess:{type:j(Function),default:Oo},onProgress:{type:j(Function),default:Oo},onError:{type:j(Function),default:Oo},onExceed:{type:j(Function),default:Oo}}),Bg=i({files:{type:j(Array),default:()=>U([])},disabled:{type:Boolean,default:!1},handlePreview:{type:j(Function),default:Oo},listType:{type:String,values:Og,default:"text"}}),Vg=["onKeydown"],Wg=["src"],Hg=["onClick"],zg=["onClick"],jg=["onClick"];var Ug=s(Zi({name:"ElUploadList",props:Bg,emits:{remove:e=>!!e},setup(e,{emit:t}){const i=e,{t:o}=w(),s=n("upload"),r=n("icon"),a=n("list"),l=ai(!1),d=e=>{t("remove",e)};return(e,t)=>(Ln(),Fi(ho,{tag:"ul",class:bi([fi(s).b("list"),fi(s).bm("list",e.listType),fi(s).is("disabled",e.disabled)]),name:fi(a).b()},{default:no((()=>[(Ln(!0),Vi(Li,null,Mn(e.files,(n=>(Ln(),Vi("li",{key:n.uid||n.name,class:bi([fi(s).be("list","item"),fi(s).is(n.status),{focusing:l.value}]),tabindex:"0",onKeydown:Do((t=>!e.disabled&&d(n)),["delete"]),onFocus:t[0]||(t[0]=e=>l.value=!0),onBlur:t[1]||(t[1]=e=>l.value=!1),onClick:t[2]||(t[2]=e=>l.value=!1)},[On(e.$slots,"default",{file:n},(()=>["picture"===e.listType||"uploading"!==n.status&&"picture-card"===e.listType?(Ln(),Vi("img",{key:0,class:bi(fi(s).be("list","item-thumbnail")),src:n.url,alt:""},null,10,Wg)):Bi("v-if",!0),"picture"===e.listType||"uploading"!==n.status&&"picture-card"===e.listType?Bi("v-if",!0):(Ln(),Vi("div",{key:1,class:bi(fi(s).be("list","item-info"))},[Wi("a",{class:bi(fi(s).be("list","item-name")),onClick:Eo((e=>(e=>{i.handlePreview(e)})(n)),["prevent"])},[qi(fi(b),{class:bi(fi(r).m("document"))},{default:no((()=>[qi(fi(dt))])),_:1},8,["class"]),Wi("span",{class:bi(fi(s).be("list","item-file-name"))},yi(n.name),3)],10,Hg),"uploading"===n.status?(Ln(),Fi(fi(Fc),{key:0,type:"picture-card"===e.listType?"circle":"line","stroke-width":"picture-card"===e.listType?6:2,percentage:Number(n.percentage),style:wi("picture-card"===e.listType?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):Bi("v-if",!0)],2)),Wi("label",{class:bi(fi(s).be("list","item-status-label"))},["text"===e.listType?(Ln(),Fi(fi(b),{key:0,class:bi([fi(r).m("upload-success"),fi(r).m("circle-check")])},{default:no((()=>[qi(fi(rt))])),_:1},8,["class"])):["picture-card","picture"].includes(e.listType)?(Ln(),Fi(fi(b),{key:1,class:bi([fi(r).m("upload-success"),fi(r).m("check")])},{default:no((()=>[qi(fi(Ze))])),_:1},8,["class"])):Bi("v-if",!0)],2),e.disabled?Bi("v-if",!0):(Ln(),Fi(fi(b),{key:2,class:bi(fi(r).m("close")),onClick:e=>d(n)},{default:no((()=>[qi(fi(et))])),_:2},1032,["class","onClick"])),Bi(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),Bi(" This is a bug which needs to be fixed "),Bi(" TODO: Fix the incorrect navigation interaction "),e.disabled?Bi("v-if",!0):(Ln(),Vi("i",{key:3,class:bi(fi(r).m("close-tip"))},yi(fi(o)("el.upload.deleteTip")),3)),"picture-card"===e.listType?(Ln(),Vi("span",{key:4,class:bi(fi(s).be("list","item-actions"))},[Wi("span",{class:bi(fi(s).be("list","item-preview")),onClick:t=>e.handlePreview(n)},[qi(fi(b),{class:bi(fi(r).m("zoom-in"))},{default:no((()=>[qi(fi(ht))])),_:1},8,["class"])],10,zg),e.disabled?Bi("v-if",!0):(Ln(),Vi("span",{key:0,class:bi(fi(s).be("list","item-delete")),onClick:e=>d(n)},[qi(fi(b),{class:bi(fi(r).m("delete"))},{default:no((()=>[qi(fi(ct))])),_:1},8,["class"])],10,jg))],2)):Bi("v-if",!0)]))],42,Vg)))),128)),On(e.$slots,"append")])),_:3},8,["class","name"]))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-list.vue"]]);const $g=i({disabled:{type:Boolean,default:!1}}),Kg=["onDrop","onDragover"];var qg=s(Zi({name:"ElUploadDrag",props:$g,emits:{file:e=>Io(e)},setup(e,{emit:t}){const i=e,o=an(md);o||oe("ElUploadDrag","usage: ");const s=n("upload"),r=ai(!1),a=e=>{if(i.disabled)return;r.value=!1;const n=Array.from(e.dataTransfer.files),s=o.accept.value;if(!s)return void t("file",n);const a=n.filter((e=>{const{type:t,name:i}=e,n=i.includes(".")?`.${i.split(".").pop()}`:"",o=t.replace(/\/.*$/,"");return s.split(",").map((e=>e.trim())).filter((e=>e)).some((e=>e.startsWith(".")?n===e:/\/\*$/.test(e)?o===e.replace(/\/\*$/,""):!!/^[^/]+\/[^/]+$/.test(e)&&t===e))}));t("file",a)},l=()=>{i.disabled||(r.value=!0)};return(e,t)=>(Ln(),Vi("div",{class:bi([fi(s).b("dragger"),fi(s).is("dragover",r.value)]),onDrop:Eo(a,["prevent"]),onDragover:Eo(l,["prevent"]),onDragleave:t[0]||(t[0]=Eo((e=>r.value=!1),["prevent"]))},[On(e.$slots,"default")],42,Kg))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-dragger.vue"]]);const Gg=i({...Pg,beforeUpload:{type:j(Function),default:Oo},onRemove:{type:j(Function),default:Oo},onStart:{type:j(Function),default:Oo},onSuccess:{type:j(Function),default:Oo},onProgress:{type:j(Function),default:Oo},onError:{type:j(Function),default:Oo},onExceed:{type:j(Function),default:Oo}}),Zg=["onKeydown"],Yg=["name","multiple","accept"];var Xg=s(Zi({name:"ElUploadContent",inheritAttrs:!1,props:Gg,setup(e,{expose:t}){const i=e,o=n("upload"),s=hi({}),r=hi(),a=e=>{if(0===e.length)return;const{autoUpload:t,limit:n,fileList:o,multiple:s,onStart:r,onExceed:a}=i;if(n&&o.length+e.length>n)a(e,o);else{s||(e=e.slice(0,1));for(const i of e){const e=i;e.uid=Rg(),r(e),t&&l(e)}}},l=async e=>{if(r.value.value="",!i.beforeUpload)return d(e);let t;try{t=await i.beforeUpload(e)}catch(o){t=!1}if(!1===t)return void i.onRemove(e);let n=e;t instanceof Blob&&(n=t instanceof File?t:new File([t],e.name,{type:e.type})),d(Object.assign(n,{uid:e.uid}))},d=e=>{const{headers:t,data:n,method:o,withCredentials:r,name:a,action:l,onProgress:d,onSuccess:h,onError:c,httpRequest:u}=i,{uid:g}=e,p={headers:t||{},withCredentials:r,file:e,data:n,method:o,filename:a,action:l,onProgress:t=>{d(t,e)},onSuccess:t=>{h(t,e),delete s.value[g]},onError:t=>{c(t,e),delete s.value[g]}},m=u(p);s.value[g]=m,m instanceof Promise&&m.then(p.onSuccess,p.onError)},h=e=>{const t=e.target.files;t&&a(Array.from(t))},c=()=>{i.disabled||(r.value.value="",r.value.click())},u=()=>{c()};return t({abort:e=>{_e(s.value).filter(e?([t])=>String(e.uid)===t:()=>!0).forEach((([e,t])=>{t instanceof XMLHttpRequest&&t.abort(),delete s.value[e]}))},upload:l}),(e,t)=>(Ln(),Vi("div",{class:bi([fi(o).b(),fi(o).m(e.listType),fi(o).is("drag",e.drag)]),tabindex:"0",onClick:c,onKeydown:Do(Eo(u,["self"]),["enter","space"])},[e.drag?(Ln(),Fi(qg,{key:0,disabled:e.disabled,onFile:a},{default:no((()=>[On(e.$slots,"default")])),_:3},8,["disabled"])):On(e.$slots,"default",{key:1}),Wi("input",{ref_key:"inputRef",ref:r,class:bi(fi(o).e("input")),name:e.name,multiple:e.multiple,accept:e.accept,type:"file",onChange:h,onClick:t[0]||(t[0]=Eo((()=>{}),["stop"]))},null,42,Yg)],42,Zg))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);const Qg=(e,t)=>{const i=ve(e,"fileList",void 0,{passive:!0}),n=e=>i.value.find((t=>t.uid===e.uid));function o(e){var i;null==(i=t.value)||i.abort(e)}return Qn((()=>e.listType),(t=>{"picture-card"!==t&&"picture"!==t||(i.value=i.value.map((t=>{const{raw:n,url:o}=t;if(!o&&n)try{t.url=URL.createObjectURL(n)}catch(s){e.onError(s,t,i.value)}return t})))})),Qn(i,(e=>{for(const t of e)t.uid||(t.uid=Rg()),t.status||(t.status="success")}),{immediate:!0,deep:!0}),{uploadFiles:i,abort:o,clearFiles:function(e=["ready","uploading","success","fail"]){i.value=i.value.filter((t=>!e.includes(t.status)))},handleError:(t,o)=>{const s=n(o);s&&(s.status="fail",i.value.splice(i.value.indexOf(s),1),e.onError(t,s,i.value),e.onChange(s,i.value))},handleProgress:(t,o)=>{const s=n(o);s&&(e.onProgress(t,s,i.value),s.status="uploading",s.percentage=Math.round(t.percent))},handleStart:t=>{const n={name:t.name,percentage:0,status:"ready",size:t.size,raw:t,uid:t.uid};if("picture-card"===e.listType||"picture"===e.listType)try{n.url=URL.createObjectURL(t)}catch(o){f("ElUpload",o.message),e.onError(o,n,i.value)}i.value.push(n),e.onChange(n,i.value)},handleSuccess:(t,o)=>{const s=n(o);s&&(s.status="success",s.response=t,e.onSuccess(t,s,i.value),e.onChange(s,i.value))},handleRemove:async t=>{const s=t instanceof File?n(t):t;s||oe("ElUpload","file to be removed not found");const r=t=>{o(t);const n=i.value;n.splice(n.indexOf(t),1),e.onRemove(t,n),(e=>{var t;(null==(t=e.url)?void 0:t.startsWith("blob:"))&&URL.revokeObjectURL(e.url)})(t)};if(e.beforeRemove){!1!==await e.beforeRemove(s,i.value)&&r(s)}else r(s)},submit:function(){i.value.filter((({status:e})=>"ready"===e)).forEach((({raw:e})=>{var i;return e&&(null==(i=t.value)?void 0:i.upload(e))}))}}};const Jg=r(s(Zi({name:"ElUpload",props:Fg,setup(e,{expose:t}){const i=e,n=Gn(),o=J(),s=hi(),{abort:r,submit:a,clearFiles:l,uploadFiles:d,handleStart:h,handleError:c,handleRemove:u,handleSuccess:g,handleProgress:p}=Qg(i,s),m=Pi((()=>"picture-card"===i.listType)),f=Pi((()=>({...i,onStart:h,onProgress:p,onSuccess:g,onError:c,onRemove:u})));return fn((()=>{d.value.forEach((({url:e})=>{(null==e?void 0:e.startsWith("blob:"))&&URL.revokeObjectURL(e)}))})),En(md,{accept:gi(i,"accept")}),t({abort:r,submit:a,clearFiles:l,handleStart:h,handleRemove:u}),(e,t)=>(Ln(),Vi("div",null,[fi(m)&&e.showFileList?(Ln(),Fi(Ug,{key:0,disabled:fi(o),"list-type":e.listType,files:fi(d),"handle-preview":e.onPreview,onRemove:fi(u)},Ui({append:no((()=>["picture-card"===e.listType?(Ln(),Fi(Xg,un({key:0,ref_key:"uploadRef",ref:s},fi(f)),{default:no((()=>[fi(n).trigger?On(e.$slots,"trigger",{key:0}):Bi("v-if",!0),!fi(n).trigger&&fi(n).default?On(e.$slots,"default",{key:1}):Bi("v-if",!0)])),_:3},16)):Bi("v-if",!0)])),_:2},[e.$slots.file?{name:"default",fn:no((({file:t})=>[On(e.$slots,"file",{file:t})]))}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):Bi("v-if",!0),"picture-card"!==e.listType?(Ln(),Fi(Xg,un({key:1,ref_key:"uploadRef",ref:s},fi(f)),{default:no((()=>[fi(n).trigger?On(e.$slots,"trigger",{key:0}):Bi("v-if",!0),!fi(n).trigger&&fi(n).default?On(e.$slots,"default",{key:1}):Bi("v-if",!0)])),_:3},16)):Bi("v-if",!0),e.$slots.trigger?On(e.$slots,"default",{key:2}):Bi("v-if",!0),On(e.$slots,"tip"),!fi(m)&&e.showFileList?(Ln(),Fi(Ug,{key:3,disabled:fi(o),"list-type":e.listType,files:fi(d),"handle-preview":e.onPreview,onRemove:fi(u)},Ui({_:2},[e.$slots.file?{name:"default",fn:no((({file:t})=>[On(e.$slots,"file",{file:t})]))}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):Bi("v-if",!0)]))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload.vue"]])),ep=["success","info","warning","error"],tp=U({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:"",id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:E?document.body:void 0}),ip=i({customClass:{type:String,default:tp.customClass},center:{type:Boolean,default:tp.center},dangerouslyUseHTMLString:{type:Boolean,default:tp.dangerouslyUseHTMLString},duration:{type:Number,default:tp.duration},icon:{type:te,default:tp.icon},id:{type:String,default:tp.id},message:{type:j([String,Object,Function]),default:tp.message},onClose:{type:j(Function),required:!1},showClose:{type:Boolean,default:tp.showClose},type:{type:String,values:ep,default:tp.type},offset:{type:Number,default:tp.offset},zIndex:{type:Number,default:tp.zIndex},grouping:{type:Boolean,default:tp.grouping},repeatNum:{type:Number,default:tp.repeatNum}}),np=li([]),op=e=>{const{prev:t}=(e=>{const t=np.findIndex((t=>t.id===e)),i=np[t];let n;return t>0&&(n=np[t-1]),{current:i,prev:n}})(e);return t?t.vm.exposeProxy.bottom:0},sp=["id"],rp=["innerHTML"];var ap=s(Zi({name:"ElMessage",props:ip,emits:{destroy:()=>!0},setup(e,{expose:t}){const i=e,{Close:o}=Ce,s=n("message"),r=ai(),a=ai(!1),l=ai(0);let d;const h=Pi((()=>i.type?"error"===i.type?"danger":i.type:"info")),c=Pi((()=>{const e=i.type;return{[s.bm("icon",e)]:e&&be[e]}})),u=Pi((()=>i.icon||be[i.type]||"")),g=Pi((()=>op(i.id))),p=Pi((()=>i.offset+g.value)),m=Pi((()=>l.value+p.value)),f=Pi((()=>({top:`${p.value}px`,zIndex:i.zIndex})));function _(){0!==i.duration&&({stop:d}=we((()=>{C()}),i.duration))}function v(){null==d||d()}function C(){a.value=!1}return Cn((()=>{_(),a.value=!0})),Qn((()=>i.repeatNum),(()=>{v(),_()})),ue(document,"keydown",(function({code:e}){e===I.esc&&C()})),H(r,(()=>{l.value=r.value.getBoundingClientRect().height})),t({visible:a,bottom:m,close:C}),(e,t)=>(Ln(),Fi(lo,{name:fi(s).b("fade"),onBeforeLeave:e.onClose,onAfterLeave:t[0]||(t[0]=t=>e.$emit("destroy")),persisted:""},{default:no((()=>[so(Wi("div",{id:e.id,ref_key:"messageRef",ref:r,class:bi([fi(s).b(),{[fi(s).m(e.type)]:e.type&&!e.icon},fi(s).is("center",e.center),fi(s).is("closable",e.showClose),e.customClass]),style:wi(fi(f)),role:"alert",onMouseenter:v,onMouseleave:_},[e.repeatNum>1?(Ln(),Fi(fi(vd),{key:0,value:e.repeatNum,type:fi(h),class:bi(fi(s).e("badge"))},null,8,["value","type","class"])):Bi("v-if",!0),fi(u)?(Ln(),Fi(fi(b),{key:1,class:bi([fi(s).e("icon"),fi(c)])},{default:no((()=>[(Ln(),Fi(Pn(fi(u))))])),_:1},8,["class"])):Bi("v-if",!0),On(e.$slots,"default",{},(()=>[e.dangerouslyUseHTMLString?(Ln(),Vi(Li,{key:1},[Bi(" Caution here, message could've been compromised, never use user's input as message "),Wi("p",{class:bi(fi(s).e("content")),innerHTML:e.message},null,10,rp)],2112)):(Ln(),Vi("p",{key:0,class:bi(fi(s).e("content"))},yi(e.message),3))])),e.showClose?(Ln(),Fi(fi(b),{key:2,class:bi(fi(s).e("closeBtn")),onClick:Eo(C,["stop"])},{default:no((()=>[qi(fi(o))])),_:1},8,["class","onClick"])):Bi("v-if",!0)],46,sp),[[Lo,a.value]])])),_:3},8,["name","onBeforeLeave"]))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/message/src/message.vue"]]);let lp=1;const dp=e=>{const t=!e||No(e)||hn(e)||Mo(e)?{message:e}:e,i={...tp,...t};if(No(i.appendTo)){let e=document.querySelector(i.appendTo);Se(e)||(e=document.body),i.appendTo=e}return i},hp=({appendTo:e,...t},i)=>{const{nextZIndex:n}=se(),o="message_"+lp++,s=t.onClose,r=document.createElement("div"),a={...t,zIndex:n()+t.zIndex,id:o,onClose:()=>{null==s||s(),(e=>{const t=np.indexOf(e);if(-1===t)return;np.splice(t,1);const{handler:i}=e;i.close()})(c)},onDestroy:()=>{vo(null,r)}},l=qi(ap,a,Mo(a.message)||hn(a.message)?{default:a.message}:null);l.appContext=i||cp._context,vo(l,r),e.appendChild(r.firstElementChild);const d=l.component,h={close:()=>{d.exposeProxy.visible=!1}},c={id:o,vnode:l,vm:d,handler:h,props:l.component.props};return c},cp=(e={},t)=>{if(!E)return{close:()=>{}};if(o(ye.max)&&np.length>=ye.max)return{close:()=>{}};const i=dp(e);if(i.grouping&&np.length){const e=np.find((({vnode:e})=>{var t;return(null==(t=e.props)?void 0:t.message)===i.message}));if(e)return e.props.repeatNum+=1,e.props.type=i.type,e.handler}const n=hp(i,t);return np.push(n),n.handler};ep.forEach((e=>{cp[e]=(t={},i)=>{const n=dp(t);return cp({...n,type:e},i)}})),cp.closeAll=function(e){for(const t of np)e&&e!==t.props.type||t.handler.close()},cp._context=null;const up=xe(cp,"$message");const gp=Zi({name:"Preview",props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(e,{emit:t}){const i=ve(e,"visible",t),n=`${ut}preview/${location.hash}`;return(e,t)=>{const o=ke;return Ln(),Fi(o,{modelValue:fi(i),"onUpdate:modelValue":t[0]||(t[0]=e=>ei(i)?i.value=e:null),"custom-class":"h5-preview","show-close":!1,width:"360px"},{default:no((()=>[fi(i)?(Ln(),Vi("iframe",{key:0,style:{width:"100%",height:"100%"},src:n,frameborder:"0",scrolling:"auto"})):Bi("",!0)])),_:1},8,["modelValue"])}}});var pp={},mp={},fp={};let _p;const vp=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];fp.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},fp.getSymbolTotalCodewords=function(e){return vp[e]},fp.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},fp.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');_p=e},fp.isKanjiModeEnabled=function(){return void 0!==_p},fp.toSJIS=function(e){return _p(e)};var bp,Cp={};function wp(){this.buffer=[],this.length=0}(bp=Cp).L={bit:1},bp.M={bit:0},bp.Q={bit:3},bp.H={bit:2},bp.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},bp.from=function(e,t){if(bp.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return bp.L;case"m":case"medium":return bp.M;case"q":case"quartile":return bp.Q;case"h":case"high":return bp.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(i){return t}},wp.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let i=0;i>>t-i-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var yp=wp;function Sp(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Sp.prototype.set=function(e,t,i,n){const o=e*this.size+t;this.data[o]=i,n&&(this.reservedBit[o]=!0)},Sp.prototype.get=function(e,t){return this.data[e*this.size+t]},Sp.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i},Sp.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var xp=Sp,kp={};!function(e){const t=fp.getSymbolSize;e.getRowColCoords=function(e){if(1===e)return[];const i=Math.floor(e/7)+2,n=t(e),o=145===n?26:2*Math.ceil((n-13)/(2*i-2)),s=[n-7];for(let t=1;t=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){const i=e.size;let n=0,o=0,s=0,r=null,a=null;for(let l=0;l=5&&(n+=t+(o-5)),r=i,o=1),i=e.get(d,l),i===a?s++:(s>=5&&(n+=t+(s-5)),a=i,s=1)}o>=5&&(n+=t+(o-5)),s>=5&&(n+=t+(s-5))}return n},e.getPenaltyN2=function(e){const t=e.size;let n=0;for(let i=0;i=10&&(1488===o||93===o)&&i++,s=s<<1&2047|e.get(r,n),r>=10&&(1488===s||93===s)&&i++}return i*n},e.getPenaltyN4=function(e){let t=0;const i=e.data.length;for(let n=0;n=0;){const e=n[0];for(let s=0;s0){const e=new Uint8Array(this.degree);return e.set(i,n),e}return i};var Vp=Bp,Wp={},Hp={},zp={isValid:function(e){return!isNaN(e)&&e>=1&&e<=40}},jp={};let Up="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Up=Up.replace(/u/g,"\\u");const $p="(?:(?![A-Z0-9 $%*+\\-./:]|"+Up+")(?:.|[\r\n]))+";jp.KANJI=new RegExp(Up,"g"),jp.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),jp.BYTE=new RegExp($p,"g"),jp.NUMERIC=new RegExp("[0-9]+","g"),jp.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const Kp=new RegExp("^"+Up+"$"),qp=new RegExp("^[0-9]+$"),Gp=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");jp.testKanji=function(e){return Kp.test(e)},jp.testNumeric=function(e){return qp.test(e)},jp.testAlphanumeric=function(e){return Gp.test(e)},function(e){const t=zp,i=jp;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,i){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!t.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?e.ccBits[0]:i<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return i.testNumeric(t)?e.NUMERIC:i.testAlphanumeric(t)?e.ALPHANUMERIC:i.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},e.isValid=function(e){return e&&e.bit&&e.ccBits},e.from=function(t,i){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(n){return i}}}(Hp),function(e){const t=fp,i=Np,n=Cp,o=Hp,s=zp,r=t.getBCHDigit(7973);function a(e,t){return o.getCharCountIndicator(e,t)+4}function l(e,t){let i=0;return e.forEach((function(e){const n=a(e.mode,t);i+=n+e.getBitsLength()})),i}e.from=function(e,t){return s.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,n,r){if(!s.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=o.BYTE);const l=8*(t.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,n));if(r===o.MIXED)return l;const d=l-a(r,e);switch(r){case o.NUMERIC:return Math.floor(d/10*3);case o.ALPHANUMERIC:return Math.floor(d/11*2);case o.KANJI:return Math.floor(d/13);case o.BYTE:default:return Math.floor(d/8)}},e.getBestVersionForData=function(t,i){let s;const r=n.from(i,n.M);if(Array.isArray(t)){if(t.length>1)return function(t,i){for(let n=1;n<=40;n++)if(l(t,n)<=e.getCapacity(n,i,o.MIXED))return n}(t,r);if(0===t.length)return 1;s=t[0]}else s=t;return function(t,i,n){for(let o=1;o<=40;o++)if(i<=e.getCapacity(o,n,t))return o}(s.mode,s.getLength(),r)},e.getEncodedBits=function(e){if(!s.isValid(e)||e<7)throw new Error("Invalid QR Code version");let i=e<<12;for(;t.getBCHDigit(i)-r>=0;)i^=7973<=0;)n^=1335<0&&(i=this.data.substr(t),n=parseInt(i,10),e.put(n,3*o+1))};var tm=em;const im=Hp,nm=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function om(e){this.mode=im.ALPHANUMERIC,this.data=e}om.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},om.prototype.getLength=function(){return this.data.length},om.prototype.getBitsLength=function(){return om.getBitsLength(this.data.length)},om.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let i=45*nm.indexOf(this.data[t]);i+=nm.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(nm.indexOf(this.data[t]),6)};var sm=om;const rm=function(e){for(var t=[],i=e.length,n=0;n=55296&&o<=56319&&i>n+1){var s=e.charCodeAt(n+1);s>=56320&&s<=57343&&(o=1024*(o-55296)+s-56320+65536,n+=1)}o<128?t.push(o):o<2048?(t.push(o>>6|192),t.push(63&o|128)):o<55296||o>=57344&&o<65536?(t.push(o>>12|224),t.push(o>>6&63|128),t.push(63&o|128)):o>=65536&&o<=1114111?(t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(63&o|128)):t.push(239,191,189)}return new Uint8Array(t).buffer},am=Hp;function lm(e){this.mode=am.BYTE,this.data=new Uint8Array(rm(e))}lm.getBitsLength=function(e){return 8*e},lm.prototype.getLength=function(){return this.data.length},lm.prototype.getBitsLength=function(){return lm.getBitsLength(this.data.length)},lm.prototype.write=function(e){for(let t=0,i=this.data.length;t=33088&&i<=40956)i-=33088;else{if(!(i>=57408&&i<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");i-=49472}i=192*(i>>>8&255)+(255&i),e.put(i,13)}};var gm,pm=um,mm={exports:{}};mm.exports=gm={single_source_shortest_paths:function(e,t,i){var n={},o={};o[t]=0;var s,r,a,l,d,h,c,u=gm.PriorityQueue.make();for(u.push(t,0);!u.empty();)for(a in r=(s=u.pop()).value,l=s.cost,d=e[r]||{})d.hasOwnProperty(a)&&(h=l+d[a],c=o[a],(void 0===o[a]||c>h)&&(o[a]=h,u.push(a,h),n[a]=r));if(void 0!==i&&void 0===o[i]){var g=["Could not find a path from ",t," to ",i,"."].join("");throw new Error(g)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var i=[],n=t;n;)i.push(n),n=e[n];return i.reverse(),i},find_path:function(e,t,i){var n=gm.single_source_shortest_paths(e,t,i);return gm.extract_shortest_path_from_predecessor_list(n,i)},PriorityQueue:{make:function(e){var t,i=gm.PriorityQueue,n={};for(t in e=e||{},i)i.hasOwnProperty(t)&&(n[t]=i[t]);return n.queue=[],n.sorter=e.sorter||i.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var i={value:e,cost:t};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}},function(e){const t=Hp,i=tm,n=sm,o=dm,s=pm,r=jp,a=fp,l=mm.exports;function d(e){return unescape(encodeURIComponent(e)).length}function h(e,t,i){const n=[];let o;for(;null!==(o=e.exec(i));)n.push({data:o[0],index:o.index,mode:t,length:o[0].length});return n}function c(e){const i=h(r.NUMERIC,t.NUMERIC,e),n=h(r.ALPHANUMERIC,t.ALPHANUMERIC,e);let o,s;a.isKanjiModeEnabled()?(o=h(r.BYTE,t.BYTE,e),s=h(r.KANJI,t.KANJI,e)):(o=h(r.BYTE_KANJI,t.BYTE,e),s=[]);return i.concat(n,o,s).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function u(e,r){switch(r){case t.NUMERIC:return i.getBitsLength(e);case t.ALPHANUMERIC:return n.getBitsLength(e);case t.KANJI:return s.getBitsLength(e);case t.BYTE:return o.getBitsLength(e)}}function g(e,r){let l;const d=t.getBestModeForData(e);if(l=t.from(r,d),l!==t.BYTE&&l.bit=0?e[e.length-1]:null;return i&&i.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(h))},e.rawSplit=function(t){return e.fromArray(c(t,a.isKanjiModeEnabled()))}}(Qp);const fm=fp,_m=Cp,vm=yp,bm=xp,Cm=kp,wm=Lp,ym=Ep,Sm=Np,xm=Vp,km=Wp,Lm=Zp,Dm=Hp,Em=Qp;function Nm(e,t,i){const n=e.size,o=Lm.getEncodedBits(t,i);let s,r;for(s=0;s<15;s++)r=1==(o>>s&1),s<6?e.set(s,8,r,!0):s<8?e.set(s+1,8,r,!0):e.set(n-15+s,8,r,!0),s<8?e.set(8,n-s-1,r,!0):s<9?e.set(8,15-s-1+1,r,!0):e.set(8,15-s-1,r,!0);e.set(n-8,8,1,!0)}function Im(e,t,i){const n=new vm;i.forEach((function(t){n.put(t.mode.bit,4),n.put(t.getLength(),Dm.getCharCountIndicator(t.mode,e)),t.write(n)}));const o=8*(fm.getSymbolTotalCodewords(e)-Sm.getTotalCodewordsCount(e,t));for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);const s=(o-n.getLengthInBits())/8;for(let r=0;r=0&&n<=6&&(0===o||6===o)||o>=0&&o<=6&&(0===n||6===n)||n>=2&&n<=4&&o>=2&&o<=4?e.set(t+n,s+o,!0,!0):e.set(t+n,s+o,!1,!0))}}(l,t),function(e){const t=e.size;for(let i=8;i=7&&function(e,t){const i=e.size,n=km.getEncodedBits(t);let o,s,r;for(let a=0;a<18;a++)o=Math.floor(a/3),s=a%3+i-8-3,r=1==(n>>a&1),e.set(o,s,r,!0),e.set(s,o,r,!0)}(l,t),function(e,t){const i=e.size;let n=-1,o=i-1,s=7,r=0;for(let a=i-1;a>0;a-=2)for(6===a&&a--;;){for(let i=0;i<2;i++)if(!e.isReserved(o,a-i)){let n=!1;r>>s&1)),e.set(o,a-i,n),s--,-1===s&&(r++,s=7)}if(o+=n,o<0||i<=o){o-=n,n=-n;break}}}(l,r),isNaN(n)&&(n=ym.getBestMask(l,Nm.bind(null,l,i))),ym.applyMask(n,l),Nm(l,i,n),{modules:l,version:t,errorCorrectionLevel:i,maskPattern:n,segments:o}}mp.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let i,n,o=_m.M;return void 0!==t&&(o=_m.from(t.errorCorrectionLevel,_m.M),i=km.from(t.version),n=ym.from(t.maskPattern),t.toSJISFunc&&fm.setToSJISFunction(t.toSJISFunc)),Tm(e,i,o,n)};var Mm={},Om={};!function(e){function t(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const i=parseInt(t.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:255&i,hex:"#"+t.slice(0,6).join("")}}e.getOptions=function(e){e||(e={}),e.color||(e.color={});const i=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,o=e.scale||4;return{width:n,scale:n?4:o,margin:i,color:{dark:t(e.color.dark||"#000000ff"),light:t(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},e.getImageWidth=function(t,i){const n=e.getScale(t,i);return Math.floor((t+2*i.margin)*n)},e.qrToImageData=function(t,i,n){const o=i.modules.size,s=i.modules.data,r=e.getScale(o,n),a=Math.floor((o+2*n.margin)*r),l=n.margin*r,d=[n.color.light,n.color.dark];for(let e=0;e=l&&i>=l&&e':"",l="0&&l>0&&e[a-1]||(n+=s?Fm("M",l+i,.5+d+i):Fm("m",o,0),o=0,s=!1),l+1',d='viewBox="0 0 '+r+" "+r+'"',h=''+a+l+"\n";return"function"==typeof i&&i(null,h),h};const Bm=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},Vm=mp,Wm=Mm,Hm=Am;function zm(e,t,i,n,o){const s=[].slice.call(arguments,1),r=s.length,a="function"==typeof s[r-1];if(!a&&!Bm())throw new Error("Callback required as last argument");if(!a){if(r<1)throw new Error("Too few arguments provided");return 1===r?(i=t,t=n=void 0):2!==r||t.getContext||(n=i,i=t,t=void 0),new Promise((function(o,s){try{const s=Vm.create(i,n);o(e(s,t,n))}catch(r){s(r)}}))}if(r<2)throw new Error("Too few arguments provided");2===r?(o=i,i=t,t=n=void 0):3===r&&(t.getContext&&void 0===o?(o=n,n=void 0):(o=n,n=i,i=t,t=void 0));try{const s=Vm.create(i,n);o(null,e(s,t,n))}catch(l){o(l)}}pp.create=Vm.create,pp.toCanvas=zm.bind(null,Wm.render),pp.toDataURL=zm.bind(null,Wm.renderToDataURL),pp.toString=zm.bind(null,(function(e,t,i){return Hm.render(e,i)}));const jm=Zi({props:{options:{type:Object,default:()=>({})}},setup(e){const t=en(),i=si({options:e.options,visible:!0}),n={service:e=>{i.options=e,n.show()},show:()=>i.visible=!0,hide:()=>i.visible=!1},o={onConfirm:async()=>{var e,t;await(null==(t=(e=i.options).onConfirm)?void 0:t.call(e)),n.hide()},onCancel:()=>{var e,t;null==(t=(e=i.options).onCancel)||t.call(e),n.hide()}};return Object.assign(t.proxy,n),()=>qi(ke,un({modelValue:i.visible,"onUpdate:modelValue":e=>i.visible=e,title:i.options.title,destroyOnClose:!0},i.options.props,{onClose:o.onCancel}),{default:()=>hn(i.options.content)?qi(An("content"),null,null):gt(i.options.content)?i.options.content():null,footer:()=>null===i.options.footer?null:qi("div",null,[qi(Z,{onClick:o.onCancel},{default:()=>[Ki("取消")]}),qi(Z,un({type:"primary"},{onClick:o.onConfirm}),{default:()=>[Ki("确定")]})])})}}),Um=(()=>{let e;return t=>{if(e)return e.service(t),e;const i=document.createElement("div");document.body.appendChild(i);const n=uo(jm,{options:t});return e=n.mount(i),e}})();function $m(e,t,...i){return function(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,i){const n=i[0];return void 0!==t[n]?t[n]:e})),i}(t,i)}const Km={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!1}};class qm{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Gm{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Zm{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return Xm(e,t)}compute(e,t,i){return i}}class Ym{constructor(e,t){this.newValue=e,this.didChange=t}}function Xm(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new Ym(t,e!==t);if(Array.isArray(e)||Array.isArray(t)){const i=Array.isArray(e)&&Array.isArray(t)&&jo(e,t);return new Ym(t,i)}let i=!1;for(const n in t)if(t.hasOwnProperty(n)){const o=Xm(e[n],t[n]);o.didChange&&(e[n]=o.newValue,i=!0)}return new Ym(e,i)}class Qm{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return Xm(e,t)}validate(e){return this.defaultValue}}class Jm{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return Xm(e,t)}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}function ef(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}class tf extends Jm{constructor(e,t,i,n){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return ef(e,this.defaultValue)}}function nf(e,t,i,n){if(void 0===e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),o=Math.min(n,o),0|o)}class of extends Jm{constructor(e,t,i,n,o,s){void 0!==s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}static clampedInt(e,t,i,n){return nf(e,t,i,n)}validate(e){return of.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class sf extends Jm{constructor(e,t,i,n,o){void 0!==o&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}static clamp(e,t,i){return ei?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){return this.validationFn(sf.float(e,this.defaultValue))}}class rf extends Jm{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return rf.string(e,this.defaultValue)}}function af(e,t,i){return"string"!=typeof e||-1===i.indexOf(e)?t:e}class lf extends Jm{constructor(e,t,i,n,o){void 0!==o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return af(e,this.defaultValue,this._allowedValues)}}class df extends Zm{constructor(e,t,i,n,o,s,r){void 0!==r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var hf,cf;(cf=hf||(hf={}))[cf.Line=1]="Line",cf[cf.Block=2]="Block",cf[cf.Underline=3]="Underline",cf[cf.LineThin=4]="LineThin",cf[cf.BlockOutline=5]="BlockOutline",cf[cf.UnderlineThin=6]="UnderlineThin";class uf extends Zm{constructor(){super(45,"fontLigatures",uf.OFF,{anyOf:[{type:"boolean",description:$m(0,"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:$m(0,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:$m(0,"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 void 0===e?this.defaultValue:"string"==typeof e?"false"===e?uf.OFF:"true"===e?uf.ON:e:Boolean(e)?uf.ON:uf.OFF}}uf.OFF='"liga" off, "calt" off',uf.ON='"liga" on, "calt" on';class gf extends Zm{constructor(){super(47,"fontWeight",kf.fontWeight,{anyOf:[{type:"number",minimum:gf.MINIMUM_VALUE,maximum:gf.MAXIMUM_VALUE,errorMessage:$m(0,'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:gf.SUGGESTION_VALUES}],default:kf.fontWeight,description:$m(0,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String(of.clampedInt(e,kf.fontWeight,gf.MINIMUM_VALUE,gf.MAXIMUM_VALUE))}}gf.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],gf.MINIMUM_VALUE=1,gf.MAXIMUM_VALUE=1e3;class pf extends Qm{constructor(){super(131)}compute(e,t,i){return pf.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=e.scrollBeyondLastLine?t-1:0,n=(e.viewLineCount+i)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:n,minimapLineCount:Math.floor(e.viewLineCount/n)}}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 s=t.stableMinimapLayoutInput,r=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let c=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,f=e.viewLineCount,_=e.remainingWidth,v=e.isViewportWrapping,b=h?2:3;let C=Math.floor(o*n);const w=C/o;let y=!1,S=!1,x=b*c,k=c/o,L=1;if("fill"===g||"fit"===g){const{typicalViewportLineCount:i,extraLinesBeyondLastLine:s,desiredRatio:l,minimapLineCount:h}=pf.computeContainedMinimapLineCount({viewLineCount:f,scrollBeyondLastLine:d,height:n,lineHeight:a,pixelRatio:o});if(f/h>1)y=!0,S=!0,c=1,x=1,k=c/o;else{let n=!1,d=c+1;if("fit"===g){const e=Math.ceil((f+s)*x);v&&r&&_<=t.stableFitRemainingWidth?(n=!0,d=t.stableFitMaxMinimapScale):n=e>C}if("fill"===g||n){y=!0;const n=c;x=Math.min(a*o,Math.max(1,Math.floor(1/l))),v&&r&&_<=t.stableFitRemainingWidth&&(d=t.stableFitMaxMinimapScale),c=Math.min(d,Math.max(1,Math.floor(x/b))),c>n&&(L=Math.min(2,c/n)),k=c/o/L,C=Math.ceil(Math.max(i,f+s)*x),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=c):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const D=Math.floor(u*k),E=Math.min(D,Math.max(0,Math.floor((_-m-2)*k/(l+k)))+8);let N=Math.floor(o*E);const I=N/o;N=Math.floor(N*L);return{renderMinimap:h?1:2,minimapLeft:"left"===p?0:i-E-m,minimapWidth:E,minimapHeightIsEditorHeight:y,minimapIsSampling:S,minimapScale:c,minimapLineHeight:x,minimapCanvasInnerWidth:N,minimapCanvasInnerHeight:C,minimapCanvasOuterWidth:I,minimapCanvasOuterHeight:w}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,o=0|t.lineHeight,s=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,d=t.viewLineCount,h=e.get(123),c="inherit"===h?e.get(122):h,u="inherit"===c?e.get(118):c,g=e.get(121),p=e.get(2),m=t.isDominatedByLongLines,f=e.get(50),_=0!==e.get(60).renderType,v=e.get(61),b=e.get(94),C=e.get(65),w=e.get(92),y=w.verticalScrollbarSize,S=w.verticalHasArrows,x=w.arrowSize,k=w.horizontalScrollbarSize,L=e.get(58),D=e.get(37);let E;if("string"==typeof L&&/^\d+(\.\d+)?ch$/.test(L)){const e=parseFloat(L.substr(0,L.length-2));E=of.clampedInt(e*r,0,0,1e3)}else E=of.clampedInt(L,0,0,1e3);D&&(E+=16);let N=0;if(_){const e=Math.max(s,v);N=Math.round(e*a)}let I=0;f&&(I=o);let T=0,M=T+I,O=M+N,A=O+E;const R=i-I-N-E;let P=!1,F=!1,B=-1;2!==p&&("inherit"===c&&m?(P=!0,F=!0):"on"===u||"bounded"===u?F=!0:"wordWrapColumn"===u&&(B=g));const V=pf._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:b,minimap:C,verticalScrollbarWidth:y,viewLineCount:d,remainingWidth:R,isViewportWrapping:F},t.memory||new Gm);0!==V.renderMinimap&&0===V.minimapLeft&&(T+=V.minimapWidth,M+=V.minimapWidth,O+=V.minimapWidth,A+=V.minimapWidth);const W=R-V.minimapWidth,H=Math.max(1,Math.floor((W-y-2)/r)),z=S?x:0;return F&&(B=Math.max(1,H),"bounded"===u&&(B=Math.min(B,g))),{width:i,height:n,glyphMarginLeft:T,glyphMarginWidth:I,lineNumbersLeft:M,lineNumbersWidth:N,decorationsLeft:O,decorationsWidth:E,contentLeft:A,contentWidth:W,minimap:V,viewportColumn:H,isWordWrapMinified:P,isViewportWrapping:F,wrappingColumn:B,verticalScrollbarWidth:y,horizontalScrollbarHeight:k,overviewRuler:{top:z,width:y,height:n-2*z,right:0}}}}function mf(e){const t=e.get(87);return"editable"===t?e.get(81):"on"!==t}function ff(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}const _f="editor.unicodeHighlight.allowedCharacters",vf="editor.unicodeHighlight.invisibleCharacters",bf="editor.unicodeHighlight.nonBasicASCII",Cf="editor.unicodeHighlight.ambiguousCharacters",wf="editor.unicodeHighlight.includeComments",yf="editor.unicodeHighlight.includeStrings",Sf="editor.unicodeHighlight.allowedLocales";function xf(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}const kf={fontFamily:Ho?"Menlo, Monaco, 'Courier New', monospace":Vo?"'Droid Sans Mono', 'monospace', monospace":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:Ho?12:14,lineHeight:0,letterSpacing:0},Lf=[];function Df(e){return Lf[e.id]=e,e}const Ef={acceptSuggestionOnCommitCharacter:Df(new tf(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:$m(0,"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:Df(new lf(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",$m(0,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:$m(0,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Df(new class extends Zm{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[$m(0,"The editor will use platform APIs to detect when a Screen Reader is attached."),$m(0,"The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."),$m(0,"The editor will never be optimized for usage with a Screen Reader.")],default:"auto",description:$m(0,"Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:Df(new of(3,"accessibilityPageSize",10,1,1073741824,{description:$m(0,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.")})),ariaLabel:Df(new rf(4,"ariaLabel",$m(0,"Editor content"))),autoClosingBrackets:Df(new lf(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",$m(0,"Use language configurations to determine when to autoclose brackets."),$m(0,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:$m(0,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingDelete:Df(new lf(6,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",$m(0,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:$m(0,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Df(new lf(7,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",$m(0,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:$m(0,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Df(new lf(8,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",$m(0,"Use language configurations to determine when to autoclose quotes."),$m(0,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:$m(0,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Df(new df(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[$m(0,"The editor will not insert indentation automatically."),$m(0,"The editor will keep the current line's indentation."),$m(0,"The editor will keep the current line's indentation and honor language defined brackets."),$m(0,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),$m(0,"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:$m(0,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Df(new tf(10,"automaticLayout",!1)),autoSurround:Df(new lf(11,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[$m(0,"Use language configurations to determine when to automatically surround selections."),$m(0,"Surround with quotes but not brackets."),$m(0,"Surround with brackets but not quotes."),""],description:$m(0,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Df(new class extends Zm{constructor(){const e={enabled:Km.bracketPairColorizationOptions.enabled};super(12,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,description:$m(0,"Controls whether bracket pair colorization is enabled or not. Use 'workbench.colorCustomizations' to override the bracket highlight colors.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;return{enabled:ef(e.enabled,this.defaultValue.enabled)}}}),bracketPairGuides:Df(new class extends Zm{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(13,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[$m(0,"Enables bracket pair guides."),$m(0,"Enables bracket pair guides only for the active bracket pair."),$m(0,"Disables bracket pair guides.")],default:e.bracketPairs,description:$m(0,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[$m(0,"Enables horizontal guides as addition to vertical bracket pair guides."),$m(0,"Enables horizontal guides only for the active bracket pair."),$m(0,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:$m(0,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:$m(0,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:$m(0,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:"boolean",default:e.highlightActiveIndentation,description:$m(0,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:xf(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:xf(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:ef(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:ef(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:ef(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation)}}}),stickyTabStops:Df(new tf(104,"stickyTabStops",!1,{description:$m(0,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Df(new tf(14,"codeLens",!0,{description:$m(0,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Df(new rf(15,"codeLensFontFamily","",{description:$m(0,"Controls the font family for CodeLens.")})),codeLensFontSize:Df(new of(16,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:$m(0,"Controls the font size in pixels for CodeLens. When set to `0`, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Df(new tf(17,"colorDecorators",!0,{description:$m(0,"Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:Df(new tf(18,"columnSelection",!1,{description:$m(0,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:Df(new class extends Zm{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(19,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:$m(0,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:$m(0,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:ef(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:ef(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:Df(new tf(20,"contextmenu",!0)),copyWithSyntaxHighlighting:Df(new tf(21,"copyWithSyntaxHighlighting",!0,{description:$m(0,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Df(new df(22,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:$m(0,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:Df(new tf(23,"cursorSmoothCaretAnimation",!1,{description:$m(0,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Df(new df(24,"cursorStyle",hf.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return hf.Line;case"block":return hf.Block;case"underline":return hf.Underline;case"line-thin":return hf.LineThin;case"block-outline":return hf.BlockOutline;case"underline-thin":return hf.UnderlineThin}}),{description:$m(0,"Controls the cursor style.")})),cursorSurroundingLines:Df(new of(25,"cursorSurroundingLines",0,0,1073741824,{description:$m(0,"Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Df(new lf(26,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[$m(0,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),$m(0,"`cursorSurroundingLines` is enforced always.")],description:$m(0,"Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:Df(new of(27,"cursorWidth",0,0,1073741824,{markdownDescription:$m(0,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Df(new tf(28,"disableLayerHinting",!1)),disableMonospaceOptimizations:Df(new tf(29,"disableMonospaceOptimizations",!1)),domReadOnly:Df(new tf(30,"domReadOnly",!1)),dragAndDrop:Df(new tf(31,"dragAndDrop",!0,{description:$m(0,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Df(new class extends tf{constructor(){super(32,"emptySelectionClipboard",!0,{description:$m(0,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),extraEditorClassName:Df(new rf(33,"extraEditorClassName","")),fastScrollSensitivity:Df(new sf(34,"fastScrollSensitivity",5,(e=>e<=0?5:e),{markdownDescription:$m(0,"Scrolling speed multiplier when pressing `Alt`.")})),find:Df(new class extends Zm{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(35,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:$m(0,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[$m(0,"Never seed search string from the editor selection."),$m(0,"Always seed search string from the editor selection, including word at cursor position."),$m(0,"Only seed search string from the editor selection.")],description:$m(0,"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:[$m(0,"Never turn on Find in Selection automatically (default)."),$m(0,"Always turn on Find in Selection automatically."),$m(0,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:$m(0,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:$m(0,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Ho},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:$m(0,"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:$m(0,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:ef(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:"boolean"==typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":af(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":af(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:ef(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:ef(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:ef(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:Df(new tf(36,"fixedOverflowWidgets",!1)),folding:Df(new tf(37,"folding",!0,{description:$m(0,"Controls whether the editor has code folding enabled.")})),foldingStrategy:Df(new lf(38,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[$m(0,"Use a language-specific folding strategy if available, else the indentation-based one."),$m(0,"Use the indentation-based folding strategy.")],description:$m(0,"Controls the strategy for computing folding ranges.")})),foldingHighlight:Df(new tf(39,"foldingHighlight",!0,{description:$m(0,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Df(new tf(40,"foldingImportsByDefault",!1,{description:$m(0,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Df(new of(41,"foldingMaximumRegions",5e3,10,65e3,{description:$m(0,"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:Df(new tf(42,"unfoldOnClickAfterEndOfLine",!1,{description:$m(0,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Df(new rf(43,"fontFamily",kf.fontFamily,{description:$m(0,"Controls the font family.")})),fontInfo:Df(new class extends Qm{constructor(){super(44)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:Df(new uf),fontSize:Df(new class extends Jm{constructor(){super(46,"fontSize",kf.fontSize,{type:"number",minimum:6,maximum:100,default:kf.fontSize,description:$m(0,"Controls the font size in pixels.")})}validate(e){const t=sf.float(e,this.defaultValue);return 0===t?kf.fontSize:sf.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:Df(new gf),formatOnPaste:Df(new tf(48,"formatOnPaste",!1,{description:$m(0,"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:Df(new tf(49,"formatOnType",!1,{description:$m(0,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Df(new tf(50,"glyphMargin",!0,{description:$m(0,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Df(new class extends Zm{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:[$m(0,"Show peek view of the results (default)"),$m(0,"Go to the primary result and show a peek view"),$m(0,"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(51,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:$m(0,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:$m(0,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:$m(0,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:$m(0,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:$m(0,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:$m(0,"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:$m(0,"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:$m(0,"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:$m(0,"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:$m(0,"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:$m(0,"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,s;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:af(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:af(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:af(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:af(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:af(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:af(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:rf.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:rf.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:rf.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:rf.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:rf.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:Df(new tf(52,"hideCursorInOverviewRuler",!1,{description:$m(0,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:Df(new class extends Zm{constructor(){const e={enabled:!0,delay:300,sticky:!0,above:!0};super(53,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:$m(0,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:$m(0,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:$m(0,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.above":{type:"boolean",default:e.above,description:$m(0,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ef(t.enabled,this.defaultValue.enabled),delay:of.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:ef(t.sticky,this.defaultValue.sticky),above:ef(t.above,this.defaultValue.above)}}}),inDiffEditor:Df(new tf(54,"inDiffEditor",!1)),letterSpacing:Df(new sf(56,"letterSpacing",kf.letterSpacing,(e=>sf.clamp(e,-5,20)),{description:$m(0,"Controls the letter spacing in pixels.")})),lightbulb:Df(new class extends Zm{constructor(){const e={enabled:!0};super(57,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:$m(0,"Enables the code action lightbulb in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;return{enabled:ef(e.enabled,this.defaultValue.enabled)}}}),lineDecorationsWidth:Df(new Jm(58,"lineDecorationsWidth",10)),lineHeight:Df(new class extends sf{constructor(){super(59,"lineHeight",kf.lineHeight,(e=>sf.clamp(e,0,150)),{markdownDescription:$m(0,"Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:Df(new class extends Zm{constructor(){super(60,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[$m(0,"Line numbers are not rendered."),$m(0,"Line numbers are rendered as absolute number."),$m(0,"Line numbers are rendered as distance in lines to cursor position."),$m(0,"Line numbers are rendered every 10 lines.")],default:"on",description:$m(0,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:Df(new of(61,"lineNumbersMinChars",5,1,300)),linkedEditing:Df(new tf(62,"linkedEditing",!1,{description:$m(0,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.")})),links:Df(new tf(63,"links",!0,{description:$m(0,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Df(new lf(64,"matchBrackets","always",["always","near","never"],{description:$m(0,"Highlight matching brackets.")})),minimap:Df(new class extends Zm{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(65,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:$m(0,"Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[$m(0,"The minimap has the same size as the editor contents (and might scroll)."),$m(0,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),$m(0,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:$m(0,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:$m(0,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:$m(0,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:$m(0,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:$m(0,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:$m(0,"Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ef(t.enabled,this.defaultValue.enabled),size:af(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:af(t.side,this.defaultValue.side,["right","left"]),showSlider:af(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ef(t.renderCharacters,this.defaultValue.renderCharacters),scale:of.clampedInt(t.scale,1,1,3),maxColumn:of.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:Df(new lf(66,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Df(new sf(67,"mouseWheelScrollSensitivity",1,(e=>0===e?1:e),{markdownDescription:$m(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Df(new tf(68,"mouseWheelZoom",!1,{markdownDescription:$m(0,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Df(new tf(69,"multiCursorMergeOverlapping",!0,{description:$m(0,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Df(new df(70,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?Ho?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[$m(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),$m(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:$m(0,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Df(new lf(71,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[$m(0,"Each cursor pastes a single line of the text."),$m(0,"Each cursor pastes the full text.")],markdownDescription:$m(0,"Controls pasting when the line count of the pasted text matches the cursor count.")})),occurrencesHighlight:Df(new tf(72,"occurrencesHighlight",!0,{description:$m(0,"Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:Df(new tf(73,"overviewRulerBorder",!0,{description:$m(0,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Df(new of(74,"overviewRulerLanes",3,0,3)),padding:Df(new class extends Zm{constructor(){super(75,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:$m(0,"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:$m(0,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:of.clampedInt(t.top,0,0,1e3),bottom:of.clampedInt(t.bottom,0,0,1e3)}}}),parameterHints:Df(new class extends Zm{constructor(){const e={enabled:!0,cycle:!1};super(76,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:$m(0,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:$m(0,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ef(t.enabled,this.defaultValue.enabled),cycle:ef(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:Df(new lf(77,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[$m(0,"Focus the tree when opening peek"),$m(0,"Focus the editor when opening peek")],description:$m(0,"Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Df(new tf(78,"definitionLinkOpensInPeek",!1,{description:$m(0,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Df(new class extends Zm{constructor(){const e={other:!0,comments:!1,strings:!1};super(79,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:$m(0,"Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:$m(0,"Enable quick suggestions inside comments.")},other:{type:"boolean",default:e.other,description:$m(0,"Enable quick suggestions outside of strings and comments.")}}}],default:e,description:$m(0,"Controls whether suggestions should automatically show up while typing.")}),this.defaultValue=e}validate(e){if("boolean"==typeof e)return e;if(e&&"object"==typeof e){const t=e,i={other:ef(t.other,this.defaultValue.other),comments:ef(t.comments,this.defaultValue.comments),strings:ef(t.strings,this.defaultValue.strings)};return!!(i.other&&i.comments&&i.strings)||!!(i.other||i.comments||i.strings)&&i}return this.defaultValue}}),quickSuggestionsDelay:Df(new of(80,"quickSuggestionsDelay",10,0,1073741824,{description:$m(0,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Df(new tf(81,"readOnly",!1)),renameOnType:Df(new tf(82,"renameOnType",!1,{description:$m(0,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:$m(0,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Df(new tf(83,"renderControlCharacters",!0,{description:$m(0,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Df(new tf(84,"renderFinalNewline",!0,{description:$m(0,"Render last line number when the file ends with a newline.")})),renderLineHighlight:Df(new lf(85,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",$m(0,"Highlights both the gutter and the current line.")],description:$m(0,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Df(new tf(86,"renderLineHighlightOnlyWhenFocus",!1,{description:$m(0,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Df(new lf(87,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Df(new lf(88,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",$m(0,"Render whitespace characters except for single spaces between words."),$m(0,"Render whitespace characters only on selected text."),$m(0,"Render only trailing whitespace characters."),""],description:$m(0,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Df(new of(89,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:Df(new tf(90,"roundedSelection",!0,{description:$m(0,"Controls whether selections should have rounded corners.")})),rulers:Df(new class extends Zm{constructor(){const e=[],t={type:"number",description:$m(0,"Number of monospace characters at which this editor ruler will render.")};super(91,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:$m(0,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:$m(0,"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(let i of e)if("number"==typeof i)t.push({column:of.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:of.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort(((e,t)=>e.column-t.column)),t}return this.defaultValue}}),scrollbar:Df(new class extends Zm{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(92,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[$m(0,"The vertical scrollbar will be visible only when necessary."),$m(0,"The vertical scrollbar will always be visible."),$m(0,"The vertical scrollbar will always be hidden.")],default:"auto",description:$m(0,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[$m(0,"The horizontal scrollbar will be visible only when necessary."),$m(0,"The horizontal scrollbar will always be visible."),$m(0,"The horizontal scrollbar will always be hidden.")],default:"auto",description:$m(0,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:$m(0,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:$m(0,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:$m(0,"Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=of.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=of.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:of.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:ff(t.vertical,this.defaultValue.vertical),horizontal:ff(t.horizontal,this.defaultValue.horizontal),useShadows:ef(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:ef(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:ef(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:ef(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:ef(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:of.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:of.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:ef(t.scrollByPage,this.defaultValue.scrollByPage)}}}),scrollBeyondLastColumn:Df(new of(93,"scrollBeyondLastColumn",5,0,1073741824,{description:$m(0,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Df(new tf(94,"scrollBeyondLastLine",!0,{description:$m(0,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Df(new tf(95,"scrollPredominantAxis",!0,{description:$m(0,"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:Df(new tf(96,"selectionClipboard",!0,{description:$m(0,"Controls whether the Linux primary clipboard should be supported."),included:Vo})),selectionHighlight:Df(new tf(97,"selectionHighlight",!0,{description:$m(0,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Df(new tf(98,"selectOnLineNumbers",!0)),showFoldingControls:Df(new lf(99,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[$m(0,"Always show the folding controls."),$m(0,"Only show the folding controls when the mouse is over the gutter.")],description:$m(0,"Controls when the folding controls on the gutter are shown.")})),showUnused:Df(new tf(100,"showUnused",!0,{description:$m(0,"Controls fading out of unused code.")})),showDeprecated:Df(new tf(126,"showDeprecated",!0,{description:$m(0,"Controls strikethrough deprecated variables.")})),inlayHints:Df(new class extends Zm{constructor(){const e={enabled:!0,fontSize:0,fontFamily:""};super(127,"inlayHints",e,{"editor.inlayHints.enabled":{type:"boolean",default:e.enabled,description:$m(0,"Enables the inlay hints in the editor.")},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:$m(0,"Controls font size of inlay hints in the editor. A default of 90% of `#editor.fontSize#` is used when the configured value is less than `5` or greater than the editor font size.")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:$m(0,"Controls font family of inlay hints in the editor. When set to empty, the `#editor.fontFamily#` is used.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ef(t.enabled,this.defaultValue.enabled),fontSize:of.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:rf.string(t.fontFamily,this.defaultValue.fontFamily)}}}),snippetSuggestions:Df(new lf(101,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[$m(0,"Show snippet suggestions on top of other suggestions."),$m(0,"Show snippet suggestions below other suggestions."),$m(0,"Show snippets suggestions with other suggestions."),$m(0,"Do not show snippet suggestions.")],description:$m(0,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Df(new class extends Zm{constructor(){super(102,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:$m(0,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:ef(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}:this.defaultValue}}),smoothScrolling:Df(new tf(103,"smoothScrolling",!1,{description:$m(0,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Df(new of(105,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Df(new class extends Zm{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(106,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[$m(0,"Insert suggestion without overwriting text right of the cursor."),$m(0,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:$m(0,"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:$m(0,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:$m(0,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:$m(0,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:$m(0,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:$m(0,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:$m(0,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:$m(0,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:$m(0,"Controls whether suggest details show inline with the label or only in the details widget")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:$m(0,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:$m(0,"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:$m(0,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:$m(0,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:af(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:ef(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:ef(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:ef(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:ef(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:ef(t.showIcons,this.defaultValue.showIcons),showStatusBar:ef(t.showStatusBar,this.defaultValue.showStatusBar),preview:ef(t.preview,this.defaultValue.preview),previewMode:af(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:ef(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:ef(t.showMethods,this.defaultValue.showMethods),showFunctions:ef(t.showFunctions,this.defaultValue.showFunctions),showConstructors:ef(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:ef(t.showDeprecated,this.defaultValue.showDeprecated),showFields:ef(t.showFields,this.defaultValue.showFields),showVariables:ef(t.showVariables,this.defaultValue.showVariables),showClasses:ef(t.showClasses,this.defaultValue.showClasses),showStructs:ef(t.showStructs,this.defaultValue.showStructs),showInterfaces:ef(t.showInterfaces,this.defaultValue.showInterfaces),showModules:ef(t.showModules,this.defaultValue.showModules),showProperties:ef(t.showProperties,this.defaultValue.showProperties),showEvents:ef(t.showEvents,this.defaultValue.showEvents),showOperators:ef(t.showOperators,this.defaultValue.showOperators),showUnits:ef(t.showUnits,this.defaultValue.showUnits),showValues:ef(t.showValues,this.defaultValue.showValues),showConstants:ef(t.showConstants,this.defaultValue.showConstants),showEnums:ef(t.showEnums,this.defaultValue.showEnums),showEnumMembers:ef(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:ef(t.showKeywords,this.defaultValue.showKeywords),showWords:ef(t.showWords,this.defaultValue.showWords),showColors:ef(t.showColors,this.defaultValue.showColors),showFiles:ef(t.showFiles,this.defaultValue.showFiles),showReferences:ef(t.showReferences,this.defaultValue.showReferences),showFolders:ef(t.showFolders,this.defaultValue.showFolders),showTypeParameters:ef(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:ef(t.showSnippets,this.defaultValue.showSnippets),showUsers:ef(t.showUsers,this.defaultValue.showUsers),showIssues:ef(t.showIssues,this.defaultValue.showIssues)}}}),inlineSuggest:Df(new class extends Zm{constructor(){const e={enabled:!0,mode:"subwordSmart"};super(55,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:$m(0,"Controls whether to automatically show inline suggestions in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:ef(t.enabled,this.defaultValue.enabled),mode:af(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"])}}}),suggestFontSize:Df(new of(107,"suggestFontSize",0,0,1e3,{markdownDescription:$m(0,"Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")})),suggestLineHeight:Df(new of(108,"suggestLineHeight",0,0,1e3,{markdownDescription:$m(0,"Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.")})),suggestOnTriggerCharacters:Df(new tf(109,"suggestOnTriggerCharacters",!0,{description:$m(0,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Df(new lf(110,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[$m(0,"Always select the first suggestion."),$m(0,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),$m(0,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:$m(0,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Df(new lf(111,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[$m(0,"Tab complete will insert the best matching suggestion when pressing tab."),$m(0,"Disable tab completions."),$m(0,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:$m(0,"Enables tab completions.")})),tabIndex:Df(new of(112,"tabIndex",0,-1,1073741824)),unicodeHighlight:Df(new class extends Zm{constructor(){const e={nonBasicASCII:"inUntrustedWorkspace",invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:"inUntrustedWorkspace",includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(113,"unicodeHighlight",e,{[bf]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,"inUntrustedWorkspace"],default:e.nonBasicASCII,description:$m(0,"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.")},[vf]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:$m(0,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[Cf]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:$m(0,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[wf]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,"inUntrustedWorkspace"],default:e.includeComments,description:$m(0,"Controls whether characters in comments should also be subject to unicode highlighting.")},[yf]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,"inUntrustedWorkspace"],default:e.includeStrings,description:$m(0,"Controls whether characters in strings should also be subject to unicode highlighting.")},[_f]:{restricted:!0,type:"object",default:e.allowedCharacters,description:$m(0,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Sf]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:$m(0,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&(zo(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&(zo(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const n=super.applyUpdate(e,t);return i?new Ym(n.newValue,!0):n}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:xf(t.nonBasicASCII,"inUntrustedWorkspace",[!0,!1,"inUntrustedWorkspace"]),invisibleCharacters:ef(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:ef(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:xf(t.includeComments,"inUntrustedWorkspace",[!0,!1,"inUntrustedWorkspace"]),includeStrings:xf(t.includeStrings,"inUntrustedWorkspace",[!0,!1,"inUntrustedWorkspace"]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const i={};for(const[n,o]of Object.entries(e))!0===o&&(i[n]=!0);return i}}),unusualLineTerminators:Df(new lf(114,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[$m(0,"Unusual line terminators are automatically removed."),$m(0,"Unusual line terminators are ignored."),$m(0,"Unusual line terminators prompt to be removed.")],description:$m(0,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:Df(new tf(115,"useShadowDOM",!0)),useTabStops:Df(new tf(116,"useTabStops",!0,{description:$m(0,"Inserting and deleting whitespace follows tab stops.")})),wordSeparators:Df(new rf(117,"wordSeparators",Wo,{description:$m(0,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Df(new lf(118,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[$m(0,"Lines will never wrap."),$m(0,"Lines will wrap at the viewport width."),$m(0,"Lines will wrap at `#editor.wordWrapColumn#`."),$m(0,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:$m(0,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Df(new rf(119,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Df(new rf(120,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Df(new of(121,"wordWrapColumn",80,1,1073741824,{markdownDescription:$m(0,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Df(new lf(122,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Df(new lf(123,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:Df(new df(124,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],(function(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}),{enumDescriptions:[$m(0,"No indentation. Wrapped lines begin at column 1."),$m(0,"Wrapped lines get the same indentation as the parent."),$m(0,"Wrapped lines get +1 indentation toward the parent."),$m(0,"Wrapped lines get +2 indentation toward the parent.")],description:$m(0,"Controls the indentation of wrapped lines.")})),wrappingStrategy:Df(new lf(125,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[$m(0,"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."),$m(0,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],description:$m(0,"Controls the algorithm that computes wrapping points.")})),editorClassName:Df(new class extends Qm{constructor(){super(128)}compute(e,t,i){const n=["monaco-editor"];return t.get(33)&&n.push(t.get(33)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(66)?n.push("mouse-default"):"copy"===t.get(66)&&n.push("mouse-copy"),t.get(100)&&n.push("showUnused"),t.get(126)&&n.push("showDeprecated"),n.join(" ")}}),pixelRatio:Df(new class extends Qm{constructor(){super(129)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:Df(new class extends Qm{constructor(){super(130)}compute(e,t,i){return!!t.get(81)||e.tabFocusMode}}),layoutInfo:Df(new pf),wrappingInfo:Df(new class extends Qm{constructor(){super(132)}compute(e,t,i){const n=t.get(131);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}})};class Nf{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}Nf.INSTANCE=new Nf;class If extends Uo{constructor(){super(),this._onDidChange=this._register(new $o),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){this._mediaQueryList&&this._mediaQueryList.removeEventListener("change",this._listener),this._mediaQueryList=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class Tf extends Uo{constructor(){super(),this._onDidChange=this._register(new $o),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new If);this._register(e.onDidChange((()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)})))}get value(){return this._value}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d");return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}}const Mf=new class{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new Tf),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}};function Of(){return Nf.INSTANCE.getZoomFactor()}const Af=navigator.userAgent,Rf=Af.indexOf("Firefox")>=0,Pf=Af.indexOf("AppleWebKit")>=0,Ff=Af.indexOf("Chrome")>=0,Bf=!Ff&&Af.indexOf("Safari")>=0,Vf=!Ff&&!Bf&&Pf,Wf=Af.indexOf("Electron/")>=0,Hf=Af.indexOf("Android")>=0,zf=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches;var jf=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",PixelRatio:Mf,getZoomFactor:Of,isFirefox:Rf,isWebKit:Pf,isChrome:Ff,isSafari:Bf,isWebkitWebView:Vf,isElectron:Wf,isAndroid:Hf,isStandalone:zf});class Uf{constructor(e){this.domNode=e,this._maxWidth=-1,this._width=-1,this._height=-1,this._top=-1,this._left=-1,this._bottom=-1,this._right=-1,this._fontFamily="",this._fontWeight="",this._fontSize=-1,this._fontStyle="",this._fontFeatureSettings="",this._textDecoration="",this._lineHeight=-1,this._letterSpacing=-100,this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth+"px")}setWidth(e){this._width!==e&&(this._width=e,this.domNode.style.width=this._width+"px")}setHeight(e){this._height!==e&&(this._height=e,this.domNode.style.height=this._height+"px")}setTop(e){this._top!==e&&(this._top=e,this.domNode.style.top=this._top+"px")}unsetTop(){-1!==this._top&&(this._top=-1,this.domNode.style.top="")}setLeft(e){this._left!==e&&(this._left=e,this.domNode.style.left=this._left+"px")}setBottom(e){this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom+"px")}setRight(e){this._right!==e&&(this._right=e,this.domNode.style.right=this._right+"px")}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize+"px")}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)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight+"px")}setLetterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing+"px")}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}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 $f(e){return new Uf(e)}function Kf(e,t){e instanceof Uf?(e.setFontFamily(t.getMassagedFontFamily(Bf?kf.fontFamily:null)),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(Bf?kf.fontFamily:null),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}class qf{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class Gf{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Kf(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Kf(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");Kf(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const s of this._requests){let e;0===s.type&&(e=t),2===s.type&&(e=i),1===s.type&&(e=n),e.appendChild(document.createElement("br"));const r=document.createElement("span");Gf._render(r,s),e.appendChild(r),o.push(r)}this._container=e,this._testElements=o}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;ethis._values[e]))}}const e_=new class extends Uo{constructor(){super(),this._onDidChange=this._register(new $o),this.onDidChange=this._onDidChange.event,this._cache=new Jf,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new Jf,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=window.setTimeout((()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()}),5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new Qf({pixelRatio:Mf.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,n){const o=new qf(e,t);return i.push(o),n&&n.push(o),o}_actualReadFontInfo(e){const t=[],i=[],n=this._createRequest("n",0,t,i),o=this._createRequest("m",0,t,null),s=this._createRequest(" ",0,t,i),r=this._createRequest("0",0,t,i),a=this._createRequest("1",0,t,i),l=this._createRequest("2",0,t,i),d=this._createRequest("3",0,t,i),h=this._createRequest("4",0,t,i),c=this._createRequest("5",0,t,i),u=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),m=this._createRequest("9",0,t,i),f=this._createRequest("→",0,t,i),_=this._createRequest("→",0,t,null),v=this._createRequest("·",0,t,i),b=this._createRequest(String.fromCharCode(11825),0,t,null),C="|/-_ilm%";for(let k=0,L=C.length;k.001){y=!1;break}}let x=!0;return y&&_.width!==S&&(x=!1),_.width>f.width&&(x=!1),new Qf({pixelRatio:Mf.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:y,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:x,spaceWidth:s.width,middotWidth:v.width,wsmiddotWidth:b.width,maxDigitWidth:w},!0)}};var t_,i_;(i_=t_||(t_={})).serviceIds=new Map,i_.DI_TARGET="$di$target",i_.DI_DEPENDENCIES="$di$dependencies",i_.getServiceDependencies=function(e){return e[i_.DI_DEPENDENCIES]||[]};const n_=s_("instantiationService");function o_(e,t,i){t[t_.DI_TARGET]===t?t[t_.DI_DEPENDENCIES].push({id:e,index:i}):(t[t_.DI_DEPENDENCIES]=[{id:e,index:i}],t[t_.DI_TARGET]=t)}function s_(e){if(t_.serviceIds.has(e))return t_.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");o_(t,e,n)};return t.toString=()=>e,t_.serviceIds.set(e,t),t}const r_=s_("codeEditorService");function a_(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}const l_={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class d_ extends Uo{constructor(e,t={}){super(),this._onDidUpdate=this._register(new $o),this._editor=e,this._options=Ko(t,l_,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._register(this._editor.onDidDispose((()=>this.dispose()))),this._register(this._editor.onDidUpdateDiff((()=>this._onDiffUpdated()))),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition((e=>{this.ignoreSelectionChange||(this.nextIdx=-1)}))),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel((e=>{this.revealFirst=!0}))),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&null!==this._editor.getLineChanges()&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach((e=>{!this._options.ignoreCharChanges&&e.charChanges?e.charChanges.forEach((e=>{this.ranges.push({rhs:!0,range:new qo(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})})):0===e.modifiedEndLineNumber?this.ranges.push({rhs:!0,range:new qo(e.modifiedStartLineNumber,1,e.modifiedStartLineNumber+1,1)}):this.ranges.push({rhs:!0,range:new qo(e.modifiedStartLineNumber,1,e.modifiedEndLineNumber+1,1)})})),this.ranges.sort(((e,t)=>qo.compareRangesUsingStarts(e.range,t.range))),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1;const i=this._editor.getPosition();if(i){for(let n=0,o=this.ranges.length;n=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));const i=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{const e=i.range.getStartPosition();this._editor.setPosition(e),this._editor.revealRangeInCenter(i.range,t)}finally{this.ignoreSelectionChange=!1}}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this._move(!0,e)}previous(e=0){this._move(!1,e)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}}const h_={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};var c_,u_;(u_=c_||(c_={}))[u_.None=0]="None",u_[u_.Indent=1]="Indent",u_[u_.IndentOutdent=2]="IndentOutdent",u_[u_.Outdent=3]="Outdent";class g_{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;t0&&e.getLanguageId(r-1)===o;)r--;return new __(e,o,r,s+1,e.getStartOffset(r),e.getEndOffset(s))}class __{constructor(e,t,i,n,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function v_(e){return 0!=(3&e)}class b_{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map((e=>new g_(e))):e.brackets?this._autoClosingPairs=e.brackets.map((e=>new g_({open:e[0],close:e[1]}))):this._autoClosingPairs=[],e.colorizedBracketPairs?this._colorizedBracketPairs=C_(e.colorizedBracketPairs.map((e=>[e[0],e[1]]))):e.brackets?this._colorizedBracketPairs=C_(e.brackets.map((e=>[e[0],e[1]])).filter((e=>!("<"===e[0]&&">"===e[1])))):this._colorizedBracketPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new g_({open:t.open,close:t.close||""}))}this._autoCloseBefore="string"==typeof e.autoCloseBefore?e.autoCloseBefore:b_.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(){return this._autoCloseBefore}getSurroundingPairs(){return this._surroundingPairs}getColorizedBrackets(){return this._colorizedBracketPairs}}function C_(e){return e.filter((([e,t])=>""!==e&&""!==t))}b_.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t";const w_="undefined"!=typeof Buffer;let y_,S_,x_,k_;class L_{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(e){return w_&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new L_(e)}toString(){return w_?this.buffer.toString():(y_||(y_=new TextDecoder),y_.decode(this.buffer))}}function D_(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function E_(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function N_(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}function I_(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function T_(e,t){return e[t]}function M_(e,t,i){e[i]=t}function O_(){return S_||(S_=new TextDecoder("UTF-16LE")),S_}function A_(){return k_||(k_=Zo()?O_():(x_||(x_=new TextDecoder("UTF-16BE")),x_)),k_}const R_="undefined"!=typeof TextDecoder;let P_,F_;function B_(e,t,i){const n=[];let o=0;for(let s=0;snew V_(e),F_=function(e,t,i){const n=new Uint16Array(e.buffer,t,i);if(i>0&&(65279===n[0]||65534===n[0]))return B_(e,t,i);return O_().decode(n)}):(P_=e=>new W_,F_=B_);class V_{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return A_().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}write1(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||Go(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCII(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIIString(e){const t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i[e[0].toLowerCase(),e[1].toLowerCase()]));const i=[];for(let r=0;r{const[i,n]=e,[o,s]=t;return i===o||i===s||n===o||n===s},o=(e,n)=>{const o=Math.min(e,n),s=Math.max(e,n);for(let r=0;r0&&s.push({open:n,close:o})}return s}(t);this.brackets=i.map(((t,n)=>new H_(e,n,t.open,t.close,function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let s=0,r=o.length;s=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function U_(e,t){return e.length-t.length}function $_(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function K_(e){const t=/^[\w ]+$/.test(e);return e=Xo(e),t?`\\b${e}\\b`:e}function q_(e){const t=`(${e.map(K_).join(")|(")})`;return Yo(t,!0)}const G_=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){if(R_){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return A_().decode(t)}{const t=[];let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charAt(n);return t.join("")}}(e)),t}}();class Z_{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=i.length-(o.index||0),r=o[0].length,a=n+s;return new qo(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,o){const s=G_(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,s,n)}static findNextBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=o.index||0,r=o[0].length;if(0===r)return null;const a=n+s;return new qo(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}class Y_{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 t=i.charAt(i.length-1);e.push(t)}return Qo(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(v_(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=Z_.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function X_(e){return e.global&&(e.lastIndex=0),!0}class Q_{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&X_(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&X_(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&X_(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&X_(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 J_{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach((e=>{const t=J_._createOpenBracketRegExp(e[0]),i=J_._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})})),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let o=0,s=this._regExpRules.length;o!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text)))))return e.action}if(e>=2&&i.length>0&&n.length>0)for(let o=0,s=this._brackets.length;o=2&&i.length>0)for(let o=0,s=this._brackets.length;o=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},uv=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};class gv{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const pv=s_("languageConfigurationService");let mv=class extends Uo{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this.onDidChangeEmitter=this._register(new $o),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(fv));this._register(this.configurationService.onDidChangeConfiguration((e=>{const t=e.change.keys.some((e=>i.has(e))),n=e.change.overrides.filter((([e,t])=>t.some((e=>i.has(e))))).map((([e])=>e));if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new gv(void 0));else for(const i of n)this.languageService.isRegisteredLanguageId(i)&&(this.configurations.delete(i),this.onDidChangeEmitter.fire(new gv(i)))}))),this._register(bv.onDidChange((e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new gv(e.languageId))})))}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i){let n=bv.getLanguageConfiguration(e);if(!n){if(!i.isRegisteredLanguageId(e))throw new Error(`Language id "${e}" is not configured nor known`);n=new Sv(e,{})}const o=function(e,t){const i=t.getValue(fv.brackets,{overrideIdentifier:e}),n=t.getValue(fv.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:_v(i),colorizedBracketPairs:_v(n)}}(n.languageId,t),s=wv([n.underlyingConfig,o]);return new Sv(n.languageId,s)}(e,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};mv=cv([uv(0,ev),uv(1,rv)],mv);const fv={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function _v(e){if(Array.isArray(e))return e.map((e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]})).filter((e=>!!e))}class vv{constructor(e){this.languageId=e}}const bv=new class{constructor(){this._entries=new Map,this._onDidChange=new $o,this.onDidChange=this._onDidChange.event}register(e,t,i=0){let n=this._entries.get(e);n||(n=new Cv(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new vv(e)),es((()=>{o.dispose(),this._onDidChange.fire(new vv(e))}))}getLanguageConfiguration(e){const t=this._entries.get(e);return(null==t?void 0:t.getResolvedConfiguration())||null}getComments(e){const t=this.getLanguageConfiguration(e);return t&&t.comments||null}getIndentRulesSupport(e){const t=this.getLanguageConfiguration(e);return t&&t.indentRulesSupport||null}getPrecedingValidLine(e,t,i){const n=e.getLanguageIdAtPosition(t,0);if(t>1){let o,s=-1;for(o=t-1;o>=1;o--){if(e.getLanguageIdAtPosition(o,0)!==n)return s;const t=e.getLineContent(o);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return o;s=o}}return-1}getInheritIndentForLine(e,t,i,n=!0){if(e<4)return null;const o=this.getIndentRulesSupport(t.getLanguageId());if(!o)return null;if(i<=1)return{indentation:"",action:null};const s=this.getPrecedingValidLine(t,i,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const r=t.getLineContent(s);if(o.shouldIncrease(r)||o.shouldIndentNextLine(r))return{indentation:ts(r),action:c_.Indent,line:s};if(o.shouldDecrease(r))return{indentation:ts(r),action:null,line:s};{if(1===s)return{indentation:ts(t.getLineContent(s)),action:null,line:s};const e=s-1,i=o.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let n=e-1;n>0;n--)if(!o.shouldIndentNextLine(t.getLineContent(n))){i=n;break}return{indentation:ts(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:ts(t.getLineContent(s)),action:null,line:s};for(let n=s;n>0;n--){const e=t.getLineContent(n);if(o.shouldIncrease(e))return{indentation:ts(e),action:c_.Indent,line:n};if(o.shouldIndentNextLine(e)){let e=0;for(let i=n-1;i>0;i--)if(!o.shouldIndentNextLine(t.getLineContent(n))){e=i;break}return{indentation:ts(t.getLineContent(e+1)),action:null,line:e+1}}if(o.shouldDecrease(e))return{indentation:ts(e),action:null,line:n}}return{indentation:ts(t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,n,o){if(e<4)return null;const s=this.getLanguageConfiguration(i);if(!s)return null;const r=this.getIndentRulesSupport(i);if(!r)return null;const a=this.getInheritIndentForLine(e,t,n),l=t.getLineContent(n);if(a){const i=a.line;if(void 0!==i){const n=s.onEnter(e,"",t.getLineContent(i),"");if(n){let e=ts(t.getLineContent(i));return n.removeText&&(e=e.substring(0,e.length-n.removeText)),n.indentAction===c_.Indent||n.indentAction===c_.IndentOutdent?e=o.shiftIndent(e):n.indentAction===c_.Outdent&&(e=o.unshiftIndent(e)),r.shouldDecrease(l)&&(e=o.unshiftIndent(e)),n.appendText&&(e+=n.appendText),ts(e)}}return r.shouldDecrease(l)?a.action===c_.Indent?a.indentation:o.unshiftIndent(a.indentation):a.action===c_.Indent?o.shiftIndent(a.indentation):a.indentation}return null}getIndentForEnter(e,t,i,n){if(e<4)return null;t.forceTokenization(i.startLineNumber);const o=t.getLineTokens(i.startLineNumber),s=f_(o,i.startColumn-1),r=s.getLineContent();let a,l,d=!1;if(s.firstCharOffset>0&&o.getLanguageId(0)!==s.languageId?(d=!0,a=r.substr(0,i.startColumn-1-s.firstCharOffset)):a=o.getLineContent().substring(0,i.startColumn-1),i.isEmpty())l=r.substr(i.startColumn-1-s.firstCharOffset);else{l=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-s.firstCharOffset)}const h=this.getIndentRulesSupport(s.languageId);if(!h)return null;const c=a,u=ts(a),g={getLineTokens:e=>t.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i),getLineContent:e=>e===i.startLineNumber?c:t.getLineContent(e)},p=ts(o.getLineContent()),m=this.getInheritIndentForLine(e,g,i.startLineNumber+1);if(!m){const e=d?p:u;return{beforeEnter:e,afterEnter:e}}let f=d?p:m.indentation;return m.action===c_.Indent&&(f=n.shiftIndent(f)),h.shouldDecrease(l)&&(f=n.unshiftIndent(f)),{beforeEnter:d?p:u,afterEnter:f}}getIndentActionForType(e,t,i,n,o){if(e<4)return null;const s=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn);if(s.firstCharOffset)return null;const r=this.getIndentRulesSupport(s.languageId);if(!r)return null;const a=s.getLineContent(),l=a.substr(0,i.startColumn-1-s.firstCharOffset);let d;if(i.isEmpty())d=a.substr(i.startColumn-1-s.firstCharOffset);else{d=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-s.firstCharOffset)}if(!r.shouldDecrease(l+d)&&r.shouldDecrease(l+n+d)){const n=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!n)return null;let s=n.indentation;return n.action!==c_.Indent&&(s=o.unshiftIndent(s)),s}return null}getIndentMetadata(e,t){const i=this.getIndentRulesSupport(e.getLanguageId());return i?t<1||t>e.getLineCount()?null:i.getIndentMetadata(e.getLineContent(t)):null}getEnterAction(e,t,i){const n=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn),o=this.getLanguageConfiguration(n.languageId);if(!o)return null;const s=n.getLineContent(),r=s.substr(0,i.startColumn-1-n.firstCharOffset);let a;if(i.isEmpty())a=s.substr(i.startColumn-1-n.firstCharOffset);else{a=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-n.firstCharOffset)}let l="";if(i.startLineNumber>1&&0===n.firstCharOffset){const e=this.getScopedLineTokens(t,i.startLineNumber-1);e.languageId===n.languageId&&(l=e.getLineContent())}const d=o.onEnter(e,l,r,a);if(!d)return null;const h=d.indentAction;let c=d.appendText;const u=d.removeText||0;c?h===c_.Indent&&(c="\t"+c):c=h===c_.Indent||h===c_.IndentOutdent?"\t":"";let g=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return u&&(g=g.substring(0,g.length-u)),{indentAction:h,appendText:c,removeText:u,indentation:g}}getIndentationAtPosition(e,t,i){const n=e.getLineContent(t);let o=ts(n);return o.length>i-1&&(o=o.substring(0,i-1)),o}getScopedLineTokens(e,t,i){e.forceTokenization(t);return f_(e.getLineTokens(t),void 0===i?e.getLineMaxColumn(t)-1:i-1)}};class Cv{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new yv(e,t,++this._order);return this._entries.push(i),this._resolved=null,es((()=>{for(let e=0;ee.configuration))))}}function wv(e){let t={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 i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class yv{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 Sv{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 J_(this.underlyingConfig):null,this.comments=Sv._handleComments(this.underlyingConfig),this.characterPair=new b_(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||is,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Q_(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{}}getWordDefinition(){return ns(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new z_(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new Y_(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new p_(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(){return this.characterPair.getAutoCloseBeforeSet()}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[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}dv(pv,mv);const xv=new class{clone(){return this}equals(e){return this===e}};function kv(e,t){return new ss([new rs(0,"",e)],t)}function Lv(e,t){const i=new Uint32Array(2);return i[0]=0,i[1]=(16384|e<<0|2<<23)>>>0,new os(i,null===t?xv:t)}const Dv=s_("modelService");var Ev=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},Nv=globalThis&&globalThis.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,o){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,o,(t=e[i](t)).done,t.value)}))}}};function Iv(e){const t=new as,i=e(t.token),n=new Promise(((e,n)=>{const o=t.token.onCancellationRequested((()=>{o.dispose(),t.dispose(),n(new ls)}));Promise.resolve(i).then((i=>{o.dispose(),t.dispose(),e(i)}),(e=>{o.dispose(),t.dispose(),n(e)}))}));return new class{cancel(){t.cancel()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}function Tv(e,t,i){return new Promise(((n,o)=>{const s=t.onCancellationRequested((()=>{s.dispose(),n(i)}));e.then(n,o).finally((()=>s.dispose()))}))}class Mv{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{this.queuedPromise=null;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}}const Ov=Symbol("MicrotaskDelay");class Av{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(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}})));const i=()=>{var e;this.deferred=null,null===(e=this.doResolve)||void 0===e||e.call(this,null)};return this.deferred=t===Ov?(e=>{let t=!0;return queueMicrotask((()=>{t&&(t=!1,e())})),{isTriggered:()=>t,dispose:()=>{t=!1}}})(i):((e,t)=>{let i=!0;const n=setTimeout((()=>{i=!1,t()}),e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}})(t,i),this.completionPromise}isTriggered(){var e;return!!(null===(e=this.deferred)||void 0===e?void 0:e.isTriggered())}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject&&this.doReject(new ls),this.completionPromise=null)}cancelTimeout(){var e;null===(e=this.deferred)||void 0===e||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class Rv{constructor(e){this.delayer=new Av(e),this.throttler=new Mv}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}dispose(){this.delayer.dispose()}}function Pv(e,t){return t?new Promise(((i,n)=>{const o=setTimeout((()=>{s.dispose(),i()}),e),s=t.onCancellationRequested((()=>{clearTimeout(o),s.dispose(),n(new ls)}))})):Iv((t=>Pv(e,t)))}function Fv(e,t=0){const i=setTimeout(e,t);return es((()=>clearTimeout(i)))}function Bv(e,t=(e=>!!e),i=null){let n=0;const o=e.length,s=()=>{if(n>=o)return Promise.resolve(i);const r=e[n++];return Promise.resolve(r()).then((e=>t(e)?Promise.resolve(e):s()))};return s()}class Vv{constructor(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout((()=>{this._token=-1,e()}),t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout((()=>{this._token=-1,e()}),t))}}class Wv{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval((()=>{e()}),t)}}class Hv{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-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner&&this.runner()}}let zv;zv="function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback?e=>{hs((()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,i-Date.now())}))}));let t=!1;return{dispose(){t||(t=!0)}}}:(e,t)=>{const i=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(i))}}};class jv{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=zv((()=>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 Uv{constructor(){this.rejected=!1,this.resolved=!1,this.p=new Promise(((e,t)=>{this.completeCallback=e,this.errorCallback=t}))}get isRejected(){return this.rejected}get isSettled(){return this.rejected||this.resolved}complete(e){return new Promise((t=>{this.completeCallback(e),this.resolved=!0,t()}))}cancel(){new Promise((e=>{this.errorCallback(new ls),this.rejected=!0,e()}))}}var $v,Kv,qv;(Kv=$v||($v={})).settled=function(e){return Ev(this,void 0,void 0,(function*(){let t;const i=yield Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return i}))},Kv.withAsyncBody=function(e){return new Promise(((t,i)=>Ev(this,void 0,void 0,(function*(){try{yield e(t,i)}catch(n){i(n)}}))))};class Gv{constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new $o,queueMicrotask((()=>Ev(this,void 0,void 0,(function*(){const t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{yield Promise.resolve(e(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))))}static fromArray(e){return new Gv((t=>{t.emitMany(e)}))}static fromPromise(e){return new Gv((t=>Ev(this,void 0,void 0,(function*(){t.emitMany(yield e)}))))}static fromPromises(e){return new Gv((t=>Ev(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>Ev(this,void 0,void 0,(function*(){return t.emitOne(yield e)})))))}))))}static merge(e){return new Gv((t=>Ev(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>{var i,n;return Ev(this,void 0,void 0,(function*(){var o,s;try{for(i=Nv(e);!(n=yield i.next()).done;){const e=n.value;t.emitOne(e)}}catch(r){o={error:r}}finally{try{n&&!n.done&&(s=i.return)&&(yield s.call(i))}finally{if(o)throw o.error}}}))})))}))))}[Symbol.asyncIterator](){let e=0;return{next:()=>Ev(this,void 0,void 0,(function*(){for(;;){if(2===this._state)throw this._error;if(eEv(this,void 0,void 0,(function*(){var n,o;try{for(var s,r=Nv(e);!(s=yield r.next()).done;){const e=s.value;i.emitOne(t(e))}}catch(a){n={error:a}}finally{try{s&&!s.done&&(o=r.return)&&(yield o.call(r))}finally{if(n)throw n.error}}}))))}map(e){return Gv.map(this,e)}static filter(e,t){return new Gv((i=>Ev(this,void 0,void 0,(function*(){var n,o;try{for(var s,r=Nv(e);!(s=yield r.next()).done;){const e=s.value;t(e)&&i.emitOne(e)}}catch(a){n={error:a}}finally{try{s&&!s.done&&(o=r.return)&&(yield o.call(r))}finally{if(n)throw n.error}}}))))}filter(e){return Gv.filter(this,e)}static coalesce(e){return Gv.filter(e,(e=>!!e))}coalesce(){return Gv.coalesce(this)}static toPromise(e){var t,i,n,o;return Ev(this,void 0,void 0,(function*(){const s=[];try{for(t=Nv(e);!(i=yield t.next()).done;){const e=i.value;s.push(e)}}catch(r){n={error:r}}finally{try{i&&!i.done&&(o=t.return)&&(yield o.call(t))}finally{if(n)throw n.error}}return s}))}toPromise(){return Gv.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}}Gv.EMPTY=Gv.fromArray([]);class Zv extends Gv{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}const Yv=null===(qv=window.trustedTypes)||void 0===qv?void 0:qv.createPolicy("defaultWorkerFactory",{createScriptURL:e=>e});class Xv{constructor(e,t,i,n,o){this.id=t;const s=function(e){if(us.MonacoEnvironment){if("function"==typeof us.MonacoEnvironment.getWorker)return us.MonacoEnvironment.getWorker("workerMain.js",e);if("function"==typeof us.MonacoEnvironment.getWorkerUrl){const t=us.MonacoEnvironment.getWorkerUrl("workerMain.js",e);return new Worker(Yv?Yv.createScriptURL(t):t,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}(i);"function"==typeof s.then?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then((e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=o,"function"==typeof e.addEventListener&&e.addEventListener("error",o)}))}getId(){return this.id}postMessage(e,t){this.worker&&this.worker.then((i=>i.postMessage(e,t)))}dispose(){this.worker&&this.worker.then((e=>e.terminate())),this.worker=null}}class Qv{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let n=++Qv.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new Xv(e,n,this._label||"anonymous"+n,t,(e=>{cs(e),this._webWorkerFailedBeforeError=e,i(e)}))}}Qv.LAST_WORKER_ID=0;const Jv=s_("textResourceConfigurationService"),eb=s_("textResourcePropertiesService"),tb=s_("logService");var ib,nb;(nb=ib||(ib={}))[nb.Trace=0]="Trace",nb[nb.Debug=1]="Debug",nb[nb.Info=2]="Info",nb[nb.Warning=3]="Warning",nb[nb.Error=4]="Error",nb[nb.Critical=5]="Critical",nb[nb.Off=6]="Off";const ob=ib.Info;class sb extends Uo{constructor(){super(...arguments),this.level=ob,this._onDidChangeLogLevel=this._register(new $o)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class rb extends sb{constructor(e=ob){super(),this.setLevel(e)}trace(e,...t){this.getLevel(),ib.Trace}debug(e,...t){this.getLevel(),ib.Debug}info(e,...t){this.getLevel(),ib.Info}error(e,...t){this.getLevel(),ib.Error}dispose(){}}class ab extends Uo{constructor(e){super(),this.logger=e,this._register(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}error(e,...t){this.logger.error(e,...t)}}const lb=s_("ILanguageFeaturesService");var db=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},hb=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},cb=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ub(e,t){const i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let gb=class extends Uo{constructor(e,t,i,n,o){super(),this._modelService=e,this._workerManager=this._register(new mb(this._modelService,n)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(e,t)=>ub(this._modelService,e.uri)?this._workerManager.withWorker().then((t=>t.computeLinks(e.uri))).then((e=>e&&{links:e})):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new pb(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return ub(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then((n=>n.computedUnicodeHighlights(e,t,i)))}computeDiff(e,t,i,n){return this._workerManager.withWorker().then((o=>o.computeDiff(e,t,i,n)))}computeMoreMinimalEdits(e,t){if(gs(t)){if(!ub(this._modelService,e))return Promise.resolve(t);const i=ps.create(!0),n=this._workerManager.withWorker().then((i=>i.computeMoreMinimalEdits(e,t)));return n.finally((()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed()))),Promise.race([n,Pv(1e3).then((()=>t))])}return Promise.resolve(void 0)}canNavigateValueSet(e){return ub(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then((n=>n.navigateValueSet(e,t,i)))}canComputeWordRanges(e){return ub(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then((i=>i.computeWordRanges(e,t)))}};gb=db([hb(0,Dv),hb(1,Jv),hb(2,tb),hb(3,pv),hb(4,lb)],gb);class pb{constructor(e,t,i,n){this.languageConfigurationService=n,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return cb(this,void 0,void 0,(function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestionsMode)ub(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())ub(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestionsMode&&t.getLanguageId()!==e.getLanguageId()||n.push(t.uri));if(0===n.length)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),r=s?new qo(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):qo.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),d=yield l.textualSuggest(n,null==s?void 0:s.word,o);return d?{duration:d.duration,suggestions:d.words.map((e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}})))}:void 0}))}}class mb extends Uo{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime();this._register(new Wv).cancelAndSet((()=>this._checkStopIdleWorker()),Math.round(15e4)),this._register(this._modelService.onModelRemoved((e=>this._checkStopEmptyWorker())))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;(new Date).getTime()-this._lastWorkerUsedTime>3e5&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new bb(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class fb extends Uo{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const e=new Wv;e.cancelAndSet((()=>this._checkStopModelSync()),Math.round(3e4)),this._register(e)}}dispose(){for(let e in this._syncedModels)bs(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(let i in this._syncedModelsLastUsedTime){e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i)}for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i)return;if(!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 Cs;o.add(i.onDidChangeContent((e=>{this._proxy.acceptModelChanged(n.toString(),e)}))),o.add(i.onWillDispose((()=>{this._stopModelSync(n)}))),o.add(es((()=>{this._proxy.acceptRemovedModel(n)}))),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],bs(t)}}class _b{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class vb{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class bb extends Uo{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new Qv(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 ms(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new vb(this)))}catch(e){cs(e),this._worker=new _b(new fs(new vb(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,(e=>(cs(e),this._worker=new _b(new fs(new vb(this),null)),this._getOrCreateWorker().getProxyObject())))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new fb(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return cb(this,void 0,void 0,(function*(){return this._disposed?Promise.reject(_s()):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){return this._withSyncedResources([e]).then((i=>i.computeMoreMinimalEdits(e.toString(),t)))}computeLinks(e){return this._withSyncedResources([e]).then((t=>t.computeLinks(e.toString())))}textualSuggest(e,t,i){return cb(this,void 0,void 0,(function*(){const n=yield this._withSyncedResources(e),o=i.source,s=vs(i);return n.textualSuggest(e.map((e=>e.toString())),t,o,s)}))}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(),s=o.source,r=vs(o);return i.computeWordRanges(e.toString(),t,s,r)}))}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then((n=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),r=s.source,a=vs(s);return n.navigateValueSet(e.toString(),t,i,r,a)}))}dispose(){super.dispose(),this._disposed=!0}}class Cb extends bb{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||"function"!=typeof this._foreignModuleHost[e])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?ws(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then((t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},o={};for(const e of t)o[e]=n(e,i);return o}))}))),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then((e=>this.getProxy()))}}class wb{constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}static createEmpty(e,t){const i=wb.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new wb(n,e,t)}equals(e){return e instanceof wb&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let s=n;s0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=ys.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return ys.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return ys.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return ys.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return ys.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return ys.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return wb.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new yb(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let n=0;n>>1)-1;for(;it&&(n=o)}return i}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="";const o=new Array;let s=0;for(;;){const r=ts){n+=this._text.substring(s,a.offset);const e=this._tokens[1+(t<<1)];o.push(n.length,e),s=a.offset}n+=a.text,o.push(n.length,a.tokenMetadata),i++}}return new wb(new Uint32Array(o),n,this._languageIdCodec)}}wb.defaultTokenMetadata=16793600;class yb{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,s=e.getCount();o=i)break;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 yb&&(this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount))}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class Sb{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n=o||(r[a++]=new Sb(Math.max(1,l.startColumn-n+1),Math.min(s+1,l.endColumn-n+1),l.className,l.type));return r}static filter(e,t,i,n){if(0===e.length)return[];const o=[];let s=0;for(let r=0,a=e.length;rt)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const d=l.startLineNumber===t?l.startColumn:i,h=l.endLineNumber===t?l.endColumn:n;o[s++]=new Sb(d,h,a.inlineClassName,a.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=Sb._typeCompare(e.type,t.type);return 0!==i?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 Lb{constructor(e,t,i){this._linePartBrand=void 0,this.endIndex=e,this.type=t,this.metadata=i}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class Db{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Eb{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p,m,f,_,v){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(Sb.compare),this.tabSize=d,this.startVisibleColumn=h,this.spaceWidth=c,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=f,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort(((e,t)=>e.startOffset>>16}static getCharIndex(e){return(65535&e)>>>0}setColumnInfo(e,t,i,n){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._absoluteOffsets[e-1]=n+i}getAbsoluteOffset(e){return 0===this._absoluteOffsets.length?0:this._absoluteOffsets[e-1]}charOffsetToPartData(e){return 0===this.length?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=Ib.getPartIndex(t),n=Ib.getCharIndex(t);return new Nb(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;const n=(e<<16|i<<0)>>>0;let o=0,s=this.length-1;for(;o+1>>1,t=this._data[e];if(t===n)return e;t>n?s=e:o=e}if(o===s)return o;const r=this._data[o],a=this._data[s];if(r===n)return o;if(a===n)return s;const l=Ib.getPartIndex(r),d=Ib.getCharIndex(r);let h;h=l!==Ib.getPartIndex(a)?t:Ib.getCharIndex(a);return i-d<=h-i?o:s}}class Tb{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function Mb(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendASCIIString("");let i=0,n=0,o=0;for(const r of e.lineDecorations)1!==r.type&&2!==r.type||(t.appendASCIIString(''),1===r.type&&(o|=1,i++),2===r.type&&(o|=2,n++));t.appendASCIIString("");const s=new Ib(1,i+n);return s.setColumnInfo(1,i,0,0),new Tb(s,!1,o)}return t.appendASCIIString(""),new Tb(new Ib(0,0),!1,0)}return function(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,o=e.containsForeignElements,s=e.lineContent,r=e.len,a=e.isOverflowing,l=e.parts,d=e.fauxIndentLength,h=e.tabSize,c=e.startVisibleColumn,u=e.containsRTL,g=e.spaceWidth,p=e.renderSpaceCharCode,m=e.renderWhitespace,f=e.renderControlCharacters,_=new Ib(r+1,l.length);let v=!1,b=0,C=c,w=0,y=0,S=0,x=0;u?t.appendASCIIString(''):t.appendASCIIString("");for(let k=0,L=l.length;k=d&&(i+=n)}}for(L&&(t.appendASCIIString(' style="width:'),t.appendASCIIString(String(g*e)),t.appendASCIIString('px"')),t.appendASCII(62);b1?t.write1(8594):t.write1(65515);for(let i=2;i<=e;i++)t.write1(160)}else e=1,t.write1(p);w+=e,b>=d&&(C+=e)}S=e}else{let e=0;for(t.appendASCII(62);b=d&&(C+=o)}S=e}D?y++:y=0,b>=r&&!v&&e.isPseudoAfter()&&(v=!0,_.setColumnInfo(b+1,k,w,x)),t.appendASCIIString("")}v||_.setColumnInfo(r+1,l.length-1,w,x);a&&t.appendASCIIString("");return t.appendASCIIString(""),new Tb(_,u,o)}(function(e){const t=e.lineContent;let i,n;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0&&(n[o++]=new Lb(t,"",0));for(let s=0,r=e.getCount();s=i){n[o++]=new Lb(i,a,0);break}n[o++]=new Lb(r,a,0)}return n}(e.lineTokens,e.fauxIndentLength,n);e.renderControlCharacters&&!e.isBasicASCII&&(o=function(e,t){const i=[];let n=new Lb(0,"",0),o=0;for(const s of t){const t=s.endIndex;for(;on.endIndex&&(n=new Lb(o,s.type,s.metadata),i.push(n)),n=new Lb(o+1,"mtkcontrol",s.metadata),i.push(n))}o>n.endIndex&&(n=new Lb(t,s.type,s.metadata),i.push(n))}return i}(t,o));(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace)&&(o=function(e,t,i,n){const o=e.continuesWithWrappedLine,s=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,d=e.selectionsOnLine,h=1===e.renderWhitespace,c=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth,g=[];let p=0,m=0,f=n[m].type,_=n[m].endIndex;const v=n.length;let b,C=!1,w=Ss(t);-1===w?(C=!0,w=i,b=i):b=xs(t);let y=!1,S=0,x=d&&d[S],k=a%r;for(let D=s;D=x.endOffset&&(S++,x=d&&d[S]),Db)o=!0;else if(9===e)o=!0;else if(32===e)if(h)if(y)o=!0;else{const e=D+1D),o&&c&&(o=C||D>b),y){if(!o||!l&&k>=r){if(u){for(let e=(p>0?g[p-1].endIndex:s)+1;e<=D;e++)g[p++]=new Lb(e,"mtkw",1)}else g[p++]=new Lb(D,"mtkw",1);k%=r}}else(D===_||o&&D>s)&&(g[p++]=new Lb(D,f,0),k%=r);for(9===e?k=r:ks(e)?k+=2:k++,y=o;D===_&&(m++,m0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(L=!0)}else L=!0;if(L)if(u){for(let e=(p>0?g[p-1].endIndex:s)+1;e<=i;e++)g[p++]=new Lb(e,"mtkw",1)}else g[p++]=new Lb(i,"mtkw",1);else g[p++]=new Lb(i,f,0);return g}(e,t,n,o));let s=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;t1){const t=e.charCodeAt(a-2);Go(t)&&a--}if(l>1){const t=e.charCodeAt(l-2);Go(t)&&l--}const c=a-1,u=l-2;o=n.consumeLowerThan(c,o,i),0===n.count&&(o=c),n.insert(u,d,h)}return n.consumeLowerThan(1073741824,o,i),i}}.normalize(e,n),s=o.length;let r=0;const a=[];let l=0,d=0;for(let c=0,u=i.length;cd&&(d=e.startOffset,a[l++]=new Lb(d,n,h)),!(e.endOffset+1<=t)){d=t,a[l++]=new Lb(d,n+" "+e.className,h|e.metadata);break}d=e.endOffset+1,a[l++]=new Lb(d,n+" "+e.className,h|e.metadata),r++}t>d&&(d=t,a[l++]=new Lb(d,n,h))}const h=i[i.length-1].endIndex;if(r=50&&(o[s++]=new Lb(l+1,t,r),d=l+1,l=-1);d!==a&&(o[s++]=new Lb(a,t,r))}else o[s++]=i;n=a}else for(let r=0,a=t.length;r50){const t=e.type,r=e.metadata,l=Math.ceil(a/50);for(let e=1;e=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e)}function Fb(e){return e.toString(16).toUpperCase().padStart(4,"0")}class Bb{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class Vb{constructor(e,t){this.tabSize=e,this.data=t}}class Wb{constructor(e,t,i,n,o,s,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=r}}class Hb{constructor(e,t,i,n,o,s,r,a,l,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=Hb.isBasicASCII(i,s),this.containsRTL=Hb.containsRTL(i,this.isBasicASCII,o),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=d}static isBasicASCII(e,t){return!t||Ls(e)}static containsRTL(e,t,i){return!(t||!i)&&Ds(e)}}class zb{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class jb{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new zb(new qo(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Ub{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class $b{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static cmp(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}}function Kb(e){return!function(e){return Array.isArray(e)}(e)}function qb(e){return"string"==typeof e}function Gb(e){return!qb(e)}function Zb(e){return!e}function Yb(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function Xb(e){return e.replace(/[&<>'"_]/g,"-")}function Qb(e,t){return new Error(`${e.languageId}: ${t}`)}function Jb(e,t,i,n,o){let s=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,r,a,l,d,h,c,u,g){return Zb(a)?Zb(l)?!Zb(d)&&d0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}class tC{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new iC(e,t);let i=iC.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new iC(e,t),this._entries[i]=n,n)}}tC._INSTANCE=new tC(5);class iC{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return iC._equals(this,e)}push(e){return tC.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return tC.create(this.parent,e)}}class nC{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 nC(this.languageId,this.state)}}class oC{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(null!==t)return new sC(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new sC(e,t);const i=iC.getStackElementId(e);let n=this._entries[i];return n||(n=new sC(e,null),this._entries[i]=n,n)}}oC._INSTANCE=new oC(5);class sC{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:oC.create(this.stack,this.embeddedLanguageData)}equals(e){return e instanceof sC&&(!!this.stack.equals(e.stack)&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData)))}}class rC{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 rs(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=Es.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenize(e,t,s);if(0!==n)for(const l of a.tokens)this._tokens.push(new rs(l.offset+n,l.type,l.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new ss(this._tokens,e)}}class aC{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);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=null!==e?e.length:0,o=t.length,s=null!==i?i.length:0;if(0===n&&0===o&&0===s)return new Uint32Array(0);if(0===n&&0===o)return i;if(0===o&&0===s)return e;const r=new Uint32Array(n+o+s);null!==e&&r.set(e);for(let a=0;a{if(o)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i{}))}}getInitialState(){const e=tC.create(null,this._lexer.start);return oC.create(e,null)}tokenize(e,t,i){const n=new rC,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){const n=new aC(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=eC(this._lexer,t.stack.state),!i))throw Qb(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const s of i){if(!Gb(s.action)||"@pop"!==s.action.nextEmbedded)continue;o=!0;let t=s.regex;const i=s.regex.source;if("^(?:"===i.substr(0,4)&&")"===i.substr(i.length-1,1)){const e=(t.ignoreCase?"i":"")+(t.unicode?"u":"");t=new RegExp(i.substr(4,i.length-5),e)}const r=e.search(t);-1===r||0!==r&&s.matchOnlyAtLineStart||(-1===n||r0&&o.nestedLanguageTokenize(r,!1,i.embeddedLanguageData,n);const a=e.substring(s);return this._myTokenize(a,t,i,n+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterLanguage(this._languageId);const s=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedLanguageData,d=i.stack,h=0,c=null,u=!0;for(;u||h=a)break;u=!1;let e=this._lexer.tokenizer[m];if(!e&&(e=eC(this._lexer,m),!e))throw Qb(this._lexer,"tokenizer state is not defined: "+m);let t=r.substr(h);for(const i of e)if((0===h||!i.matchOnlyAtLineStart)&&(f=t.match(i.regex),f)){_=f[0],v=i.action;break}}if(f||(f=[""],_=""),v||(h=this._lexer.maxStack)throw Qb(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(m)}else if("@pop"===v.next){if(d.depth<=1)throw Qb(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(b));d=d.pop()}else if("@popall"===v.next)d=d.popall();else{let e=Jb(this._lexer,v.next,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!eC(this._lexer,e))throw Qb(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(b));d=d.push(e)}}v.log&&"string"==typeof v.log&&(this._lexer,this._lexer.languageId,Jb(this._lexer,v.log,_,f,m))}if(null===w)throw Qb(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(b));const y=i=>{const s=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,r=this._getNestedEmbeddedLanguageData(s);if(h0)throw Qb(this._lexer,"groups cannot be nested: "+this._safeRuleName(b));if(f.length!==w.length+1)throw Qb(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(b));let e=0;for(let t=1;te});class gC{static colorizeElement(e,t,i,n){const o=(n=n||{}).theme||"vs",s=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return Promise.resolve();const r=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const a=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;return this.colorize(t,a||"",r,n).then((e=>{var t;const n=null!==(t=null==uC?void 0:uC.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n}),(e=>{}))}static colorize(e,t,i,n){return cC(this,void 0,void 0,(function*(){const o=e.languageIdCodec;let s=4;n&&"number"==typeof n.tabSize&&(s=n.tabSize),Ns(t)&&(t=t.substr(1));const r=Is(t);if(!e.isRegisteredLanguageId(i))return pC(r,s,o);const a=yield Es.getOrCreate(i);return a?function(e,t,i,n){return new Promise(((o,s)=>{const r=()=>{const a=function(e,t,i,n){let o=[],s=i.getInitialState();for(let r=0,a=e.length;r"),s=l.endState}return o.join("")}(e,t,i,n);if(i instanceof lC){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,s)}o(a)};r()}))}(r,s,a,o):pC(r,s,o)}))}static colorizeLine(e,t,i,n,o=4){const s=Hb.isBasicASCII(e,t),r=Hb.containsRTL(e,s,i);return Ab(new Eb(!1,!0,e,!1,s,r,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.forceTokenization(t);const o=e.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function pC(e,t,i){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=16793600;for(let s=0,r=e.length;s")}return n.join("")}Ts||document.queryCommandSupported&&document.queryCommandSupported("copy")||navigator&&navigator.clipboard&&navigator.clipboard.writeText,Ts||navigator&&navigator.clipboard&&navigator.clipboard.readText,Ts||zf||navigator.keyboard,"ontouchstart"in window||navigator.maxTouchPoints;const mC=window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0);function fC(e,t){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new bC(0!==n?[_C(i,t),_C(n,t)]:[_C(i,t)])}function _C(e,t){const i=!!(2048&e),n=!!(256&e);return new vC(2===t?n:i,!!(1024&e),!!(512&e),2===t?i:n,255&e)}class vC{constructor(e,t,i,n,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=o}equals(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}toChord(){return new bC([this])}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class bC{constructor(e){if(0===e.length)throw Ms("parts");this.parts=e}}class CC{constructor(e,t,i,n,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=o,this.keyAriaLabel=s}}const wC=Ho?256:2048,yC=Ho?2048:256;class SC{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.keyCode=function(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return Os.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(Rf){if(59===t)return 80;if(107===t)return 81;if(109===t)return 83;if(Ho&&224===t)return 57}else if(Pf){if(91===t)return 57;if(Ho&&93===t)return 57;if(!Ho&&92===t)return 57}return As[t]||0}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asRuntimeKeybinding=this._computeRuntimeKeybinding()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeybinding(){return this._asRuntimeKeybinding}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=wC),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=yC),t|=e,t}_computeRuntimeKeybinding(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new vC(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let xC=!1,kC=null;function LC(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return xC=!0,null}catch(t){return xC=!0,null}return e.parent}class DC{static getSameOriginWindowChain(){if(!kC){kC=[];let e,t=window;do{e=LC(t),e?kC.push({window:t,iframeElement:t.frameElement||null}):kC.push({window:t,iframeElement:null}),t=e}while(t)}return kC.slice(0)}static hasDifferentOriginAncestor(){return kC||this.getSameOriginWindowChain(),xC}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0,o=this.getSameOriginWindowChain();for(const s of o){if(i+=s.window.scrollY,n+=s.window.scrollX,s.window===t)break;if(!s.iframeElement)break;let e=s.iframeElement.getBoundingClientRect();i+=e.top,n+=e.left}return{top:i,left:n}}}class EC{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,"number"==typeof e.pageX?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);let t=DC.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class NC{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){let t=e,i=e;if(void 0!==t.wheelDeltaY)this.deltaY=t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaY=Rf&&!Ho?-e.deltaY/3:-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)this.deltaX=Bf&&Rs?-t.wheelDeltaX/120:t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaX=Rf&&!Ho?-e.deltaX/3:-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation()}}var IC,TC;(TC=IC||(IC={})).inMemory="inmemory",TC.vscode="vscode",TC.internal="private",TC.walkThrough="walkThrough",TC.walkThroughSnippet="walkThroughSnippet",TC.http="http",TC.https="https",TC.file="file",TC.mailto="mailto",TC.untitled="untitled",TC.data="data",TC.command="command",TC.vscodeRemote="vscode-remote",TC.vscodeRemoteResource="vscode-remote-resource",TC.userData="vscode-userdata",TC.vscodeCustomEditor="vscode-custom-editor",TC.vscodeNotebook="vscode-notebook",TC.vscodeNotebookCell="vscode-notebook-cell",TC.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",TC.vscodeNotebookCellOutput="vscode-notebook-cell-output",TC.vscodeInteractive="vscode-interactive",TC.vscodeInteractiveInput="vscode-interactive-input",TC.vscodeSettings="vscode-settings",TC.vscodeWorkspaceTrust="vscode-workspace-trust",TC.vscodeTerminal="vscode-terminal",TC.webviewPanel="webview-panel",TC.vscodeWebview="vscode-webview",TC.extension="extension",TC.vscodeFileResource="vscode-file",TC.tmp="tmp",TC.vsls="vsls";const MC=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)return this._delegate(e);const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return"string"==typeof o&&(s+=`&tkn=${encodeURIComponent(o)}`),Ps.from({scheme:Fs?this._preferredWebSchema:IC.vscodeRemoteResource,authority:`${i}:${n}`,path:"/vscode-remote-resource",query:s})}};class OC{asBrowserUri(e,t){const i=this.toUri(e,t);return i.scheme===IC.vscodeRemote?MC.rewrite(i):i.scheme===IC.file&&(Ts||Bs&&us.origin===`${IC.vscodeFileResource}://${OC.FALLBACK_AUTHORITY}`)?i.with({scheme:IC.vscodeFileResource,authority:i.authority||OC.FALLBACK_AUTHORITY,query:null,fragment:null}):i}toUri(e,t){return Ps.isUri(e)?e:Ps.parse(t.toUrl(e))}}OC.FALLBACK_AUTHORITY="vscode-app";const AC=new OC;function RC(e){for(;e.firstChild;)e.firstChild.remove()}function PC(e){var t;return null!==(t=null==e?void 0:e.isConnected)&&void 0!==t&&t}class FC{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 BC(e,t,i,n){return new FC(e,t,i,n)}function VC(e){return function(t){return e(new EC(t))}}let WC=function(e,t,i,n){let o=i;return"click"===t||"mousedown"===t?o=VC(i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=function(e){return function(t){return e(new SC(t))}}(i)),BC(e,t,o,n)};function HC(e,t,i){return BC(e,Vs&&mC?yw.POINTER_DOWN:yw.MOUSE_DOWN,t,i)}function zC(e,t,i){return BC(e,Vs&&mC?yw.POINTER_UP:yw.MOUSE_UP,t,i)}function jC(e,t){return BC(e,"mouseout",(i=>{let n=i.relatedTarget;for(;n&&n!==e;)n=n.parentNode;n!==e&&t(i)}))}function UC(e,t,i){let n=null;const o=e=>s.fire(e),s=new $o({onFirstListenerAdd:()=>{n||(n=new FC(e,t,o,i))},onLastListenerRemove:()=>{n&&(n.dispose(),n=null)}});return s}let $C,KC,qC=null;class GC{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){Jo(e)}}static sort(e,t){return t.priority-e.priority}}!function(){let e=[],t=null,i=!1,n=!1,o=()=>{for(i=!1,t=e,e=[],n=!0;t.length>0;){t.sort(GC.sort),t.shift().execute()}n=!1};KC=(t,n=0)=>{let s=new GC(t,n);return e.push(s),i||(i=!0,function(e){if(!qC){const e=e=>setTimeout((()=>e((new Date).getTime())),0);qC=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}qC.call(self,e)}(o)),s},$C=(e,i)=>{if(n){let n=new GC(e,i);return t.push(n),n}return KC(e,i)}}();const ZC=function(e,t){return t};class YC extends Uo{constructor(e,t,i,n=ZC,o=8){super();let s=null,r=0,a=this._register(new Vv),l=()=>{r=(new Date).getTime(),i(s),s=null};this._register(BC(e,t,(e=>{s=n(s,e);let t=(new Date).getTime()-r;t>=o?(a.cancel(),l()):a.setIfNotSet(l,o-t)})))}}function XC(e,t,i,n,o){return new YC(e,t,i,n,o)}function QC(e){return document.defaultView.getComputedStyle(e,null)}function JC(e){if(e!==document.body)return new tw(e.clientWidth,e.clientHeight);if(Vs&&window.visualViewport)return new tw(window.visualViewport.width,window.visualViewport.height);if(window.innerWidth&&window.innerHeight)return new tw(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new tw(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new tw(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class ew{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let n=QC(e),o="0";return n&&(o=n.getPropertyValue?n.getPropertyValue(t):n.getAttribute(i)),ew.convertToPixels(e,o)}static getBorderLeftWidth(e){return ew.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return ew.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return ew.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return ew.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return ew.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return ew.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return ew.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return ew.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return ew.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return ew.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return ew.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return ew.getDimension(e,"margin-bottom","marginBottom")}}class tw{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new tw(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof tw?e:new tw(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&(e.width===t.width&&e.height===t.height)}}function iw(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement;){i-=e.scrollTop;const o=uw(e)?null:QC(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=ew.getBorderLeftWidth(e),i+=ew.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function nw(e){let t=e.getBoundingClientRect();return{left:t.left+ow.scrollX,top:t.top+ow.scrollY,width:t.width,height:t.height}}tw.None=new tw(0,0);const ow=new class{get scrollX(){return"number"==typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft}get scrollY(){return"number"==typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop}};function sw(e){let t=ew.getMarginLeft(e)+ew.getMarginRight(e);return e.offsetWidth+t}function rw(e){let t=ew.getBorderLeftWidth(e)+ew.getBorderRightWidth(e),i=ew.getPaddingLeft(e)+ew.getPaddingRight(e);return e.offsetWidth-t-i}function aw(e){let t=ew.getBorderTopWidth(e)+ew.getBorderBottomWidth(e),i=ew.getPaddingTop(e)+ew.getPaddingBottom(e);return e.offsetHeight-t-i}function lw(e){let t=ew.getMarginTop(e)+ew.getMarginBottom(e);return e.offsetHeight+t}function dw(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function hw(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}function cw(e,t,i){return!!hw(e,t,i)}function uw(e){return e&&!!e.host&&!!e.mode}function gw(e){return!!pw(e)}function pw(e){for(;e.parentNode;){if(e===document.body)return null;e=e.parentNode}return uw(e)?e:null}function mw(){let e=document.activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function fw(e=document.getElementsByTagName("head")[0]){let t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}let _w=null;function vw(){return _w||(_w=fw()),_w}function bw(e,t,i=vw()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)}function Cw(e,t=vw()){if(!t)return;let i=function(e){var t,i;return(null===(t=null==e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(i=null==e?void 0:e.sheet)||void 0===i?void 0:i.cssRules)?e.sheet.cssRules:[]}(t),n=[];for(let o=0;o=0;o--)t.sheet.deleteRule(n[o])}function ww(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}const yw={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",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:Pf?"webkitAnimationStart":"animationstart",ANIMATION_END:Pf?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Pf?"webkitAnimationIteration":"animationiteration"},Sw=function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)};class xw extends Uo{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=xw.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{xw.hasFocusWithin(e)!==t&&(t?o():n())},this._register(BC(e,yw.FOCUS,n,!0)),this._register(BC(e,yw.BLUR,o,!0)),this._register(BC(e,yw.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(BC(e,yw.FOCUS_OUT,(()=>this._refreshStateHandler())))}static hasFocusWithin(e){const t=pw(e);return dw(t?t.activeElement:document.activeElement,e)}}function kw(e){return new xw(e)}function Lw(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function Dw(e,...t){e.innerText="",Lw(e,...t)}const Ew=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Nw,Iw;function Tw(e,t,i,...n){let o=Ew.exec(t);if(!o)throw new Error("Bad use of emmet");i=Object.assign({},i||{});let s,r=o[1]||"div";return s=e!==Nw.HTML?document.createElementNS(e,r):document.createElement(r),o[3]&&(s.id=o[3]),o[4]&&(s.className=o[4].replace(/\./g," ").trim()),Object.keys(i).forEach((e=>{const t=i[e];void 0!==t&&(/^on\w+$/.test(e)?s[e]=t:"selected"===e?t&&s.setAttribute(e,"true"):s.setAttribute(e,t))})),s.append(...n),s}function Mw(e,t,...i){return Tw(Nw.HTML,e,t,...i)}function Ow(...e){for(let t of e)t.style.display="",t.removeAttribute("aria-hidden")}function Aw(...e){for(let t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function Rw(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function Pw(e){window.open(e,"_blank","noopener")}function Fw(e){return e?`url('${AC.asBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function Bw(e){return`'${e.replace(/'/g,"%27")}'`}(Iw=Nw||(Nw={})).HTML="http://www.w3.org/1999/xhtml",Iw.SVG="http://www.w3.org/2000/svg",Mw.SVG=function(e,t,...i){return Tw(Nw.SVG,e,t,...i)},MC.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");class Vw extends $o{constructor(){super(),this._subscriptions=new Cs,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(BC(window,"keydown",(e=>{if(e.defaultPrevented)return;const t=new SC(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}),!0)),this._subscriptions.add(BC(window,"keyup",(e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))}),!0)),this._subscriptions.add(BC(document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(BC(document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(BC(document.body,"mousemove",(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),this._subscriptions.add(BC(window,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Vw.instance||(Vw.instance=new Vw),Vw.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}let Ww,Hw,zw,jw,Uw;function $w(e){Ww&&(Hw.textContent!==e?(RC(zw),qw(Hw,e)):(RC(Hw),qw(zw,e)))}function Kw(e){Ww&&(Ho?$w(e):jw.textContent!==e?(RC(Uw),qw(jw,e)):(RC(jw),qw(Uw,e)))}function qw(e,t){RC(e),t.length>2e4&&(t=t.substr(0,2e4)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}const Gw=s_("markerDecorationsService"),Zw=s_("textModelService");var Yw=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Xw extends Uo{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}))}run(e,t){return Yw(this,void 0,void 0,(function*(){this._actionCallback&&(yield this._actionCallback(e))}))}}class Qw extends Uo{constructor(){super(...arguments),this._onBeforeRun=this._register(new $o),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new $o),this.onDidRun=this._onDidRun.event}run(e,t){return Yw(this,void 0,void 0,(function*(){if(!e.enabled)return;let i;this._onBeforeRun.fire({action:e});try{yield this.runAction(e,t)}catch(n){i=n}this._onDidRun.fire({action:e,error:i})}))}runAction(e,t){return Yw(this,void 0,void 0,(function*(){yield e.run(t)}))}}class Jw extends Xw{constructor(e){super(Jw.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Jw.ID="vs.actions.separator";class ey{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}get actions(){return this._actions}dispose(){}run(){return Yw(this,void 0,void 0,(function*(){}))}}class ty extends Xw{constructor(){super(ty.ID,$m(0,"(empty)"),void 0,!1)}}ty.ID="vs.actions.empty";const iy=s_("commandService"),ny=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new $o,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(let n of e.description.args)t.push(n.constraint);const i=e.handler;e.handler=function(e,...n){return Ws(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new Hs,this._commands.set(i,n));let o=n.unshift(e),s=es((()=>{o();const e=this._commands.get(i);(null==e?void 0:e.isEmpty())&&this._commands.delete(i)}));return this._onDidRegisterCommand.fire(i),s}registerCommandAlias(e,t){return ny.registerCommand(e,((e,...i)=>e.get(iy).executeCommand(t,...i)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return zs.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}};ny.registerCommand("noop",(()=>{}));const oy=new Map;oy.set("false",!1),oy.set("true",!0),oy.set("isMac",Ho),oy.set("isLinux",Vo),oy.set("isWindows",Rs),oy.set("isWeb",Fs),oy.set("isMacNative",Ho&&!Fs),oy.set("isEdge",js),oy.set("isFirefox",Us),oy.set("isChrome",$s),oy.set("isSafari",Ks);const sy=Object.prototype.hasOwnProperty;class ry{static has(e){return hy.create(e)}static equals(e,t){return cy.create(e,t)}static regex(e,t){return wy.create(e,t)}static not(e){return my.create(e)}static and(...e){return xy.create(e,null)}static or(...e){return ky.create(e,null,!0)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return ky.create(i.map((e=>this._deserializeAndExpression(e,t))),null,!0)}static _deserializeAndExpression(e,t){let i=e.split("&&");return xy.create(i.map((e=>this._deserializeOne(e,t))),null)}static _deserializeOne(e,t){if((e=e.trim()).indexOf("!=")>=0){let i=e.split("!=");return py.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return cy.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return wy.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let t=e.split(" in ");return uy.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return vy.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return _y.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return Cy.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return by.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?my.create(e.substr(1).trim()):hy.create(e)}static _deserializeValue(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;let i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if(qs(e)){if(t)throw new Error("missing regexp-value for =~-expression");return null}let i=e.indexOf("/"),n=e.lastIndexOf("/");if(i===n||i<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return null}let o=e.slice(i+1,n),s="i"===e[n+1]?"i":"";try{return new RegExp(o,s)}catch(r){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${r}`);return null}}}function ay(e,t){return e.cmp(t)}class ly{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 dy.INSTANCE}}ly.INSTANCE=new ly;class dy{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 ly.INSTANCE}}dy.INSTANCE=new dy;class hy{constructor(e,t){this.key=e,this.negated=t,this.type=2}static create(e,t=null){const i=oy.get(e);return"boolean"==typeof i?i?dy.INSTANCE:ly.INSTANCE:new hy(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:Ey(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=oy.get(this.key);return"boolean"==typeof e?e?dy.INSTANCE:ly.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=my.create(this.key,this)),this.negated}}class cy{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}static create(e,t,i=null){if("boolean"==typeof t)return t?hy.create(e,i):my.create(e,i);const n=oy.get(e);if("boolean"==typeof n){return t===(n?"true":"false")?dy.INSTANCE:ly.INSTANCE}return new cy(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Ny(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=oy.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?dy.INSTANCE:ly.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=py.create(this.key,this.value,this)),this.negated}}class uy{constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}static create(e,t){return new uy(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:Ny(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&(this.key===e.key&&this.valueKey===e.valueKey)}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.indexOf(i)>=0:"string"==typeof i&&"object"==typeof t&&null!==t&&sy.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=gy.create(this)),this.negated}}class gy{constructor(e){this._actual=e,this.type=11}static create(e){return new gy(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class py{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}static create(e,t,i=null){if("boolean"==typeof t)return t?my.create(e,i):hy.create(e,i);const n=oy.get(e);if("boolean"==typeof n){return t===(n?"true":"false")?ly.INSTANCE:dy.INSTANCE}return new py(e,t,i)}cmp(e){return e.type!==this.type?this.type-e.type:Ny(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=oy.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?ly.INSTANCE:dy.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=cy.create(this.key,this.value,this)),this.negated}}class my{constructor(e,t){this.key=e,this.negated=t,this.type=3}static create(e,t=null){const i=oy.get(e);return"boolean"==typeof i?i?ly.INSTANCE:dy.INSTANCE:new my(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:Ey(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=oy.get(this.key);return"boolean"==typeof e?e?ly.INSTANCE:dy.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hy.create(this.key,this)),this.negated}}function fy(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):ly.INSTANCE}class _y{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}static create(e,t,i=null){return fy(t,(t=>new _y(e,t,i)))}cmp(e){return e.type!==this.type?this.type-e.type:Ny(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Cy.create(this.key,this.value,this)),this.negated}}class vy{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}static create(e,t,i=null){return fy(t,(t=>new vy(e,t,i)))}cmp(e){return e.type!==this.type?this.type-e.type:Ny(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=by.create(this.key,this.value,this)),this.negated}}class by{constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}static create(e,t,i=null){return fy(t,(t=>new by(e,t,i)))}cmp(e){return e.type!==this.type?this.type-e.type:Ny(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))new Cy(e,t,i)))}cmp(e){return e.type!==this.type?this.type-e.type:Ny(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_y.create(this.key,this.value,this)),this.negated}}class wy{constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}static create(e,t){return new wy(e,t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=yy.create(this)),this.negated}}class yy{constructor(e){this._actual=e,this.type=8}static create(e){return new yy(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function Sy(e){let t=null;for(let i=0,n=e.length;ie.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const e=i[i.length-1];if(9!==e.type)break;i.pop();const t=i.pop(),n=0===i.length,o=ky.create(e.expr.map((e=>xy.create([e,t],null))),null,n);o&&(i.push(o),i.sort(ay))}return 1===i.length?i[0]:new xy(i,t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(let t of this.expr)e.push(t.negate());this.negated=ky.create(e,this,!0)}return this.negated}}class ky{constructor(e,t){this.expr=e,this.negated=t,this.type=9}static create(e,t,i){return ky._normalizeArr(e,t,i)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize())).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const e of Ty(t))for(const t of Ty(i))n.push(xy.create([e,t],null));const o=0===e.length;e.unshift(ky.create(n,null,o))}this.negated=e[0]}return this.negated}}class Ly extends hy{constructor(e,t,i){super(e,null),this._defaultValue=t,"object"==typeof i?Ly._info.push(Object.assign(Object.assign({},i),{key:e})):!0!==i&&Ly._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}static all(){return Ly._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return cy.create(this.key,e)}}Ly._info=[];const Dy=s_("contextKeyService");function Ey(e,t){return et?1:0}function Ny(e,t,i,n){return ei?1:tn?1:0}function Iy(e,t){if(6===t.type&&9!==e.type&&6!==e.type)for(const n of t.expr)if(e.equals(n))return!0;const i=Ty(e.negate()).concat(Ty(t));i.sort(ay);for(let n=0;n{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function zy(e){return Hy.onColorThemeChange(e)}My.add(Wy,Hy);class jy extends Uo{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}var Uy=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$y=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};function Ky(e){return void 0!==e.command}class qy{constructor(e){this.id=qy._idPool++,this._debugName=e}}qy._idPool=0,qy.CommandPalette=new qy("CommandPalette"),qy.DebugBreakpointsContext=new qy("DebugBreakpointsContext"),qy.DebugCallStackContext=new qy("DebugCallStackContext"),qy.DebugConsoleContext=new qy("DebugConsoleContext"),qy.DebugVariablesContext=new qy("DebugVariablesContext"),qy.DebugWatchContext=new qy("DebugWatchContext"),qy.DebugToolBar=new qy("DebugToolBar"),qy.EditorContext=new qy("EditorContext"),qy.SimpleEditorContext=new qy("SimpleEditorContext"),qy.EditorContextCopy=new qy("EditorContextCopy"),qy.EditorContextPeek=new qy("EditorContextPeek"),qy.EditorTitle=new qy("EditorTitle"),qy.EditorTitleRun=new qy("EditorTitleRun"),qy.EditorTitleContext=new qy("EditorTitleContext"),qy.EmptyEditorGroup=new qy("EmptyEditorGroup"),qy.EmptyEditorGroupContext=new qy("EmptyEditorGroupContext"),qy.ExplorerContext=new qy("ExplorerContext"),qy.ExtensionContext=new qy("ExtensionContext"),qy.GlobalActivity=new qy("GlobalActivity"),qy.LayoutControlMenuSubmenu=new qy("LayoutControlMenuSubmenu"),qy.LayoutControlMenu=new qy("LayoutControlMenu"),qy.MenubarMainMenu=new qy("MenubarMainMenu"),qy.MenubarAppearanceMenu=new qy("MenubarAppearanceMenu"),qy.MenubarDebugMenu=new qy("MenubarDebugMenu"),qy.MenubarEditMenu=new qy("MenubarEditMenu"),qy.MenubarCopy=new qy("MenubarCopy"),qy.MenubarFileMenu=new qy("MenubarFileMenu"),qy.MenubarGoMenu=new qy("MenubarGoMenu"),qy.MenubarHelpMenu=new qy("MenubarHelpMenu"),qy.MenubarLayoutMenu=new qy("MenubarLayoutMenu"),qy.MenubarNewBreakpointMenu=new qy("MenubarNewBreakpointMenu"),qy.MenubarPanelAlignmentMenu=new qy("MenubarPanelAlignmentMenu"),qy.MenubarPanelPositionMenu=new qy("MenubarPanelPositionMenu"),qy.MenubarPreferencesMenu=new qy("MenubarPreferencesMenu"),qy.MenubarRecentMenu=new qy("MenubarRecentMenu"),qy.MenubarSelectionMenu=new qy("MenubarSelectionMenu"),qy.MenubarSwitchEditorMenu=new qy("MenubarSwitchEditorMenu"),qy.MenubarSwitchGroupMenu=new qy("MenubarSwitchGroupMenu"),qy.MenubarTerminalMenu=new qy("MenubarTerminalMenu"),qy.MenubarViewMenu=new qy("MenubarViewMenu"),qy.MenubarHomeMenu=new qy("MenubarHomeMenu"),qy.OpenEditorsContext=new qy("OpenEditorsContext"),qy.ProblemsPanelContext=new qy("ProblemsPanelContext"),qy.SCMChangeContext=new qy("SCMChangeContext"),qy.SCMResourceContext=new qy("SCMResourceContext"),qy.SCMResourceFolderContext=new qy("SCMResourceFolderContext"),qy.SCMResourceGroupContext=new qy("SCMResourceGroupContext"),qy.SCMSourceControl=new qy("SCMSourceControl"),qy.SCMTitle=new qy("SCMTitle"),qy.SearchContext=new qy("SearchContext"),qy.StatusBarWindowIndicatorMenu=new qy("StatusBarWindowIndicatorMenu"),qy.StatusBarRemoteIndicatorMenu=new qy("StatusBarRemoteIndicatorMenu"),qy.TestItem=new qy("TestItem"),qy.TestItemGutter=new qy("TestItemGutter"),qy.TestPeekElement=new qy("TestPeekElement"),qy.TestPeekTitle=new qy("TestPeekTitle"),qy.TouchBarContext=new qy("TouchBarContext"),qy.TitleBarContext=new qy("TitleBarContext"),qy.TunnelContext=new qy("TunnelContext"),qy.TunnelPrivacy=new qy("TunnelPrivacy"),qy.TunnelProtocol=new qy("TunnelProtocol"),qy.TunnelPortInline=new qy("TunnelInline"),qy.TunnelTitle=new qy("TunnelTitle"),qy.TunnelLocalAddressInline=new qy("TunnelLocalAddressInline"),qy.TunnelOriginInline=new qy("TunnelOriginInline"),qy.ViewItemContext=new qy("ViewItemContext"),qy.ViewContainerTitle=new qy("ViewContainerTitle"),qy.ViewContainerTitleContext=new qy("ViewContainerTitleContext"),qy.ViewTitle=new qy("ViewTitle"),qy.ViewTitleContext=new qy("ViewTitleContext"),qy.CommentThreadTitle=new qy("CommentThreadTitle"),qy.CommentThreadActions=new qy("CommentThreadActions"),qy.CommentTitle=new qy("CommentTitle"),qy.CommentActions=new qy("CommentActions"),qy.InteractiveToolbar=new qy("InteractiveToolbar"),qy.InteractiveCellTitle=new qy("InteractiveCellTitle"),qy.InteractiveCellExecute=new qy("InteractiveCellExecute"),qy.InteractiveInputExecute=new qy("InteractiveInputExecute"),qy.NotebookToolbar=new qy("NotebookToolbar"),qy.NotebookCellTitle=new qy("NotebookCellTitle"),qy.NotebookCellInsert=new qy("NotebookCellInsert"),qy.NotebookCellBetween=new qy("NotebookCellBetween"),qy.NotebookCellListTop=new qy("NotebookCellTop"),qy.NotebookCellExecute=new qy("NotebookCellExecute"),qy.NotebookCellExecutePrimary=new qy("NotebookCellExecutePrimary"),qy.NotebookDiffCellInputTitle=new qy("NotebookDiffCellInputTitle"),qy.NotebookDiffCellMetadataTitle=new qy("NotebookDiffCellMetadataTitle"),qy.NotebookDiffCellOutputsTitle=new qy("NotebookDiffCellOutputsTitle"),qy.NotebookOutputToolbar=new qy("NotebookOutputToolbar"),qy.NotebookEditorLayoutConfigure=new qy("NotebookEditorLayoutConfigure"),qy.BulkEditTitle=new qy("BulkEditTitle"),qy.BulkEditContext=new qy("BulkEditContext"),qy.TimelineItemContext=new qy("TimelineItemContext"),qy.TimelineTitle=new qy("TimelineTitle"),qy.TimelineTitleContext=new qy("TimelineTitleContext"),qy.AccountsContext=new qy("AccountsContext"),qy.PanelTitle=new qy("PanelTitle"),qy.AuxiliaryBarTitle=new qy("AuxiliaryBarTitle"),qy.TerminalInstanceContext=new qy("TerminalInstanceContext"),qy.TerminalEditorInstanceContext=new qy("TerminalEditorInstanceContext"),qy.TerminalNewDropdownContext=new qy("TerminalNewDropdownContext"),qy.TerminalTabContext=new qy("TerminalTabContext"),qy.TerminalTabEmptyAreaContext=new qy("TerminalTabEmptyAreaContext"),qy.TerminalInlineTabContext=new qy("TerminalInlineTabContext"),qy.WebviewContext=new qy("WebviewContext"),qy.InlineCompletionsActions=new qy("InlineCompletionsActions"),qy.NewFile=new qy("NewFile");const Gy=s_("menuService"),Zy=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new $o,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:e=>e===qy.CommandPalette}}addCommand(e){return this.addCommands(zs.single(e))}addCommands(e){for(const t of e)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),es((()=>{let t=!1;for(const i of e)t=this._commands.delete(i.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,i)=>e.set(i,t))),e}appendMenuItem(e,t){return this.appendMenuItems(zs.single({id:e,item:t}))}appendMenuItems(e){const t=new Set,i=new Hs;for(const{id:n,item:o}of e){let e=this._menuItems.get(n);e||(e=new Hs,this._menuItems.set(n,e)),i.push(e.push(o)),t.add(n)}return this._onDidChangeMenu.fire(t),es((()=>{if(i.size>0){for(let e of i)e();this._onDidChangeMenu.fire(t),i.clear()}}))}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===qy.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)Ky(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach(((i,n)=>{t.has(n)||e.push({command:i})}))}};class Yy extends ey{constructor(e,t,i,n){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,[],"submenu"),this.item=e,this._menuService=t,this._contextKeyService=i,this._options=n}get actions(){const e=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),i=t.getActions(this._options);t.dispose();for(const[,n]of i)n.length>0&&(e.push(...n),e.push(new Jw));return e.length&&e.pop(),e}}let Xy=class e{constructor(t,i,n,o,s){var r,a;if(this._commandService=s,this.id=t.id,this.label=(null==n?void 0:n.renderShortTitle)&&t.shortTitle?"string"==typeof t.shortTitle?t.shortTitle:t.shortTitle.value:"string"==typeof t.title?t.title:t.title.value,this.tooltip=null!==(a="string"==typeof t.tooltip?t.tooltip:null===(r=t.tooltip)||void 0===r?void 0:r.value)&&void 0!==a?a:"",this.enabled=!t.precondition||o.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const e=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=o.contextMatchesRules(e.condition),this.checked&&e.tooltip&&(this.tooltip="string"==typeof e.tooltip?e.tooltip:e.tooltip.value),e.title&&(this.label="string"==typeof e.title?e.title:e.title.value)}this.item=t,this.alt=i?new e(i,void 0,n,o,s):void 0,this._options=n,Fy.isThemeIcon(t.icon)&&(this.class=Ys.asClassName(t.icon))}dispose(){}run(...e){var t,i;let n=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(n=[...n,this._options.arg]),(null===(i=this._options)||void 0===i?void 0:i.shouldForwardArgs)&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};Xy=Uy([$y(3,Dy),$y(4,iy)],Xy);class Qy{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===Xs){if(e&&e.win)return e.win}else if(2===Xs){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=Qy.bindToCurrentPlatform(e);if(t&&t.primary){const i=fC(t.primary,Xs);i&&this._registerDefaultKeybinding(i,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let i=0,n=t.secondary.length;i=21&&e<=30||(e>=31&&e<=56||(80===e||81===e||82===e||83===e||84===e||85===e||86===e||110===e||111===e||87===e||88===e||89===e||90===e||91===e||92===e))}_assertNoCtrlAlt(e,t){e.ctrlKey&&e.altKey&&!e.metaKey&&Qy._mightProduceChar(e.keyCode)}_registerDefaultKeybinding(e,t,i,n,o,s){1===Xs&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e.parts,command:t,commandArgs:i,when:s,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(eS)),this._cachedMergedKeybindings.slice(0)}}const Jy=new Qy;function eS(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.commandt.command?1:e.weight2-t.weight2}My.add("platform.keybindingsRegistry",Jy);const tS=s_("telemetryService");class iS{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?ry.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Jy.registerKeybindingRule(i)}}ny.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Zy.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 nS extends iS{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),this._implementations.sort(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e{if(e.get(Dy).contextMatchesRules(Qs(this.precondition)))return this.runEditorCommand(e,n,t)}))}}class rS extends sS{constructor(e){super(rS.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=qy.EditorContext),t.title||(t.title=e.label),t.when=ry.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(tS).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class aS extends rS{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort(((e,t)=>t[0]-e[0])),{dispose:()=>{for(let e=0;enew Promise(((o,r)=>{try{o(n.invokeFunction(t,e.object.textEditorModel,er.lift(s),i.slice(2)))}catch(a){r(a)}})).finally((()=>{e.dispose()}))))}))}function dS(e){return fS.INSTANCE.registerEditorCommand(e),e}function hS(e){const t=new e;return fS.INSTANCE.registerEditorAction(t),t}function cS(e){return fS.INSTANCE.registerEditorAction(e),e}function uS(e){fS.INSTANCE.registerEditorAction(e)}function gS(e,t){fS.INSTANCE.registerEditorContribution(e,t)}var pS,mS;(mS=pS||(pS={})).getEditorCommand=function(e){return fS.INSTANCE.getEditorCommand(e)},mS.getEditorActions=function(){return fS.INSTANCE.getEditorActions()},mS.getEditorContributions=function(){return fS.INSTANCE.getEditorContributions()},mS.getSomeEditorContributions=function(e){return fS.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},mS.getDiffEditorContributions=function(){return fS.INSTANCE.getDiffEditorContributions()};class fS{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function _S(e){return e.register(),e}fS.INSTANCE=new fS,My.add("editor.contributions",fS.INSTANCE);const vS=_S(new nS({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:qy.MenubarEditMenu,group:"1_do",title:$m(0,"&&Undo"),order:1},{menuId:qy.CommandPalette,group:"",title:$m(0,"Undo"),order:1}]}));_S(new oS(vS,{id:"default:undo",precondition:void 0}));const bS=_S(new nS({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:qy.MenubarEditMenu,group:"1_do",title:$m(0,"&&Redo"),order:2},{menuId:qy.CommandPalette,group:"",title:$m(0,"Redo"),order:1}]}));_S(new oS(bS,{id:"default:redo",precondition:void 0}));const CS=_S(new nS({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:qy.MenubarSelectionMenu,group:"1_basic",title:$m(0,"&&Select All"),order:1},{menuId:qy.CommandPalette,group:"",title:$m(0,"Select All"),order:1}]}));var wS=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},yS=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let SS=class{constructor(e,t){}dispose(){}};SS.ID="editor.contrib.markerDecorations",SS=wS([yS(1,Gw)],SS),gS(SS.ID,SS);class xS extends Uo{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(){!this._resizeObserver&&this._referenceDomElement&&(this._resizeObserver=new ResizeObserver((e=>{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()})),this._resizeObserver.observe(this._referenceDomElement))}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())}}const kS=Object.prototype.hasOwnProperty;class LS{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),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}}function DS(e){const t=e.wordWrap;!0===t?e.wordWrap="on":!1===t&&(e.wordWrap="off");const i=e.lineNumbers;!0===i?e.lineNumbers="on":!1===i&&(e.lineNumbers="off");!1===e.autoClosingBrackets&&(e.autoClosingBrackets="never",e.autoClosingQuotes="never",e.autoSurround="never");"visible"===e.cursorBlinking&&(e.cursorBlinking="solid");const n=e.renderWhitespace;!0===n?e.renderWhitespace="boundary":!1===n&&(e.renderWhitespace="none");const o=e.renderLineHighlight;!0===o?e.renderLineHighlight="line":!1===o&&(e.renderLineHighlight="none");const s=e.acceptSuggestionOnEnter;!0===s?e.acceptSuggestionOnEnter="on":!1===s&&(e.acceptSuggestionOnEnter="off");const r=e.tabCompletion;!1===r?e.tabCompletion="off":!0===r&&(e.tabCompletion="onlySnippets");const a=e.suggest;if(a&&"object"==typeof a.filteredTypes&&a.filteredTypes){const e={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"};(function(e,t){for(let i in e)if(kS.call(e,i)&&!1===t({key:i,value:e[i]},(function(){delete e[i]})))return})(e,(e=>{const t=a.filteredTypes[e.key];!1===t&&(a[e.value]=t)}))}const l=e.hover;!0===l?e.hover={enabled:!0}:!1===l&&(e.hover={enabled:!1});const d=e.parameterHints;!0===d?e.parameterHints={enabled:!0}:!1===d&&(e.parameterHints={enabled:!1});const h=e.autoIndent;!0===h?e.autoIndent="full":!1===h&&(e.autoIndent="advanced");const c=e.matchBrackets;!0===c?e.matchBrackets="always":!1===c&&(e.matchBrackets="never");const{renderIndentGuides:u,highlightActiveIndentGuide:g}=e;e.guides||(e.guides={}),void 0!==u&&(e.guides.indentation=!!u),void 0!==g&&(e.guides.highlightActiveIndentation=!!g)}const ES=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new $o,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus!==e&&(this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus))}},NS=s_("accessibilityService"),IS=new Ly("accessibilityModeEnabled",!1);var TS=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},MS=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let OS=class extends Uo{constructor(e,t,i,n){super(),this._accessibilityService=n,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._computeOptionsMemory=new Gm,this.isSimpleWidget=e,this._containerObserver=this._register(new xS(i,t.dimension)),this._rawOptions=BS(t),this._validatedOptions=FS.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(10)&&this._containerObserver.startObserving(),this._register(Zf.onDidChangeZoomLevel((()=>this._recomputeOptions()))),this._register(ES.onDidChangeTabFocus((()=>this._recomputeOptions()))),this._register(this._containerObserver.onDidChange((()=>this._recomputeOptions()))),this._register(e_.onDidChange((()=>this._recomputeOptions()))),this._register(Mf.onDidChange((()=>this._recomputeOptions()))),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized((()=>this._recomputeOptions())))}_recomputeOptions(){const e=this._computeOptions(),t=FS.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=Xf.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:ES.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return FS.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:AS(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:Pf||Rf,pixelRatio:Mf.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return e_.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=BS(e);FS.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=FS.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=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(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())}};function AS(){let e="";return Bf||Vf||(e+="no-user-select "),Bf&&(e+="no-minimap-shadow "),Ho&&(e+="mac "),e}OS=TS([MS(3,NS)],OS);class RS{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class PS{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 FS{static validateOptions(e){const t=new RS;for(const i of Lf){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new PS;for(const n of Lf)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&jo(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!FS._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of Lf){const s=!FS._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new qm(i):null}static applyUpdate(e,t){let i=!1;for(const n of Lf)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 BS(e){const t=tr(e);return DS(t),t}function VS(e,t,i){let n=null,o=null;if("function"==typeof i.value?(n="value",o=i.value,o.length):"function"==typeof i.get&&(n="get",o=i.get),!o)throw new Error("not supported");const s=`$memoize$${t}`;i[n]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,e)}),this[s]}}var WS,HS,zS,jS,US=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};(HS=WS||(WS={})).Tap="-monaco-gesturetap",HS.Change="-monaco-gesturechange",HS.Start="-monaco-gesturestart",HS.End="-monaco-gesturesend",HS.Contextmenu="-monaco-gesturecontextmenu";class $S extends Uo{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(BC(document,"touchstart",(e=>this.onTouchStart(e)),{passive:!1})),this._register(BC(document,"touchend",(e=>this.onTouchEnd(e)))),this._register(BC(document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}static addTarget(e){return $S.isTouchDevice()?($S.INSTANCE||($S.INSTANCE=new $S),$S.INSTANCE.targets.push(e),{dispose:()=>{$S.INSTANCE.targets=$S.INSTANCE.targets.filter((t=>t!==e))}}):Uo.None}static ignoreTarget(e){return $S.isTouchDevice()?($S.INSTANCE||($S.INSTANCE=new $S),$S.INSTANCE.ignoreTargets.push(e),{dispose:()=>{$S.INSTANCE.ignoreTargets=$S.INSTANCE.ignoreTargets.filter((t=>t!==e))}}):Uo.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i=$S.HOLD_DELAY&&Math.abs(s.initialPageX-ir(s.rollingPageX))<30&&Math.abs(s.initialPageY-ir(s.rollingPageY))<30){let e=this.newGestureEvent(WS.Contextmenu,s.initialTarget);e.pageX=ir(s.rollingPageX),e.pageY=ir(s.rollingPageY),this.dispatchEvent(e)}else if(1===i){let e=ir(s.rollingPageX),i=ir(s.rollingPageY),n=ir(s.rollingTimestamps)-s.rollingTimestamps[0],o=e-s.rollingPageX[0],r=i-s.rollingPageY[0];const a=this.targets.filter((e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget)));this.inertia(a,t,Math.abs(o)/n,o>0?1:-1,e,Math.abs(r)/n,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent(WS.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===WS.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>$S.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==WS.Change&&e.type!==WS.Contextmenu||(this._lastSetTapCountTime=0);for(let t=0;t{e.initialTarget instanceof Node&&t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}))}inertia(e,t,i,n,o,s,r,a){this.handle=KC((()=>{let l=Date.now(),d=l-t,h=0,c=0,u=!0;i+=$S.SCROLL_FRICTION*d,s+=$S.SCROLL_FRICTION*d,i>0&&(u=!1,h=n*i*d),s>0&&(u=!1,c=r*s*d);let g=this.newGestureEvent(WS.Change);g.translationX=h,g.translationY=c,e.forEach((e=>e.dispatchEvent(g))),u||this.inertia(e,l,i,n,o+h,s,r,a+c)}))}onTouchMove(e){let t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}function KS(e,t){let i=new EC(t);return i.preventDefault(),{leftButton:i.leftButton,buttons:i.buttons,posx:i.posx,posy:i.posy}}$S.SCROLL_FRICTION=-.005,$S.HOLD_DELAY=700,$S.CLEAR_TAP_COUNT_TIME=400,US([VS],$S,"isTouchDevice",null);class qS{constructor(){this._hooks=new Cs,this._mouseMoveEventMerger=null,this._mouseMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._mouseMoveEventMerger=null,this._mouseMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._mouseMoveEventMerger}startMonitoring(e,t,i,n,o){if(this.isMonitoring())return;this._mouseMoveEventMerger=i,this._mouseMoveCallback=n,this._onStopCallback=o;const s=DC.getSameOriginWindowChain(),r=Vs?"pointermove":"mousemove",a=s.map((e=>e.window.document)),l=pw(e);l&&a.unshift(l);for(const d of a)this._hooks.add(XC(d,r,(e=>{e.buttons===t?this._mouseMoveCallback(e):this.stopMonitoring(!0)}),((e,t)=>this._mouseMoveEventMerger(e,t)))),this._hooks.add(BC(d,"mouseup",(e=>this.stopMonitoring(!0))));if(DC.hasDifferentOriginAncestor()){let e=s[s.length-1];this._hooks.add(BC(e.window.document,"mouseout",(e=>{"html"===new EC(e).target.tagName.toLowerCase()&&this.stopMonitoring(!0)}))),this._hooks.add(BC(e.window.document,"mouseover",(e=>{"html"===new EC(e).target.tagName.toLowerCase()&&this.stopMonitoring(!0)}))),this._hooks.add(BC(e.window.document.body,"mouseleave",(e=>{this.stopMonitoring(!0)})))}}}function GS(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}class ZS{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=GS(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 YS{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=GS(Math.max(Math.min(1,t),0),3),this.l=GS(Math.max(Math.min(1,i),0),3),this.a=GS(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,s=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const d=(r+s)/2,h=s-r;if(h>0){switch(l=Math.min(d<=.5?h/(2*d):h/(2-2*d),1),s){case t:a=(i-n)/h+(i1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?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 s,r,a;if(0===i)s=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,o=2*n-e;s=YS._hue2rgb(o,e,t+1/3),r=YS._hue2rgb(o,e,t),a=YS._hue2rgb(o,e,t-1/3)}return new ZS(Math.round(255*s),Math.round(255*r),Math.round(255*a),o)}}class XS{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=GS(Math.max(Math.min(1,t),0),3),this.v=GS(Math.max(Math.min(1,i),0),3),this.a=GS(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),s=o-Math.min(t,i,n),r=0===o?0:s/o;let a;return a=0===s?0:o===t?((i-n)/s%6+6)%6:o===i?(n-t)/s+2:(t-i)/s+4,new XS(Math.round(60*a),r,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,s=n*i,r=s*(1-Math.abs(t/60%2-1)),a=n-s;let[l,d,h]=[0,0,0];return t<60?(l=s,d=r):t<120?(l=r,d=s):t<180?(d=s,h=r):t<240?(d=r,h=s):t<300?(l=r,h=s):t<=360&&(l=s,h=r),l=Math.round(255*(l+a)),d=Math.round(255*(d+a)),h=Math.round(255*(h+a)),new ZS(l,d,h,o)}}class QS{constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof ZS)this.rgba=e;else if(e instanceof YS)this._hsla=e,this.rgba=YS.toRGBA(e);else{if(!(e instanceof XS))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=XS.toRGBA(e)}}static fromHex(e){return QS.Format.CSS.parseHex(e)||QS.red}get hsla(){return this._hsla?this._hsla:YS.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:XS.fromRGBA(this.rgba)}equals(e){return!!e&&ZS.equals(this.rgba,e.rgba)&&YS.equals(this.hsla,e.hsla)&&XS.equals(this.hsva,e.hsva)}getRelativeLuminance(){return GS(.2126*QS._relativeLuminanceForComponent(this.rgba.r)+.7152*QS._relativeLuminanceForComponent(this.rgba.g)+.0722*QS._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()0&&"#"===i.charAt(i.length-1)?i.substring(0,i.length-1):i)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};function tx(e){return`--vscode-${e.replace(/\./g,"-")}`}My.add(JS,ex);const ix="base.contributions.colors";const nx=new class{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){let s={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=s;let r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(r.deprecationMessage=o),this.colorSchema.properties[e]=r,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){return cD(i.defaults[t.type],t)}}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort(((e,t)=>{let i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)})).map((e=>`- \`${e}\`: ${this.colorsById[e].description}`)).join("\n")}};function ox(e,t,i,n,o){return nx.registerColor(e,t,i,n,o)}My.add(ix,nx);const sx=ox("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},$m(0,"Overall foreground color. This color is only used if not overridden by a component.")),rx=ox("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},$m(0,"Overall foreground color for error messages. This color is only used if not overridden by a component."));ox("descriptionForeground",{light:"#717171",dark:lD(sx,.7),hc:lD(sx,.7)},$m(0,"Foreground color for description text providing additional information, for example for a label."));const ax=ox("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},$m(0,"The default color for icons in the workbench.")),lx=ox("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},$m(0,"Overall border color for focused elements. This color is only used if not overridden by a component.")),dx=ox("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},$m(0,"An extra border around elements to separate them from others for greater contrast.")),hx=ox("contrastActiveBorder",{light:null,dark:null,hc:lx},$m(0,"An extra border around active elements to separate them from others for greater contrast."));ox("selection.background",{light:null,dark:null,hc:null},$m(0,"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.")),ox("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hc:QS.black},$m(0,"Color for text separators."));const cx=ox("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},$m(0,"Foreground color for links in text.")),ux=ox("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},$m(0,"Foreground color for links in text when clicked on and on mouse hover."));ox("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hc:"#D7BA7D"},$m(0,"Foreground color for preformatted text segments.")),ox("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hc:null},$m(0,"Background color for block quotes in text.")),ox("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hc:QS.white},$m(0,"Border color for block quotes in text."));const gx=ox("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:QS.black},$m(0,"Background color for code blocks in text.")),px=ox("widget.shadow",{dark:lD(QS.black,.36),light:lD(QS.black,.16),hc:null},$m(0,"Shadow color of widgets such as find/replace inside the editor.")),mx=ox("input.background",{dark:"#3C3C3C",light:QS.white,hc:QS.black},$m(0,"Input box background.")),fx=ox("input.foreground",{dark:sx,light:sx,hc:sx},$m(0,"Input box foreground.")),_x=ox("input.border",{dark:null,light:null,hc:dx},$m(0,"Input box border.")),vx=ox("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:dx},$m(0,"Border color of activated options in input fields."));ox("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hc:null},$m(0,"Background color of activated options in input fields."));const bx=ox("inputOption.activeBackground",{dark:lD(lx,.4),light:lD(lx,.2),hc:QS.transparent},$m(0,"Background hover color of options in input fields.")),Cx=ox("inputOption.activeForeground",{dark:QS.white,light:QS.black,hc:null},$m(0,"Foreground color of activated options in input fields."));ox("input.placeholderForeground",{light:lD(sx,.5),dark:lD(sx,.5),hc:lD(sx,.7)},$m(0,"Input box foreground color for placeholder text."));const wx=ox("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:QS.black},$m(0,"Input validation background color for information severity.")),yx=ox("inputValidation.infoForeground",{dark:null,light:null,hc:null},$m(0,"Input validation foreground color for information severity.")),Sx=ox("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:dx},$m(0,"Input validation border color for information severity.")),xx=ox("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:QS.black},$m(0,"Input validation background color for warning severity.")),kx=ox("inputValidation.warningForeground",{dark:null,light:null,hc:null},$m(0,"Input validation foreground color for warning severity.")),Lx=ox("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:dx},$m(0,"Input validation border color for warning severity.")),Dx=ox("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:QS.black},$m(0,"Input validation background color for error severity.")),Ex=ox("inputValidation.errorForeground",{dark:null,light:null,hc:null},$m(0,"Input validation foreground color for error severity.")),Nx=ox("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:dx},$m(0,"Input validation border color for error severity.")),Ix=ox("dropdown.background",{dark:"#3C3C3C",light:QS.white,hc:QS.black},$m(0,"Dropdown background."));ox("dropdown.listBackground",{dark:null,light:null,hc:QS.black},$m(0,"Dropdown list background."));const Tx=ox("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:QS.white},$m(0,"Dropdown foreground.")),Mx=ox("dropdown.border",{dark:Ix,light:"#CECECE",hc:dx},$m(0,"Dropdown border."));ox("checkbox.background",{dark:Ix,light:Ix,hc:Ix},$m(0,"Background color of checkbox widget.")),ox("checkbox.foreground",{dark:Tx,light:Tx,hc:Tx},$m(0,"Foreground color of checkbox widget.")),ox("checkbox.border",{dark:Mx,light:Mx,hc:Mx},$m(0,"Border color of checkbox widget."));const Ox=ox("button.foreground",{dark:QS.white,light:QS.white,hc:QS.white},$m(0,"Button foreground color.")),Ax=ox("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},$m(0,"Button background color.")),Rx=ox("button.hoverBackground",{dark:aD(Ax,.2),light:rD(Ax,.2),hc:null},$m(0,"Button background color when hovering."));ox("button.border",{dark:dx,light:dx,hc:dx},$m(0,"Button border color.")),ox("button.secondaryForeground",{dark:QS.white,light:QS.white,hc:QS.white},$m(0,"Secondary button foreground color."));const Px=ox("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hc:null},$m(0,"Secondary button background color."));ox("button.secondaryHoverBackground",{dark:aD(Px,.2),light:rD(Px,.2),hc:null},$m(0,"Secondary button background color when hovering."));const Fx=ox("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:QS.black},$m(0,"Badge background color. Badges are small information labels, e.g. for search results count.")),Bx=ox("badge.foreground",{dark:QS.white,light:"#333",hc:QS.white},$m(0,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),Vx=ox("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},$m(0,"Scrollbar shadow to indicate that the view is scrolled.")),Wx=ox("scrollbarSlider.background",{dark:QS.fromHex("#797979").transparent(.4),light:QS.fromHex("#646464").transparent(.4),hc:lD(dx,.6)},$m(0,"Scrollbar slider background color.")),Hx=ox("scrollbarSlider.hoverBackground",{dark:QS.fromHex("#646464").transparent(.7),light:QS.fromHex("#646464").transparent(.7),hc:lD(dx,.8)},$m(0,"Scrollbar slider background color when hovering.")),zx=ox("scrollbarSlider.activeBackground",{dark:QS.fromHex("#BFBFBF").transparent(.4),light:QS.fromHex("#000000").transparent(.6),hc:dx},$m(0,"Scrollbar slider background color when clicked on.")),jx=ox("progressBar.background",{dark:QS.fromHex("#0E70C0"),light:QS.fromHex("#0E70C0"),hc:dx},$m(0,"Background color of the progress bar that can show for long running operations.")),Ux=ox("editorError.background",{dark:null,light:null,hc:null},$m(0,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),$x=ox("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hc:null},$m(0,"Foreground color of error squigglies in the editor.")),Kx=ox("editorError.border",{dark:null,light:null,hc:QS.fromHex("#E47777").transparent(.8)},$m(0,"Border color of error boxes in the editor.")),qx=ox("editorWarning.background",{dark:null,light:null,hc:null},$m(0,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Gx=ox("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hc:null},$m(0,"Foreground color of warning squigglies in the editor.")),Zx=ox("editorWarning.border",{dark:null,light:null,hc:QS.fromHex("#FFCC00").transparent(.8)},$m(0,"Border color of warning boxes in the editor.")),Yx=ox("editorInfo.background",{dark:null,light:null,hc:null},$m(0,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Xx=ox("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},$m(0,"Foreground color of info squigglies in the editor.")),Qx=ox("editorInfo.border",{dark:null,light:null,hc:QS.fromHex("#3794FF").transparent(.8)},$m(0,"Border color of info boxes in the editor.")),Jx=ox("editorHint.foreground",{dark:QS.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},$m(0,"Foreground color of hint squigglies in the editor.")),ek=ox("editorHint.border",{dark:null,light:null,hc:QS.fromHex("#eeeeee").transparent(.8)},$m(0,"Border color of hint boxes in the editor."));ox("sash.hoverBorder",{dark:lx,light:lx,hc:lx},$m(0,"Border color of active sashes."));const tk=ox("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:QS.black},$m(0,"Editor background color.")),ik=ox("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:QS.white},$m(0,"Editor default foreground color.")),nk=ox("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},$m(0,"Background color of editor widgets, such as find/replace.")),ok=ox("editorWidget.foreground",{dark:sx,light:sx,hc:sx},$m(0,"Foreground color of editor widgets, such as find/replace.")),sk=ox("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:dx},$m(0,"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.")),rk=ox("editorWidget.resizeBorder",{light:null,dark:null,hc:null},$m(0,"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.")),ak=ox("quickInput.background",{dark:nk,light:nk,hc:nk},$m(0,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),lk=ox("quickInput.foreground",{dark:ok,light:ok,hc:ok},$m(0,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),dk=ox("quickInputTitle.background",{dark:new QS(new ZS(255,255,255,.105)),light:new QS(new ZS(0,0,0,.06)),hc:"#000000"},$m(0,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),hk=ox("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:QS.white},$m(0,"Quick picker color for grouping labels.")),ck=ox("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:QS.white},$m(0,"Quick picker color for grouping borders.")),uk=ox("keybindingLabel.background",{dark:new QS(new ZS(128,128,128,.17)),light:new QS(new ZS(221,221,221,.4)),hc:QS.transparent},$m(0,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),gk=ox("keybindingLabel.foreground",{dark:QS.fromHex("#CCCCCC"),light:QS.fromHex("#555555"),hc:QS.white},$m(0,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),pk=ox("keybindingLabel.border",{dark:new QS(new ZS(51,51,51,.6)),light:new QS(new ZS(204,204,204,.4)),hc:new QS(new ZS(111,195,223))},$m(0,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),mk=ox("keybindingLabel.bottomBorder",{dark:new QS(new ZS(68,68,68,.6)),light:new QS(new ZS(187,187,187,.4)),hc:new QS(new ZS(111,195,223))},$m(0,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),fk=ox("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},$m(0,"Color of the editor selection.")),_k=ox("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},$m(0,"Color of the selected text for high contrast.")),vk=ox("editor.inactiveSelectionBackground",{light:lD(fk,.5),dark:lD(fk,.5),hc:lD(fk,.5)},$m(0,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),bk=ox("editor.selectionHighlightBackground",{light:hD(fk,tk,.3,.6),dark:hD(fk,tk,.3,.6),hc:null},$m(0,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),Ck=ox("editor.selectionHighlightBorder",{light:null,dark:null,hc:hx},$m(0,"Border color for regions with the same content as the selection.")),wk=ox("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},$m(0,"Color of the current search match.")),yk=ox("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},$m(0,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Sk=ox("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},$m(0,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),xk=ox("editor.findMatchBorder",{light:null,dark:null,hc:hx},$m(0,"Border color of the current search match.")),kk=ox("editor.findMatchHighlightBorder",{light:null,dark:null,hc:hx},$m(0,"Border color of the other search matches.")),Lk=ox("editor.findRangeHighlightBorder",{dark:null,light:null,hc:lD(hx,.4)},$m(0,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);ox("searchEditor.findMatchBackground",{light:lD(yk,.66),dark:lD(yk,.66),hc:yk},$m(0,"Color of the Search Editor query matches.")),ox("searchEditor.findMatchBorder",{light:lD(kk,.66),dark:lD(kk,.66),hc:kk},$m(0,"Border color of the Search Editor query matches."));const Dk=ox("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},$m(0,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),Ek=ox("editorHoverWidget.background",{light:nk,dark:nk,hc:nk},$m(0,"Background color of the editor hover.")),Nk=ox("editorHoverWidget.foreground",{light:ok,dark:ok,hc:ok},$m(0,"Foreground color of the editor hover.")),Ik=ox("editorHoverWidget.border",{light:sk,dark:sk,hc:sk},$m(0,"Border color of the editor hover.")),Tk=ox("editorHoverWidget.statusBarBackground",{dark:aD(Ek,.2),light:rD(Ek,.05),hc:nk},$m(0,"Background color of the editor hover status bar.")),Mk=ox("editorLink.activeForeground",{dark:"#4E94CE",light:QS.blue,hc:QS.cyan},$m(0,"Color of active links.")),Ok=ox("editorInlayHint.foreground",{dark:lD(Bx,.8),light:lD(Bx,.8),hc:Bx},$m(0,"Foreground color of inline hints")),Ak=ox("editorInlayHint.background",{dark:lD(Fx,.6),light:lD(Fx,.3),hc:Fx},$m(0,"Background color of inline hints")),Rk=ox("editorInlayHint.typeForeground",{dark:Ok,light:Ok,hc:Ok},$m(0,"Foreground color of inline hints for types")),Pk=ox("editorInlayHint.typeBackground",{dark:Ak,light:Ak,hc:Ak},$m(0,"Background color of inline hints for types")),Fk=ox("editorInlayHint.parameterForeground",{dark:Ok,light:Ok,hc:Ok},$m(0,"Foreground color of inline hints for parameters")),Bk=ox("editorInlayHint.parameterBackground",{dark:Ak,light:Ak,hc:Ak},$m(0,"Background color of inline hints for parameters")),Vk=ox("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},$m(0,"The color used for the lightbulb actions icon.")),Wk=ox("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},$m(0,"The color used for the lightbulb auto fix actions icon.")),Hk=new QS(new ZS(155,185,85,.2)),zk=new QS(new ZS(255,0,0,.2)),jk=ox("diffEditor.insertedTextBackground",{dark:Hk,light:Hk,hc:null},$m(0,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Uk=ox("diffEditor.removedTextBackground",{dark:zk,light:zk,hc:null},$m(0,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),$k=ox("diffEditor.insertedLineBackground",{dark:null,light:null,hc:null},$m(0,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Kk=ox("diffEditor.removedLineBackground",{dark:null,light:null,hc:null},$m(0,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),qk=ox("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hc:null},$m(0,"Background color for the margin where lines got inserted.")),Gk=ox("diffEditorGutter.removedLineBackground",{dark:null,light:null,hc:null},$m(0,"Background color for the margin where lines got removed.")),Zk=ox("diffEditorOverview.insertedForeground",{dark:null,light:null,hc:null},$m(0,"Diff overview ruler foreground for inserted content.")),Yk=ox("diffEditorOverview.removedForeground",{dark:null,light:null,hc:null},$m(0,"Diff overview ruler foreground for removed content.")),Xk=ox("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},$m(0,"Outline color for the text that got inserted.")),Qk=ox("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},$m(0,"Outline color for text that got removed.")),Jk=ox("diffEditor.border",{dark:null,light:null,hc:dx},$m(0,"Border color between the two text editors.")),eL=ox("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},$m(0,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),tL=ox("list.focusBackground",{dark:null,light:null,hc:null},$m(0,"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.")),iL=ox("list.focusForeground",{dark:null,light:null,hc:null},$m(0,"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.")),nL=ox("list.focusOutline",{dark:lx,light:lx,hc:hx},$m(0,"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.")),oL=ox("list.activeSelectionBackground",{dark:"#094771",light:"#0060C0",hc:null},$m(0,"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.")),sL=ox("list.activeSelectionForeground",{dark:QS.white,light:QS.white,hc:null},$m(0,"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.")),rL=ox("list.activeSelectionIconForeground",{dark:null,light:null,hc:null},$m(0,"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.")),aL=ox("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},$m(0,"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.")),lL=ox("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},$m(0,"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.")),dL=ox("list.inactiveSelectionIconForeground",{dark:null,light:null,hc:null},$m(0,"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.")),hL=ox("list.inactiveFocusBackground",{dark:null,light:null,hc:null},$m(0,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),cL=ox("list.inactiveFocusOutline",{dark:null,light:null,hc:null},$m(0,"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.")),uL=ox("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},$m(0,"List/Tree background when hovering over items using the mouse.")),gL=ox("list.hoverForeground",{dark:null,light:null,hc:null},$m(0,"List/Tree foreground when hovering over items using the mouse.")),pL=ox("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},$m(0,"List/Tree drag and drop background when moving items around using the mouse.")),mL=ox("list.highlightForeground",{dark:"#18A3FF",light:"#0066BF",hc:lx},$m(0,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),fL=ox("list.focusHighlightForeground",{dark:mL,light:(_L=oL,vL=mL,bL="#9DDDFF",{op:5,if:_L,then:vL,else:bL}),hc:mL},$m(0,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));var _L,vL,bL;ox("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hc:"#B89500"},$m(0,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),ox("list.errorForeground",{dark:"#F88070",light:"#B01011",hc:null},$m(0,"Foreground color of list items containing errors.")),ox("list.warningForeground",{dark:"#CCA700",light:"#855F00",hc:null},$m(0,"Foreground color of list items containing warnings."));const CL=ox("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:QS.black},$m(0,"Background color of the type filter widget in lists and trees.")),wL=ox("listFilterWidget.outline",{dark:QS.transparent,light:QS.transparent,hc:"#f38518"},$m(0,"Outline color of the type filter widget in lists and trees.")),yL=ox("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:dx},$m(0,"Outline color of the type filter widget in lists and trees, when there are no matches."));ox("list.filterMatchBackground",{dark:yk,light:yk,hc:null},$m(0,"Background color of the filtered match.")),ox("list.filterMatchBorder",{dark:kk,light:kk,hc:dx},$m(0,"Border color of the filtered match."));const SL=ox("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},$m(0,"Tree stroke color for the indentation guides.")),xL=ox("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hc:null},$m(0,"Table border color between columns.")),kL=ox("tree.tableOddRowsBackground",{dark:lD(sx,.04),light:lD(sx,.04),hc:null},$m(0,"Background color for odd table rows."));ox("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hc:"#A7A8A9"},$m(0,"List/Tree foreground color for items that are deemphasized. "));const LL=ox("quickInput.list.focusBackground",{dark:null,light:null,hc:null},"",void 0,$m(0,"Please use quickInputList.focusBackground instead")),DL=ox("quickInputList.focusForeground",{dark:sL,light:sL,hc:sL},$m(0,"Quick picker foreground color for the focused item.")),EL=ox("quickInputList.focusIconForeground",{dark:rL,light:rL,hc:rL},$m(0,"Quick picker icon foreground color for the focused item.")),NL=ox("quickInputList.focusBackground",{dark:dD(LL,oL),light:dD(LL,oL),hc:null},$m(0,"Quick picker background color for the focused item.")),IL=ox("menu.border",{dark:null,light:null,hc:dx},$m(0,"Border color of menus.")),TL=ox("menu.foreground",{dark:Tx,light:sx,hc:Tx},$m(0,"Foreground color of menu items.")),ML=ox("menu.background",{dark:Ix,light:Ix,hc:Ix},$m(0,"Background color of menu items.")),OL=ox("menu.selectionForeground",{dark:sL,light:sL,hc:sL},$m(0,"Foreground color of the selected menu item in menus.")),AL=ox("menu.selectionBackground",{dark:oL,light:oL,hc:oL},$m(0,"Background color of the selected menu item in menus.")),RL=ox("menu.selectionBorder",{dark:null,light:null,hc:hx},$m(0,"Border color of the selected menu item in menus.")),PL=ox("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:dx},$m(0,"Color of a separator menu item in menus.")),FL=ox("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hc:null},$m(0,"Toolbar background when hovering over actions using the mouse"));ox("toolbar.hoverOutline",{dark:null,light:null,hc:hx},$m(0,"Toolbar outline when hovering over actions using the mouse")),ox("toolbar.activeBackground",{dark:aD(FL,.1),light:rD(FL,.1),hc:null},$m(0,"Toolbar background when holding the mouse over actions")),ox("editor.snippetTabstopHighlightBackground",{dark:new QS(new ZS(124,124,124,.3)),light:new QS(new ZS(10,50,100,.2)),hc:new QS(new ZS(124,124,124,.3))},$m(0,"Highlight background color of a snippet tabstop.")),ox("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},$m(0,"Highlight border color of a snippet tabstop.")),ox("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},$m(0,"Highlight background color of the final tabstop of a snippet.")),ox("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new QS(new ZS(10,50,100,.5)),hc:"#525252"},$m(0,"Highlight border color of the final tabstop of a snippet.")),ox("breadcrumb.foreground",{light:lD(sx,.8),dark:lD(sx,.8),hc:lD(sx,.8)},$m(0,"Color of focused breadcrumb items.")),ox("breadcrumb.background",{light:tk,dark:tk,hc:tk},$m(0,"Background color of breadcrumb items.")),ox("breadcrumb.focusForeground",{light:rD(sx,.2),dark:aD(sx,.1),hc:aD(sx,.1)},$m(0,"Color of focused breadcrumb items.")),ox("breadcrumb.activeSelectionForeground",{light:rD(sx,.2),dark:aD(sx,.1),hc:aD(sx,.1)},$m(0,"Color of selected breadcrumb items.")),ox("breadcrumbPicker.background",{light:nk,dark:nk,hc:nk},$m(0,"Background color of breadcrumb item picker."));const BL=QS.fromHex("#40C8AE").transparent(.5),VL=QS.fromHex("#40A6FF").transparent(.5),WL=QS.fromHex("#606060").transparent(.4),HL=ox("merge.currentHeaderBackground",{dark:BL,light:BL,hc:null},$m(0,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);ox("merge.currentContentBackground",{dark:lD(HL,.4),light:lD(HL,.4),hc:lD(HL,.4)},$m(0,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const zL=ox("merge.incomingHeaderBackground",{dark:VL,light:VL,hc:null},$m(0,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);ox("merge.incomingContentBackground",{dark:lD(zL,.4),light:lD(zL,.4),hc:lD(zL,.4)},$m(0,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const jL=ox("merge.commonHeaderBackground",{dark:WL,light:WL,hc:null},$m(0,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);ox("merge.commonContentBackground",{dark:lD(jL,.4),light:lD(jL,.4),hc:lD(jL,.4)},$m(0,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const UL=ox("merge.border",{dark:null,light:null,hc:"#C3DF6F"},$m(0,"Border color on headers and the splitter in inline merge-conflicts."));ox("editorOverviewRuler.currentContentForeground",{dark:lD(HL,1),light:lD(HL,1),hc:UL},$m(0,"Current overview ruler foreground for inline merge-conflicts.")),ox("editorOverviewRuler.incomingContentForeground",{dark:lD(zL,1),light:lD(zL,1),hc:UL},$m(0,"Incoming overview ruler foreground for inline merge-conflicts.")),ox("editorOverviewRuler.commonContentForeground",{dark:lD(jL,1),light:lD(jL,1),hc:UL},$m(0,"Common ancestor overview ruler foreground for inline merge-conflicts."));const $L=ox("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},$m(0,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),KL=ox("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},$m(0,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),qL=ox("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},$m(0,"Minimap marker color for find matches."),!0),GL=ox("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hc:"#ffffff"},$m(0,"Minimap marker color for repeating editor selections."),!0),ZL=ox("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},$m(0,"Minimap marker color for the editor selection."),!0),YL=ox("minimap.errorHighlight",{dark:new QS(new ZS(255,18,18,.7)),light:new QS(new ZS(255,18,18,.7)),hc:new QS(new ZS(255,50,50,1))},$m(0,"Minimap marker color for errors.")),XL=ox("minimap.warningHighlight",{dark:Gx,light:Gx,hc:Zx},$m(0,"Minimap marker color for warnings.")),QL=ox("minimap.background",{dark:null,light:null,hc:null},$m(0,"Minimap background color.")),JL=ox("minimap.foregroundOpacity",{dark:QS.fromHex("#000f"),light:QS.fromHex("#000f"),hc:QS.fromHex("#000f")},$m(0,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),eD=ox("minimapSlider.background",{light:lD(Wx,.5),dark:lD(Wx,.5),hc:lD(Wx,.5)},$m(0,"Minimap slider background color.")),tD=ox("minimapSlider.hoverBackground",{light:lD(Hx,.5),dark:lD(Hx,.5),hc:lD(Hx,.5)},$m(0,"Minimap slider background color when hovering.")),iD=ox("minimapSlider.activeBackground",{light:lD(zx,.5),dark:lD(zx,.5),hc:lD(zx,.5)},$m(0,"Minimap slider background color when clicked on.")),nD=ox("problemsErrorIcon.foreground",{dark:$x,light:$x,hc:$x},$m(0,"The color used for the problems error icon.")),oD=ox("problemsWarningIcon.foreground",{dark:Gx,light:Gx,hc:Gx},$m(0,"The color used for the problems warning icon.")),sD=ox("problemsInfoIcon.foreground",{dark:Xx,light:Xx,hc:Xx},$m(0,"The color used for the problems info icon."));function rD(e,t){return{op:0,value:e,factor:t}}function aD(e,t){return{op:1,value:e,factor:t}}function lD(e,t){return{op:2,value:e,factor:t}}function dD(...e){return{op:3,values:e}}function hD(e,t,i,n){return{op:4,value:e,background:t,factor:i,transparency:n}}function cD(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?QS.fromHex(e):t.getColor(e):e instanceof QS?e:"object"==typeof e?function(e,t){var i,n,o;switch(e.op){case 0:return null===(i=cD(e.value,t))||void 0===i?void 0:i.darken(e.factor);case 1:return null===(n=cD(e.value,t))||void 0===n?void 0:n.lighten(e.factor);case 2:return null===(o=cD(e.value,t))||void 0===o?void 0:o.transparent(e.factor);case 3:for(const i of e.values){const e=cD(i,t);if(e)return e}return;case 5:return cD(t.defines(e.if)?e.then:e.else,t);case 4:{const i=cD(e.value,t);if(!i)return;const n=cD(e.background,t);return n?i.isDarkerThan(n)?QS.getLighterColor(i,n,e.factor).transparent(e.transparency):QS.getDarkerColor(i,n,e.factor).transparent(e.transparency):i.transparent(e.factor*e.transparency)}default:throw nr()}}(e,t):void 0}ox("charts.foreground",{dark:sx,light:sx,hc:sx},$m(0,"The foreground color used in charts.")),ox("charts.lines",{dark:lD(sx,.5),light:lD(sx,.5),hc:lD(sx,.5)},$m(0,"The color used for horizontal lines in charts.")),ox("charts.red",{dark:$x,light:$x,hc:$x},$m(0,"The red color used in chart visualizations.")),ox("charts.blue",{dark:Xx,light:Xx,hc:Xx},$m(0,"The blue color used in chart visualizations.")),ox("charts.yellow",{dark:Gx,light:Gx,hc:Gx},$m(0,"The yellow color used in chart visualizations.")),ox("charts.orange",{dark:qL,light:qL,hc:qL},$m(0,"The orange color used in chart visualizations.")),ox("charts.green",{dark:"#89D185",light:"#388A34",hc:"#89D185"},$m(0,"The green color used in chart visualizations.")),ox("charts.purple",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},$m(0,"The purple color used in chart visualizations."));let uD=My.as(JS);uD.registerSchema("vscode://schemas/workbench-colors",nx.getColorSchema());const gD=new Hv((()=>uD.notifySchemaChanged("vscode://schemas/workbench-colors")),200);nx.onDidChangeSchema((()=>{gD.isScheduled()||gD.schedule()}));class pD{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new mD(this.x-ow.scrollX,this.y-ow.scrollY)}}class mD{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new pD(this.clientX+ow.scrollX,this.clientY+ow.scrollY)}}class fD{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class _D{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function vD(e){const t=nw(e);return new fD(t.left,t.top,t.width,t.height)}function bD(e,t,i){const n=t.width/e.offsetWidth,o=t.height/e.offsetHeight,s=(i.x-t.x)/n,r=(i.y-t.y)/o;return new _D(s,r)}class CD extends EC{constructor(e,t){super(e),this._editorMouseEventBrand=void 0,this.pos=new pD(this.posx,this.posy),this.editorPos=vD(t),this.relativePos=bD(t,this.editorPos,this.pos)}}class wD{constructor(e){this._editorViewDomNode=e}_create(e){return new CD(e,this._editorViewDomNode)}onContextMenu(e,t){return BC(e,"contextmenu",(e=>{t(this._create(e))}))}onMouseUp(e,t){return BC(e,"mouseup",(e=>{t(this._create(e))}))}onMouseDown(e,t){return BC(e,"mousedown",(e=>{t(this._create(e))}))}onMouseLeave(e,t){return jC(e,(e=>{t(this._create(e))}))}onMouseMoveThrottled(e,t,i,n){return XC(e,"mousemove",t,((e,t)=>i(e,this._create(t))),n)}}class yD{constructor(e){this._editorViewDomNode=e}_create(e){return new CD(e,this._editorViewDomNode)}onPointerUp(e,t){return BC(e,"pointerup",(e=>{t(this._create(e))}))}onPointerDown(e,t){return BC(e,"pointerdown",(e=>{t(this._create(e))}))}onPointerLeave(e,t){return n=e=>{t(this._create(e))},BC(i=e,"pointerout",(e=>{let t=e.relatedTarget;for(;t&&t!==i;)t=t.parentNode;t!==i&&n(e)}));var i,n}onPointerMoveThrottled(e,t,i,n){return XC(e,"pointermove",t,((e,t)=>i(e,this._create(t))),n)}}class SD extends Uo{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new qS),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=WC(document,"keydown",(e=>{e.toKeybinding().isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,e.browserEvent)}),!0);this._globalMouseMoveMonitor.startMonitoring(e,t,((e,t)=>i(e,new CD(t,this._editorViewDomNode))),n,(e=>{this._keydownListener.dispose(),o(e)}))}stopMonitoring(){this._globalMouseMoveMonitor.stopMonitoring(!0)}}class xD{constructor(e){this._editor=e,this._instanceId=++xD._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new Hv((()=>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 kD(t,`dyn-rule-${this._instanceId}-${n}`,gw(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())}}xD._idPool=0;class kD{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElement=fw(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const e=t[n];let o;o="object"==typeof e?`var(${tx(e.id)})`:e;i+=`\n\t${LD(n)}: ${o};`}return i+="\n}",i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function LD(e){return e.replace(/(^[A-Z])/,(([e])=>e.toLowerCase())).replace(/([A-Z])/g,(([e])=>`-${e.toLowerCase()}`))}class DD extends Uo{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=s.left?n.width=Math.max(n.width,s.left+s.width-n.left):(t[i++]=n,n=s)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let o=0,s=e.length;ol)return null;if((t=Math.min(l,Math.max(0,t)))===(n=Math.min(l,Math.max(0,n)))&&i===o&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(i,s,r)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let d=e.children[t].firstChild,h=e.children[n].firstChild;if(d&&h||(!d&&0===i&&t>0&&(d=e.children[t-1].firstChild,i=1073741824),!h&&0===o&&n>0&&(h=e.children[n-1].firstChild,o=1073741824)),!d||!h)return null;i=Math.min(d.textContent.length,Math.max(0,i)),o=Math.min(h.textContent.length,Math.max(0,o));const c=this._readClientRects(d,i,h,o,a);return this._createHorizontalRangesFromClientRects(c,s,r)}}const FD=!!Ts||!(Vo||Rf||Bf);let BD=!0;class VD{constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1,this.endNode=t}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();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}}class WD{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(44);this.renderWhitespace=i.get(88),this.renderControlCharacters=i.get(83),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(29),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(59),this.stopRenderingLineAfter=i.get(105),this.fontLigatures=i.get(45)}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 HD{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)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=$f(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return(this._options.themeType===Oy.HIGH_CONTRAST||"selection"===this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,r=Sb.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if(s.themeType===Oy.HIGH_CONTRAST||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumbere)continue;const t=i.startLineNumber===e?i.startColumn:o.minColumn,n=i.endLineNumber===e?i.endColumn:o.maxColumn;t');const d=Mb(l,n);n.appendASCIIString("");let h=null;return BD&&FD&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===d.containsForeignElements&&o.content.length<300&&l.lineTokens.getCount()<100&&(h=new zD(this._renderedViewLine?this._renderedViewLine.domNode:null,l,d.characterMapping)),h||(h=$D(this._renderedViewLine?this._renderedViewLine.domNode:null,l,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=h,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof zD}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof zD?this._renderedViewLine.monospaceAssumptionsAreValid():BD}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof zD&&(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;let s=!1;-1!==o&&t>o+1&&i>o+1&&(s=!0),-1!==o&&t>o+1&&(t=o+1),-1!==o&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new RD(s,r):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}HD.CLASS_NAME="view-line";class zD{constructor(e,t,i){this.domNode=e,this.input=t,this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){return Math.round(this._getCharPosition(this._characterMapping.length))}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){if(!this.domNode)return BD;const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;return Math.abs(e-t)>=2&&(BD=!1),BD}toSlowRenderedLine(){return $D(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getCharPosition(t),s=this._getCharPosition(i);return[new OD(o,s-o)]}_getCharPosition(e){const t=this._characterMapping.getAbsoluteOffset(e);return this._charWidth*t}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new Nb(o,i),n)}}class jD{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||0===this._characterMapping.length){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const o=this._readPixelOffset(this.domNode,e,t,n);if(-1===o)return null;const s=this._readPixelOffset(this.domNode,e,i,n);return-1===s?null:[new OD(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const n=this._readPixelOffset(e,t,i,o);return-1===n?null:[new OD(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth();const t=this._getReadingTarget(e);return t.firstChild?t.firstChild.offsetWidth:0}if(null!==this._pixelOffsetCache){const o=this._pixelOffsetCache[i];if(-1!==o)return o;const s=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=PD.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n.clientRectDeltaLeft,n.clientRectScale,n.endNode);return t&&0!==t.length?t[0].left:-1}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();const o=this._characterMapping.getDomPosition(i),s=PD.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n.clientRectDeltaLeft,n.clientRectScale,n.endNode);if(!s||0===s.length)return-1;const r=s[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getAbsoluteOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new OD(0,this.getWidth())];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return PD.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,n.clientRectDeltaLeft,n.clientRectScale,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.getColumn(new Nb(o,i),n)}}class UD extends jD{_readVisibleRangesForRange(e,t,i,n,o){const s=super._readVisibleRangesForRange(e,t,i,n,o);if(!s||0===s.length||i===n||1===i&&n===this._characterMapping.length)return s;if(!this.input.containsRTL){const i=this._readPixelOffset(e,t,n,o);if(-1!==i){const e=s[s.length-1];e.left=t){return l-t=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class iE{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(131),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(59),this.stickyTabStops=n.get(104),this.typicalHalfwidthCharacterWidth=n.get(44).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return iE.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 s,r=null,a=null;return i.afterLineNumber!==o&&(a=new er(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new er(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),s=null===a?r:null===r?a:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,rE._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}{constructor(e,t,i,n,o){super(e,t,i,n),this._ctx=e,o?(this.target=o,this.targetPath=ND.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columns.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return tE.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 s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,n,i.range,s):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,s)))}return null}static _hitTestViewLines(e,t,i){if(!tE.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new er(1,1),oE);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new er(i,n),oE)}if(i){if(tE.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){const n=e.getLineWidth(i),o=sE(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new er(i,1),o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=sE(t.mouseContentHorizontalOffset-n),s=new er(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(s,o)}}return t.fulfillUnknown()}const n=rE._doHitTest(e,t);return 1===n.type?rE.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(tE.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new er(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(tE.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new er(i,n))}}return null}static _hitTestScrollbar(e,t){if(tE.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new er(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(131),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return rE._getMouseColumn(n,t.get(44).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;return Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const s=n.lineNumber,r=n.column,a=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>a){const e=sE(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(s,r);if(!l)return t.fulfillUnknown(n);const d=l.left;if(t.mouseContentHorizontalOffset===d)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const h=[];if(h.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(s,r-1);t&&h.push({offset:t.left,column:r-1})}if(re.offset-t.offset));const c=t.pos.toClientCoordinates(),u=i.getBoundingClientRect(),g=u.left<=c.clientX&&c.clientX<=u.right;for(let p=1;p=t.editorPos.y+t.editorPos.height&&(o=t.editorPos.y+t.editorPos.height-1);const s=new pD(t.pos.x,o),r=this._actualDoHitTestWithCaretRangeFromPoint(e,s.toClientCoordinates());return 1===r.type?r:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=pw(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const e=o.getBoundingClientRect(),i=window.getComputedStyle(o,null).getPropertyValue("font"),s=o.innerText;let r,a=e.left,l=0;if(t>e.left+e.width)l=s.length;else{const e=aE.getInstance();for(let n=0;nthis._createMouseTarget(e,t)),(e=>this._getMouseColumn(e)))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(131).height;const n=new wD(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,(e=>this._onContextMenu(e,!0)))),this._register(n.onMouseMoveThrottled(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)),lE(this.mouseTargetFactory),dE.MOUSE_MOVE_MINIMUM_TIME)),this._register(n.onMouseUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e))));this._register(BC(this.viewHelper.viewDomNode,yw.MOUSE_WHEEL,(e=>{if(this.viewController.emitMouseWheel(e),!this._context.configuration.options.get(68))return;const t=new NC(e);if(Ho?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){const e=Zf.getZoomLevel(),i=t.deltaY>0?1:-1;Zf.setZoomLevel(e+i),t.preventDefault(),t.stopPropagation()}}),{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(131)){const e=this._context.configuration.options.get(131).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}onScrollChanged(e){return this._mouseDownOperation.onScrollChanged(),!1}getTargetAtClientPoint(e,t){const i=new mD(e,t).toPageCoordinates(),n=vD(this.viewHelper.viewDomNode);if(i.yn.y+n.height||i.xn.x+n.width)return null;const o=bD(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=pw(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find((e=>this.viewHelper.viewDomNode.contains(e))))}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){if(this._mouseDownOperation.isActive())return;e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(l&&(i||o&&s))d(),this._mouseDownOperation.start(t.type,e);else if(n)e.preventDefault();else if(r){const i=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(i.viewZoneId)&&(d(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else a&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}dE.MOUSE_MOVE_MINIMUM_TIME=100;class hE extends Uo{constructor(e,t,i,n,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._createMouseTarget=n,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new SD(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new Vv),this._mouseState=new cE,this._currentSelection=new ar(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!0);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):this._dispatchMouse(t,!0))}start(e,t){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const i=this._findMousePosition(t,!0);if(!i||!i.position)return;this._mouseState.trySetCount(t.detail,i.position),t.detail=this._mouseState.count;const n=this._context.configuration.options;if(!n.get(81)&&n.get(31)&&!n.get(18)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===i.type&&i.position&&this._currentSelection.containsPosition(i.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,lE(null),(e=>this._onMouseDownThenMove(e)),(e=>{const t=this._findMousePosition(this._lastMouseEvent,!0);e&&e instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()}));this._mouseState.isDragAndDrop=!1,this._dispatchMouse(i,t.shiftKey),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,lE(null),(e=>this._onMouseDownThenMove(e)),(()=>this._stop())))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onScrollChanged(){this._isActive&&this._onScrollTimeout.setIfNotSet((()=>{if(!this._lastMouseEvent)return;const e=this._findMousePosition(this._lastMouseEvent,!1);e&&(this._mouseState.isDragAndDrop||this._dispatchMouse(e,!0))}),10)}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const t=n.getCurrentScrollTop()+e.relativePos.y,s=iE.getZoneAtCoord(this._context,t);if(s){const e=this._helpPositionJumpOverViewZone(s);if(e)return eE.createOutsideEditor(o,e)}const r=n.getLineNumberAtVerticalOffset(t);return eE.createOutsideEditor(o,new er(r,i.getLineMaxColumn(r)))}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);return e.posxt.x+t.width?eE.createOutsideEditor(o,new er(s,i.getLineMaxColumn(s))):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(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return eE.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new er(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:6===e.type&&null!==e.detail.injectedText})}}class cE{constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=(new Date).getTime();i-this._lastSetMouseDownCountTime>cE.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)}}var uE,gE,pE;cE.CLEAR_MOUSE_DOWN_COUNT_TIME=400,(gE=uE||(uE={})).text="text/plain",gE.binary="application/octet-stream",gE.unknown="application/unknown",gE.markdown="text/markdown",gE.latex="text/latex",gE.uriList="text/uri-list";class mE{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selectionStartPosition=n,this.selectionEndPosition=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e){return new mE(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new mE(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}const t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+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(lr(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(dr(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);const s=t.value.substring(n,t.value.length-o),r=e.selectionStart-n,a=e.selectionEnd-n;if(t.selectionStart-n===t.selectionEnd-n){return{text:s,replacePrevCharCnt:e.selectionStart-n,replaceNextCharCnt:0,positionDelta:0}}return{text:s,replacePrevCharCnt:a-r,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(lr(e.value,t.value),e.selectionEnd),n=Math.min(dr(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),s=t.value.substring(i,t.value.length-n);e.selectionStart;const r=e.selectionEnd-i;t.selectionStart;const a=t.selectionEnd-i;return{text:s,replacePrevCharCnt:r,replaceNextCharCnt:o.length-r,positionDelta:a-s.length}}}mE.EMPTY=new mE("",0,0,null,null);class fE{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t;return new qo(i+1,1,i+t+1,1)}static fromEditorSelection(e,t,i,n,o){const s=fE._getPageOfLine(i.startLineNumber,n),r=fE._getRangeForPage(s,n),a=fE._getPageOfLine(i.endLineNumber,n),l=fE._getRangeForPage(a,n),d=r.intersectRanges(new qo(1,1,i.startLineNumber,i.startColumn));let h=t.getValueInRange(d,1);const c=t.getLineCount(),u=t.getLineMaxColumn(c),g=l.intersectRanges(new qo(i.endLineNumber,i.endColumn,c,u));let p,m=t.getValueInRange(g,1);if(s===a||s+1===a)p=t.getValueInRange(i,1);else{const e=r.intersectRanges(i),n=l.intersectRanges(i);p=t.getValueInRange(e,1)+String.fromCharCode(8230)+t.getValueInRange(n,1)}if(o){const e=500;h.length>e&&(h=h.substring(h.length-e,h.length)),m.length>e&&(m=m.substring(0,e)),p.length>2*e&&(p=p.substring(0,e)+String.fromCharCode(8230)+p.substring(p.length-e,p.length))}return new mE(h+p+m,h.length,h.length+p.length,new er(i.startLineNumber,i.startColumn),new er(i.endLineNumber,i.endColumn))}}(pE||(pE={})).Tap="-monaco-textarea-synthetic-tap";const _E={forceCopyWithSyntaxHighlighting:!1};class vE{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)}}vE.INSTANCE=new vE;class bE{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class CE extends Uo{constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,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._asyncTriggerCut=this._register(new Hv((()=>this._onCut.fire()),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Hv((()=>this.writeScreenReaderContent("asyncFocusGain")),0)),this._textAreaState=mE.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown((e=>{const t=new SC(e);(109===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),o=t,this._onKeyDown.fire(t)}))),this._register(this._textArea.onKeyUp((e=>{const t=new SC(e);this._onKeyUp.fire(t)}))),this._register(this._textArea.onCompositionStart((e=>{const t=new bE;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&o&&o.equals(109)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===o.code||"ArrowLeft"===o.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}}))),this._register(this._textArea.onCompositionUpdate((e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=mE.readFromTextArea(this._textArea),i=mE.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=mE.readFromTextArea(this._textArea),this._onType.fire(i),this._onCompositionUpdate.fire(e)}))),this._register(this._textArea.onCompositionEnd((e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=mE.readFromTextArea(this._textArea),t=mE.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=mE.readFromTextArea(this._textArea),this._onType.fire(i),this._onCompositionEnd.fire()}))),this._register(this._textArea.onInput((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=mE.readFromTextArea(this._textArea),i=mE.deduceInput(this._textAreaState,t,2===this._OS);0===i.replacePrevCharCnt&&1===i.text.length&&Go(i.text.charCodeAt(0))||(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||this._onType.fire(i))}))),this._register(this._textArea.onCut((e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()}))),this._register(this._textArea.onCopy((e=>{this._ensureClipboardGetsEditorSelection(e)}))),this._register(this._textArea.onPaste((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=wE.getTextData(e.clipboardData);t&&(i=i||vE.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:i}))}))),this._register(this._textArea.onFocus((()=>{const e=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()}))),this._register(this._textArea.onBlur((()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))),this._register(this._textArea.onSyntheticTap((()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())})))}_installSelectionChangeListener(){let e=0;return BC(document,"selectionchange",(t=>{if(!this._hasFocus)return;if(this._currentComposition)return;if(!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)return;if(!this._textAreaState.selectionStartPosition||!this._textAreaState.selectionEndPosition)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),d=this._host.deduceModelPosition(l[0],l[1],l[2]),h=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(h[0],h[1],h[2]),u=new ar(d.lineNumber,d.column,c.lineNumber,c.column);this._onSelectionChangeRequest.fire(u)}))}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.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};vE.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&wE.setTextData(e.clipboardData,t.text,t.html,i)}}class wE{static getTextData(e){const t=e.getData(uE.text);let i=null;const n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(o){}return[t,i]}static setTextData(e,t,i,n){e.setData(uE.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}}class yE extends Uo{constructor(e){super(),this._actual=e,this.onKeyDown=this._register(UC(this._actual,"keydown")).event,this.onKeyUp=this._register(UC(this._actual,"keyup")).event,this.onCompositionStart=this._register(UC(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(UC(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(UC(this._actual,"compositionend")).event,this.onInput=this._register(UC(this._actual,"input")).event,this.onCut=this._register(UC(this._actual,"cut")).event,this.onCopy=this._register(UC(this._actual,"copy")).event,this.onPaste=this._register(UC(this._actual,"paste")).event,this.onFocus=this._register(UC(this._actual,"focus")).event,this.onBlur=this._register(UC(this._actual,"blur")).event,this._onSyntheticTap=this._register(new $o),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(BC(this._actual,pE.Tap,(()=>this._onSyntheticTap.fire())))}hasFocus(){const e=pw(this._actual);return e?e.activeElement===this._actual:!!PC(this._actual)&&document.activeElement===this._actual}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"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const s=pw(n);o=s?s.activeElement:document.activeElement;const r=o===n,a=n.selectionStart,l=n.selectionEnd;if(r&&a===t&&l===i)Rf&&window.parent!==window&&n.focus();else{if(r)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(Rf&&window.parent!==window&&n.focus());try{const e=function(e){let t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(d){}}}}class SE extends dE{constructor(e,t,i){super(e,t,i),this._register($S.addTarget(this.viewHelper.linesContentDomNode)),this._register(BC(this.viewHelper.linesContentDomNode,WS.Tap,(e=>this.onTap(e)))),this._register(BC(this.viewHelper.linesContentDomNode,WS.Change,(e=>this.onChange(e)))),this._register(BC(this.viewHelper.linesContentDomNode,WS.Contextmenu,(e=>this._onContextMenu(new CD(e,this.viewHelper.viewDomNode),!1)))),this._lastPointerType="mouse",this._register(BC(this.viewHelper.linesContentDomNode,"pointerdown",(e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"})));const n=new yD(this.viewHelper.viewDomNode);this._register(n.onPointerMoveThrottled(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)),lE(this.mouseTargetFactory),dE.MOUSE_MOVE_MINIMUM_TIME)),this._register(n.onPointerUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e))))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new CD(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===t.type&&null!==t.detail.injectedText})}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e)}}class xE extends dE{constructor(e,t,i){super(e,t,i),this._register($S.addTarget(this.viewHelper.linesContentDomNode)),this._register(BC(this.viewHelper.linesContentDomNode,WS.Tap,(e=>this.onTap(e)))),this._register(BC(this.viewHelper.linesContentDomNode,WS.Change,(e=>this.onChange(e)))),this._register(BC(this.viewHelper.linesContentDomNode,WS.Contextmenu,(e=>this._onContextMenu(new CD(e,this.viewHelper.viewDomNode),!1))))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new CD(e,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(pE.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class kE extends Uo{constructor(e,t,i){super(),Vs&&mC?this.handler=this._register(new SE(e,t,i)):window.TouchEvent?this.handler=this._register(new xE(e,t,i)):this.handler=this._register(new dE(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class LE extends DD{}const DE=ox("editor.lineHighlightBackground",{dark:null,light:null,hc:null},$m(0,"Background color for the highlight of line at the cursor position.")),EE=ox("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},$m(0,"Background color for the border around the line at the cursor position.")),NE=ox("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},$m(0,"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),IE=ox("editor.rangeHighlightBorder",{dark:null,light:null,hc:hx},$m(0,"Background color of the border around highlighted ranges."),!0),TE=ox("editor.symbolHighlightBackground",{dark:yk,light:yk,hc:null},$m(0,"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),ME=ox("editor.symbolHighlightBorder",{dark:null,light:null,hc:hx},$m(0,"Background color of the border around highlighted symbols."),!0),OE=ox("editorCursor.foreground",{dark:"#AEAFAD",light:QS.black,hc:QS.white},$m(0,"Color of the editor cursor.")),AE=ox("editorCursor.background",null,$m(0,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),RE=ox("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},$m(0,"Color of whitespace characters in the editor.")),PE=ox("editorIndentGuide.background",{dark:RE,light:RE,hc:RE},$m(0,"Color of the editor indentation guides.")),FE=ox("editorIndentGuide.activeBackground",{dark:RE,light:RE,hc:RE},$m(0,"Color of the active editor indentation guides.")),BE=ox("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:QS.white},$m(0,"Color of editor line numbers.")),VE=ox("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:hx},$m(0,"Color of editor active line number"),!1,$m(0,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),WE=ox("editorLineNumber.activeForeground",{dark:VE,light:VE,hc:VE},$m(0,"Color of editor active line number")),HE=ox("editorRuler.foreground",{dark:"#5A5A5A",light:QS.lightgrey,hc:QS.white},$m(0,"Color of the editor rulers."));ox("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hc:"#999999"},$m(0,"Foreground color of editor CodeLens"));const zE=ox("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},$m(0,"Background color behind matching brackets")),jE=ox("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:dx},$m(0,"Color for matching brackets boxes")),UE=ox("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},$m(0,"Color of the overview ruler border.")),$E=ox("editorOverviewRuler.background",null,$m(0,"Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.")),KE=ox("editorGutter.background",{dark:tk,light:tk,hc:tk},$m(0,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),qE=ox("editorUnnecessaryCode.border",{dark:null,light:null,hc:QS.fromHex("#fff").transparent(.8)},$m(0,"Border color of unnecessary (unused) source code in the editor.")),GE=ox("editorUnnecessaryCode.opacity",{dark:QS.fromHex("#000a"),light:QS.fromHex("#0007"),hc:null},$m(0,"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.")),ZE=ox("editorGhostText.border",{dark:null,light:null,hc:QS.fromHex("#fff").transparent(.8)},$m(0,"Border color of ghost text in the editor.")),YE=ox("editorGhostText.foreground",{dark:QS.fromHex("#ffffff56"),light:QS.fromHex("#0007"),hc:null},$m(0,"Foreground color of the ghost text in the editor.")),XE=ox("editorGhostText.background",{dark:null,light:null,hc:null},$m(0,"Background color of the ghost text in the editor.")),QE=new QS(new ZS(0,122,204,.6)),JE=ox("editorOverviewRuler.rangeHighlightForeground",{dark:QE,light:QE,hc:QE},$m(0,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),eN=ox("editorOverviewRuler.errorForeground",{dark:new QS(new ZS(255,18,18,.7)),light:new QS(new ZS(255,18,18,.7)),hc:new QS(new ZS(255,50,50,1))},$m(0,"Overview ruler marker color for errors.")),tN=ox("editorOverviewRuler.warningForeground",{dark:Gx,light:Gx,hc:Zx},$m(0,"Overview ruler marker color for warnings.")),iN=ox("editorOverviewRuler.infoForeground",{dark:Xx,light:Xx,hc:Qx},$m(0,"Overview ruler marker color for infos.")),nN=ox("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hc:"#FFD700"},$m(0,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),oN=ox("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hc:"#DA70D6"},$m(0,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),sN=ox("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hc:"#87CEFA"},$m(0,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),rN=ox("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),aN=ox("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),lN=ox("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),dN=ox("editorBracketHighlight.unexpectedBracket.foreground",{dark:new QS(new ZS(255,18,18,.8)),light:new QS(new ZS(255,18,18,.8)),hc:new QS(new ZS(255,50,50,1))},$m(0,"Foreground color of unexpected brackets.")),hN=ox("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),cN=ox("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),uN=ox("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),gN=ox("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),pN=ox("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),mN=ox("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),fN=ox("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),_N=ox("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),vN=ox("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),bN=ox("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),CN=ox("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),wN=ox("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hc:"#00000000"},$m(0,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));ox("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hc:"#ff0000"},$m(0,"Border color used to highlight unicode characters.")),zy(((e,t)=>{const i=e.getColor(tk);i&&t.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${i}; }`);const n=e.getColor(ik);n&&t.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${n}; }`);const o=e.getColor(KE);o&&t.addRule(`.monaco-editor .margin { background-color: ${o}; }`);const s=e.getColor(NE);s&&t.addRule(`.monaco-editor .rangeHighlight { background-color: ${s}; }`);const r=e.getColor(IE);r&&t.addRule(`.monaco-editor .rangeHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${r}; }`);const a=e.getColor(TE);a&&t.addRule(`.monaco-editor .symbolHighlight { background-color: ${a}; }`);const l=e.getColor(ME);l&&t.addRule(`.monaco-editor .symbolHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${l}; }`);const d=e.getColor(RE);d&&(t.addRule(`.monaco-editor .mtkw { color: ${d} !important; }`),t.addRule(`.monaco-editor .mtkz { color: ${d} !important; }`))}));class yN extends LE{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new er(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(59);const t=e.get(60);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(84);const i=e.get(131);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),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new er(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?''+i+"":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=Vo?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o='
',s=this._context.viewModel.getLineCount(),r=[];for(let a=i;a<=n;a++){const e=a-i;if(!this._renderFinalNewline&&a===s&&0===this._context.viewModel.getLineLength(a)){r[e]="";continue}const n=this._getLineRenderLineNumber(a);n?a===this._activeLineNumber?r[e]='
'+n+"
":r[e]=o+n+"
":r[e]=""}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}yN.CLASS_NAME="line-numbers",zy(((e,t)=>{const i=e.getColor(BE);i&&t.addRule(`.monaco-editor .line-numbers { color: ${i}; }`);const n=e.getColor(WE);n&&t.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${n}; }`)}));class SN extends ED{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(131);this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=$f(document.createElement("div")),this._domNode.setClassName(SN.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=$f(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(SN.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(131);return this._canUseLayerHinting=!t.get(28),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}SN.CLASS_NAME="glyph-margin",SN.OUTER_CLASS_NAME="margin";class xN{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 er(this.modelLineNumber,this.distanceToModelLineStart+1),i=new er(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||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const kN=Rf;class LN extends ED{constructor(e,t,i){super(e),this._primaryCursorPosition=new er(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const n=this._context.configuration.options,o=n.get(131);this._setAccessibilityOptions(n),this._contentLeft=o.contentLeft,this._contentWidth=o.contentWidth,this._contentHeight=o.height,this._fontInfo=n.get(44),this._lineHeight=n.get(59),this._emptySelectionClipboard=n.get(32),this._copyWithSyntaxHighlighting=n.get(21),this._visibleTextArea=null,this._selections=[new ar(1,1,1,1)],this._modelSelections=[new ar(1,1,1,1)],this._lastRenderPosition=null,this.textArea=$f(document.createElement("textarea")),ND.write(this.textArea,6),this.textArea.setClassName("inputarea monaco-mouse-cursor-text"),this.textArea.setAttribute("wrap","off"),this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(n)),this.textArea.setAttribute("tabindex",String(n.get(112))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",$m(0,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),n.get(30)&&n.get(81)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=$f(document.createElement("div")),this.textAreaCover.setPosition("absolute");const s={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t)},r={getDataToCopy:()=>{const e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Rs),t=this._context.viewModel.model.getEOL(),i=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),n=Array.isArray(e)?e:null,o=Array.isArray(e)?e.join(t):e;let s,r=null;if(_E.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&o.length<65536){const e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(s=e.html,r=e.mode)}return{isFromEmptySelection:i,multicursorText:n,text:o,html:s,mode:r}},getScreenReaderContent:e=>{if(1===this._accessibilitySupport){if(Ho){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new mE(i,i.length,i.length,t,t)}}return mE.EMPTY}if(Hf){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new mE(i,n,n,t,t)}return mE.EMPTY}return fE.fromEditorSelection(e,s,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},a=this._register(new yE(this.textArea.domNode));this._textAreaInput=this._register(new CE(r,a,Xs,jf)),this._register(this._textAreaInput.onKeyDown((e=>{this._viewController.emitKeyDown(e)}))),this._register(this._textAreaInput.onKeyUp((e=>{this._viewController.emitKeyUp(e)}))),this._register(this._textAreaInput.onPaste((e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)}))),this._register(this._textAreaInput.onCut((()=>{this._viewController.cut()}))),this._register(this._textAreaInput.onType((e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)}))),this._register(this._textAreaInput.onSelectionChangeRequest((e=>{this._viewController.setSelection(e)}))),this._register(this._textAreaInput.onCompositionStart((e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:o}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),o=e.substring(n+1),s=o.lastIndexOf("\t"),r=o.length-s-1,a=i.getStartPosition(),l=Math.min(a.column-1,r);return{distanceToModelLineStart:a.column-1-l,widthOfHiddenTextBefore:function(e,t){if(0===e.length)return 0;const i=document.createElement("div");i.style.position="absolute",i.style.top="-50000px",i.style.width="50000px";const n=document.createElement("span");Kf(n,t),n.style.whiteSpace="pre",n.append(e),i.appendChild(n),document.body.appendChild(i);const o=n.offsetWidth;return document.body.removeChild(i),o}(o.substring(0,o.length-l),this._fontInfo)}})(),{distanceToModelLineEnd:s}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),o=-1===n?e:e.substring(0,n),s=o.indexOf("\t"),r=-1===s?o.length:o.length-s-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,qo.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new xN(this._context,i.startLineNumber,n,o,s),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName("inputarea monaco-mouse-cursor-text ime-input"),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()}))),this._register(this._textAreaInput.onCompositionUpdate((e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())}))),this._register(this._textAreaInput.onCompositionEnd((()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName("inputarea monaco-mouse-cursor-text"),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)})))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=hr('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let n=!0,o=e.column,s=!0,r=e.column,a=0;for(;a<50&&(n||s);){if(n&&o<=1&&(n=!1),n){const e=t.charCodeAt(o-2);0!==i.get(e)?n=!1:o--}if(s&&r>t.length&&(s=!1),s){const e=t.charCodeAt(r-1);0!==i.get(e)?s=!1:r++}a++}return[t.substring(o-1,r-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=hr(this._context.configuration.options.get(117));let n=e.column,o=0;for(;n>1;){const s=t.charCodeAt(n-2);if(0!==i.get(s)||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 t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Go(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){return 1===e.get(2)?$m(0,"The editor is not accessible at this time. Press {0} for options.",Vo?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===Ef.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(131);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(44),this._lineHeight=t.get(59),this._emptySelectionClipboard=t.get(32),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(112))),(e.hasChanged(30)||e.hasChanged(81))&&(t.get(30)&&t.get(81)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}prepareRender(e){this._primaryCursorPosition=new er(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea&&this._visibleTextArea.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const o=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,s=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(athis._contentWidth&&(l=this._contentWidth);const d=this._context.viewModel.getViewLineData(i.lineNumber),h=d.tokens.findTokenIndexAtOffset(i.column-1),c=h===d.tokens.findTokenIndexAtOffset(n.column-1),u=this._visibleTextArea.definePresentation(c?d.tokens.getPresentation(h):null);this.textArea.domNode.scrollTop=s*this._lineHeight,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:o,left:a,width:l,height:this._lineHeight,useCover:!1,color:(Es.getColorMap()||[])[u.foreground],italic:u.italic,bold:u.bold,underline:u.underline,strikethrough:u.strikethrough})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight)this._renderAtTopLeft();else if(Ho){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:e,width:kN?0:1,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const i=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=i*this._lineHeight}else this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:e,width:kN?0:1,height:kN?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;for(;;){if(i=e.indexOf("\n",i+1),-1===i)break;t++}return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:kN?0:1,height:kN?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Kf(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?QS.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(50)?i.setClassName("monaco-editor-background textAreaCover "+SN.OUTER_CLASS_NAME):0!==n.get(60).renderType?i.setClassName("monaco-editor-background textAreaCover "+yN.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}}function DN(e,t,i){let n=Ss(e);return-1===n&&(n=e.length),function(e,t,i){let n=0;for(let s=0;s!0,NN=()=>!1,IN=e=>" "===e||"\t"===e;class TN{constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,s=o.get(131);this.readOnly=o.get(81),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(104),this.lineHeight=o.get(59),this.pageSize=Math.max(1,Math.floor(s.height/this.lineHeight)-2),this.useTabStops=o.get(116),this.wordSeparators=o.get(117),this.emptySelectionClipboard=o.get(32),this.copyWithSyntaxHighlighting=o.get(21),this.multiCursorMergeOverlapping=o.get(69),this.multiCursorPaste=o.get(71),this.autoClosingBrackets=o.get(5),this.autoClosingQuotes=o.get(8),this.autoClosingDelete=o.get(6),this.autoClosingOvertype=o.get(7),this.autoSurround=o.get(11),this.autoIndent=o.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const r=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(r)for(const a of r)this.surroundingPairs[a.open]=a.close}static shouldRecreate(e){return e.hasChanged(131)||e.hasChanged(117)||e.hasChanged(32)||e.hasChanged(69)||e.hasChanged(71)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(116)||e.hasChanged(59)||e.hasChanged(81)}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=null===(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)||void 0===e?void 0:e.getElectricCharacters();if(t)for(const e of t)this._electricChars[e]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=f_(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return DN(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return IN;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e);case"always":return EN;case"never":return NN}}_getLanguageDefinedShouldAutoClose(e){const t=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet();return e=>-1!==t.indexOf(e)}visibleColumnFromColumn(e,t){return GD.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=GD.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(ns?s:n}}class MN{constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}static fromModelState(e){return new ON(e)}static fromViewState(e){return new AN(e)}static fromModelSelection(e){const t=ar.liftSelection(e),i=new RN(qo.fromPositions(t.getSelectionStart()),0,t.getPosition(),0);return MN.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;io,l=n>s,d=ns)continue;if(pn)continue;if(g0&&n--,BN.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),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let a=o;a<=s;a++){const i=t.getLineMaxColumn(a),o=e.visibleColumnFromColumn(t,new er(a,i));n=Math.max(n,o)}let r=i.toViewVisualColumn;return re.getLineMinColumn(t.lineNumber))return t.delta(void 0,-cr(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new er(i,e.getLineMaxColumn(i))}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),s=ZD.atomicPosition(o,t.column-1,i,0);if(-1!==s&&s+1>=n)return new er(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?$N.leftPositionAtomicSoftTabs(t,i,e.tabSize):$N.leftPosition(t,i);return new UN(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,o){let s,r;if(i.hasSelection()&&!n)s=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(o-1)),a=t.normalizePosition($N.clipPositionColumn(n,t),0),l=$N.left(e,t,a);s=l.lineNumber,r=l.column}return i.move(n,s,r,0)}static clipPositionColumn(e,t){return new er(e.lineNumber,$N.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,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),o=u?0:l-GD.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){const e=new er(i,n),s=t.normalizePosition(e,a);o+=n-s.column,i=s.lineNumber,n=s.column}return new UN(i,n,o)}static down(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i+s,r,1)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);const a=$N.down(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){const n=i.selection,o=$N.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=$N.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new RN(new qo(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new er(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i-s,r,0)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);const a=$N.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){const n=i.selection,o=$N.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=$N.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new RN(new qo(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new er(s.lineNumber,s.column),s.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&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 s=i.position.lineNumber;for(;s=h.length+1)return!1;const c=h.charAt(d.column-2),u=n.get(c);if(!u)return!1;if(FN(c)){if("never"===i)return!1}else if("never"===t)return!1;const g=h.charAt(d.column-1);let p=!1;for(const e of u)e.open===c&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t1){const e=t.getLineContent(n.lineNumber),o=Ss(e),s=-1===o?e.length+1:o+1;if(n.column<=s){const e=i.visibleColumnFromColumn(t,n),o=GD.prevIndentTabStop(e,i.indentSize),s=i.columnFromVisibleColumn(t,n.lineNumber,o);return new qo(n.lineNumber,s,n.lineNumber,n.column)}}return qo.fromPositions(KN.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=gr(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new er(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let o=null;i.sort(((e,t)=>er.compare(e.getStartPosition(),t.getEndPosition())));for(let s=0,r=i.length;s1&&(null==o?void 0:o.endLineNumber)!==e.lineNumber?(i=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,d=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,a=1,l=e.lineNumber,d=t.getLineMaxColumn(e.lineNumber));const h=new qo(i,a,l,d);o=h,h.isEmpty()?n[s]=null:n[s]=new VN(h,"")}else n[s]=null;else n[s]=new VN(r,"")}return new PN(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class qN{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}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;for(let o=i.column-2;o>=0;o--){const i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=e.length;for(let s=n;s=0;o--){const n=e.charCodeAt(o),s=t.get(n);if(1===s)return o+1;if(1===i&&2===s)return o+1;if(2===i&&0===s)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,s=i.column;1===s&&o>1&&(o-=1,s=t.getLineMaxColumn(o));let r=qN._findPreviousWordOnLine(e,t,new er(o,s));if(0===n)return new er(o,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start==1&&0===r.nextCharClass&&(r=qN._findPreviousWordOnLine(e,t,new er(o,r.start+1))),new er(o,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=qN._findPreviousWordOnLine(e,t,new er(o,r.start+1));return new er(o,r?r.start+1:1)}return r&&s<=r.end+1&&(r=qN._findPreviousWordOnLine(e,t,new er(o,r.start+1))),new er(o,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new er(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let s=t.column-1;s>1;s--){const e=o.charCodeAt(s-2),t=o.charCodeAt(s-1);if(95===e&&95!==t)return new er(i,s);if(pr(e)&&mr(t))return new er(i,s);if(mr(e)&&mr(t)&&s+1=a.start+1&&(a=qN._findNextWordOnLine(e,t,new er(o,a.end+1))),s=a?a.start+1:t.getLineMaxColumn(o);return new er(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?l=1:(a--,l=n.getLineMaxColumn(a)):(d&&l<=d.end+1&&(d=qN._findPreviousWordOnLine(i,n,new er(a,d.start+1))),d?l=d.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new qo(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new er(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 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+11?new qo(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumbere.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new qo(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;for(;i-11&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},l=qN._findPreviousWordOnLine(e,t,i);if(l&&s(l))return a(l);const d=qN._findNextWordOnLine(e,t,i);return d&&s(d)?a(d):l&&d?r(l.end+1,d.start+1):l?r(l.start+1,l.end+1):d?r(d.start+1,d.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=qN._moveWordPartLeft(e,i);return new qo(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=c.start+1&&(c=qN._findNextWordOnLine(i,n,new er(a,c.end+1))),c?l=c.start+1:lBoolean(e)))}class YN{static addCursorDown(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;st&&(i=t,n=e.model.getLineMaxColumn(i)),MN.fromModelState(new RN(new qo(s.lineNumber,1,i,n),0,new er(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumbera){const i=e.getLineCount();let n=r.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),MN.fromViewState(t.viewState.move(t.modelState.hasSelection(),n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return MN.fromModelState(t.modelState.move(t.modelState.hasSelection(),e.lineNumber,e.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return MN.fromModelState(qN.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new MN(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return MN.fromViewState(new RN(new qo(i,n,i,n),0,new er(i,n),0))}static moveTo(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new er(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return MN.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return 2===s?t.map((t=>MN.fromViewState($N.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>MN.fromModelState($N.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 5:return 2===s?t.map((t=>MN.fromViewState($N.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>MN.fromModelState($N.moveToNextBlankLine(e.cursorConfig,e.model,t.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 s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 14:{const i=[];for(let o=0,r=t.length;oi.endLineNumber-1?i.endLineNumber-1:oMN.fromViewState($N.moveLeft(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,s=t.length;oMN.fromViewState($N.moveRight(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,s=t.length;o1){if(GD.visibleColumnFromColumn(n,u+1,o)%s!=0&&e.isCheapToTokenize(h-1)){const t=bv.getEnterAction(this._opts.autoIndent,e,new qo(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)));if(t){if(d=l,t.appendText)for(let e=0,i=t.appendText.length;e1){let n;for(n=i-1;n>=1;n--){const e=t.getLineContent(n);if(xs(e)>=0)break}if(n<1)return null;const s=t.getLineMaxColumn(n),r=bv.getEnterAction(e.autoIndent,t,new qo(n,s,n,s));r&&(o=r.indentation+r.appendText)}return n&&(n===c_.Indent&&(o=nI.shiftIndent(e,o)),n===c_.Outdent&&(o=nI.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const s=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,s),n=e.indentSize,r=n-i%n;for(let e=0;ethis._compositionType(i,e,o,s,r,a)));return new PN(4,l,{shouldPushStackElementBefore:rI(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,s){if(!t.isEmpty())return null;const r=t.getPosition(),a=Math.max(1,r.column-n),l=Math.min(e.getLineMaxColumn(r.lineNumber),r.column+o),d=new qo(r.lineNumber,a,r.lineNumber,l);return e.getValueInRange(d)===i&&0===s?null:new zN(d,i,0,s)}static _typeCommand(e,t,i){return i?new HN(e,t,!0):new VN(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return nI._typeCommand(n,"\n",i);if(!t.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const o=t.getLineContent(n.startLineNumber),s=ts(o).substring(0,n.startColumn-1);return nI._typeCommand(n,"\n"+e.normalizeIndentation(s),i)}const o=bv.getEnterAction(e.autoIndent,t,n);if(o){if(o.indentAction===c_.None)return nI._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===c_.Indent)return nI._typeCommand(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===c_.IndentOutdent){const t=e.normalizeIndentation(o.indentation),s=e.normalizeIndentation(o.indentation+o.appendText),r="\n"+s+"\n"+t;return i?new HN(n,r,!0):new zN(n,r,-1,s.length-t.length,!0)}if(o.indentAction===c_.Outdent){const t=nI.unshiftIndent(e,o.indentation);return nI._typeCommand(n,"\n"+e.normalizeIndentation(t+o.appendText),i)}}const s=t.getLineContent(n.startLineNumber),r=ts(s).substring(0,n.startColumn-1);if(e.autoIndent>=4){const o=bv.getIndentForEnter(e.autoIndent,t,n,{unshiftIndent:t=>nI.unshiftIndent(e,t),shiftIndent:t=>nI.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)});if(o){let s=e.visibleColumnFromColumn(t,n.getEndPosition());const r=n.endColumn,a=t.getLineContent(n.endLineNumber),l=Ss(a);if(n=l>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,l+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new HN(n,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return r<=l+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new zN(n,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return nI._typeCommand(n,"\n"+e.normalizeIndentation(r),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;nnI.shiftIndent(e,t),unshiftIndent:t=>nI.unshiftIndent(e,t)});if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===o?nI._typeCommand(new qo(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):nI._typeCommand(new qo(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(o-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,r=i.length;s2?l.charCodeAt(a.column-2):0)&&d)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;tt.startsWith(e.open))),r=o.some((e=>t.startsWith(e.close)));return!s&&r}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let s=null;for(const r of o)if(null===s||r.open.length>s.open.length){let e=!0;for(const o of i){if(t.getValueInRange(new qo(o.lineNumber,o.column-r.open.length+1,o.lineNumber,o.column))+n!==r.open){e=!1;break}}e&&(s=r)}return s}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 s of n)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o}static _getAutoClosingPairClose(e,t,i,n,o){const s=FN(n),r=s?e.autoClosingQuotes:e.autoClosingBrackets,a=s?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;if("never"===r)return null;for(const g of i)if(!g.isEmpty())return null;const l=i.map((e=>{const t=e.getPosition();return o?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}})),d=this._findAutoClosingPairOpen(e,t,l.map((e=>new er(e.lineNumber,e.beforeColumn))),n);if(!d)return null;const h=this._findContainedAutoClosingPair(e,d),c=h?h.close:"";let u=!0;for(const g of l){const{lineNumber:i,beforeColumn:o,afterColumn:s}=g,l=t.getLineContent(i),h=l.substring(0,o-1),p=l.substring(s-1);if(p.startsWith(c)||(u=!1),p.length>0){const t=p.charAt(0);if(!nI._isBeforeClosingBrace(e,p)&&!a(t))return null}if(1===d.open.length&&("'"===n||'"'===n)&&"always"!==r){const t=hr(e.wordSeparators);if(h.length>0){const e=h.charCodeAt(h.length-1);if(0===t.get(e))return null}}if(!t.isCheapToTokenize(i))return null;t.forceTokenization(i);const m=f_(t.getLineTokens(i),o-1);if(!d.shouldAutoClose(m,o-m.firstCharOffset))return null;const f=d.findNeutralCharacter();if(f){const e=t.getTokenTypeIfInsertingCharacter(i,o,f);if(!d.isOK(e))return null}}return u?d.close.substring(0,d.close.length-c.length):d.close}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){const a=[];for(let l=0,d=n.length;lnew VN(new qo(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)));return new PN(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const a=this._getAutoClosingPairClose(t,i,o,r,!0);return null!==a?this._runAutoClosingOpenCharType(e,t,i,o,r,!0,a):null}static typeWithInterceptors(e,t,i,n,o,s,r){if(!e&&"\n"===r){const e=[];for(let t=0,s=o.length;t{const i=e.get(r_).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)})),e.addImplementation(1e3,"generic-dom-input-textarea",((e,t)=>{const i=document.activeElement;return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)})),e.addImplementation(0,"generic-dom",((e,t)=>{const i=e.get(r_).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))}))}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}!function(e){class t extends cI{constructor(e){super(e),this._minimalReveal=e.minimalReveal,this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement();e.setCursorStates(t.source,3,[YN.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&e.revealPrimaryCursor(t.source,!0,this._minimalReveal)}}e.MoveTo=dS(new t({id:"_moveTo",minimalReveal:!0,inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=dS(new t({id:"_moveToSelect",minimalReveal:!1,inSelectionMode:!0,precondition:void 0}));class i extends cI{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);e.setCursorStates(t.source,3,i.viewStates.map((e=>MN.fromViewState(e)))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source)}}e.ColumnSelect=dS(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new er(n.viewPosition.lineNumber,n.viewPosition.column),o),r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return BN.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=dS(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return BN.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=dS(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return BN.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return BN.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=dS(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=dS(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return BN.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=dS(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=dS(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends cI{constructor(){super({id:"cursorMove",precondition:void 0,description:XN.description})}runCoreEditorCommand(e,t){const i=XN.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,s._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,o=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return YN.simpleMove(e,t,i.direction,n,o,i.unit);case 11:case 13:case 12:case 14:return YN.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=s,e.CursorMove=dS(new s);class r extends cI{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,YN.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=dS(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=dS(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:1039}})),e.CursorRight=dS(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=dS(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:1041}})),e.CursorUp=dS(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=dS(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=dS(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:11}})),e.CursorPageUpSelect=dS(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:1035}})),e.CursorDown=dS(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=dS(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=dS(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:12}})),e.CursorPageDownSelect=dS(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:1036}})),e.CreateCursor=dS(new class extends cI{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let i;i=t.wholeLine?YN.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):YN.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;is&&(o=s);const r=new qo(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case pI.RawAtArgument.Top:a=3;break;case pI.RawAtArgument.Center:a=1;break;case pI.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends _I{constructor(){super(CS)}runDOMCommand(){Rf&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[YN.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=dS(new class extends cI{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[MN.fromModelSelection(t.selection)])}})}(fI||(fI={}));const vI=ry.and(dI.textInputFocus,dI.columnSelection);function bI(e,t){Jy.registerKeybindingRule({id:e,primary:t,when:vI,weight:1})}function CI(e){return e.register(),e}var wI,yI;bI(fI.CursorColumnSelectLeft.id,1039),bI(fI.CursorColumnSelectRight.id,1041),bI(fI.CursorColumnSelectUp.id,1040),bI(fI.CursorColumnSelectPageUp.id,1035),bI(fI.CursorColumnSelectDown.id,1042),bI(fI.CursorColumnSelectPageDown.id,1036),function(e){class t extends sS{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=dS(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:dI.writable,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,nI.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection))))}}),e.Outdent=dS(new class extends t{constructor(){super({id:"outdent",precondition:dI.writable,kbOpts:{weight:0,kbExpr:ry.and(dI.editorTextFocus,dI.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,nI.outdent(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.Tab=dS(new class extends t{constructor(){super({id:"tab",precondition:dI.writable,kbOpts:{weight:0,kbExpr:ry.and(dI.editorTextFocus,dI.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,nI.tab(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.DeleteLeft=dS(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=KN.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=dS(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:dI.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=KN.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends _I{constructor(){super(vS)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(81))return t.getModel().undo()}},e.Redo=new class extends _I{constructor(){super(bS)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(81))return t.getModel().redo()}}}(wI||(wI={}));class SI extends iS{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(r_).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function xI(e,t){CI(new SI("default:"+e,e)),CI(new SI(e,e,t))}xI("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),xI("replacePreviousChar"),xI("compositionType"),xI("compositionStart"),xI("compositionEnd"),xI("paste"),xI("cut");class kI{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){fI.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){fI.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){fI.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),fI.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),fI.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){fI.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){fI.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){fI.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){fI.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){fI.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){fI.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){fI.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){fI.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){fI.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 LI{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown&&this.onKeyDown(e)}emitKeyUp(e){this.onKeyUp&&this.onKeyUp(e)}emitContextMenu(e){this.onContextMenu&&this.onContextMenu(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove&&this.onMouseMove(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave&&this.onMouseLeave(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown&&this.onMouseDown(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp&&this.onMouseUp(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag&&this.onMouseDrag(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop&&this.onMouseDrop(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled&&this.onMouseDropCanceled()}emitMouseWheel(e){this.onMouseWheel&&this.onMouseWheel(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return LI.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),i}}class DI{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let o=0,s=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===s?(o=i,s=1):s++)}if(e=i&&s<=n&&(this._lines[s-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(0===this.getCount())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 s=[];for(let h=0;hi)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class EI{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new DI((()=>this._host.createVisibleLine()))}_createDomNode(){const e=$f(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(131)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;it){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let a=t;a<=i;a++){const e=s+a;r[a].layoutLine(e,n[e-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let a=t;a<=i;a++)s[r++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;r--){const t=e.lines[r];n[r]&&(t.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");NI._ttPolicy&&(t=NI._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;oe}),NI._sb=P_(1e5);class II extends ED{constructor(e){super(e),this._visibleLines=new EI(this),this.domNode=this._visibleLines.domNode,this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ee.shouldRender()));for(let i=0,n=t.length;i'),n.appendASCIIString(o),n.appendASCIIString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class MI extends II{constructor(e){super(e);const t=this._context.configuration.options.get(131);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(131);return this._contentWidth=t.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 OI extends II{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(131);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Kf(this.domNode,t.get(44))}onConfigurationChanged(e){const t=this._context.configuration.options;Kf(this.domNode,t.get(44));const i=t.get(131);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 AI{constructor(e,t){this._coordinateBrand=void 0,this.top=e,this.left=t}}class RI extends ED{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=$f(document.createElement("div")),ND.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=$f(document.createElement("div")),ND.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onLineMappingChanged(e);return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}addWidget(e){const t=new PI(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i){this._widgets[e.getId()].setPosition(t,i),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.parentNode.removeChild(i),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class PI{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=$f(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,o=n.get(131);this._fixedOverflowWidgets=n.get(36),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(59),this._range=null,this._viewRange=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(59),e.hasChanged(131)){const e=t.get(131);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}onLineMappingChanged(e){this._setPosition(this._range)}_setPosition(e){if(this._range=e,this._viewRange=null,this._range){const e=this._context.viewModel.model.validateRange(this._range);(this._context.viewModel.coordinatesConverter.modelPositionIsVisible(e.getStartPosition())||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(e.getEndPosition()))&&(this._viewRange=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(e))}}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.offsetWidth||document.body.offsetWidth:this._contentWidth}setPosition(e,t){this._setPosition(e),this._preference=t,this._viewRange&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n,o){const s=e.top,r=s,a=t.top+this._lineHeight,l=s-n,d=r>=n,h=a,c=o.viewportHeight-a>=n;let u=e.left,g=t.left;return u+i>o.scrollLeft+o.viewportWidth&&(u=o.scrollLeft+o.viewportWidth-i),g+i>o.scrollLeft+o.viewportWidth&&(g=o.scrollLeft+o.viewportWidth-i),us){const e=r-(s-n);r-=e,i-=e}if(r=22,f=d+n<=h.height-22;return this._fixedOverflowWidgets?{fitsAbove:m,aboveTop:Math.max(l,22),aboveLeft:u,fitsBelow:f,belowTop:d,belowLeft:p}:{fitsAbove:m,aboveTop:s,aboveLeft:c,fitsBelow:f,belowTop:r,belowLeft:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new AI(e.top,e.left+this._contentLeft)}_getTopAndBottomLeft(e){if(!this._viewRange)return[null,null];const t=e.linesVisibleRangesForRange(this._viewRange,!1);if(!t||0===t.length)return[null,null];let i=t[0],n=t[0];for(const d of t)d.lineNumbern.lineNumber&&(n=d);let o=1073741824;for(const d of i.ranges)d.lefte.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&FI(this._actual.afterRender,this._actual,null));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),"function"==typeof this._actual.afterRender&&FI(this._actual.afterRender,this._actual,this._renderData.position)}}function FI(e,t,...i){try{return e.call(t,...i)}catch(n){return null}}class BI extends LE{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(131);this._lineHeight=t.get(59),this._renderLineHighlight=t.get(85),this._renderLineHighlightOnlyWhenFocus=t.get(86),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ar(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map((e=>e.positionLineNumber));t.sort(((e,t)=>e-t)),jo(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every((e=>e.isEmpty()));return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(131);return this._lineHeight=t.get(59),this._renderLineHighlight=t.get(85),this._renderLineHighlightOnlyWhenFocus=t.get(86),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)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const r=[];for(let a=i;a<=n;a++){const e=a-i;for(;s=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class VI extends BI{_renderOne(e){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class WI extends BI{_renderOne(e){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}zy(((e,t)=>{const i=e.getColor(DE);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(EE)){const i=e.getColor(EE);i&&(t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),"hc"===e.type&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}}));class HI extends LE{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=t.get(44).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=t.get(44).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 a=0,l=t.length;a{if(e.options.zIndext.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return in?1:qo.compareRangesUsingStarts(e.range,t.range)}));const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let a=o;a<=s;a++){r[a-o]=""}this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',l=Math.max(e.range.startLineNumber,o),d=Math.min(e.range.endLineNumber,s);for(let t=l;t<=d;t++){i[t-o]+=a}}}_renderNormalDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber;let s=null,r=!1,a=null;for(let l=0,d=t.length;l';r[t]+=a}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class zI extends Uo{onclick(e,t){this._register(BC(e,yw.CLICK,(e=>t(new EC(e)))))}onmousedown(e,t){this._register(BC(e,yw.MOUSE_DOWN,(e=>t(new EC(e)))))}onmouseover(e,t){this._register(BC(e,yw.MOUSE_OVER,(e=>t(new EC(e)))))}onnonbubblingmouseout(e,t){this._register(jC(e,(e=>t(new EC(e)))))}onkeydown(e,t){this._register(BC(e,yw.KEY_DOWN,(e=>t(new SC(e)))))}onkeyup(e,t){this._register(BC(e,yw.KEY_UP,(e=>t(new SC(e)))))}oninput(e,t){this._register(BC(e,yw.INPUT,t))}onblur(e,t){this._register(BC(e,yw.BLUR,t))}onfocus(e,t){this._register(BC(e,yw.FOCUS,t))}ignoreGesture(e){$S.ignoreTarget(e)}}class jI extends zI{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",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...e.icon.classNamesArray),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new qS),this.onmousedown(this.bgDomNode,(e=>this._arrowMouseDown(e))),this.onmousedown(this.domNode,(e=>this._arrowMouseDown(e))),this._mousedownRepeatTimer=this._register(new Wv),this._mousedownScheduleRepeatTimer=this._register(new Vv)}_arrowMouseDown(e){this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet((()=>{this._mousedownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24)}),200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,KS,(e=>{}),(()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()})),e.preventDefault()}}class UI extends Uo{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 Vv)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||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(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{this._domNode&&this._domNode.setClassName(this._visibleClassName)}),0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode&&this._domNode.setClassName(this._invisibleClassName+(e?" fade":"")))}}class $I extends zI{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 UI(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new qS),this._shouldRender=!0,this.domNode=$f(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this.onmousedown(this.domNode.domNode,(e=>this._domNodeMouseDown(e)))}_createArrow(e){const t=this._register(new jI(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=$f(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this.onmousedown(this.slider.domNode,(e=>{e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(()=>{})))})),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.stopPropagation()}))}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodeMouseDown(e){e.target===this.domNode.domNode&&this._onMouseDown(e)}delegateMouseDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderMousePosition(e);i<=o&&o<=n?e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(()=>{}))):this._onMouseDown(e)}_onMouseDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.browserEvent.offsetX&&"number"==typeof e.browserEvent.offsetY)t=e.browserEvent.offsetX,i=e.browserEvent.offsetY;else{const n=nw(this.domNode.domNode);t=e.posx-n.left,i=e.posy-n.top}const n=this._mouseDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(()=>{})))}_sliderMouseDown(e,t){const i=this._sliderMousePosition(e),n=this._sliderOrthogonalMousePosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,KS,(e=>{const t=this._sliderOrthogonalMousePosition(e),s=Math.abs(t-n);if(Rs&&s>140)return void this._setDesiredScrollPositionNow(o.getScrollPosition());const r=this._sliderMousePosition(e)-i;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(r))}),(()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd(),t()})),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}class KI{constructor(e,t,i,n,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new KI(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)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,o){const s=Math.max(0,i-e),r=Math.max(0,s-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),d=(r-l)/(n-i),h=o*d;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){const e=KI._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 NC(null,1,0))}),this._createArrow({className:"scra",icon:br.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new NC(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return e}_sliderMousePosition(e){return e.posx}_sliderOrthogonalMousePosition(e){return e.posy}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class GI extends $I{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new KI(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-11)/2,i=(t.verticalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:br.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new NC(null,0,1))}),this._createArrow({className:"scra",icon:br.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new NC(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return t}_sliderMousePosition(e){return e.posy}_sliderOrthogonalMousePosition(e){return e.posx}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class ZI{constructor(e,t,i,n,o,s,r){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,o|=0,s|=0,r|=0),this.rawScrollLeft=n,this.rawScrollTop=r,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),o<0&&(o=0),r+o>s&&(r=s-o),r<0&&(r=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=o,this.scrollHeight=s,this.scrollTop=r}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 ZI(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new ZI(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=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:s,scrollHeightChanged:r,scrollTopChanged:a}}}class YI extends Uo{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 ZI(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){const i=this._state.withScrollDimensions(e,t);this._setState(i,Boolean(this._smoothScrolling)),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new JI(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=JI.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class XI{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function QI(e,t){const i=t-e;return function(t){return e+i*(1-function(e){return Math.pow(e,3)}(1-t))}}class JI{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,a;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return(-1!==this._front||-1!==this._rear)&&this._memory[this._rear],this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}tT.INSTANCE=new tT;class iT extends zI{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=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,Ho&&(t.className+=" mac");return t}(t),this._scrollable=i,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new GI(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new qI(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=$f(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=$f(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=$f(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,(e=>this._onMouseOver(e))),this.onnonbubblingmouseout(this._listenOnDomNode,(e=>this._onMouseOut(e))),this._hideTimeout=this._register(new Vv),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=bs(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarMouseDown(e){this._verticalScrollbar.delegateMouseDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ho&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=bs(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new NC(e))};this._mouseWheelToDispose.push(BC(this._listenOnDomNode,yw.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){const t=tT.INSTANCE;{const i=window.devicePixelRatio/Of();Rs||Vo?t.accept(Date.now(),e.deltaX/i,e.deltaY/i):t.accept(Date.now(),e.deltaX,e.deltaY)}let i=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(n)>=Math.abs(o)?o=0:n=0),this._options.flipAxes&&([n,o]=[o,n]);const s=!Ho&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!s||o||(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(n){const e=50*n,t=r.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,t)}if(o){const e=50*o,t=r.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}if(a=this._scrollable.validateScrollPosition(a),r.scrollLeft!==a.scrollLeft||r.scrollTop!==a.scrollTop){this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),i=!0}}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(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":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseOut(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((()=>this._hide()),500)}}class nT extends iT{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new YI({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>KC(e)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class oT extends iT{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 sT extends iT{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new YI({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>KC(e)});super(e,t,i),this._register(i),this._element=e,this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.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})}}class rT extends ED{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(92),r=o.get(67),a=o.get(34),l=o.get(95),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+Vy(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new oT(t.domNode,d,this._context.viewLayout.getScrollable())),ND.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=$f(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const h=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(BC(i.domNode,"scroll",(e=>h(i.domNode,!0,!0)))),this._register(BC(t.domNode,"scroll",(e=>h(t.domNode,!0,!1)))),this._register(BC(n.domNode,"scroll",(e=>h(n.domNode,!0,!1)))),this._register(BC(this.scrollbarDomNode.domNode,"scroll",(e=>h(this.scrollbarDomNode.domNode,!0,!1))))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(131);this.scrollbarDomNode.setLeft(t.contentLeft);"right"===e.get(65).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarMouseDown(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)}onConfigurationChanged(e){if(e.hasChanged(92)||e.hasChanged(67)||e.hasChanged(34)){const e=this._context.configuration.options,t=e.get(92),i=e.get(67),n=e.get(34),o=e.get(95),s={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(131)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+Vy(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}zy(((e,t)=>{const i=e.getColor(Vx);i&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tbox-shadow: ${i} 0 6px 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tbox-shadow: ${i} 6px 0 6px -6px inset;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\tbox-shadow: ${i} 6px 6px 6px -6px inset;\n\t\t\t}\n\t\t`);const n=e.getColor(Wx);n&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\tbackground: ${n};\n\t\t\t}\n\t\t`);const o=e.getColor(Hx);o&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\tbackground: ${o};\n\t\t\t}\n\t\t`);const s=e.getColor(zx);s&&t.addRule(`\n\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\tbackground: ${s};\n\t\t\t}\n\t\t`)}));class aT{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class lT extends LE{_render(e,t,i){const n=[];for(let r=e;r<=t;r++){n[r-e]=[]}if(0===i.length)return n;i.sort(((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className',r=[];for(let a=t;a<=i;a++){const e=a-t,i=n[e];0===i.length?r[e]="":r[e]='
=this._renderResult.length?"":this._renderResult[i]}}var hT,cT;function uT(e,t){let i=0,n=0;const o=e.length;for(;nn)throw new Error("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,d=-1;const h=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,d=-1;for(let t=e;t=0){l=t,d=e;break}}}};let c=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===c){c=-1,u=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){c=t,u=e;break}}}if(-1!==g&&(-2===g||g=0){g=t,p=e;break}}}};let f=0,_=!0,v=0,b=!0,C=0,w=0;for(let y=0;_||b;y++){const o=e-y,r=e+y;y>1&&(o<1||o1&&(r>n||r>i)&&(b=!1),y>5e4&&(_=!1,b=!1);let g=-1;if(_&&o>=1){const e=this._computeIndentLevel(o-1);e>=0?(l=o-1,d=e,g=Math.ceil(e/this.textModel.getOptions().indentSize)):(h(o),g=this._getIndentLevelForWhitespaceLine(s,a,d))}let S=-1;if(b&&r<=n){const e=this._computeIndentLevel(r-1);e>=0?(c=r-1,u=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(m(r),S=this._getIndentLevelForWhitespaceLine(s,u,p))}if(0!==y){if(1===y){if(r<=n&&S>=0&&w+1===S){_=!1,f=r,v=r,C=S;continue}if(o>=1&&g>=0&&g-1===w){b=!1,f=o,v=o,C=g;continue}if(f=e,v=e,C=w,0===C)return{startLineNumber:f,endLineNumber:v,indent:C}}_&&(g>=C?f=o:_=!1),b&&(S>=C?v=r:b=!1)}else w=g}return{startLineNumber:f,endLineNumber:v,indent:C}}getLinesBracketGuides(e,t,i,n){var o,s,r,a,l;const d=[],h=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new qo(e,1,t,this.textModel.getLineMaxColumn(t)));let c;if(i&&h.length>0){const n=e<=i.lineNumber&&i.lineNumber<=t?h.filter((e=>qo.strictContainsPosition(e.range,i))):this.textModel.bracketPairs.getBracketPairsInRange(qo.fromPositions(i));c=null===(o=Cr(n,(e=>e.range.startLineNumber!==e.range.endLineNumber)))||void 0===o?void 0:o.range}const u=new wr(h),g=new Array,p=new Array,m=new fT;for(let f=e;f<=t;f++){let e=new Array;p.length>0&&(e=e.concat(p),p.length=0),d.push(e);for(const i of u.takeWhile((e=>e.openingBracketRange.startLineNumber<=f))||[]){if(i.range.startLineNumber===i.range.endLineNumber)continue;const e=Math.min(this.getVisibleColumnFromPosition(i.openingBracketRange.getStartPosition()),this.getVisibleColumnFromPosition(null!==(r=null===(s=i.closingBracketRange)||void 0===s?void 0:s.getStartPosition())&&void 0!==r?r:i.range.getEndPosition()),i.minVisibleColumnIndentation+1);let t=!1;if(i.closingBracketRange){Ss(this.textModel.getLineContent(i.closingBracketRange.startLineNumber))=0;i--){const o=g[i];if(!o)continue;const s=n.highlightActive&&c&&o.bracketPair.range.equalsRange(c),r=m.getInlineClassNameOfLevel(o.nestingLevel)+(s?" "+m.activeClassName:"");(s||n.includeInactive)&&o.renderHorizontalEndLineAtTheBottom&&o.end.lineNumber===f+1&&p.push(new gT(o.guideVisibleColumn,r,null)),o.end.lineNumber<=f||o.start.lineNumber>=f||(o.guideVisibleColumn>=t&&!s||(t=o.guideVisibleColumn,(s||n.includeInactive)&&e.push(new gT(o.guideVisibleColumn,r,null))))}e.sort(((e,t)=>e.visibleColumn-t.visibleColumn))}return d}getVisibleColumnFromPosition(e){return GD.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,s=Boolean(o&&o.offSide),r=new Array(t-e+1);let a=-2,l=-1,d=-2,h=-1;for(let c=e;c<=t;c++){const t=c-e,o=this._computeIndentLevel(c-1);if(o>=0)a=c-1,l=o,r[t]=Math.ceil(o/n.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=c-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==d&&(-2===d||d=0){d=e,h=t;break}}}r[t]=this._getIndentLevelForWhitespaceLine(s,l,h)}}return r}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return-1===t||-1===i?0:ta||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const s=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(null!==(o=null===(n=e.visibleRangeForPosition(new er(u,t.horizontalLine.endColumn)))||void 0===n?void 0:n.left)&&void 0!==o?o:i+this._spaceWidth)-i:this._spaceWidth;g+=`
`}c[r]=g}this._renderResult=c}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?hT.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?hT.EnabledForActive:hT.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,r=0,a=0;if(this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);s=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let h=e;h<=t;h++){const t=new Array;d.push(t);const i=n?n[h-e]:[],c=new wr(i),u=o?o[h-e]:[];for(let e=1;e<=u;e++){const n=(e-1)*l+1,o=0===i.length&&s<=h&&h<=r&&e===a;t.push(...c.takeWhile((e=>e.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 vT(e){if(!e||!e.isTransparent())return e}zy(((e,t)=>{const i=e.getColor(PE);i&&t.addRule(`.monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 ${i} inset; }`);const n=e.getColor(FE)||i;n&&t.addRule(`.monaco-editor .lines-content .core-guide-indent-active { box-shadow: 1px 0 0 0 ${n} inset; }`);const o=[{bracketColor:nN,guideColor:hN,guideColorActive:fN},{bracketColor:oN,guideColor:cN,guideColorActive:_N},{bracketColor:sN,guideColor:uN,guideColorActive:vN},{bracketColor:rN,guideColor:gN,guideColorActive:bN},{bracketColor:aN,guideColor:pN,guideColorActive:CN},{bracketColor:lN,guideColor:mN,guideColorActive:wN}],s=new fT,r=o.map((t=>{var i,n;const o=e.getColor(t.bracketColor),s=e.getColor(t.guideColor),r=e.getColor(t.guideColorActive),a=vT(null!==(i=vT(s))&&void 0!==i?i:null==o?void 0:o.transparent(.3)),l=vT(null!==(n=vT(r))&&void 0!==n?n:o);if(a&&l)return{guideColor:a,guideColorActive:l}})).filter(yr);if(r.length>0){for(let e=0;e<30;e++){const i=r[e%r.length];t.addRule(`.monaco-editor .${s.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${s.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${s.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${s.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}}));class bT{constructor(){this._currentVisibleRange=new qo(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class CT{constructor(e,t,i,n,o,s,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class wT{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 s=t[0].startLineNumber,r=t[0].endLineNumber;for(let a=1,l=t.length;a{this._updateLineWidthsSlow()}),200),this._asyncCheckMonospaceFontAssumptions=new Hv((()=>{this._checkMonospaceFontAssumptions()}),2e3),this._lastRenderedData=new bT,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new HD(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(132)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(44),n=t.get(132),o=t.get(131);return this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(89),this._horizontalScrollbarHeight=o.horizontalScrollbarHeight,this._cursorSurroundingLines=t.get(25),this._cursorSurroundingLinesStyle=t.get(26),this._canUseLayerHinting=!t.get(28),Kf(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(131)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new WD(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++){this._visibleLines.getVisibleLine(t).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 e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).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(-1===t)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 CT(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 wT(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!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(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new er(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(ns)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(n,e,t);const a=this._context.viewModel.getLineMinColumn(n);return ri?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=qo.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let o=[],s=0;const r=new VD(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new er(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let h=n.startLineNumber;h<=n.endLineNumber;h++){if(hd)continue;const e=h===n.startLineNumber?n.startColumn:1,c=h===n.endLineNumber?n.endColumn:this._context.viewModel.getLineMaxColumn(h),u=this._visibleLines.getVisibleLine(h).getVisibleRangesForRange(h,e,c,r);if(u){if(t&&hthis._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,new VD(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new AD(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth()):o=!1}return o&&1===t&&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 i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth();n>t&&(t=n,e=o)}}if(-1!==e&&!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 t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),Vo&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++){if(this._visibleLines.getVisibleLine(i).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 e=o[0].startLineNumber,t=o[0].endLineNumber;for(let i=1,n=o.length;ia){if(!d)return-1;u=h}else if(5===s||6===s)if(6===s&&r<=h&&c<=l)u=r;else{const e=h-Math.max(5*this._lineHeight,.2*a),t=c-a;u=Math.max(t,e)}else if(1===s||2===s)if(2===s&&r<=h&&c<=l)u=r;else{const e=(h+c)/2;u=Math.max(0,e-a/2)}else u=this._computeMinimumScrolling(r,l,h,c,3===s,4===s);return u}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=t.left,n=i+t.width;let o=1073741824,s=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)o=Math.min(o,Math.round(e.left)),s=Math.max(s,Math.round(e.left+e.width))}else for(const r of e.selections){if(r.startLineNumber!==r.endLineNumber)return null;const e=this._visibleRangesForLineRange(r.startLineNumber,r.startColumn,r.endColumn);if(!e)return null;for(const t of e.ranges)o=Math.min(o,Math.round(t.left)),s=Math.max(s,Math.round(t.left+t.width))}if(e.minimalReveal||(o=Math.max(0,o-yT.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding),"selections"===e.type&&s-o>t.width)return null;return{scrollLeft:this._computeMinimumScrolling(i,n,o,s),maxHorizontalOffset:s}}_computeMinimumScrolling(e,t,i,n,o,s){o=!!o,s=!!s;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)t?Math.max(0,n-r):e:i}}yT.HORIZONTAL_EXTRA_PX=30;class ST extends lT{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(131);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,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.get(131);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let o=0,s=t.length;o
',s=[];for(let r=t;r<=i;r++){const e=r-t,i=n[e];let a="";for(let t=0,n=i.length;t';o[e]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class kT{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=kT._clamp(e),this.g=kT._clamp(t),this.b=kT._clamp(i),this.a=kT._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:0|e}}kT.Empty=new kT(0,0,0,0);class LT extends Uo{constructor(){super(),this._onDidChange=new $o,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Es.onDidChange((e=>{e.changedColorMap&&this._updateColorMap()})))}static getInstance(){return this._INSTANCE||(this._INSTANCE=Sr(new LT)),this._INSTANCE}_updateColorMap(){const e=Es.getColorMap();if(!e)return this._colors=[kT.Empty],void(this._backgroundIsLight=!0);this._colors=[kT.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}}LT._INSTANCE=null;const DT=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();class ET{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=ET.soften(e,.8),this.charDataLight=ET.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)return;const p=d?this.charDataLight:this.charDataNormal,m=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,l),f=4*e.width,_=r.r,v=r.g,b=r.b,C=o.r-_,w=o.g-v,y=o.b-b,S=Math.max(s,a),x=e.data;let k=m*c*u,L=i*f+4*t;for(let D=0;De.width||i+h>e.height)return;const c=4*e.width,u=o/255*.5,g=s.r,p=s.g,m=s.b,f=g+(n.r-g)*u,_=p+(n.g-p)*u,v=m+(n.b-m)*u,b=Math.max(o,r),C=e.data;let w=i*c+4*t;for(let y=0;y{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i>1]=NT[e[i]]<<4|15&NT[e[i+1]];return t},TT={1:kr((()=>IT("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792"))),2:kr((()=>IT("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")))};class MT{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=TT[e]?new ET(TT[e](),e):MT.createFromSampleData(MT.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=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const o of DT)i.fillText(String.fromCharCode(o),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const i=MT._downsample(e,t);return new ET(i,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let d=0;d0){const e=255/a;for(let t=0;tMT.create(this.fontScale,a.fontFamily))),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=OT._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=OT._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(QL);return i?new kT(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(JL);return t?kT._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.showSlider===e.showSlider&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class AT{constructor(e,t,i,n,o,s,r,a){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=s,this.startLineNumber=r,this.endLineNumber=a}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}static create(e,t,i,n,o,s,r,a,l,d,h){const c=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){const t=a*e.lineHeight+(e.scrollBeyondLastLine?o-e.lineHeight:0),i=Math.max(1,Math.floor(o*o/t)),n=Math.max(0,e.minimapHeight-i),s=n/(d-o),h=l*s,c=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new AT(l,d,c,s,h,i,1,Math.min(r,u))}let m,f;if(s&&i!==r){const e=i-t+1;m=Math.floor(e*u/c)}else{const e=o/p;m=Math.floor(e*u/c)}f=e.scrollBeyondLastLine?(r-1)*u/c:Math.max(0,r*u/c-m),f=Math.min(e.minimapHeight-m,f);const _=f/(d-o),v=l*_;let b=0;if(e.scrollBeyondLastLine){b=o/p-1}if(g>=r+b){return new AT(l,d,f>0,_,v,m,1,r)}{let e=Math.max(1,Math.floor(t-v*c/u));h&&h.scrollHeight===d&&(h.scrollTop>l&&(e=Math.min(e,h.startLineNumber)),h.scrollTopRT.INVALID)),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let i=0,n=t.length;i1){for(let t=0,i=r-1;t0&&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=Boolean(this._samplingState),[t,i]=BT.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()}}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,s=t-e+1;o{e.preventDefault();if(0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(e.leftButton&&this._lastRenderData){const t=nw(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e.buttons,e.posx,i,e.posy,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.browserEvent.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)})),this._sliderMouseMoveMonitor=new qS,this._sliderMouseDownListener=WC(this._slider.domNode,"mousedown",(e=>{e.preventDefault(),e.stopPropagation(),e.leftButton&&this._lastRenderData&&this._startSliderDragging(e.buttons,e.posx,e.posy,e.posy,this._lastRenderData.renderedLayout)})),this._gestureDisposable=$S.addTarget(this._domNode.domNode),this._sliderTouchStartListener=BC(this._domNode.domNode,WS.Start,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))}),{passive:!1}),this._sliderTouchMoveListener=BC(this._domNode.domNode,WS.Change,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)}),{passive:!1}),this._sliderTouchEndListener=WC(this._domNode.domNode,WS.End,(e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)}))}_startSliderDragging(e,t,i,n,o){this._slider.toggleClassName("active",!0);const s=(e,n)=>{const s=Math.abs(n-t);if(Rs&&s>140)return void this._model.setScrollTop(o.scrollTop);const r=e-i;this._model.setScrollTop(o.getDesiredScrollTopFromDelta(r))};n!==i&&s(n,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,KS,(e=>s(e.posy,e.posx)),(()=>{this._slider.toggleClassName("active",!1)}))}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){return"always"===this._model.options.showSlider?"minimap slider-always":"minimap slider-mouseover"}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new FT(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)}onLinesDeleted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(ZL),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=AT.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(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(qo.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort(((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0)));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const d=new HT(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,s),this._renderDecorationsLineHighlights(l,i,d,e,s);const h=new HT(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,h,e,s,a,r,n),this._renderDecorationsHighlights(l,i,h,e,s,a,r,n)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,r=0;for(const a of t){const t=Math.max(n.startLineNumber,a.startLineNumber),l=Math.min(n.endLineNumber,a.endLineNumber);if(t>l)continue;for(let e=t;e<=l;e++)i.set(e,!0);const d=(t-n.startLineNumber)*o,h=(l-n.startLineNumber)*o+o;r>=d||(r>s&&e.fillRect(8,s,e.canvas.width,r-s),s=d),r=h}r>s&&e.fillRect(8,s,e.canvas.width,r-s)}_renderDecorationsLineHighlights(e,t,i,n,o){const s=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||l.position!==Lr.Inline)continue;const d=Math.max(n.startLineNumber,a.range.startLineNumber),h=Math.min(n.endLineNumber,a.range.endLineNumber);if(d>h)continue;const c=l.getColor(this._theme.value);if(!c||c.isTransparent())continue;let u=s.get(c.toString());u||(u=c.transparent(.5).toString(),s.set(c.toString(),u)),e.fillStyle=u;for(let t=d;t<=h;t++){if(i.has(t))continue;i.set(t,!0);const s=(d-n.startLineNumber)*o;e.fillRect(8,s,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,s,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=Math.max(n.startLineNumber,l.startLineNumber),d=Math.min(n.endLineNumber,l.endLineNumber);if(!(t>d))for(let h=t;h<=d;h++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,h,o,o,s,r,a)}}_renderDecorationsHighlights(e,t,i,n,o,s,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const d=Math.max(n.startLineNumber,l.range.startLineNumber),h=Math.min(n.endLineNumber,l.range.endLineNumber);if(d>h)continue;const c=t.getColor(this._theme.value);if(c&&!c.isTransparent())for(let u=d;u<=h;u++)switch(t.position){case Lr.Inline:this.renderDecorationOnLine(e,i,l.range,c,n,u,o,o,s,r,a);continue;case Lr.Gutter:{const t=(u-n.startLineNumber)*o,i=2;this.renderDecoration(e,c,i,t,2,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,s,r,a,l,d,h){const c=(s-o.startLineNumber)*a;if(c+r<0||c>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,p=u===s?i.startColumn:1,m=g===s?i.endColumn:this._model.getLineMaxColumn(s),f=this.getXOffsetForPosition(t,s,p,l,d,h),_=this.getXOffsetForPosition(t,s,m,l,d,h);this.renderDecoration(e,n,f,c,_-f,r)}getXOffsetForPosition(e,t,i,n,o,s){if(1===i)return 8;if((i-1)*o>=s)return s;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[8];let a=8;for(let e=1;e=s){r[e]=s;break}r[e]=l,a=l}e.set(t,r)}return i-1b?Math.floor((n-b)/2):0,w=c.a/255,y=new kT(Math.round((c.r-h.r)*w+h.r),Math.round((c.g-h.g)*w+h.g),Math.round((c.b-h.b)*w+h.b),255);let S=0;const x=[];for(let D=0,E=i-t+1;D=0&&i_)return;const r=m.charCodeAt(C);if(9===r){const e=c-(C+w)%c;w+=e-1,b+=e*s}else if(32===r)b+=s;else{const c=ks(r)?2:1;for(let u=0;u_)return}}}}}class HT{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]}}zy(((e,t)=>{const i=e.getColor(eD);i&&t.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${i}; }`);const n=e.getColor(tD);n&&t.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${n}; }`);const o=e.getColor(iD);o&&t.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${o}; }`);const s=e.getColor(Vx);s&&t.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${s} -6px 0 6px -6px inset; }`)}));class zT extends ED{constructor(e){super(e);const t=this._context.configuration.options.get(131);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=$f(document.createElement("div")),ND.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(131);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=$f(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference!==t&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let i=0,n=t.length;i=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e+t;return[[0,e,s,e,e+t+o,e,s,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class UT extends ED{constructor(e){super(e),this._domNode=$f(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=Es.onDidChange((e=>{e.changedColorMap&&this._updateSettings(!0)})),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new jT(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;tt&&(e=t-a),_=e-a,v=e+a}_>p+1||e!==u?(0!==c&&l.fillRect(d[u],g,h[u],p-g),u=e,g=_,p=v):v>p&&(p=v)}l.fillRect(d[u],g,h[u],p-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,i=e/2|0,s=this._settings.x[7],r=this._settings.w[7];l.fillStyle=this._settings.cursorColor;let a=-100,d=-100;for(let h=0,c=this._cursorPositions.length;ht&&(u=t-i);const g=u-i,p=g+e;g>d+1?(0!==h&&l.fillRect(s,a,r,d-a),a=g,d=p):p>d&&(d=p)}l.fillRect(s,a,r,d-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(l.beginPath(),l.lineWidth=1,l.strokeStyle=this._settings.borderColor,l.moveTo(0,0),l.lineTo(0,t),l.stroke(),l.moveTo(0,0),l.lineTo(e,0),l.stroke())}}class $T{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}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 KT{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&&(u=i-g);const p=a.color;let m=this._color2Id[p];m||(m=++this._lastAssignedId,this._color2Id[p]=m,this._id2Color[m]=p);const f=new $T(u-g,u+g,m);a.setColorZone(f),s.push(f)}return this._colorZonesInvalid=!1,s.sort($T.compare),s}}class GT extends DD{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=$f(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new qT((e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e))),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(59)),this._zoneManager.setPixelRatio(i.get(129)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(59)&&(this._zoneManager.setLineHeight(t.get(59)),this._render()),e.hasChanged(129)&&(this._zoneManager.setPixelRatio(t.get(129)),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(0===this._zoneManager.getOuterHeight())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,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,d=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=d):r>=l?r=Math.max(r,d):(e.fillRect(0,s,n,r-s),s=l,r=d)}e.fillRect(0,s,n,r-s)}}class ZT extends ED{constructor(e){super(e),this.domNode=$f(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(91),this._typicalHalfwidthCharacterWidth=t.get(44).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(91),this._typicalHalfwidthCharacterWidth=t.get(44).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 e=$f(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t{const i=e.getColor(HE);i&&t.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${i} inset; }`)}));class YT extends ED{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(92);this._useShadows=t.useShadows,this._domNode=$f(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(131);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(92);return this._useShadows=t.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":"")}}zy(((e,t)=>{const i=e.getColor(Vx);i&&t.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${i} 0 6px 6px -6px inset; }`)}));class XT{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class QT{constructor(e,t){this.lineNumber=e,this.ranges=t}}function JT(e){return new XT(e)}function eM(e){return new QT(e.lineNumber,e.ranges.map(JT))}class tM extends LE{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(59),this._roundedSelection=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(44).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(59),this._roundedSelection=t.get(90),this._typicalHalfwidthCharacterWidth=t.get(44).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,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let r=0,a=t.length;r0){const e=t[r-1].ranges[0].left,o=t[r-1].ranges[0].left+t[r-1].ranges[0].width;iM(i-e)e&&(d.top=1),iM(l-o)'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const o=!!n[0].ranges[0].startStyle,s=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let d=0,h=n.length;d1,r)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map((([e,t])=>e+t))}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function iM(e){return e<0?-e:e}tM.SELECTION_CLASS_NAME="selected-text",tM.SELECTION_TOP_LEFT="top-left-radius",tM.SELECTION_BOTTOM_LEFT="bottom-left-radius",tM.SELECTION_TOP_RIGHT="top-right-radius",tM.SELECTION_BOTTOM_RIGHT="bottom-right-radius",tM.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",tM.ROUNDED_PIECE_WIDTH=10,zy(((e,t)=>{const i=e.getColor(fk);i&&t.addRule(`.monaco-editor .focused .selected-text { background-color: ${i}; }`);const n=e.getColor(vk);n&&t.addRule(`.monaco-editor .selected-text { background-color: ${n}; }`);const o=e.getColor(_k);o&&!o.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${o}; }`)}));class nM{constructor(e,t,i,n,o,s){this.top=e,this.left=t,this.width=i,this.height=n,this.textContent=o,this.textContentClassName=s}}class oM{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(44);this._cursorStyle=t.get(24),this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=$f(document.createElement("div")),this._domNode.setClassName("cursor monaco-mouse-cursor-text"),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Kf(this._domNode,i),this._domNode.setDisplay("none"),this._position=new er(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(44);return this._cursorStyle=t.get(24),this._lineHeight=t.get(59),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(27),this._typicalHalfwidthCharacterWidth),Kf(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=Dr(i,t-1);return[new er(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="";const[i,n]=this._getGraphemeAwarePosition();if(this._cursorStyle===hf.Line||this._cursorStyle===hf.LineThin){const o=e.visibleRangeForPosition(i);if(!o||o.outsideRenderedLine)return null;let s;this._cursorStyle===hf.Line?(s=Rw(this._lineCursorWidth>0?this._lineCursorWidth:2),s>2&&(t=n)):s=Rw(1);let r=o.left;s>=2&&r>=1&&(r-=1);const a=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.bigNumbersDelta;return new nM(a,r,s,this._lineHeight,t,"")}const o=e.linesVisibleRangesForRange(new qo(i.lineNumber,i.column,i.lineNumber,i.column+n.length),!1);if(!o||0===o.length)return null;const s=o[0];if(s.outsideRenderedLine||0===s.ranges.length)return null;const r=s.ranges[0],a=r.width<1?this._typicalHalfwidthCharacterWidth:r.width;let l="";if(this._cursorStyle===hf.Block){const e=this._context.viewModel.getViewLineData(i.lineNumber);t=n;const o=e.tokens.findTokenIndexAtOffset(i.column-1);l=e.tokens.getClassName(o)}let d=e.getVerticalOffsetForLineNumber(i.lineNumber)-e.bigNumbersDelta,h=this._lineHeight;return this._cursorStyle!==hf.Underline&&this._cursorStyle!==hf.UnderlineThin||(d+=this._lineHeight-2,h=2),new nM(d,r.left,a,h,t,l)}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 monaco-mouse-cursor-text ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class sM extends ED{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(81),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new oM(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=$f(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 Vv,this._cursorFlatBlinkInterval=new Wv,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(81),this._cursorBlinking=t.get(22),this._cursorStyle=t.get(24),this._cursorSmoothCaretAnimation=t.get(23),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t{for(let i=0,n=e.ranges.length;i{this._isVisible?this._hide():this._show()}),sM.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet((()=>{this._blinkingEnabled=!0,this._updateDomClassName()}),sM.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case hf.Line:e+=" cursor-line-style";break;case hf.Block:e+=" cursor-block-style";break;case hf.Underline:e+=" cursor-underline-style";break;case hf.LineThin:e+=" cursor-line-thin-style";break;case hf.BlockOutline:e+=" cursor-block-outline-style";break;case hf.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;default:e+=" cursor-solid"}else e+=" cursor-solid";return this._cursorSmoothCaretAnimation&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const i=e.getColor(OE);if(i){let n=e.getColor(AE);n||(n=i.opposite()),t.addRule(`.monaco-editor .inputarea.ime-input { caret-color: ${i}; }`),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),"hc"===e.type&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}}));const rM=()=>{throw new Error("Invalid change accessor")};class aM extends ED{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(131);this._lineHeight=t.get(59),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=$f(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=$f(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((e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{e(t)}catch(i){Jo(i)}}(e,n),n.addZone=rM,n.removeZone=rM,n.layoutZone=rM})),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:$f(t.domNode),marginDomNode:t.marginDomNode?$f(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.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){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(i){Jo(i)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(i){Jo(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(i[s.id]=s,n=!0);const o=Object.keys(this._zones);for(let s=0,r=o.length;s{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new JD(e,t)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new er(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const e=this._context.configuration.options.get(131);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(128)+" "+Vy(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}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(){null!==this._renderAnimationFrame&&(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(){null===this._renderAnimationFrame&&(this._renderAnimationFrame=$C(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){!function(e){try{e()}catch(t){Jo(t)}}((()=>this._actualRender()))}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!PC(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new hM(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const n=new ID(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(n);for(const o of e)o.render(n),o.onDidRender()}delegateVerticalScrollbarMouseDown(e){this._scrollbar.delegateVerticalScrollbarMouseDown(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop},1),this._context.viewModel.tokenizeViewport(),this._renderNow(),this._viewLines.updateLineWidths(),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},1)}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 er(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?LI.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new GT(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){let t=e.position&&e.position.range||null;if(null===t){const i=e.position?e.position.position:null;null!==i&&(t=new qo(i.lineNumber,i.column,i.lineNumber,i.column))}const i=e.position?e.position.preference:null;this._contentWidgets.setWidgetPosition(e.widget,t,i),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}class uM{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new RN(new qo(1,1,1,1),0,new er(1,1),0),new RN(new qo(1,1,1,1),0,new er(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 MN(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return ar.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(),s=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,s),a=this._validatePositionWithCache(e,o,n,r);return i.equals(s)&&n.equals(r)&&o.equals(a)?t:new RN(qo.fromPositions(r,a),t.selectionStartLeftoverVisibleColumns+n.column-r.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(e,t,i){if(i&&(i=uM._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),s=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new RN(i,n,o,s)}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 RN(n,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 RN(n,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new er(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new er(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new qo(n.lineNumber,n.column,o.lineNumber,o.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new RN(s,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class gM{constructor(e){this.context=e,this.cursors=[new uM(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 Er(this.cursors,Nr((e=>e.viewState.position),er.compare)).viewState.position}getBottomMostViewPosition(){return Ir(this.cursors,Nr((e=>e.viewState.position),er.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(MN.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(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 e=t-i;for(let t=0;t=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;ie.selection),qo.compareRangesUsingStarts));for(let i=0;ia&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}}class pM{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class mM{constructor(){this.changeType=1}}class fM{constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}static applyInjectedText(e,t){if(!t||0===t.length)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 fM(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new fM(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber)),t}}class _M{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class vM{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class bM{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class CM{constructor(){this.changeType=5}}class wM{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;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 jM{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class UM{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}merge(e){return 0!==e.kind?this:new UM(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class $M{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}merge(e){return 1!==e.kind?this:new $M(this.oldHasFocus,e.hasFocus)}}class KM{constructor(e,t,i,n,o,s,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}merge(e){return 2!==e.kind?this:new KM(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class qM{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class GM{constructor(e,t,i,n,o,s,r){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n0){const e=this._cursors.getSelections();for(let t=0;tYM.MAX_CURSOR_COUNT&&(n=n.slice(0,YM.MAX_CURSOR_COUNT),o=!0);const s=XM.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,s,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n,o,s){const r=this._cursors.getViewPositions();let a=null,l=null;r.length>1?l=this._cursors.getViewSelections():a=qo.fromPositions(r[0],r[0]),e.emitViewEvent(new PM(t,i,a,l,n,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const i=MN.fromModelSelections(t.resultingSelection);this.setStates(e,"modelChange",t.isUndoing?5:t.isRedoing?6:2,i)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,MN.fromModelSelections(t))}}}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,MN.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let r=0,a=e.length;r0&&(s[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,s,(i=>{const n=[];for(let t=0;te.identifier.minor-t.identifier.minor,s=[];for(let r=0;r0?(n[r].sort(o),s[r]=t[r].computeCursorState(e.model,{getInverseEditOperations:()=>n[r],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new ar(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new ar(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[r]=e.selectionsBefore[r];return s}));r||(r=e.selectionsBefore);const a=[];for(let l in o)o.hasOwnProperty(l)&&a.push(parseInt(l,10));a.sort(((e,t)=>t-e));for(const l of a)r.splice(l,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{qo.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a=(e,t,i)=>{r=!0,s(e,t,i)},l={addEditOperation:s,addTrackedEditOperation:a,trackSelection:(t,i)=>{const n=ar.liftSelection(t);let o;if(n.isEmpty())if("boolean"==typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{i.getEditOperations(e.model,l)}catch(d){return Jo(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){(e=e.slice(0)).sort(((e,t)=>-qo.compareRangesUsingEnds(e.range,t.range)));const t={};for(let i=1;io.identifier.major?n.identifier.major:o.identifier.major,t[s.toString()]=!0;for(let t=0;t0&&i--}}return t}}.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const i=[],n=[];for(let t=0;t0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=XM.from(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new DM(a,r)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some(((e,t)=>!e.modelState.equals(n.cursorState[t].modelState)))){const a=n?n.cursorState.map((e=>e.modelState.selection)):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new GM(a,r,l,s.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 o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,d=n.text.lastIndexOf(a,l-1);if(-1===d)return null;t.push([d,l])}return t}executeEdits(e,t,i,n){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const s=[],r=[],a=this._model.pushEditOperations(this.getSelections(),i,(e=>{if(o)for(let i=0,n=o.length;i0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=XM.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){Jo(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}getAutoClosedCharacters(){return QM.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit((()=>{"keyboard"===t&&(this._executeEditOperation(nI.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),this.getAutoClosedCharacters())),this._selectionsWhenCompositionStarted=null)}),e,t)}type(e,t,i){this._executeEdit((()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i{this._executeEditOperation(nI.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))}),e,s);else if(0!==o){const t=this.getSelections().map((e=>{const t=e.getPosition();return new ar(t.lineNumber,t.column+o,t.lineNumber,t.column+o)}));this.setSelections(e,s,t,0)}}paste(e,t,i,n,o){this._executeEdit((()=>{this._executeEditOperation(nI.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))}),e,o,4)}cut(e,t){this._executeEdit((()=>{this._executeEditOperation(KN.cut(this.context.cursorConfig,this._model,this.getSelections()))}),e,t)}executeCommand(e,t,i){this._executeEdit((()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new PN(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}executeCommands(e,t,i){this._executeEdit((()=>{this._executeEditOperation(new PN(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}}YM.MAX_CURSOR_COUNT=1e4;class XM{constructor(e,t){this.modelVersionId=e,this.cursorState=t}static from(e,t){return new XM(e.getVersionId(),t.getCursorStates())}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class JM{constructor(e,t,i,n,o,s){this.id=e,this.label=t,this.alias=i,this._precondition=n,this._run=o,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}const eO="base.contributions.configuration",tO={properties:{},patternProperties:{}},iO={properties:{},patternProperties:{}},nO={properties:{},patternProperties:{}},oO={properties:{},patternProperties:{}},sO={properties:{},patternProperties:{}},rO={properties:{},patternProperties:{}},aO=My.as(JS);const lO=new RegExp("\\[([^\\]]+)\\]","g"),dO="^(\\[([^\\]]+)\\])+$",hO=new RegExp(dO);function cO(e){const t=[];if(hO.test(e)){let i=lO.exec(e);for(;null==i?void 0:i.length;){const n=i[1].trim();n&&t.push(n),i=lO.exec(e)}}return Qo(t)}const uO=new class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new $o,this._onDidUpdateConfiguration=new $o,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:$m(0,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},aO.registerSchema("vscode://schemas/settings/resourceLanguage",this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=this.doRegisterConfigurations(e,t);aO.registerSchema("vscode://schemas/settings/resourceLanguage",this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){var t;const i=[],n=[];for(const{overrides:o,source:s}of e)for(const e in o)if(i.push(e),hO.test(e)){const i=Object.assign(Object.assign({},(null===(t=this.configurationDefaultsOverrides.get(e))||void 0===t?void 0:t.value)||{}),o[e]);this.configurationDefaultsOverrides.set(e,{source:s,value:i});const r={type:"object",default:i,description:$m(0,"Configure settings to be overridden for {0} language.",e),$ref:"vscode://schemas/settings/resourceLanguage",defaultDefaultValue:i,source:Gs(s)?void 0:s};n.push(...cO(e)),this.configurationProperties[e]=r,this.defaultLanguageConfigurationOverridesNode.properties[e]=r}else{this.configurationDefaultsOverrides.set(e,{value:o[e],source:s});const t=this.configurationProperties[e];t&&(this.updatePropertyDefaultValue(e,t),this.updateSchema(e,t))}this.registerOverrideIdentifiers(n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i,defaultsOverrides:!0})}registerOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t){const i=[];return e.forEach((e=>{i.push(...this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties)),this.configurationContributors.push(e),this.registerJSONConfiguration(e)})),i}validateAndRegisterProperties(e,t=!0,i,n,o=3){o=Tr(e.scope)?o:e.scope;let s=[],r=e.properties;if(r)for(let l in r){if(t&&gO(l)){delete r[l];continue}const e=r[l];e.source=i,e.defaultDefaultValue=r[l].default,this.updatePropertyDefaultValue(l,e),hO.test(l)?e.scope=void 0:(e.scope=Tr(e.scope)?o:e.scope,e.restricted=Tr(e.restricted)?!!(null==n?void 0:n.includes(l)):e.restricted),!r[l].hasOwnProperty("included")||r[l].included?(this.configurationProperties[l]=r[l],!r[l].deprecationMessage&&r[l].markdownDeprecationMessage&&(r[l].deprecationMessage=r[l].markdownDeprecationMessage),s.push(l)):(this.excludedConfigurationProperties[l]=r[l],delete r[l])}let a=e.allOf;if(a)for(let l of a)s.push(...this.validateAndRegisterProperties(l,t,i,n,o));return s}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=e=>{let i=e.properties;if(i)for(const t in i)this.updateSchema(t,i[t]);let n=e.allOf;n&&n.forEach(t)};t(e)}updateSchema(e,t){switch(tO.properties[e]=t,t.scope){case 1:iO.properties[e]=t;break;case 2:nO.properties[e]=t;break;case 6:oO.properties[e]=t;break;case 3:sO.properties[e]=t;break;case 4:rO.properties[e]=t;break;case 5:rO.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:$m(0,"Configure editor settings to be overridden for a language."),errorMessage:$m(0,"This setting does not support per-language configuration."),$ref:"vscode://schemas/settings/resourceLanguage"};this.updatePropertyDefaultValue(t,i),tO.properties[t]=i,iO.properties[t]=i,nO.properties[t]=i,oO.properties[t]=i,sO.properties[t]=i,rO.properties[t]=i}this._onDidSchemaChange.fire()}registerOverridePropertyPatternKey(){const e={type:"object",description:$m(0,"Configure editor settings to be overridden for a language."),errorMessage:$m(0,"This setting does not support per-language configuration."),$ref:"vscode://schemas/settings/resourceLanguage"};tO.patternProperties[dO]=e,iO.patternProperties[dO]=e,nO.patternProperties[dO]=e,oO.patternProperties[dO]=e,sO.patternProperties[dO]=e,rO.patternProperties[dO]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let n=null==i?void 0:i.value,o=null==i?void 0:i.source;fr(n)&&(n=t.defaultDefaultValue,o=void 0),fr(n)&&(n=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=n,t.defaultValueSource=o}};function gO(e){return e.trim()?hO.test(e)?$m(0,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==uO.getConfigurationProperties()[e]?$m(0,"Cannot register '{0}'. This property is already registered.",e):null:$m(0,"Cannot register an empty property")}My.add(eO,uO);const pO=new class{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"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0),My.as(eO).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);var mO=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const fO={getInitialState:()=>xv,tokenizeEncoded:(e,t,i)=>Lv(0,i)};function _O(e,t,i,n,o,s,r){let a="
",l=n,d=0,h=!0;for(let c=0,u=t.getCount();c0;)r&&h?(g+=" ",h=!1):(g+=" ",h=!0),e--;break}case 60:g+="<",h=!1;break;case 62:g+=">",h=!1;break;case 38:g+="&",h=!1;break;case 0:g+="�",h=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",h=!1;break;case 13:g+="​",h=!1;break;case 32:r&&h?(g+=" ",h=!1):(g+=" ",h=!0);break;default:g+=String.fromCharCode(t),h=!1}}if(a+=`${g}`,u>o||l>=o)break}return a+="
",a}function vO(e,t,i){let n='
';const o=Is(e);let s=i.getInitialState();for(let r=0,a=o.length;r0&&(n+="
");const a=i.tokenizeEncoded(e,!0,s);wb.convertToEndOffset(a.tokens,e.length);const l=new wb(a.tokens,e,t).inflate();let d=0;for(let t=0,i=l.getCount();t${Mr(e.substring(d,o))}`,d=o}s=a.endState}return n+="
",n}class bO{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 CO{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}class wO{constructor(e,t,i,n){this._instanceId=Or(++wO.INSTANCE_COUNT),this._pendingChanges=new bO,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[s].afterLineNumber?i{t=!0,e|=0,i|=0,n|=0,o|=0;const s=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new CO(s,e,i,n,o)),s},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}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 t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const a of i)n.add(a.id);const o=new Map;for(const a of t)o.set(a.id,a);const s=e=>{const t=[];for(const i of e)if(!n.has(i.id)){if(o.has(i.id)){const e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=s(this._arr).concat(s(e));r.sort(((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber)),this._arr=r,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=wO.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|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i=t.length||t[o+1].afterLineNumber>=e)return o;i=o+1|0}else n=o-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t1?this._lineHeight*(e-1):0;return t+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e)+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;tthis.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e=this.getLinesTotalHeight()-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,o=t;for(;n=s+i)n=t+1;else{if(e>=s)return t;o=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),o=0|this.getVerticalOffsetForLineNumber(n);let s=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,d;-1===r?(r=a,d=s+1,l=0):(d=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let h=o,c=h;const u=5e5;let g=0;o>=u&&(g=Math.floor(o/u)*u,g=Math.floor(g/i)*i,c-=g);const p=[],m=e+(t-e)/2;let f=-1;for(let C=n;C<=s;C++){if(-1===f){const e=h,t=h+i;(e<=m&&mm)&&(f=C)}for(h+=i,p[C-n]=c,c+=i;d===C;)c+=l,h+=l,r++,r>=a?d=s+1:(d=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(h>=t){s=C;break}}-1===f&&(f=s);const _=0|this.getVerticalOffsetForLineNumber(s);let v=n,b=s;return vt&&b--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:s,relativeVerticalOffset:p,centeredLineNumber:f,completelyVisibleStartLineNumber:v,completelyVisibleEndLineNumber:b}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeight*t:0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t=o+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=o)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let s=i;s<=n;s++){const e=this.getVerticalOffsetForWhitespaceIndex(s),i=this.getHeightForWhitespaceIndex(s);if(e>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:e,height:i})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}wO.INSTANCE_COUNT=0;class yO{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<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 SO extends Uo{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new $o),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new yO(0,0,0,0),this._scrollable=this._register(new YI({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 UM(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}}class xO extends Uo{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(131),s=n.get(75);this._linesLayout=new wO(t,n.get(59),s.top,s.bottom),this._scrollable=this._register(new SO(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new yO(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(103)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(59)&&this._linesLayout.setLineHeight(t.get(59)),e.hasChanged(75)){const e=t.get(75);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(131)){const e=t.get(131),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new yO(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(103)&&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 i=this._configuration.options.get(92);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(94)?o+=Math.max(0,t-n.get(59)-n.get(75).bottom):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 yO(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Bb(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Bb(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(132),n=t.get(44);if(i.isViewportWrapping){const i=t.get(131),o=t.get(65);return e>i.contentWidth+n.typicalHalfwidthCharacterWidth&&o.enabled&&"right"===o.side?e+i.verticalScrollbarWidth:e}{const i=t.get(93)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i,o)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new yO(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class kO{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 s;if(o.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new er(n.startLineNumber,1),0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new er(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);s=new qo(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new Ub(s,o),this._decorationsCache[t]=i}return i}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsViewportData(e),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}_getDecorationsViewportData(e){const t=this._linesCollection.getDecorationsInRange(e,this.editorId,mf(this.configuration.options)),i=e.startLineNumber,n=e.endLineNumber,o=[];let s=0;const r=[];for(let a=i;a<=n;a++)r[a-i]=[];for(let a=0,l=t.length;a1===e))}function EO(e,t){return NO(e,t.range,(e=>2===e))}function NO(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const o=e.getLineTokens(n),s=n===t.startLineNumber,r=n===t.endLineNumber;let a=s?o.findTokenIndexAtOffset(t.startColumn-1):0;for(;at.endColumn-1)break}if(!i(o.getStandardTokenType(a)))return!1;a++}}return!0}class IO{constructor(e,t,i){this.range=e,this.nestingLevel=t,this.isInvalid=i}}class TO extends class{constructor(e,t,i,n){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n}}{constructor(e,t,i,n,o){super(e,t,i,n),this.minVisibleColumnIndentation=o}}class MO{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}MO.zero=new MO(0,0);const OO=Math.pow(2,26);function AO(e,t){return e*OO+t}function RO(e){const t=e,i=Math.floor(t/OO);return new MO(i,t-i*OO)}function PO(e,t){return t=t}function WO(e){return AO(e.lineNumber-1,e.column-1)}function HO(e,t){const i=e,n=Math.floor(i/OO),o=i-n*OO,s=t,r=Math.floor(s/OO);return new qo(n+1,o+1,r+1,s-r*OO+1)}class zO{constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}}class jO{constructor(e,t){this.documentLength=t,this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map((e=>UO.from(e)))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx];return function(e,t){const i=e,n=t;if(n-i<=0)return 0;const o=Math.floor(i/OO),s=Math.floor(n/OO),r=n-s*OO;if(o===s)return AO(0,r-(i-o*OO));return AO(s-o,r)}(e,t?this.translateOldToCur(t.offsetObj):this.documentLength)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?AO(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):AO(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=RO(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?AO(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):AO(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(0===n){const e=1<e};class GO{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class ZO{constructor(e){this._length=e}get length(){return this._length}}class YO extends ZO{constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}static create(e,t,i){let n=e.length;return t&&(n=PO(n,t.length)),i&&(n=PO(n,i.length)),new YO(n,e,t,i,t?t.missingOpeningBracketIds:KO.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=new Array;return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new YO(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(PO(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class XO extends ZO{constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}static create23(e,t,i,n=!1){let o=e.length,s=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=PO(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=PO(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return n?new JO(o,e.listHeight+1,e,t,i,s):new QO(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new tA(0,0,[],KO.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){this.throwIfImmutable();if(0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;let t,i=this;for(;4===i.kind&&(t=i.childrenLength)>0;)i=i.getChild(t-1);return i.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;nthis.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const n=this.lineTokens,o=n.getCount();let s=null;if(this.lineTokenOffset1e3)break}if(i>1500)break}const n=(o=e,s=t,r=this.lineIdx,a=this.lineCharOffset,o!==r?AO(r-o,a):AO(0,a-s));var o,s,r,a;return new aA(n,0,-1,KO.getEmpty(),new oA(n))}}class hA{constructor(e,t){this.text=e,this._offset=0,this.idx=0;const i=t.getRegExpStr()?new RegExp(t.getRegExpStr()+"|\n","g"):null,n=[];let o,s=0,r=0,a=0,l=0;const d=new Array;for(let u=0;u<60;u++)d.push(new aA(AO(0,u),0,-1,KO.getEmpty(),new oA(AO(0,u))));const h=new Array;for(let u=0;u<60;u++)h.push(new aA(AO(1,u),0,-1,KO.getEmpty(),new oA(AO(1,u))));if(i)for(i.lastIndex=0;null!==(o=i.exec(e));){const e=o.index,i=o[0];if("\n"===i)s++,r=e+1;else{if(a!==e){let t;if(l===s){const i=e-a;if(ifunction(e){const t=Xo(e);return/^[\w ]+$/.test(e)?`\\b${t}\\b`:t}(e))).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"g"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e)}findClosingTokenText(e){for(const[t,i]of this.map)if(i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}class uA{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){const t=this.languageIdToBracketTokens.get(e);if(!t)return!1;const i=cA.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider).getRegExpStr();return t.getRegExpStr()!==i}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=cA.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function gA(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){const n=i>>1;for(let o=0;o=3?e[2]:null,t)}function pA(e,t){return Math.abs(e.listHeight-t.listHeight)}function mA(e,t){return e.listHeight===t.listHeight?XO.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i=e=e.toMutable();const n=new Array;let o;for(;;){if(t.listHeight===i.listHeight){o=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let s=n.length-1;s>=0;s--){const e=n[s];o?e.childrenLength>=3?o=XO.create23(e.unappendChild(),o,null,!1):(e.appendChildOfSameHeight(o),o=void 0):e.handleChildrenChanged()}return o?XO.create23(e,o,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable();const n=new Array;for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let o=t;for(let s=n.length-1;s>=0;s--){const e=n[s];o?e.childrenLength>=3?o=XO.create23(o,e.unprependChild(),null,!1):(e.prependChildOfSameHeight(o),o=void 0):e.handleChildrenChanged()}return o?XO.create23(o,e,null,!1):e}(t,e)}class fA{constructor(e){this.lastOffset=0,this.nextNodes=[e],this.offsets=[0],this.idxs=[]}readLongestNodeAt(e,t){if(FO(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=vA(this.nextNodes);if(!i)return;const n=vA(this.offsets);if(FO(e,n))return;if(FO(n,e))if(PO(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=_A(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const e=_A(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=vA(this.offsets),t=vA(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=vA(this.nextNodes),n=_A(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(PO(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function _A(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function vA(e){return e.length>0?e[e.length-1]:void 0}function bA(e,t,i,n){return new CA(e,t,i,n).parseDocument()}class CA{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 fA(i):void 0,this.positionMapper=new jO(t,e.length)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(KO.getEmpty());return e||(e=XO.getEmpty()),e}parseList(e){const t=new Array;for(;;){const i=this.tokenizer.peek();if(!i||2===i.kind&&i.bracketIds.intersects(e))break;const n=this.parseChild(e);4===n.kind&&0===n.childrenLength||t.push(n)}const i=this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;const i=t,n=e[i].listHeight;for(t++;t=2?gA(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),o=i();if(!o)return n;for(let s=i();s;s=i())pA(n,o)<=pA(o,s)?(n=mA(n,o),o=s):o=mA(o,s);return mA(n,o)}(t):gA(t,this.createImmutableLists);return i}parseChild(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(0!==t){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),(i=>{if(!FO(i.length,t))return!1;return i.canBeReused(e)}));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}this._itemsConstructed++;const t=this.tokenizer.read();switch(t.kind){case 2:return new rA(t.bracketIds,t.length);case 0:return t.astNode;case 1:{const i=e.merge(t.bracketIds),n=this.parseList(i),o=this.tokenizer.peek();return o&&2===o.kind&&(o.bracketId===t.bracketId||o.bracketIds.intersects(t.bracketIds))?(this.tokenizer.read(),YO.create(t.astNode,n,o.astNode)):YO.create(t.astNode,n,null)}default:throw new Error("unexpected")}}}class wA extends Uo{constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new $o,this.denseKeyProvider=new GO,this.brackets=new uA(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,0===e.backgroundTokenizationState){const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new hA(this.textModel.getValue(),e);this.initialAstWithoutTokens=bA(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}else 2===e.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):1===e.backgroundTokenizationState&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens)}didLanguageChange(e){return this.brackets.didLanguageChange(e)}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map((e=>new zO(AO(e.fromLineNumber-1,0),AO(e.toLineNumber,0),AO(e.toLineNumber-e.fromLineNumber+1,0))));this.astWithTokens=this.parseDocumentFromTextBuffer(t,this.astWithTokens,!1),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=e.changes.map((e=>{const t=qo.lift(e.range);return new zO(WO(t.getStartPosition()),WO(t.getEndPosition()),function(e){const t=Is(e);return AO(t.length-1,t[t.length-1].length)}(e.text))})).reverse();this.astWithTokens=this.parseDocumentFromTextBuffer(t,this.astWithTokens,!1),this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(t,this.initialAstWithoutTokens,!1))}parseDocumentFromTextBuffer(e,t,i){const n=t;return bA(new lA(this.textModel,this.brackets),e,n,i)}getBracketsInRange(e){const t=AO(e.startLineNumber-1,e.startColumn-1),i=AO(e.endLineNumber-1,e.endColumn-1),n=new Array,o=this.initialAstWithoutTokens||this.astWithTokens;return yA(o,0,o.length,t,i,n),n}getBracketPairsInRange(e,t){const i=new Array,n=WO(e.getStartPosition()),o=WO(e.getEndPosition()),s=this.initialAstWithoutTokens||this.astWithTokens,r=new SA(i,t,this.textModel);return xA(s,0,s.length,n,o,r),i}}function yA(e,t,i,n,o,s,r=0){if(4===e.kind)for(const a of e.children)i=PO(t,a.length),BO(t,o)&&VO(i,n)&&yA(a,t,i,n,o,s,r),t=i;else if(2===e.kind){r++;if(i=PO(t,e.openingBracket.length),BO(t,o)&&VO(i,n)){const n=HO(t,i);s.push(new IO(n,r-1,!e.closingBracket))}t=i;if(e.child){const a=e.child;i=PO(t,a.length),BO(t,o)&&VO(i,n)&&yA(a,t,i,n,o,s,r),t=i}if(e.closingBracket){if(i=PO(t,e.closingBracket.length),BO(t,o)&&VO(i,n)){const e=HO(t,i);s.push(new IO(e,r-1,!1))}t=i}}else if(3===e.kind){const e=HO(t,i);s.push(new IO(e,r-1,!0))}else if(1===e.kind){const e=HO(t,i);s.push(new IO(e,r-1,!1))}}class SA{constructor(e,t,i){this.result=e,this.includeMinIndentation=t,this.textModel=i}}function xA(e,t,i,n,o,s,r=0){var a;if(2===e.kind){const n=PO(t,e.openingBracket.length);let o=-1;s.includeMinIndentation&&(o=e.computeMinIndentation(t,s.textModel)),s.result.push(new TO(HO(t,i),HO(t,n),e.closingBracket?HO(PO(n,(null===(a=e.child)||void 0===a?void 0:a.length)||0),i):void 0,r,o)),r++}let l=t;for(const d of e.children){const e=l;l=PO(l,d.length),BO(e,o)&&BO(n,l)&&xA(d,e,l,n,o,s,r)}}class kA extends Uo{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Rr),this.onDidChangeEmitter=new $o,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange((e=>{var t;e.languageId&&!(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.didLanguageChange(e.languageId))||(this.bracketPairsTree.clear(),this.updateBracketPairsTree())})))}get isDocumentSupported(){return this.textModel.getValueLength()<=5e6}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;null===(e=this.bracketPairsTree.value)||void 0===e||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.isDocumentSupported){if(!this.bracketPairsTree.value){const i=new Cs;this.bracketPairsTree.value=(e=i.add(new wA(this.textModel,(e=>this.languageConfigurationService.getLanguageConfiguration(e)))),t=i,{object:e,dispose:()=>null==t?void 0:t.dispose()}),i.add(this.bracketPairsTree.value.object.onDidChange((e=>this.onDidChangeEmitter.fire(e)))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire());var e,t}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!1))||[]}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!0))||[]}getBracketsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketsInRange(e))||[]}findMatchingBracketUp(e,t,i){const n=e.toLowerCase(),o=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(o.lineNumber,o.column),r=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!r)return null;const a=r.textIsBracket[n];return a?EA(this._findMatchingBracketUp(a,o,LA(i))):null}matchBracket(e,t){const i=LA(t);return this._matchBracket(this.textModel.validatePosition(e),i)}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),s=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let l=n-1;l>=0;l--){const e=t.getEndOffset(l);if(e<=r)break;if(v_(t.getStandardTokenType(l))||t.getLanguageId(l)!==s){r=e;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=n+1;l=a)break;if(v_(t.getStandardTokenType(l))||t.getLanguageId(l)!==s){a=e;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.getLineTokens(i),o=this.textModel.getLineContent(i),s=n.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(s)).brackets;if(r&&!v_(n.getStandardTokenType(s))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,s),d=null;for(;;){const n=Z_.findNextBracketInRange(r.forwardRegex,i,o,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=o.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof DA)return null;d=i}}a=n.endColumn-1}if(d)return d}if(s>0&&n.getStartOffset(s)===e.column-1){const r=s-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!v_(n.getStandardTokenType(r))){const{searchStartOffset:s,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),d=Z_.findPrevBracketInRange(a.reversedRegex,i,o,s,l);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn){const e=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),i=this._matchFoundBracket(d,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof DA?null:i}}}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 DA?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return DA.INSTANCE;const d=Z_.findPrevBracketInRange(o,t,n,a,l);if(!d)break;const h=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(h)?s++:e.isClose(h)&&s--,0===s)return d;l=d.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const e=this.textModel.getLineTokens(l),i=e.getCount(),o=this.textModel.getLineContent(l);let s=i-1,r=o.length,d=o.length;l===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,d=t.column-1);let h=!0;for(;s>=0;s--){const t=e.getLanguageId(s)===n&&!v_(e.getStandardTokenType(s));if(t)h?r=e.getStartOffset(s):(r=e.getStartOffset(s),d=e.getEndOffset(s));else if(h&&r!==d){const e=a(l,o,r,d);if(e)return e}h=t}if(h&&r!==d){const e=a(l,o,r,d);if(e)return e}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return DA.INSTANCE;const d=Z_.findNextBracketInRange(o,t,n,a,l);if(!d)break;const h=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(h)?s++:e.isClose(h)&&s--,0===s)return d;a=d.endColumn-1}return null},l=this.textModel.getLineCount();for(let d=t.lineNumber;d<=l;d++){const e=this.textModel.getLineTokens(d),i=e.getCount(),o=this.textModel.getLineContent(d);let s=0,r=0,l=0;d===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,l=t.column-1);let h=!0;for(;s=1;o--){const e=this.textModel.getLineTokens(o),s=e.getCount(),r=this.textModel.getLineContent(o);let a=s-1,l=r.length,d=r.length;if(o===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1;const o=e.getLanguageId(a);i!==o&&(i=o,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets)}let h=!0;for(;a>=0;a--){const t=e.getLanguageId(a);if(i!==t){if(n&&h&&l!==d){const e=Z_.findPrevBracketInRange(n.reversedRegex,o,r,l,d);if(e)return this._toFoundBracket(n,e);h=!1}i=t,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets}const s=!!n&&!v_(e.getStandardTokenType(a));if(s)h?l=e.getStartOffset(a):(l=e.getStartOffset(a),d=e.getEndOffset(a));else if(n&&h&&l!==d){const e=Z_.findPrevBracketInRange(n.reversedRegex,o,r,l,d);if(e)return this._toFoundBracket(n,e)}h=s}if(n&&h&&l!==d){const e=Z_.findPrevBracketInRange(n.reversedRegex,o,r,l,d);if(e)return this._toFoundBracket(n,e)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e),i=this.textModel.getLineCount();let n=null,o=null;for(let s=t.lineNumber;s<=i;s++){const e=this.textModel.getLineTokens(s),i=e.getCount(),r=this.textModel.getLineContent(s);let a=0,l=0,d=0;if(s===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,d=t.column-1;const i=e.getLanguageId(a);n!==i&&(n=i,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets)}let h=!0;for(;a{if(!s.has(e)){const i=[];for(let e=0,n=t?t.brackets.length:0;e{for(;;){if(i&&++l%100==0&&!i())return DA.INSTANCE;const a=Z_.findNextBracketInRange(e.forwardRegex,t,n,o,s);if(!a)break;const d=n.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),h=e.textIsBracket[d];if(h&&(h.isOpen(d)?r[h.index]++:h.isClose(d)&&r[h.index]--,-1===r[h.index]))return this._matchFoundBracket(a,h,!1,i);o=a.endColumn-1}return null};let h=null,c=null;for(let u=n.lineNumber;u<=o;u++){const e=this.textModel.getLineTokens(u),t=e.getCount(),i=this.textModel.getLineContent(u);let o=0,s=0,r=0;if(u===n.lineNumber){o=e.findTokenIndexAtOffset(n.column-1),s=n.column-1,r=n.column-1;const t=e.getLanguageId(o);h!==t&&(h=t,c=this.languageConfigurationService.getLanguageConfiguration(h).brackets,a(h,c))}let l=!0;for(;o!0;{const t=Date.now();return()=>Date.now()-t<=e}}class DA{constructor(){this._searchCanceledBrand=void 0}}function EA(e){return e instanceof DA?null:e}DA.INSTANCE=new DA;class NA extends Uo{constructor(e){super(),this.textModel=e,this.colorProvider=new IA,this.onDidChangeEmitter=new $o,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange((e=>{this.onDidChangeEmitter.fire()})))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i){if(void 0===t)return[];if(!this.colorizationOptions.enabled)return[];const n=new Array,o=this.textModel.bracketPairs.getBracketsInRange(e);for(const s of o)n.push({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s)},ownerId:0,range:s.range});return n}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new qo(1,1,this.textModel.getLineCount(),1),e,t):[]}}class IA{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(e.nestingLevel)}getInlineClassNameOfLevel(e){return"bracket-highlighting-"+e%30}}function TA(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}zy(((e,t)=>{const i=[nN,oN,sN,rN,aN,lN],n=new IA;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(dN)}; }`);const o=i.map((t=>e.getColor(t))).filter((e=>!!e)).filter((e=>!e.isTransparent()));for(let s=0;s<30;s++){const e=o[s%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(s)} { color: ${e}; }`)}}));class MA{constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}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}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${TA(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${TA(this.oldText)}")`:`(replace@${this.oldPosition} "${TA(this.oldText)}" with "${TA(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;I_(e,n,i),i+=4;for(let o=0;oe.length)return!1;if(i){if(!Br(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function BA(e){return e>=65&&e<=90||e>=97&&e<=122}function VA(e,t){return!!(void 0!==t?t:Rs)&&(BA(e.charCodeAt(0))&&58===e.charCodeAt(1))}function WA(e){return Wr(e,!0)}class HA{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Hr(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&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===IC.file)return FA(WA(e),WA(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(XA(e.authority,t.authority))return FA(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Ps.joinPath(e,...t)}basenameOrAuthority(e){return $A(e)||e.authority}basename(e){return Pr.basename(e.path)}extname(e){return Pr.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===IC.file?t=Ps.file(zr(WA(e))).path:(t=Pr.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===IC.file?Ps.file(Vr(WA(e))).path:Pr.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!XA(e.authority,t.authority))return;if(e.scheme===IC.file){const i=jr(WA(e),WA(t));return Rs?RA(i):i}let i=e.path||"/",n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(i.length,n.length);ePA(i).length&&i[i.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Fr){return QA(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Fr){let i=!1;if(e.scheme===IC.file){const n=WA(e);i=void 0!==n&&n.length===PA(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||QA(e,t)?e:e.with({path:e.path+"/"})}}const zA=new HA((()=>!1));new HA((e=>e.scheme!==IC.file||!Vo)),new HA((e=>!0));const jA=zA.isEqual.bind(zA);zA.isEqualOrParent.bind(zA),zA.getComparisonKey.bind(zA);const UA=zA.basenameOrAuthority.bind(zA),$A=zA.basename.bind(zA),KA=zA.extname.bind(zA),qA=zA.dirname.bind(zA),GA=zA.joinPath.bind(zA),ZA=zA.normalizePath.bind(zA);zA.relativePath.bind(zA);const YA=zA.resolvePath.bind(zA);zA.isAbsolutePath.bind(zA);const XA=zA.isEqualAuthority.bind(zA),QA=zA.hasTrailingPathSeparator.bind(zA);var JA,eR;function tR(e){return e.toString()}zA.removeTrailingPathSeparator.bind(zA),zA.addTrailingPathSeparator.bind(zA),(eR=JA||(JA={})).META_DATA_LABEL="label",eR.META_DATA_DESCRIPTION="description",eR.META_DATA_SIZE="size",eR.META_DATA_MIME="mime",eR.parseMetaData=function(e){const t=new Map;e.path.substring(e.path.indexOf(";")+1,e.path.lastIndexOf(";")).split(";").forEach((e=>{const[i,n]=e.split(":");i&&n&&t.set(i,n)}));const i=e.path.substring(0,e.path.indexOf(";"));return i&&t.set(eR.META_DATA_MIME,i),t};class iR{constructor(e,t,i,n,o,s,r){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=s,this.changes=r}static create(e,t){const i=e.getAlternativeVersionId(),n=oR(e);return new iR(i,i,n,n,t,t,[])}append(e,t,i,n,o){var s,r;t.length>0&&(this.changes=(s=this.changes,r=t,null===s||0===s.length?r:new OA(s,r).compress())),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(I_(e,t?t.length:0,i),i+=4,t)for(const n of t)I_(e,n.selectionStartLineNumber,i),i+=4,I_(e,n.selectionStartColumn,i),i+=4,I_(e,n.positionLineNumber,i),i+=4,I_(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=N_(e,t);t+=4;for(let o=0;oe.toString())).join(", ")}matchesResource(e){return(Ps.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 iR}append(e,t,i,n,o){this._data instanceof iR&&this._data.append(e,t,i,n,o)}close(){this._data instanceof iR&&(this._data=this._data.serialize())}open(){this._data instanceof iR||(this._data=iR.deserialize(this._data))}undo(){if(Ps.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof iR&&(this._data=this._data.serialize());const e=iR.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Ps.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof iR&&(this._data=this._data.serialize());const e=iR.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof iR&&(this._data=this._data.serialize()),this._data.byteLength+168}}function oR(e){return"\n"===e.getEOL()?0:1}function sR(e){return!!e&&(e instanceof nR||e instanceof class{constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const i of this._editStackElementsArr){const e=tR(i.resource);this._editStackElementsMap.set(e,i)}this._delegate=null}get resources(){return this._editStackElementsArr.map((e=>e.resource))}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=tR(e);return this._editStackElementsMap.has(t)}setModel(e){const t=tR(Ps.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=tR(e.uri);return!!this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).canAppend(e)}append(e,t,i,n,o){const s=tR(e.uri);this._editStackElementsMap.get(s).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=tR(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){let e=[];for(const t of this._editStackElementsArr)e.push(`${$A(t.resource)}: ${t}`);return`{${e.join(", ")}}`}})}class rR{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);sR(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);sR(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(sR(t)&&t.canAppend(this._model))return t;const i=new nR(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],oR(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),s=rR._computeCursorState(i,o),r=o.map(((e,t)=>({index:t,textChange:e.textChange})));return r.sort(((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition)),n.append(this._model,r.map((e=>e.textChange)),oR(this._model),this._model.getAlternativeVersionId(),s),s}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Jo(i),null}}}class aR{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function lR(e,t,i,n,o){let s;for(o.spacesDiff=0,o.looksLikeAlignment=!1,s=0;s0&&a>0)return;if(l>0&&d>0)return;const h=Math.abs(a-d),c=Math.abs(r-l);if(0===h)return o.spacesDiff=c,void(c>0&&0<=l-1&&l-10?o++:m>1&&s++,lR(r,a,l,p,h),h.looksLikeAlignment&&(!i||t!==h.spacesDiff))continue;const _=h.spacesDiff;_<=8&&d[_]++,r=l,a=p}let c=i;o!==s&&(c=o{const i=d[t];i>e&&(e=i,u=t)})),4===u&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(u=2)}return{insertSpaces:c,tabSize:u}}function hR(e){return(1&e.metadata)>>>0}function cR(e,t){e.metadata=254&e.metadata|t<<0}function uR(e){return(2&e.metadata)>>>1==1}function gR(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function pR(e){return(4&e.metadata)>>>2==1}function mR(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function fR(e,t){e.metadata=231&e.metadata|t<<3}function _R(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class vR{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,cR(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,mR(this,!1),fR(this,1),_R(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,gR(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;mR(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),fR(this,this.options.stickiness),_R(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 bR=new vR(null,0,0);bR.parent=bR,bR.left=bR,bR.right=bR,cR(bR,0);class CR{constructor(){this.root=bR,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o){return this.root===bR?[]:function(e,t,i,n,o,s){let r=e.root,a=0,l=0,d=0,h=0;const c=[];let u=0;for(;r!==bR;)if(uR(r))gR(r.left,!1),gR(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;else{if(!uR(r.left)){if(l=a+r.maxEnd,li)gR(r,!0);else{if(h=a+r.end,h>=t){r.setCachedOffsets(d,h,s);let e=!0;n&&r.ownerId&&r.ownerId!==n&&(e=!1),o&&pR(r)&&(e=!1),e&&(c[u++]=r)}gR(r,!0),r.right===bR||uR(r.right)||(a+=r.delta,r=r.right)}}return gR(e.root,!1),c}(this,e,t,i,n,o)}search(e,t,i){return this.root===bR?[]:function(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=[];let d=0;for(;o!==bR;){if(uR(o)){gR(o.left,!1),gR(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==bR&&!uR(o.left)){o=o.left;continue}r=s+o.start,a=s+o.end,o.setCachedOffsets(r,a,n);let e=!0;t&&o.ownerId&&o.ownerId!==t&&(e=!1),i&&pR(o)&&(e=!1),e&&(l[d++]=o),gR(o,!0),o.right===bR||uR(o.right)||(s+=o.delta,o=o.right)}return gR(e.root,!1),l}(this,e,t,i)}collectNodesFromOwner(e){return function(e,t){let i=e.root;const n=[];let o=0;for(;i!==bR;)uR(i)?(gR(i.left,!1),gR(i.right,!1),i=i.parent):i.left===bR||uR(i.left)?(i.ownerId===t&&(n[o++]=i),gR(i,!0),i.right===bR||uR(i.right)||(i=i.right)):i=i.left;return gR(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root;const i=[];let n=0;for(;t!==bR;)uR(t)?(gR(t.left,!1),gR(t.right,!1),t=t.parent):t.left===bR||uR(t.left)?t.right===bR||uR(t.right)?(i[n++]=t,gR(t,!0)):t=t.right:t=t.left;return gR(e.root,!1),i}(this)}insert(e){SR(this,e),this._normalizeDeltaIfNecessary()}delete(e){xR(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,s=i.end+n;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,n){const o=function(e,t,i){let n=e.root,o=0,s=0,r=0,a=0;const l=[];let d=0;for(;n!==bR;)if(uR(n))gR(n.left,!1),gR(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!uR(n.left)){if(s=o+n.maxEnd,si?gR(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[d++]=n),gR(n,!0),n.right===bR||uR(n.right)||(o+=n.delta,n=n.right))}return gR(e.root,!1),l}(this,e,e+t);for(let s=0,r=o.length;si?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),gR(o,!0)):(gR(o,!0),o.right===bR||uR(o.right)||(s+=o.delta,o=o.right))}gR(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,r=o.length;si)&&(1!==n&&(2===n||t))}function yR(e,t,i,n,o){const s=function(e){return(24&e.metadata)>>>3}(e),r=0===s||2===s,a=1===s||2===s,l=i-t,d=n,h=Math.min(l,d),c=e.start;let u=!1;const g=e.end;let p=!1;t<=c&&g<=i&&function(e){return(32&e.metadata)>>>5==1}(e)&&(e.start=t,u=!0,e.end=t,p=!0);{const e=o?1:l>0?2:0;!u&&wR(c,r,t,e)&&(u=!0),!p&&wR(g,a,t,e)&&(p=!0)}if(h>0&&!o){const e=l>d?2:0;!u&&wR(c,r,t+h,e)&&(u=!0),!p&&wR(g,a,t+h,e)&&(p=!0)}{const n=o?1:0;!u&&wR(c,r,i,n)&&(e.start=t+d,u=!0),!p&&wR(g,a,i,n)&&(e.end=t+d,p=!0)}const m=d-l;u||(e.start=Math.max(0,c+m)),p||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function SR(e,t){if(e.root===bR)return t.parent=bR,t.left=bR,t.right=bR,cR(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const o=t.start,s=t.end;for(;;){if(TR(o,s,n.start+i,n.end+i)<0){if(n.left===bR){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===bR){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}}t.parent=n,t.left=bR,t.right=bR,cR(t,1)}(e,t),IR(t.parent);let i=t;for(;i!==e.root&&1===hR(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===hR(t)?(cR(i.parent,0),cR(t,0),cR(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,LR(e,i)),cR(i.parent,0),cR(i.parent.parent,1),DR(e,i.parent.parent))}else{const t=i.parent.parent.left;1===hR(t)?(cR(i.parent,0),cR(t,0),cR(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,DR(e,i)),cR(i.parent,0),cR(i.parent.parent,1),LR(e,i.parent.parent))}return cR(e.root,0),t}function xR(e,t){let i,n;if(t.left===bR?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===bR?(i=t.left,n=t):(n=function(e){for(;e.left!==bR;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,cR(i,0),t.detach(),kR(),NR(i),void(e.root.parent=bR);const o=1===hR(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,cR(n,hR(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==bR&&(n.left.parent=n),n.right!==bR&&(n.right.parent=n)),t.detach(),o)return IR(i.parent),n!==t&&(IR(n),IR(n.parent)),void kR();let s;for(IR(i),IR(i.parent),n!==t&&(IR(n),IR(n.parent));i!==e.root&&0===hR(i);)i===i.parent.left?(s=i.parent.right,1===hR(s)&&(cR(s,0),cR(i.parent,1),LR(e,i.parent),s=i.parent.right),0===hR(s.left)&&0===hR(s.right)?(cR(s,1),i=i.parent):(0===hR(s.right)&&(cR(s.left,0),cR(s,1),DR(e,s),s=i.parent.right),cR(s,hR(i.parent)),cR(i.parent,0),cR(s.right,0),LR(e,i.parent),i=e.root)):(s=i.parent.left,1===hR(s)&&(cR(s,0),cR(i.parent,1),DR(e,i.parent),s=i.parent.left),0===hR(s.left)&&0===hR(s.right)?(cR(s,1),i=i.parent):(0===hR(s.left)&&(cR(s.right,0),cR(s,1),LR(e,s),s=i.parent.left),cR(s,hR(i.parent)),cR(i.parent,0),cR(s.left,0),DR(e,i.parent),i=e.root));cR(i,0),kR()}function kR(){bR.parent=bR,bR.delta=0,bR.start=0,bR.end=0}function LR(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==bR&&(i.left.parent=t),i.parent=t.parent,t.parent===bR?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,NR(t),NR(i)}function DR(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==bR&&(i.right.parent=t),i.parent=t.parent,t.parent===bR?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,NR(t),NR(i)}function ER(e){let t=e.end;if(e.left!==bR){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==bR){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function NR(e){e.maxEnd=ER(e)}function IR(e){for(;e!==bR;){const t=ER(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function TR(e,t,i,n){return e===i?t-n:e-i}class MR{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!==OR)return AR(this.right);let e=this;for(;e.parent!==OR&&e.parent.left!==e;)e=e.parent;return e.parent===OR?OR:e.parent}prev(){if(this.left!==OR)return RR(this.left);let e=this;for(;e.parent!==OR&&e.parent.right!==e;)e=e.parent;return e.parent===OR?OR:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const OR=new MR(null,0);function AR(e){for(;e.left!==OR;)e=e.left;return e}function RR(e){for(;e.right!==OR;)e=e.right;return e}function PR(e){return e===OR?0:e.size_left+e.piece.length+PR(e.right)}function FR(e){return e===OR?0:e.lf_left+e.piece.lineFeedCnt+FR(e.right)}function BR(){OR.parent=OR}function VR(e,t){const i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==OR&&(i.left.parent=t),i.parent=t.parent,t.parent===OR?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function WR(e,t){const i=t.left;t.left=i.right,i.right!==OR&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===OR?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function HR(e,t){let i,n;if(t.left===OR?(n=t,i=n.right):t.right===OR?(n=t,i=n.left):(n=AR(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),BR(),void(e.root.parent=OR);const o=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,UR(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,UR(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==OR&&(n.left.parent=n),n.right!==OR&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,UR(e,n)),t.detach(),i.parent.left===i){const t=PR(i),n=FR(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){const o=t-i.parent.size_left,s=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,jR(e,i.parent,o,s)}}if(UR(e,i.parent),o)return void BR();let s;for(;i!==e.root&&0===i.color;)i===i.parent.left?(s=i.parent.right,1===s.color&&(s.color=0,i.parent.color=1,VR(e,i.parent),s=i.parent.right),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.right.color&&(s.left.color=0,s.color=1,WR(e,s),s=i.parent.right),s.color=i.parent.color,i.parent.color=0,s.right.color=0,VR(e,i.parent),i=e.root)):(s=i.parent.left,1===s.color&&(s.color=0,i.parent.color=1,WR(e,i.parent),s=i.parent.left),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.left.color&&(s.right.color=0,s.color=1,VR(e,s),s=i.parent.left),s.color=i.parent.color,i.parent.color=0,s.left.color=0,WR(e,i.parent),i=e.root));i.color=0,BR()}function zR(e,t){for(UR(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&VR(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,WR(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&WR(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,VR(e,t.parent.parent))}e.root.color=0}function jR(e,t,i,n){for(;t!==e.root&&t!==OR;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function UR(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=PR((t=t.parent).left)-t.size_left,n=FR(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}OR.parent=OR,OR.left=OR,OR.right=OR,OR.color=0;function $R(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class KR{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function qR(e,t=!0){const i=[0];let n=1;for(let o=0,s=e.length;o(e!==OR&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class XR{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)}if(t){const e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class QR{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new ZR("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=OR,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,s=e.length;o0){e[o].lineStarts||(e[o].lineStarts=qR(e[o].buffer));const t=new GR(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,t)}this._searchCache=new XR(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=65535-Math.floor(21845),i=2*t;let n="",o=0;const s=[];if(this.iterate(this.root,(r=>{const a=this.getNodeContent(r),l=a.length;if(o<=t||o+l0){const t=n.replace(/\r\n|\r|\n/g,e);s.push(new ZR(t,qR(t)))}this.create(s,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new YR(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==OR;)if(n.left!==OR&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;return i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1)}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!==OR;)if(0!==t.size_left&&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,0===o.index){const e=this.getOffsetAt(i+1,1);return new er(i+1,n-e+1)}return new er(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===OR){const t=this.getOffsetAt(i+1,1);return new er(i+1,n-e-t+1)}t=t.right}return new er(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&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(o+e.remainder,o+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let s=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==OR;){const e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=e.substring(n,n+t.remainder);break}s+=e.substr(n,i.piece.length),i=i.next()}return s}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,(o=>{if(o===OR)return!0;const s=o.piece;let r=s.length;if(0===r)return!0;const a=this._buffers[s.bufferIndex].buffer,l=this._buffers[s.bufferIndex].lineStarts,d=s.start.line,h=s.end.line;let c=l[d]+s.start.column;if(n&&(10===a.charCodeAt(c)&&(c++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(d===h)return this._EOLNormalized||13!==a.charCodeAt(c+r-1)?i+=a.substr(c,r):(n=!0,i+=a.substr(c,r-1)),!0;i+=this._EOLNormalized?a.substring(c,Math.max(c,l[d+1]-this._EOLLength)):a.substring(c,l[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=d+1;ne+g,t.reset(0)):(_=c.buffer,v=e=>e,t.reset(g));do{if(m=t.next(_),m){if(v(m.index)>=p)return d;this.positionInBuffer(e,v(m.index)-u,f);const t=this.getLineFeedCnt(e.piece.bufferIndex,o,f),s=f.line===o.line?f.column-o.column+n:f.column+1,r=s+m[0].length;if(h[d++]=Kr(new qo(i+t,s,i+t,r),m,a),v(m.index)+m[0].length>=p)return d;if(d>=l)return d}}while(m);return d}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new qr(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let d=this.positionInBuffer(a.node,a.remainder);const h=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,d,h,t,i,n,s,o),o;let c=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,d,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,h=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[d.line+l],p=c===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,c,p,d,this.positionInBuffer(u,g-h),t,i,n,s,o),s>=n)return o;c+=l}const h=c===e.startLineNumber?e.startColumn-1:0;if(c===e.endLineNumber){const a=this.getLineContent(c).substring(h,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,h,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(c).substr(h),c,h,s,o,i,n),s>=n)return o;c++,a=this.nodeAt2(c,1),u=a.node,d=this.positionInBuffer(a.node,a.remainder)}if(c===e.endLineNumber){const a=c===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(c).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}const g=c===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,c,g,d,h,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const d=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,h=i.length;let c=-a;for(;-1!==(c=i.indexOf(t,c+a));)if((!d||Gr(d,i,h,c,a))&&(r[s++]=new Zr(new qo(n,c+1+o,n,c+1+a+o),null),s>=l))return s;return s}let h;t.reset(0);do{if(h=t.next(i),h&&(r[s++]=Kr(new qo(n,h.index+1+o,n,h.index+1+h[0].length+o),h,a),s>=l))return s}while(h);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==OR){const{node:i,remainder:n,nodeStartOffset:o}=this.nodeAt(e),s=i.piece,r=s.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&s.end.line===this._lastChangeBufferPos.line&&s.end.column===this._lastChangeBufferPos.column&&o+s.length===e&&t.length<65535)return this.appendToNode(i,t),void this.computeBufferMetadata();if(o===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(o+i.piece.length>e){const e=[];let o=new GR(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),this.offsetInBuffer(r,s.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)){if(10===this.nodeCharCodeAt(i,n)){const e={line:o.start.line+1,column:0};o=new GR(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){if(13===this.nodeCharCodeAt(i,n-1)){const o=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,o),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a)}else this.deleteNodeTail(i,a);const l=this.createNewPieces(t);o.length>0&&this.rbInsertRight(i,o);let d=i;for(let t=0;t=0;s--)o=this.rbInsertLeft(o,n[s]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let s=1;s=h))break;a=d+1}return i?(i.line=d,i.column=r-c,null):{line:d,column:r-c}}getLineFeedCnt(e,t,i){if(0===i.column)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],s=n[i.line]+i.column;if(o>s+1)return i.line-t.line;const r=s-1;return 13===this._buffers[e].buffer.charCodeAt(r)?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;t65535){const t=[];for(;e.length>65535;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,65535),e=e.substring(65535));const o=qR(n);t.push(new GR(this._buffers.length,{line:0,column:0},{line:o.length-1,column:n.length-o[o.length-1]},o.length-1,n.length)),this._buffers.push(new ZR(n,o))}const i=qR(e);return t.push(new GR(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new ZR(e,i)),t}let t=this._buffers[0].buffer.length;const i=qR(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&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 e=0;e=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:s-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(i,e-i.lf_left-2),o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=o.substring(s+t,s+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==OR;){const e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(s,s+o-t),n}{const t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==OR;)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 t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==o)return{index:t,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),s=t,r=this.offsetInBuffer(i.bufferIndex,s),a=this.getLineFeedCnt(i.bufferIndex,i.start,s),l=a-n,d=r-o,h=i.length+d;e.piece=new GR(i.bufferIndex,i.start,s,a,h),jR(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,r=this.getLineFeedCnt(i.bufferIndex,s,i.end),a=r-n,l=o-this.offsetInBuffer(i.bufferIndex,s),d=i.length+l;e.piece=new GR(i.bufferIndex,s,i.end,r,d),jR(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,l),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new GR(n.bufferIndex,n.start,l,d,h),jR(this,e,h-r,d-a);const c=new GR(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,c);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=qR(t,!1);for(let c=0;ce)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;const i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}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!==OR;)if(i.left!==OR&&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),s=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:n}}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}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==OR;){if(i.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1){return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)}}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&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===OR||0===e.piece.lineFeedCnt)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;if(n===i.length-1)return!1;return!(i[n+1]>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o)}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==OR&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}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;o=0===e.piece.end.column?{line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new GR(e.piece.bufferIndex,e.piece.start,o,r,s),jR(this,e,-1,-1),0===e.piece.length&&i.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new GR(t.piece.bufferIndex,a,t.piece.end,d,l),jR(this,t,-1,-1),0===t.piece.length&&i.push(t);const h=this.createNewPieces("\r\n");this.rbInsertRight(e,h[0]);for(let c=0;ce.sortIndex-t.sortIndex))}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const u=this._doApplyEdits(a);let g=null;if(t&&h.length>0){h.sort(((e,t)=>t.lineNumber-e.lineNumber)),g=[];for(let e=0,t=h.length;e0&&h[e-1].lineNumber===t)continue;const i=h[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===Ss(n)&&g.push(t)}}return this._onDidChangeContent.fire(),new Xr(c,u,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 qo(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let u=0,g=e.length;u0&&a.push(i.text),s=n.endLineNumber,r=n.endColumn}const l=a.join(""),[d,h,c]=JR(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:l,eolCount:d,firstLineLength:h,lastLineLength:c,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(eP._sortOpsDescending);const t=[];for(let i=0;i0){const e=r.eolCount+1;d=1===e?new qo(a,l,a,l+r.firstLineLength):new qo(a,l,a+e-1,r.lastLineLength+1)}else d=new qo(a,l,a,l);i=d.endLineNumber,n=d.endColumn,t.push(d),o=r}return t}static _sortOpsAscending(e,t){const i=qo.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=qo.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class tP{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let o=0,s=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||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,o=0,s=0,r=!0;for(let l=0,d=t.length;l126)&&(r=!1)}const a=new KR($R(e),n,o,s,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new ZR(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=Ds(e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Yr(e))}finish(e=!0){return this._finish(),new tP(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=qR(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class nP{constructor(e,t){this._startLineNumber=e,this._tokens=t}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class oP{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e)return void i.appendLineTokens(t)}this._tokens.push(new nP(e,[t]))}finalize(){return this._tokens}}class sP{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}delete(e,t){0===t||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const i=[];for(let n=0;n{const t=this._textModel.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&(this._resetTokenizationState(),this._textModel.clearTokens())}))),this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}handleDidChangeContent(e){if(e.isFlush)this._resetTokenizationState();else{if(this._tokenizationStateStore)for(let t=0,i=e.changes.length;t{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)})))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{!this._isDisposed&&this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._backgroundTokenizeForAtLeast1ms(),Date.now()1)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._textModel.setTokens(t.finalize(),!this._hasLinesToTokenize())}tokenizeViewport(e,t){const i=new oP;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.finalize(),!this._hasLinesToTokenize())}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new oP;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.finalize(),!this._hasLinesToTokenize())}getTokenTypeIfInsertingCharacter(e,t){if(!this._tokenizationStateStore)return 0;this.forceTokenization(e.lineNumber);const i=this._tokenizationStateStore.getBeginState(e.lineNumber-1);if(!i)return 0;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),r=lP(this._languageIdCodec,n,this._tokenizationStateStore.tokenizationSupport,s,!0,i),a=new wb(r.tokens,s,this._languageIdCodec);if(0===a.getCount())return 0;const l=a.findTokenIndexAtOffset(e.column-1);return a.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,o=e.column;if(!this._tokenizationStateStore)return null;this.forceTokenization(n);const s=this._tokenizationStateStore.getBeginState(n-1);if(!s)return null;const r=this._textModel.getLineContent(n),a=r.substring(0,o-1)+i+r.substring(o-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),d=lP(this._languageIdCodec,l,this._tokenizationStateStore.tokenizationSupport,a,!0,s);return new wb(d.tokens,a,this._languageIdCodec)}isCheapToTokenize(e){if(!this._tokenizationStateStore)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e1&&l>=1;l--){const e=this._textModel.getLineFirstNonWhitespaceColumn(l);if(0!==e&&e=0;l--){a=lP(this._languageIdCodec,r,this._tokenizationStateStore.tokenizationSupport,o[l],!1,a).endState}for(let l=t;l<=i;l++){const t=this._textModel.getLineContent(l),i=lP(this._languageIdCodec,r,this._tokenizationStateStore.tokenizationSupport,t,!0,a);e.add(l,i.tokens),this._tokenizationStateStore.markMustBeTokenized(l-1),a=i.endState}}}function lP(e,t,i,n,o,s){let r=null;if(i)try{r=i.tokenizeEncoded(n,o,s.clone())}catch(a){Jo(a)}return r||(r=Lv(e.encodeLanguageId(t),s)),wb.convertToEndOffset(r.tokens,n.length),r}const dP=new Uint32Array(0).buffer;class hP{static deleteBeginning(e,t){return null===e||e===dP?e:hP.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===dP)return e;const i=cP(e),n=i[i.length-2];return hP.delete(e,t,n)}static delete(e,t,i){if(null===e||e===dP||t===i)return e;const n=cP(e),o=n.length>>>1;if(0===t&&n[n.length-2]===i)return dP;const s=wb.findIndexInTokensArray(n,t),r=s>0?n[s-1<<1]:0;if(il&&(n[a++]=e,n[a++]=n[1+(c<<1)],l=e)}if(a===n.length)return e;const h=new Uint32Array(a);return h.set(n.subarray(0,a),0),h.buffer}static append(e,t){if(t===dP)return e;if(e===dP)return t;if(null===e)return e;if(null===t)return null;const i=cP(e),n=cP(t),o=n.length>>>1,s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let l=0;l>>1;let s=wb.findIndexInTokensArray(n,t);if(s>0){n[s-1<<1]===t&&s--}for(let r=s;r1&&(t=ys.getLanguageId(n[1])!==e),!t)return dP}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=gP(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[];for(let n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=hP.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=hP.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len||(0!==t?(this._lineTokens[n]=hP.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=hP.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=hP.insert(this._lineTokens[n],e.column-1,i))}}function gP(e){return(16384|e<<0|2<<23)>>>0}class pP{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),o=t[t.length-1].getRange();if(!n||!o)return e;i=e.plusRange(n).plusRange(o)}let n=null;for(let o=0,s=this._pieces.length;oi.endLineNumber){n=n||{index:o};break}if(e.removeTokens(i),e.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(e.endLineNumberi.endLineNumber){n=n||{index:o};continue}const[t,r]=e.split(i);t.isEmpty()?n=n||{index:o}:r.isEmpty()||(this._pieces.splice(o,1,t,r),o++,s++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=Jr(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){const i=this._pieces;if(0===i.length)return t;const n=i[pP._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!n)return t;const o=t.getCount(),s=n.getCount();let r=0;const a=[];let l=0,d=0;const h=(e,t)=>{e!==d&&(d=e,a[l++]=e,a[l++]=t)};for(let c=0;c>>0,l=~a>>>0;for(;rt)){for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(const s of this._pieces)s.acceptEdit(e,t,i,n,o)}}const mP=s_("undoRedoService");class fP{constructor(e,t){this.resource=e,this.elements=t}}class _P{constructor(){this.id=_P._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}_P._ID=0,_P.None=new _P;class vP{constructor(){this.id=vP._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}vP._ID=0,vP.None=new vP;var bP=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},CP=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};function wP(e){const t=new iP;return t.acceptChunk(e),t.finish()}function yP(e,t){return("string"==typeof e?wP(e):e).create(t)}let SP=0;class xP{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;for(;;){const n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const kP=()=>{throw new Error("Invalid change accessor")};let LP=class e extends Uo{constructor(t,i,n,o=null,s,r,a){super(),this._undoRedoService=s,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new $o),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new BP((e=>this.handleBeforeFireDecorationsChangedEvent(e)))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,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._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 VP),this._backgroundTokenizationState=0,this._onBackgroundTokenizationStateChanged=this._register(new $o),SP++,this.id="$model"+SP,this.isForSimpleWidget=n.isForSimpleWidget,this._associatedResource=null==o?Ps.parse("inmemory://model/"+SP):o,this._attachedEditorCount=0;const{textBuffer:l,disposable:d}=yP(t,n.defaultEOL);this._buffer=l,this._bufferDisposable=d,this._options=e.resolveOptions(this._buffer,n);const h=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new qo(1,1,h,this._buffer.getLineLength(h)+1),0);n.largeFileOptimizations?this._isTooLargeForTokenization=c>e.LARGE_FILE_SIZE_THRESHOLD||h>e.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=c>e.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageId=i,this._languageRegistryListener=this._languageConfigurationService.onDidChange((e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._instanceId=Or(SP),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new NP,this._commandManager=new rR(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new uP(this._languageService.languageIdCodec),this._semanticTokens=new pP(this._languageService.languageIdCodec),this._tokenization=new aP(this,this._languageService.languageIdCodec),this._bracketPairColorizer=this._register(new kA(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new mT(this,this._languageConfigurationService)),this._decorationProvider=this._register(new NA(this)),this._register(this._decorationProvider.onDidChange((()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})))}static resolveOptions(e,t){if(t.detectIndentation){const i=dR(e,t.tabSize,t.insertSpaces);return new ea({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new ea({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}onDidChangeContent(e){return this._eventEmitter.slowEvent((t=>e(t.contentChangedEvent)))}onDidChangeContentOrInjectedText(e){return ta(this._eventEmitter.fastEvent((t=>e(t.rawContentChangedEvent))),this._onDidChangeInjectedText.event((t=>e(t))))}get bracketPairs(){return this._bracketPairColorizer}get guides(){return this._guidesTextModelPart}get backgroundTokenizationState(){return this._backgroundTokenizationState}handleTokenizationProgress(e){if(2===this._backgroundTokenizationState)return;const t=e?2:1;this._backgroundTokenizationState!==t&&(this._backgroundTokenizationState=t,this._bracketPairColorizer.handleDidChangeBackgroundTokenizationState(),this._onBackgroundTokenizationStateChanged.fire())}dispose(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this._isDisposing=!1;const e=new eP([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Uo.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._isDisposing||(this._bracketPairColorizer.handleDidChangeContent(t),this._tokenization.handleDidChangeContent(t),this._eventEmitter.fire(new SM(e,t)))}setValue(e){if(this._assertNotDisposed(),null===e)return;const{textBuffer:t,disposable:i}=yP(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,s,r){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:r}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokens.flush(),this._semanticTokens.flush(),this._decorations=Object.create(null),this._decorationsTree=new NP,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new wM([new mM],this._versionId,!1,!1),this._createContentChanged2(new qo(1,1,o,s),0,n,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new wM([new CM],this._versionId,!1,!1),this._createContentChanged2(new qo(1,1,o,s),0,n,this.getValue(),!1,!1,!1))}_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}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 i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}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=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.indentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new ea({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(r))return;const a=this._options.createChangeEvent(r);this._options=r,this._bracketPairColorizer.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const i=dR(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),DN(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(ia.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map((e=>({range:e.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){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new xP(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 Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor("number"!=typeof i||isNaN(i)?1:i),s=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const e=this.getLineMaxColumn(o);s>=e&&(s=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),d=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,d=1;else if(l>t)l=t,d=this.getLineMaxColumn(l);else if(d<=1)d=1;else{const e=this.getLineMaxColumn(l);d>=e&&(d=e)}return i===o&&n===s&&r===l&&a===d&&e instanceof qo&&!(e instanceof ar)?e:new qo(o,s,l,d)}_isValidPosition(e,t,i){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(1===t)return!0;if(t>this.getLineMaxColumn(e))return!1;if(1===i){const i=this._buffer.getLineCharCode(e,t-2);if(Go(i))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),s=this._buffer.getLineCount();if(n<1)return new er(1,1);if(n>s)return new er(s,this.getLineMaxColumn(s));if(o<=1)return new er(n,1);const r=this.getLineMaxColumn(n);if(o>=r)return new er(n,r);if(1===i){const e=this._buffer.getLineCharCode(n,o-2);if(Go(e))return new er(n,o-1)}return new er(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof er&&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,s=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,s,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,r=Go(e),a=Go(t);return!r&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof qo&&!(e instanceof ar)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,o=t.column,s=i.lineNumber,r=i.column;{const e=o>1?this._buffer.getLineCharCode(n,o-2):0,t=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,i=Go(e),a=Go(t);return i||a?n===s&&o===r?new qo(n,o-1,s,r-1):i&&a?new qo(n,o-1,s,r+1):i?new qo(n,o-1,s,r):new qo(n,o,s,r+1):new qo(n,o,s,r)}}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 qo(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,s,r=999){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every((e=>qo.isIRange(e)))&&(a=t.map((e=>this.validateRange(e))))),null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let d;if(l.push(a.reduce(((e,t)=>qo.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!i&&e.indexOf("\n")<0){const t=new oa(e,i,n,o).parseSearchRequest();if(!t)return[];d=e=>this.findMatchesLineByLine(e,t,s,r)}else d=t=>na.findMatches(this,new oa(e,i,n,o),t,s,r);return l.map(d).reduce(((e,t)=>e.concat(t)),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new oa(e,i,n,o).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new qo(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),d=this.findMatchesLineByLine(l,t,s,1);return na.findNextMatch(this,new oa(e,i,n,o),r,s),d.length>0?d[0]:(l=new qo(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),d=this.findMatchesLineByLine(l,t,s,1),d.length>0?d[0]:null)}return na.findNextMatch(this,new oa(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return na.findPreviousMatch(this,new oa(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof sa?e:new sa(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(e.range),text:e.text})));let n=!0;if(e)for(let t=0,o=e.length;to.endLineNumber,r=o.startLineNumber>t.endLineNumber;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,o=this._trimAutoWhitespaceLines.length;et.endLineNumber)&&!(n===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){s=!1;break}}if(s){const e=new qo(n,1,n,o);t.push(new sa(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new qo(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}));this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new qo(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}}));this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){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(s),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(),s=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==s.length){for(let i=0,n=s.length;i0?e.text.charCodeAt(0):0),this._decorationsTree.acceptReplace(e.rangeOffset,e.rangeLength,e.text.length,e.forceMoveMarkers)}const e=[];this._increaseVersionId();let t=i;for(let i=0,n=s.length;i=0;t--){const i=a+t,n=g+t;v.takeFromEndWhile((e=>e.lineNumber>n));const o=v.takeFromEndWhile((e=>e.lineNumber===n));e.push(new _M(i,this.getLineContent(n),o))}if(ce.lineNumbere.lineNumber===t))}e.push(new bM(n+1,a+h,d,l))}t+=u}this._emitContentChangedEvent(new wM(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return null===n.reverseEdits?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(null===e||0===e.size)return;const t=[...e].map((e=>new _M(e,this.getLineContent(e),this._getInjectedTextInLine(e))));this._onDidChangeInjectedText.fire(new yM(t))}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:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,FP(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)};let n=null;try{n=t(i)}catch(o){Jo(o)}return i.addDecoration=kP,i.changeDecoration=kP,i.changeDecorationOptions=kP,i.removeDecoration=kP,i.deltaDecorations=kP,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:PP[i]}])[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),n.setOptions(PP[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){const o=this.getLineCount(),s=Math.min(o,Math.max(1,e)),r=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(r),l=new qo(s,1,r,a),d=this._getDecorationsInRange(l,i,n);return d.push(...this._decorationProvider.getDecorationsInRange(l,i,n)),d}getDecorationsInRange(e,t=0,i=!1){const n=this.validateRange(e),o=this._getDecorationsInRange(n,t,i);return o.push(...this._decorationProvider.getDecorationsInRange(n,t,i)),o}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return fM.fromDecorations(n).filter((t=>t.lineNumber===e))}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}_getDecorationsInRange(e,t,i){const n=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,n,o,t,i)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.endLineNumber)}if(i.options.before){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),s=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,s,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 e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(i.options.before||t.before){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}n!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i){const n=this.getVersionId(),o=t.length;let s=0;const r=i.length;let a=0;const l=new Array(r);for(;s0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:t})}this.handleTokenizationProgress(t)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._buffer.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._buffer.getLineCount()}]})}_emitModelTokensChangedEvent(e){this._isDisposing||(this._bracketPairColorizer.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this.getLineContent(e),i=this._tokens.getTokens(this._languageId,e-1,t);return this._semanticTokens.addSparseTokens(e,i)}getLanguageId(){return this._languageId}setMode(e){if(this._languageId===e)return;const t={oldLanguage:this._languageId,newLanguage:e};this._languageId=e,this._bracketPairColorizer.handleDidChangeLanguage(t),this._tokenization.handleDidChangeLanguage(t),this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}getLanguageIdAtPosition(e,t){const i=this.validatePosition(new er(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}getTokenTypeIfInsertingCharacter(e,t,i){const n=this.validatePosition(new er(e,t));return this._tokenization.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLineWithEdit(e,t,i){const n=this.validatePosition(e);return this._tokenization.tokenizeLineWithEdit(n,t,i)}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}getWordAtPosition(t){this._assertNotDisposed();const i=this.validatePosition(t),n=this.getLineContent(i.lineNumber),o=this._getLineTokens(i.lineNumber),s=o.findTokenIndexAtOffset(i.column-1),[r,a]=e._findLanguageBoundaries(o,s),l=ra(i.column,this.getLanguageConfiguration(o.getLanguageId(s)).getWordDefinition(),n.substring(r,a),r);if(l&&l.startColumn<=t.column&&t.column<=l.endColumn)return l;if(s>0&&r===i.column-1){const[r,a]=e._findLanguageBoundaries(o,s-1),l=ra(i.column,this.getLanguageConfiguration(o.getLanguageId(s-1)).getWordDefinition(),n.substring(r,a),r);if(l&&l.startColumn<=t.column&&t.column<=l.endColumn)return l}return null}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let s=t;s>=0&&e.getLanguageId(s)===i;s--)n=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,r=e.getCount();se.options.showIfCollapsed||!e.range.isEmpty()))}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i);return this._ensureNodesHaveRanges(e,n).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAll(e,t,i,n){const o=e.getVersionId(),s=this._search(t,i,n,o);return this._ensureNodesHaveRanges(e,s)}_search(e,t,i,n){if(i)return this._decorationsTree1.search(e,t,n);{const i=this._decorationsTree0.search(e,t,n),o=this._decorationsTree1.search(e,t,n),s=this._injectedTextDecorationsTree.search(e,t,n);return i.concat(o).concat(s)}}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){EP(e)?this._injectedTextDecorationsTree.insert(e):DP(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){EP(e)?this._injectedTextDecorationsTree.delete(e):DP(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){EP(e)?this._injectedTextDecorationsTree.resolveNode(e,t):DP(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 IP(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class TP{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class MP extends TP{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:aa.Center}getColor(e){return this._resolvedColor||("light"!==e.type&&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("string"==typeof e)return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class OP extends TP{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||("light"!==e.type&&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"string"==typeof e?QS.fromHex(e):t.getColor(e.id)}}class AP{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}static from(e){return e instanceof AP?e:new AP(e)}}class RP{constructor(e){var t,i;this.description=e.description,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?IP(e.className):null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new MP(e.overviewRuler):null,this.minimap=e.minimap?new OP(e.minimap):null,this.glyphMarginClassName=e.glyphMarginClassName?IP(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?IP(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?IP(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?IP(e.marginClassName):null,this.inlineClassName=e.inlineClassName?IP(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?IP(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?IP(e.afterContentClassName):null,this.after=e.after?AP.from(e.after):null,this.before=e.before?AP.from(e.before):null,this.hideInCommentTokens=null!==(t=e.hideInCommentTokens)&&void 0!==t&&t,this.hideInStringTokens=null!==(i=e.hideInStringTokens)&&void 0!==i&&i}static register(e){return new RP(e)}static createDynamic(e){return new RP(e)}}RP.EMPTY=RP.register({description:"empty"});const PP=[RP.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),RP.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),RP.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),RP.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function FP(e){return e instanceof RP?e:RP.createDynamic(e)}class BP extends Uo{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new $o),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;if(this._deferredCnt--,0===this._deferredCnt){if(this._shouldFire){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler};this._shouldFire=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._actual.fire(e)}null===(e=this._affectedInjectedTextLines)||void 0===e||e.clear(),this._affectedInjectedTextLines=null}}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!(!e.minimap||!e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!(!e.overviewRuler||!e.overviewRuler.color)),this._shouldFire=!0}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._shouldFire=!0}}class VP extends Uo{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--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}function WP(e,t){return null===e?t?zP.INSTANCE:jP.INSTANCE:new HP(e,t)}class HP{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 s;if(null!==this._projectionData.injectionOffsets){const i=this._projectionData.injectionOffsets.map(((e,t)=>new fM(0,0,e+1,this._projectionData.injectionOptions[t],0)));s=fM.applyInjectedText(e.getLineContent(t),i).substring(n,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=$P(this._projectionData.wrappedTextIndentLength)+s),s}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,s,r){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,d=a.injectionOptions;let h,c=null;if(l){c=[];let e=0,t=0;for(let i=0;i0?a.breakOffsets[i-1]:0,s=a.breakOffsets[i];for(;ts)break;if(o0?a.wrappedTextIndentLength:0,r=t+Math.max(h-o,0),l=t+Math.min(c-o,s);r!==l&&n.push(new jb(r,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(c<=s))break;e+=r,t++}}}h=l?e.getLineTokens(t).withInserted(l.map(((e,t)=>({offset:e,text:d[t].content,tokenMetadata:wb.defaultTokenMetadata})))):e.getLineTokens(t);for(let u=i;u0?n.wrappedTextIndentLength:0,s=i>0?n.breakOffsets[i-1]:0,r=n.breakOffsets[i],a=e.sliceAndInflate(s,r,o);let l=a.getLineContent();i>0&&(l=$P(n.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,h=l.length+1,c=i+1=UP.length)for(let t=1;t<=e;t++)UP[t]=KP(t);return UP[e]}function KP(e){return new Array(e+1).join(" ")}class qP{constructor(e,t,i,n,o,s,r,a,l){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new YP(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,s=this.createLineBreaksComputer(),r=new wr(fM.fromDecorations(n));for(let p=0;pe.lineNumber===p+1));s.addRequest(i[p],e,t?t[p]:null)}const a=s.finalize(),l=[],d=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(qo.compareRangesUsingStarts);let h=1,c=0,u=-1,g=u+1=h&&e<=c,i=WP(a[p],!t);l[p]=i.getViewLineCount(),this.modelLineProjections[p]=i}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new la(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e)))}setHiddenAreas(e){const t=function(e){if(0===e.length)return[];const t=e.slice();t.sort(qo.compareRangesUsingStarts);const i=[];let n=t[0].startLineNumber,o=t[0].endLineNumber;for(let s=1,r=t.length;so+1?(i.push(new qo(n,1,o,1)),n=e.startLineNumber,o=e.endLineNumber):e.endLineNumber>o&&(o=e.endLineNumber)}return i.push(new qo(n,1,o,1)),i}(e.map((e=>this.model.validateRange(e)))),i=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(qo.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n({range:e,options:RP.EMPTY})));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,n);const o=t;let s=1,r=0,a=-1,l=a+1=s&&e<=r?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),t=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),t=!0)),t){const e=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,e)}}return d||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&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&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n){const o=this.fontInfo.equals(e),s=this.wrappingStrategy===t,r=this.wrappingColumn===i,a=this.wrappingIndent===n;if(o&&s&&r&&a)return!1;const l=o&&s&&!r&&a;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n;let d=null;if(l){d=[];for(let e=0,t=this.modelLineProjections.length;e2&&!this.modelLineProjections[t-2].isVisible(),s=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let r=0;const a=[],l=[];for(let d=0,h=n.length;dr?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+r-1,u=d+1,g=u+(o-r)-1,a=!0):ot?t:0|e}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)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,s.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new GP(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(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 er(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 er(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(i),r=new Array;for(let a=i.modelLineNumber;a<=n.modelLineNumber;a++){const e=this.modelLineProjections[a-1];if(e.isVisible()){const t=a===i.modelLineNumber?i.modelLineWrappedLineIdx:0,o=a===n.modelLineNumber?n.modelLineWrappedLineIdx+1:e.getViewLineCount();for(let e=t;ee.horizontalLine?new gT(e.visibleColumn,e.className,new pT(e.horizontalLine.top,this.convertModelPositionToViewPosition(i.modelLineNumber,e.horizontalLine.endColumn).column)):e)),s.push(n)}}return s}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 s=[],r=[],a=i.lineNumber-1,l=n.lineNumber-1;let d=null;for(let g=a;g<=l;g++){const e=this.modelLineProjections[g];if(e.isVisible()){const t=e.getViewLineNumberOfModelPosition(0,g===a?i.column:1),n=e.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),o=n-t+1;let l=0;o>1&&1===e.getViewLineMinColumn(this.model,g+1,n)&&(l=0===t?1:2),s.push(o),r.push(l),null===d&&(d=new er(g+1,0))}else null!==d&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}null!==d&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,n.lineNumber)),d=null);const h=t-e+1,c=new Array(h);let u=0;for(let g=0,p=o.length;gt&&(c=!0,h=t-o+1),n.getViewLinesData(this.model,l+1,d,h,o-e,i,a),o+=h,c)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,s=n.remainder,r=this.modelLineProjections[o],a=r.getViewLineMinColumn(this.model,o+1,s),l=r.getViewLineMaxColumn(this.model,o+1,s);tl&&(t=l);const d=r.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new er(o+1,d)).equals(i)?new er(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 qo(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 er(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new qo(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2){const n=this.model.validatePosition(new er(e,t)),o=n.lineNumber,s=n.column;let r=o-1,a=!1;for(;r>0&&!this.modelLineProjections[r].isVisible();)r--,a=!0;if(0===r&&!this.modelLineProjections[r].isVisible())return new er(1,1);const l=1+this.projectedModelLineLineCounts.getPrefixSum(r);let d;return d=a?this.modelLineProjections[r].getViewPositionOfModelPosition(l,this.model.getLineMaxColumn(r+1),i):this.modelLineProjections[o-1].getViewPositionOfModelPosition(l,s,i),d}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return qo.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new qo(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!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){const n=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),o=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(o.lineNumber-n.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new qo(n.lineNumber,1,o.lineNumber,o.column),t,i);let s=[];const r=n.lineNumber-1,a=o.lineNumber-1;let l=null;for(let u=r;u<=a;u++){if(this.modelLineProjections[u].isVisible())null===l&&(l=new er(u+1,u===r?n.column:1));else if(null!==l){const e=this.model.getLineMaxColumn(u);s=s.concat(this.model.getDecorationsInRange(new qo(l.lineNumber,l.column,u,e),t,i)),l=null}}null!==l&&(s=s.concat(this.model.getDecorationsInRange(new qo(l.lineNumber,l.column,o.lineNumber,o.column),t,i)),l=null),s.sort(((e,t)=>{const i=qo.compareRangesUsingStarts(e.range,t.range);return 0===i?e.idt.id?1:0:i}));let d=[],h=0,c=null;for(const u of s){const e=u.id;c!==e&&(c=e,d[h++]=u)}return d}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 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class GP{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}get isWrappedLineContinuation(){return this.modelLineWrappedLineIdx>0}}class ZP{constructor(e,t){this.modelRange=e,this.viewLines=t}}class YP{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class XP{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new QP(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 AM(t,i)}onModelLinesInserted(e,t,i,n){return new RM(t,i)}onModelLineChanged(e,t,i){return[!1,new OM(t,t),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class JP extends Uo{constructor(e,t,i,n,o,s,r,a){if(super(),this.languageConfigurationService=r,this._themeService=a,this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new zM,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new TN(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._tokenizeViewportSoon=this._register(new Hv((()=>this.tokenizeViewport()),50)),this._updateConfigurationViewLineCount=this._register(new Hv((()=>this._updateConfigurationViewLineCountNow()),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,this.model.isTooLargeForTokenization())this._lines=new XP(this.model);else{const e=this._configuration.options,t=e.get(44),i=e.get(125),s=e.get(132),r=e.get(124);this._lines=new qP(this._editorId,this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new YM(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new xO(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll((e=>{e.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new FM(e)),this._eventDispatcher.emitOutgoingEvent(new KM(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))}))),this._register(this.viewLayout.onDidContentSizeChange((e=>{this._eventDispatcher.emitOutgoingEvent(e)}))),this._decorations=new kO(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(LT.getInstance().onDidChange((()=>{this._eventDispatcher.emitSingleViewEvent(new WM)}))),this._register(this._themeService.onDidColorThemeChange((e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new BM(e))}))),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,null,1),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=new qo(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber)),i=this._toModelVisibleRanges(t);for(const n of i)this.model.tokenizeViewport(n.startLineNumber,n.endLineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new IM(e)),this._eventDispatcher.emitOutgoingEvent(new $M(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new xM)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new kM)}_onConfigurationChanged(e,t){let i=null;if(-1!==this._viewportStartLine){const e=new er(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(e)}let n=!1;const o=this._configuration.options,s=o.get(44),r=o.get(125),a=o.get(132),l=o.get(124);if(this._lines.setWrappingSettings(s,r,a.wrappingColumn,l)&&(e.emitViewEvent(new NM),e.emitViewEvent(new MM),e.emitViewEvent(new EM(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),0!==this.viewLayout.getCurrentScrollTop()&&(n=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(81)&&(this._decorations.reset(),e.emitViewEvent(new EM(null))),e.emitViewEvent(new LM(t)),this.viewLayout.onConfigurationChanged(t),n&&i){const e=this.coordinatesConverter.convertModelPositionToViewPosition(i),t=this.viewLayout.getVerticalOffsetForLineNumber(e.lineNumber);this.viewLayout.setScrollPosition({scrollTop:t+this._viewportStartLineDelta},1)}TN.shouldRecreate(t)&&(this.cursorConfig=new TN(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e.changes,s=e instanceof wM?e.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of o)switch(e.changeType){case 4:for(let t=0;t!e.ownerId||e.ownerId===this._editorId))),r.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(e.detail,t,null);break}}const a=r.finalize(),l=new wr(a);for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new NM),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(s,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=l.takeCount(e.detail.length),o=this._lines.onModelLinesInserted(s,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case 2:{const i=l.dequeue(),[o,r,a,d]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),d&&(t.emitViewEvent(d),this.viewLayout.onLinesDeleted(d.fromLineNumber,d.toLineNumber));break}}null!==s&&this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new MM),t.emitViewEvent(new EM(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}if(this._viewportStartLine=-1,this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&this._viewportStartLineTrackedRange){const e=this.model._getTrackedRange(this._viewportStartLineTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStartLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._tokenizeViewportSoon.schedule()}))),this._register(this.model.onDidChangeTokens((e=>{const t=[];for(let i=0,n=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new TM),this.cursorConfig=new TN(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig)}))),this._register(this.model.onDidChangeLanguage((e=>{this.cursorConfig=new TN(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig)}))),this._register(this.model.onDidChangeOptions((e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new NM),e.emitViewEvent(new MM),e.emitViewEvent(new EM(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new TN(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig)}))),this._register(this.model.onDidChangeDecorations((e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new EM(e))})))}setHiddenAreas(e){let t=!1;try{const i=this._eventDispatcher.beginEmitViewEvents();t=this._lines.setHiddenAreas(e),t&&(i.emitViewEvent(new NM),i.emitViewEvent(new MM),i.emitViewEvent(new EM(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),t&&this._eventDispatcher.emitOutgoingEvent(new qM)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(131),t=this._configuration.options.get(59),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new qo(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];const n=[];let o=0,s=t.startLineNumber,r=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let d=0,h=i.length;da||(se.toInlineDecoration(t)))]),new Hb(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,i,n,s.tokens,r,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new Vb(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,mf(this._configuration.options)),i=new eF;for(const n of t){const t=n.options,o=t.overviewRuler;if(!o)continue;const s=o.position;if(0===s)continue;const r=o.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(r,t.zIndex,a,l,s)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;e&&e.invalidateCachedColor();const i=t.options.minimap;i&&i.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(qo.compareRangesUsingStarts);let o=!1,s=!1;for(const a of e)a.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const i=e.map((e=>e.startLineNumber));let o="";for(let e=0;e0&&i[e-1]===i[e]||(o+=this.model.getLineContent(i[e])+n);return o}if(o&&t){const t=[];let n=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,i?2:0)),n=e}return 1===t.length?t[0]:t}const r=[];for(const a of e)a.isEmpty()||r.push(this.model.getValueInRange(a,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if("plaintext"===i)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new qo(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(44),s=this._getColorMap();let r;if(/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===kf.fontFamily)r=kf.fontFamily;else{r=o.fontFamily,r=r.replace(/"/g,"'");if(!/[,']/.test(r)){/[+ ]/.test(r)&&(r=`'${r}'`)}r=`${r}, ${kf.fontFamily}`}return{mode:i,html:`
`+this._getHTMLToCopy(n,s)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=this.getTabSize();let a="";for(let l=i;l<=o;l++){const e=this.model.getLineTokens(l),d=e.getLineContent(),h=l===i?n-1:0,c=l===o?s-1:d.length;a+=""===d?"
":_O(d,e.inflate(),t,h,c,r,Rs)}return a}_getColorMap(){const e=Es.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){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new ZM):this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit((n=>this._cursor.executeEdits(n,e,t,i)))}startComposition(){this._cursor.setIsDoingComposition(!0),this._executeCursorEdit((e=>this._cursor.startComposition(e)))}endComposition(e){this._cursor.setIsDoingComposition(!1),this._executeCursorEdit((t=>this._cursor.endComposition(t,e)))}type(e,t){this._executeCursorEdit((i=>this._cursor.type(i,e,t)))}compositionType(e,t,i,n,o){this._executeCursorEdit((s=>this._cursor.compositionType(s,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)))}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 qo(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new PM(e,!1,i,null,0,!0,0))))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new qo(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new PM(e,!1,i,null,0,!0,0))))}revealRange(e,t,i,n,o){this._withViewEventsCollector((s=>s.emitViewEvent(new PM(e,!1,i,null,n,t,o))))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new HM),this._eventDispatcher.emitOutgoingEvent(new qM))}_withViewEventsCollector(e){try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class eF{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const s=this._asMap[e];if(s){const e=s.data,t=e[e.length-3],r=e[e.length-1];if(t===o&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(o,i,n)}else{const s=new $b(e,t,[o,i,n]);this._asMap[e]=s,this.asArray.push(s)}}}class tF{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}var iF,nF;(nF=iF||(iF={}))[nF.Ignore=0]="Ignore",nF[nF.Info=1]="Info",nF[nF.Warning=2]="Warning",nF[nF.Error=3]="Error",function(e){const t="error",i="warning",n="info";e.fromValue=function(o){return o?$r(t,o)?e.Error:$r(i,o)||$r("warn",o)?e.Warning:$r(n,o)?e.Info:e.Ignore:e.Ignore},e.toString=function(o){switch(o){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(iF||(iF={}));var oF=iF,sF=oF;const rF=s_("notificationService");class aF{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 i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let n=0;nthis.injectionOffsets[n];n++)i0?this.breakOffsets[o-1]:0,0===t)if(e<=s)n=o-1;else{if(!(e>r))break;i=o+1}else if(e=r))break;i=o+1}}let r=e-s;return o>0&&(r+=this.wrappedTextIndentLength),new hF(o,r)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new hF(e-1,this.getMaxOutputOffset(e-1))}else if(1===i){if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength));return(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&lF(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(dF(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!lF(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!dF(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}nr()}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(null!==t){let n=0;for(let o=0;oe)break;if(e<=a)return{injectedTextIndex:o,offsetInInputWithInjections:r,length:s};n+=s}}}}function lF(e){return null==e||(e===da.Right||e===da.Both)}function dF(e){return null==e||(e===da.Left||e===da.Both)}class hF{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new er(e+this.outputLineIndex,this.outputOffset+1)}}class cF{constructor(e,t){this.classifier=new uF(e,t)}static create(e){return new cF(e.get(120),e.get(119))}createLineBreaksComputer(e,t,i,n){const o=[],s=[],r=[];return{addRequest:(e,t,i)=>{o.push(e),s.push(t),r.push(i)},finalize:()=>{const a=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,l=[];for(let e=0,d=o.length;e=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 gF=[],pF=[];function mF(e,t,i,n,o,s,r){if(-1===o)return null;const a=i.length;if(a<=1)return null;const l=t.breakOffsets,d=t.breakOffsetsVisibleColumn,h=CF(i,n,o,s,r),c=o-h,u=gF,g=pF;let p=0,m=0,f=0,_=o;const v=l.length;let b=0;if(b>=0){let e=Math.abs(d[b]-_);for(;b+1=e)break;e=t,b++}}for(;bt&&(t=m,o=f);let r=0,h=0,C=0,w=0;if(o<=_){let f=o,v=0===t?0:i.charCodeAt(t-1),b=0===t?0:e.get(v),y=!0;for(let o=t;om&&bF(v,b,a,l)&&(r=t,h=f),f+=d,f>_){t>m?(C=t,w=f-d):(C=o+1,w=f),f-h>c&&(r=0),y=!1;break}v=a,b=l}if(y){p>0&&(u[p]=l[l.length-1],g[p]=d[l.length-1],p++);break}}if(0===r){let a=o,l=i.charCodeAt(t),d=e.get(l),u=!1;for(let n=t-1;n>=m;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){u=!0;break}let g,p;if(ca(o)?(n--,g=0,p=2):(g=e.get(o),p=ks(o)?s:1),a<=_){if(0===C&&(C=t,w=a),a<=_-c)break;if(bF(o,g,l,d)){r=t,h=a;break}}a-=p,l=o,d=g}if(0!==r){const e=c-(w-h);if(e<=n){const t=i.charCodeAt(C);let o;o=Go(t)?2:_F(t,w,n,s),e-o<0&&(r=0)}}if(u){b--;continue}}if(0===r&&(r=C,h=w),r<=m){const e=i.charCodeAt(m);Go(e)?(r=m+2,h=f+2):(r=m+1,h=f+_F(e,f,n,s))}for(m=r,u[p]=r,f=h,g[p]=h,p++,_=h+c;b<0||b=y)break;y=e,b++}}return 0===p?null:(u.length=p,g.length=p,gF=t.breakOffsets,pF=t.breakOffsetsVisibleColumn,t.breakOffsets=u,t.breakOffsetsVisibleColumn=g,t.wrappedTextIndentLength=h,t)}function fF(e,t,i,n,o,s,r){const a=fM.applyInjectedText(t,i);let l,d;if(i&&i.length>0?(l=i.map((e=>e.options)),d=i.map((e=>e.column-1))):(l=null,d=null),-1===o)return l?new aF(d,l,[a.length],[],0):null;const h=a.length;if(h<=1)return l?new aF(d,l,[a.length],[],0):null;const c=CF(a,n,o,s,r),u=o-c,g=[],p=[];let m=0,f=0,_=0,v=o,b=a.charCodeAt(0),C=e.get(b),w=_F(b,0,n,s),y=1;Go(b)&&(w+=1,b=a.charCodeAt(1),C=e.get(b),y++);for(let S=y;Sv&&((0===f||w-_>u)&&(f=t,_=w-r),g[m]=f,p[m]=_,m++,v=_+u,f=0),b=i,C=o}return 0!==m||i&&0!==i.length?(g[m]=h,p[m]=w,new aF(d,l,g,p,c)):null}function _F(e,t,i,n){return 9===e?i-t%i:ks(e)||e<32?n:1}function vF(e,t){return t-e%t}function bF(e,t,i,n){return 32!==i&&(2===t||3===t&&2!==n||1===n||3===n&&1!==t)}function CF(e,t,i,n,o){let s=0;if(0!==o){const r=Ss(e);if(-1!==r){for(let i=0;ii&&(s=0)}}return s}var wF;const yF=null===(wF=window.trustedTypes)||void 0===wF?void 0:wF.createPolicy("domLineBreaksComputer",{createHTML:e=>e});class SF{static create(){return new SF}constructor(){}createLineBreaksComputer(e,t,i,n){const o=[],s=[];return{addRequest:(e,t,i)=>{o.push(e),s.push(t)},finalize:()=>function(e,t,i,n,o,s){var r;function a(t){const i=s[t];if(i){const n=fM.applyInjectedText(e[t],i),o=i.map((e=>e.options)),s=i.map((e=>e.column-1));return new aF(s,o,[n.length],[],0)}return null}if(-1===n){const t=[];for(let i=0,n=e.length;il?(r=0,a=0):d=l-e}const h=n.substr(r),u=xF(h,a,i,d,g,c);p[x]=r,m[x]=a,f[x]=h,_[x]=u[0],v[x]=u[1]}const b=g.build(),C=null!==(r=null==yF?void 0:yF.createHTML(b))&&void 0!==r?r:b;u.innerHTML=C,u.style.position="absolute",u.style.top="10000",u.style.wordWrap="break-word",document.body.appendChild(u);const w=document.createRange(),y=Array.prototype.slice.call(u.children,0),S=[];for(let x=0;xe.options)),l=d.map((e=>e.column-1))):(r=null,l=null),S[x]=new aF(l,r,e,o,i)}return document.body.removeChild(u),S}(o,e,t,i,n,s)}}}function xF(e,t,i,n,o,s){if(0!==s){const e=String(s);o.appendASCIIString('
');const r=e.length;let a=t,l=0;const d=[],h=[];let c=0");for(let u=0;u"),d[u]=l,h[u]=a;const t=c;c=u+1"),d[e.length]=l,h[e.length]=a,o.appendASCIIString("
"),[d,h]}function kF(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{LF(e,o,n,0,null,i.length-1,null,s)}catch(r){return null}return 0===s.length?null:(s.push(i.length),s)}function LF(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||DF(e,t,i[n],i[n+1]),r=r||DF(e,t,i[s],i[s+1]),Math.abs(o[0].top-r[0].top)<=.1)return;if(n+1===s)return void a.push(s);const l=n+(s-n)/2|0,d=DF(e,t,i[l],i[l+1]);LF(e,t,i,n,o,l,d,a),LF(e,t,i,l,d,s,r,a)}function DF(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}var EF=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},NF=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let IF=0;class TF{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){bs(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let MF=class e extends Uo{constructor(e,t,i,n,o,s,r,a,l,d,h,c){super(),this.languageConfigurationService=h,this._onDidDispose=this._register(new $o),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new $o),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new $o),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new $o),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new $o),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new $o),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeConfiguration=this._register(new $o),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new $o),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new $o),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new $o),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new $o),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new $o),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new OF),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new OF),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new $o),this.onWillType=this._onWillType.event,this._onDidType=this._register(new $o),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new $o),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new $o),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new $o),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new $o),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new $o),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new $o),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new $o),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new $o),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onContextMenu=this._register(new $o),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new $o),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new $o),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new $o),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new $o),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new $o),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new $o),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new $o),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new $o),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new $o),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._bannerDomNode=null;const u=Object.assign({},t);let g;this._domElement=e,this._overflowWidgetsDomNode=u.overflowWidgetsDomNode,delete u.overflowWidgetsDomNode,this._id=++IF,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,u,d)),this._register(this._configuration.onDidChange((e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(131)){const e=t.get(131);this._onDidLayoutChange.fire(e)}}))),this._contextKeyService=this._register(r.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=s,this._themeService=a,this._register(new AF(this,this._contextKeyService)),this._register(new RF(this,this._contextKeyService,c)),this._instantiationService=n.createChild(new tF([Dy,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new PF(e),this._register(this._focusTracker.onChange((()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}))),this._contentWidgets={},this._overlayWidgets={},g=Array.isArray(i.contributions)?i.contributions:pS.getEditorContributions();for(const m of g)if(this._contributions[m.id])Jo(new Error(`Cannot have two contributions with the same id ${m.id}`));else try{const e=this._instantiationService.createInstance(m.ctor,this);this._contributions[m.id]=e}catch(p){Jo(p)}pS.getEditorActions().forEach((e=>{if(this._actions[e.id])return void Jo(new Error(`Cannot have two actions with the same id ${e.id}`));const t=new JM(e.id,e.label,e.alias,Qs(e.precondition),(()=>this._instantiationService.invokeFunction((t=>Promise.resolve(e.runEditorCommand(t,this,null))))),this._contextKeyService);this._actions[t.id]=t})),this._codeEditorService.addCodeEditor(this)}get isSimpleWidget(){return this._configuration.isSimpleWidget}_createConfiguration(e,t,i){return new OS(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return h_.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;tqo.lift(e))))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return GD.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(!er.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(!qo.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,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("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new qo(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(!er.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new qo(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=ar.isISelection(e),n=qo.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new ar(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("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new qo(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(!qo.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(qo.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]);const i=t.contributionsState||{},n=Object.keys(this._contributions);for(let t=0,s=n.length;te.isSupported())),e}getAction(e){return this._actions[e]||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t);n?Promise.resolve(n.run()).then(void 0,Jo):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&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){if(!this._modelData||0===t.length)return;const s=this._modelData.viewModel.getSelection().getStartPosition();this._modelData.viewModel.paste(t,i,n,e);const r=this._modelData.viewModel.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new qo(s.lineNumber,s.column,r.lineNumber,r.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=pS.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction((e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,Jo)})),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(81)&&(this._modelData.model.pushStackElement(),!0))}popUndoStop(){return!!this._modelData&&(!this._configuration.options.get(81)&&(this._modelData.model.popStackElement(),!0))}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(81))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>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)}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,mf(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,mf(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(131)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarMouseDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarMouseDown(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&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()),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 e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId()),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 e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(t){if(!this._modelData||!this._modelData.hasRealView)return null;const i=this._modelData.model.validatePosition(t),n=this._configuration.options,o=n.get(131);return{top:e._getVerticalOffsetForPosition(this._modelData,i.lineNumber,i.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(i.lineNumber,i.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft(),height:n.get(59)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Kf(e,this._configuration.options.get(44))}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)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount()),e.onBeforeAttached();const i=new JP(this._id,this._configuration,e,SF.create(),cF.create(this._configuration.options),(e=>KC(e)),this.languageConfigurationService,this._themeService);t.push(e.onDidChangeDecorations((e=>this._onDidChangeModelDecorations.fire(e)))),t.push(e.onDidChangeLanguage((t=>{this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t)}))),t.push(e.onDidChangeLanguageConfiguration((e=>this._onDidChangeModelLanguageConfiguration.fire(e)))),t.push(e.onDidChangeContent((e=>this._onDidChangeModelContent.fire(e)))),t.push(e.onDidChangeOptions((e=>this._onDidChangeModelOptions.fire(e)))),t.push(e.onWillDispose((()=>this.setModel(null)))),t.push(i.onEvent((e=>{switch(e.kind){case 0:this._onDidContentSizeChange.fire(e);break;case 1:this._editorTextFocus.setValue(e.hasFocus);break;case 2:this._onDidScrollChange.fire(e);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{e.reachedMaxCursorCount&&this._notificationService.warn($m(0,"The number of cursors has been limited to {0}.",YM.MAX_CURSOR_COUNT));const t=[];for(let o=0,s=e.selections.length;o{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",o)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new LI(e.coordinatesConverter);i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e);return[new cM(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){e&&e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}};MF=EF([NF(3,n_),NF(4,r_),NF(5,iy),NF(6,Dy),NF(7,Ry),NF(8,rF),NF(9,NS),NF(10,pv),NF(11,lb)],MF);class OF extends Uo{constructor(){super(),this._onDidChangeToTrue=this._register(new $o),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new $o),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class AF extends Uo{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=dI.editorSimpleInput.bindTo(t),this._editorFocus=dI.focus.bindTo(t),this._textInputFocus=dI.textInputFocus.bindTo(t),this._editorTextFocus=dI.editorTextFocus.bindTo(t),this._editorTabMovesFocus=dI.tabMovesFocus.bindTo(t),this._editorReadonly=dI.readOnly.bindTo(t),this._inDiffEditor=dI.inDiffEditor.bindTo(t),this._editorColumnSelection=dI.columnSelection.bindTo(t),this._hasMultipleSelections=dI.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=dI.hasNonEmptySelection.bindTo(t),this._canUndo=dI.canUndo.bindTo(t),this._canRedo=dI.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromConfig()))),this._register(this._editor.onDidChangeCursorSelection((()=>this._updateFromSelection()))),this._register(this._editor.onDidFocusEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidFocusEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidChangeModel((()=>this._updateFromModel()))),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromModel()))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(130)),this._editorReadonly.set(e.get(81)),this._inDiffEditor.set(e.get(54)),this._editorColumnSelection.set(e.get(18))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some((e=>!e.isEmpty())))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class RF extends Uo{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=dI.languageId.bindTo(t),this._hasCompletionItemProvider=dI.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=dI.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=dI.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=dI.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=dI.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=dI.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=dI.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=dI.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=dI.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=dI.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=dI.hasReferenceProvider.bindTo(t),this._hasRenameProvider=dI.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=dI.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=dI.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=dI.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=dI.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=dI.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=dI.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=dI.isInWalkThroughSnippet.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._isInWalkThrough.reset()}))}_update(){const e=this._editor.getModel();e?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._isInWalkThrough.set(e.uri.scheme===IC.walkThroughSnippet)})):this.reset()}}class PF extends Uo{constructor(e){super(),this._onChange=this._register(new $o),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(kw(e)),this._register(this._domFocusTracker.onDidFocus((()=>{this._hasFocus=!0,this._onChange.fire(void 0)}))),this._register(this._domFocusTracker.onDidBlur((()=>{this._hasFocus=!1,this._onChange.fire(void 0)})))}hasFocus(){return this._hasFocus}}const FF=encodeURIComponent("");function VF(e){return FF+encodeURIComponent(e.toString())+BF}const WF=encodeURIComponent('');zy(((e,t)=>{const i=e.getColor(Kx);i&&t.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${i}; }`);const n=e.getColor($x);n&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${VF(n)}") repeat-x bottom left; }`);const o=e.getColor(Ux);o&&t.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${o}; }`);const s=e.getColor(Zx);s&&t.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${s}; }`);const r=e.getColor(Gx);r&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${VF(r)}") repeat-x bottom left; }`);const a=e.getColor(qx);a&&t.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=e.getColor(Qx);l&&t.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const d=e.getColor(Xx);d&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${VF(d)}") repeat-x bottom left; }`);const h=e.getColor(Yx);h&&t.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${h}; }`);const c=e.getColor(ek);c&&t.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${c}; }`);const u=e.getColor(Jx);var g;u&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${g=u,WF+encodeURIComponent(g.toString())+HF}") no-repeat bottom left; }`);const p=e.getColor(GE);p&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${p.rgba.a}; }`);const m=e.getColor(qE);m&&t.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${m}; }`);const f=e.getColor(ik)||"inherit";t.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${f}}`)}));class zF{constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new $o({onFirstListenerAdd:()=>e.addEventListener(t,n,i),onLastListenerRemove:()=>e.removeEventListener(t,n,i)})}get event(){return this.emitter.event}dispose(){this.emitter.dispose()}}function jF(e){return e.preventDefault(),e.stopPropagation(),e}var UF=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};var $F,KF;(KF=$F||($F={})).North="north",KF.South="south",KF.East="east",KF.West="west";const qF=new $o;const GF=new $o;class ZF{constructor(){this.disposables=new Cs}get onPointerMove(){return this.disposables.add(new zF(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new zF(window,"mouseup")).event}dispose(){this.disposables.dispose()}}UF([VS],ZF.prototype,"onPointerMove",null),UF([VS],ZF.prototype,"onPointerUp",null);class YF{constructor(e){this.el=e,this.disposables=new Cs}get onPointerMove(){return this.disposables.add(new zF(this.el,WS.Change)).event}get onPointerUp(){return this.disposables.add(new zF(this.el,WS.End)).event}dispose(){this.disposables.dispose()}}UF([VS],YF.prototype,"onPointerMove",null),UF([VS],YF.prototype,"onPointerUp",null);class XF{constructor(e){this.factory=e}get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}dispose(){}}UF([VS],XF.prototype,"onPointerMove",null),UF([VS],XF.prototype,"onPointerUp",null);class QF extends Uo{constructor(e,t,i){super(),this.hoverDelay=300,this.hoverDelayer=this._register(new Av(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 Cs),this.orthogonalStartDragHandleDisposables=this._register(new Cs),this.orthogonalEndSashDisposables=this._register(new Cs),this.orthogonalEndDragHandleDisposables=this._register(new Cs),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=Lw(e,Mw(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Ho&&this.el.classList.add("mac");const n=this._register(new zF(this.el,"mousedown")).event;this._register(n((e=>this.onPointerStart(e,new ZF)),this));const o=this._register(new zF(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new zF(this.el,"mouseenter")).event;this._register(s((()=>QF.onMouseEnter(this))));const r=this._register(new zF(this.el,"mouseleave")).event;this._register(r((()=>QF.onMouseLeave(this)))),this._register($S.addTarget(this.el));const a=ds.map(this._register(new zF(this.el,WS.Start)).event,(e=>{var t;return Object.assign(Object.assign({},e),{target:null!==(t=e.initialTarget)&&void 0!==t?t:null})}));this._register(a((e=>this.onPointerStart(e,new YF(this.el))),this));const l=this._register(new zF(this.el,WS.Tap)).event,d=ds.map(ds.filter(ds.debounce(l,((e,t)=>{var i;return{event:t,count:(null!==(i=null==e?void 0:e.count)&&void 0!==i?i:0)+1}}),250),(({count:e})=>2===e)),(({event:e})=>{var t;return Object.assign(Object.assign({},e),{target:null!==(t=e.initialTarget)&&void 0!==t?t:null})}));this._register(d(this.onPointerDoublePress,this)),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(qF.event((e=>{this.size=e,this.layout()})))),this._register(GF.event((e=>this.hoverDelay=e))),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(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",false),this.layout()}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",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=Lw(this.el,Mw(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(es((()=>this._orthogonalStartDragHandle.remove()))),this.orthogonalStartDragHandleDisposables.add(new zF(this._orthogonalStartDragHandle,"mouseenter")).event((()=>QF.onMouseEnter(e)),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new zF(this._orthogonalStartDragHandle,"mouseleave")).event((()=>QF.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.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=Lw(this.el,Mw(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(es((()=>this._orthogonalEndDragHandle.remove()))),this.orthogonalEndDragHandleDisposables.add(new zF(this._orthogonalEndDragHandle,"mouseenter")).event((()=>QF.onMouseEnter(e)),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new zF(this._orthogonalEndDragHandle,"mouseleave")).event((()=>QF.onMouseLeave(e)),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}onPointerStart(e,t){Sw(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new XF(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new XF(t))),!this.state)return;const n=(o="iframe",Array.prototype.slice.call(document.getElementsByTagName(o),0));var o;for(const u of n)u.classList.add("pointer-events-disabled");const s=e.pageX,r=e.pageY,a=e.altKey,l={startX:s,currentX:s,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const d=fw(this.el),h=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":Ho?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":Ho?"col-resize":"ew-resize",d.textContent=`* { cursor: ${e} !important; }`},c=new Cs;h(),i||this.onDidEnablementChange.event(h,null,c);t.onPointerMove((e=>{Sw(e,!1);const t={startX:s,currentX:e.pageX,startY:r,currentY:e.pageY,altKey:a};this._onDidChange.fire(t)}),null,c),t.onPointerUp((e=>{Sw(e,!1),this.el.removeChild(d),this.el.classList.remove("active"),this._onDidEnd.fire(),c.dispose();for(const t of n)t.classList.remove("pointer-events-disabled")}),null,c),c.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger((()=>e.el.classList.add("hover")),e.hoverDelay).then(void 0,(()=>{})),!t&&e.linkedSash&&QF.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&QF.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){QF.onMouseLeave(this)}layout(){if(0===this.orientation){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){if(e.target&&e.target instanceof HTMLElement)return e.target.classList.contains("orthogonal-drag-handle")?e.target.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}class JF{constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}static capture(e){let t=null,i=0;if(0!==e.getScrollTop()){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 JF(t,i,e.getPosition())}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}const eB={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:uE.text,TERMINALS:"Terminals"};class tB{constructor(e){this.data=e}update(){}getData(){return this.data}}const iB={CurrentDragAndDropData:void 0};class nB extends Uo{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Xw&&this._register(t.onDidChange((e=>{this.element&&this.handleActionChangeEvent(e)})))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new Qw)),this._actionRunner}set actionRunner(e){this._actionRunner=e}getAction(){return this._action}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register($S.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,Rf&&this._register(BC(e,yw.DRAG_START,(e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(eB.TEXT,this._action.label)})))),this._register(BC(t,WS.Tap,(e=>this.onClick(e,!0)))),this._register(BC(t,yw.MOUSE_DOWN,(e=>{i||Sw(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")}))),Ho&&this._register(BC(t,yw.CONTEXT_MENU,(e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)}))),this._register(BC(t,yw.CLICK,(e=>{Sw(e,!0),this.options&&this.options.isMenu||this.onClick(e)}))),this._register(BC(t,yw.DBLCLICK,(e=>{Sw(e,!0)}))),[yw.MOUSE_UP,yw.MOUSE_OUT].forEach((e=>{this._register(BC(t,e,(e=>{Sw(e),t.classList.remove("active")})))}))}onClick(e,t=!1){var i;Sw(e,!0);const n=Tr(this._context)?(null===(i=this.options)||void 0===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(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),super.dispose()}}class oB extends nB{constructor(e,t,i={}){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=Lw(this.element,Mw("a.action-label"))),this.label&&(this._action.id===Jw.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&(Lw(this.element,Mw("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.getAction().label)}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=$m(0,"{0} ({1})",e,this.options.keybinding))),e&&this.label&&(this.label.title=e)}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getAction().class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label&&this.label.classList.remove("codicon")}updateEnabled(){this.getAction().enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element&&this.element.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element&&this.element.classList.add("disabled"))}updateChecked(){this.label&&(this.getAction().checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}var sB=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class rB extends Uo{constructor(e,t={}){var i,n,o,s,r,a;let l,d;switch(super(),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new $o),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new $o({onFirstListenerAdd:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new $o),this.onDidRun=this._onDidRun.event,this._onBeforeRun=this._register(new $o),this.onBeforeRun=this._onBeforeRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(n=this.options.orientation)&&void 0!==n?n:0,this._triggerKeys={keyDown:null!==(s=null===(o=this.options.triggerKeys)||void 0===o?void 0:o.keyDown)&&void 0!==s&&s,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Qw,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._register(this._actionRunner.onBeforeRun((e=>this._onBeforeRun.fire(e)))),this._actionIds=[],this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",!1!==t.animated&&this.domNode.classList.add("animated"),this._orientation){case 0:l=[15],d=[17];break;case 1:l=[16],d=[18],this.domNode.className+=" vertical"}this._register(BC(this.domNode,yw.KEY_DOWN,(e=>{const t=new SC(e);let i=!0;const n="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;l&&(t.equals(l[0])||t.equals(l[1]))?i=this.focusPrevious():d&&(t.equals(d[0])||t.equals(d[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?i=this.focusFirst():t.equals(13)?i=this.focusLast():t.equals(2)&&n instanceof nB&&n.trapsArrowNavigation?i=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())}))),this._register(BC(this.domNode,yw.KEY_UP,(e=>{const t=new SC(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&this.updateFocusedItem()}))),this.focusTracker=this._register(kw(this.domNode)),this._register(this.focusTracker.onDidBlur((()=>{mw()!==this.domNode&&dw(mw(),this.domNode)||(this._onDidBlur.fire(),this.focusedItem=void 0,this.previouslyFocusedItem=void 0,this.triggerKeyDown=!1)}))),this._register(this.focusTracker.onDidFocus((()=>this.updateFocusedItem()))),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role","toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role","toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find((e=>e instanceof nB&&e.isEnabled()));e instanceof nB&&e.setFocusable(!0)}else this.viewItems.forEach((e=>{e instanceof nB&&e.setFocusable(!1)}))}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach((i=>{t=t||e.equals(i)})),t}updateFocusedItem(){for(let e=0;et.setActionContext(e)))}get actionRunner(){return this._actionRunner}set actionRunner(e){e&&(this._actionRunner=e,this.viewItems.forEach((t=>t.actionRunner=e)))}getContainer(){return this.domNode}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=vr(t.index)?t.index:null;i.forEach((e=>{const i=document.createElement("li");let o;i.className="action-item",i.setAttribute("role","presentation"),this.options.allowContextMenu||this._register(BC(i,yw.CONTEXT_MENU,(e=>{Sw(e,!0)}))),this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e)),o||(o=new oB(this.context,e,t)),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),this.focusable&&o instanceof nB&&0===this.viewItems.length&&o.setFocusable(!0),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(o),this._actionIds.push(e.id)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,o),this._actionIds.splice(n,0,e.id),n++)})),"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}clear(){bs(this.viewItems),this.viewItems=[],this._actionIds=[],RC(this.actionsList),this.refreshRole()}length(){return this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){const e=this.viewItems.findIndex((e=>e.isEnabled()));this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),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(void 0===this.focusedItem)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());return this.updateFocus(),!0}focusPrevious(e){if(void 0===this.focusedItem)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());return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var n;void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&(null===(n=this.viewItems[this.previouslyFocusedItem])||void 0===n||n.blur());const o=void 0!==this.focusedItem&&this.viewItems[this.focusedItem];if(o){let n=!0;ua(o.focus)||(n=!1),this.options.focusOnlyEnabledItems&&ua(o.isEnabled)&&!o.isEnabled()&&(n=!1),n?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof nB){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}run(e,t){return sB(this,void 0,void 0,(function*(){yield this._actionRunner.run(e,t)}))}dispose(){bs(this.viewItems),this.viewItems=[],this._actionIds=[],this.getContainer().remove(),super.dispose()}}var aB;(aB||(aB={})).getDefinition=function(e,t){let i=e.defaults;for(;Fy.isThemeIcon(i);){const e=lB.getIcon(i.id);if(!e)return;i=e.defaults}return i};const lB=new class{constructor(){this._onDidChange=new $o,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:$m(0,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:$m(0,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Ys.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 t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return o}let s={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=s;let r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,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=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;Fy.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`};let i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map((e=>this.iconsById[e]));for(const o of n.filter((e=>!!e.description)).sort(e))i.push(`||${o.id}|${Fy.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter((e=>!Fy.isThemeIcon(e.defaults))).sort(e))i.push(`||${o.id}|`);return i.join("\n")}};function dB(e,t,i,n){return lB.registerIcon(e,t,i,n)}function hB(){return lB}My.add("base.contributions.icons",lB),function(){for(const e of br.getAll())lB.registerIcon(e.id,e.definition,e.description)}();let cB=My.as(JS);cB.registerSchema("vscode://schemas/icons",lB.getIconSchema());const uB=new Hv((()=>cB.notifySchemaChanged("vscode://schemas/icons")),200);lB.onDidChange((()=>{uB.isScheduled()||uB.schedule()}));const gB=dB("widget-close",br.close,$m(0,"Icon for the close action in widgets."));dB("goto-previous-location",br.arrowUp,$m(0,"Icon for goto previous editor location.")),dB("goto-next-location",br.arrowDown,$m(0,"Icon for goto next editor location.")),Fy.modify(br.sync,"spin"),Fy.modify(br.loading,"spin");var pB,mB=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},fB=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},_B=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class vB{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0}}class bB{constructor(e){this.entries=e}}const CB=dB("diff-review-insert",br.add,$m(0,"Icon for 'Insert' in diff review.")),wB=dB("diff-review-remove",br.remove,$m(0,"Icon for 'Remove' in diff review.")),yB=dB("diff-review-close",br.close,$m(0,"Icon for 'Close' in diff review."));let SB=class e extends Uo{constructor(e,t){super(),this._languageService=t,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=$f(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=$f(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new rB(this.actionBarContainer.domNode)),this._actionBar.push(new Xw("diffreview.close",$m(0,"Close"),"close-diff-review "+Fy.asClassName(yB),!0,(()=>_B(this,void 0,void 0,(function*(){return this.hide()})))),{label:!1,icon:!0}),this.domNode=$f(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=$f(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new sT(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff((()=>{this._isVisible&&(this._diffs=this._compute(),this._render())}))),this._register(e.getModifiedEditor().onDidChangeCursorPosition((()=>{this._isVisible&&this._render()}))),this._register(WC(this.domNode.domNode,"click",(e=>{e.preventDefault();const t=hw(e.target,"diff-review-row");t&&this._goToRow(t)}))),this._register(WC(this.domNode.domNode,"keydown",(e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._goToRow(this._getNextRow())),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._goToRow(this._getPrevRow())),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this.hide()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this.accept())}))),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e0){const t=e[l-1];n=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let s=t-3+1,d=i-3+1;if(ss){const e=s-m;m+=e,f+=e}if(f>p){const e=p-f;m+=e,f+=e}u[g++]=new vB(n,m,o,f)}n[o++]=new bB(u)}let s=n[0].entries;const r=[];let a=0;for(let l=1,d=n.length;lc)&&(c=n),0!==o&&(0===u||og)&&(g=s)}const p=document.createElement("div");p.className="diff-review-row";const m=document.createElement("div");m.className="diff-review-cell diff-review-summary";const f=c-h+1,_=g-u+1;m.appendChild(document.createTextNode(`${a+1}/${this._diffs.length}: @@ -${h},${f} +${u},${_} @@`)),p.setAttribute("data-line",String(u));const v=e=>0===e?$m(0,"no lines changed"):1===e?$m(0,"1 line changed"):$m(0,"{0} lines changed",e),b=v(f),C=v(_);p.setAttribute("aria-label",$m(0,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",a+1,this._diffs.length,h,b,u,C)),p.appendChild(m),p.setAttribute("role","listitem"),d.appendChild(p);const w=i.get(59);let y=u;for(let S=0,x=l.length;Se}),SB=mB([fB(1,rv)],SB),zy(((e,t)=>{const i=e.getColor(BE);i&&t.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${i}; }`);const n=e.getColor(Vx);n&&t.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${n} 0 -6px 6px -6px inset; }`)}));function xB(e){const t=e.get(r_),i=t.listDiffEditors(),n=t.getActiveCodeEditor();if(!n)return null;for(let o=0,s=i.length;on.modifiedStartLineNumber?$m(0,"Copy deleted lines"):$m(0,"Copy deleted line"):n.originalEndLineNumber>n.modifiedStartLineNumber?$m(0,"Copy changed lines"):$m(0,"Copy changed line"),void 0,!0,(()=>EB(this,void 0,void 0,(function*(){const e=new qo(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),t=n.originalModel.getValueInRange(e);yield this._clipboardService.writeText(t)})))));let h,c=0;n.originalEndLineNumber>n.modifiedStartLineNumber&&(h=new Xw("diff.clipboard.copyDeletedLineContent",$m(0,d?"Copy deleted line ({0})":"Copy changed line ({0})",n.originalStartLineNumber),void 0,!0,(()=>EB(this,void 0,void 0,(function*(){const e=n.originalModel.getLineContent(n.originalStartLineNumber+c);if(""===e){const e=n.originalModel.getEndOfLineSequence();yield this._clipboardService.writeText(0===e?"\n":"\r\n")}else yield this._clipboardService.writeText(e)})))),l.push(h));i.getOption(81)||l.push(new Xw("diff.inline.revertChange",$m(0,"Revert this change"),void 0,!0,(()=>EB(this,void 0,void 0,(function*(){const e=new qo(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),t=n.originalModel.getValueInRange(e);if(0===n.modifiedEndLineNumber){const e=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new qo(n.modifiedStartLineNumber,e,n.modifiedStartLineNumber,e),text:a+t}])}else{const e=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new qo(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,e),text:t}])}})))));const u=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(h&&(h.label=$m(0,d?"Copy deleted line ({0})":"Copy changed line ({0})",n.originalStartLineNumber+c)),l),autoSelectFirstItem:!0})};this._register(WC(this._diffActions,"mousedown",(e=>{const{top:t,height:i}=nw(this._diffActions),n=Math.floor(r/3);e.preventDefault(),u(e.posx,t+i+n)}))),this._register(i.onMouseMove((e=>{if(8===e.target.type||5===e.target.type){e.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,c=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,r)):this.visibility=!1}else this.visibility=!1}))),this._register(i.onMouseDown((e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){e.target.detail.viewZoneId===this._viewZoneId&&(e.event.preventDefault(),c=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,r),u(e.event.posx,e.event.posy+r))}})))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}_updateLightBulbPosition(e,t,i){const{top:n}=nw(e),o=t-n,s=Math.floor(o/i),r=s*i;if(this._diffActions.style.top=`${r}px`,this.diff.viewLineCounts){let e=0;for(let t=0;t=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},RB=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};class PB{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter((e=>!this._zonesMap[String(e.id)]))}clean(e){this._zones.length>0&&e.changeViewZones((e=>{for(const t of this._zones)e.removeZone(t)})),this._zones=[],this._zonesMap={},this._decorations=e.deltaDecorations(this._decorations,[])}apply(e,t,i,n){const o=n?JF.capture(e):null;e.changeViewZones((t=>{var n;for(const e of this._zones)t.removeZone(e);for(const e of this._inlineDiffMargins)e.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let o=0,s=i.zones.length;oe});let HB=class e extends Uo{constructor(t,i,n,o,s,r,a,l,d,h,c,u){super(),this._editorProgressService=u,this._onDidDispose=this._register(new $o),this.onDidDispose=this._onDidDispose.event,this._onDidUpdateDiff=this._register(new $o),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new $o),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._editorWorkerService=s,this._codeEditorService=l,this._contextKeyService=this._register(r.createScoped(t)),this._instantiationService=a.createChild(new tF([Dy,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=d,this._notificationService=h,this._id=++FB,this._state=0,this._updatingDiffProgress=null,this._domElement=t,i=i||{},this._options=tV(i,{enableSplitViewResizing:!0,renderSideBySide:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit"}),void 0!==i.isInEmbeddedEditor?this._contextKeyService.createKey("isInEmbeddedDiffEditor",i.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._updateDecorationsRunner=this._register(new Hv((()=>this._updateDecorations()),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=$f(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"),this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(WC(this._overviewDomElement,"mousedown",(e=>{this._modifiedEditor.delegateVerticalScrollbarMouseDown(e)}))),this._options.renderOverviewRuler&&this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode),this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new PB(c,o),this._modifiedEditorState=new PB(c,o),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new xS(this._containerDomElement,i.dimension)),this._register(this._elementSizeObserver.onDidChange((()=>this._onDidContainerSizeChanged()))),i.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null,this._originalEditor=this._createLeftHandSideEditor(i,n.originalEditor||{}),this._modifiedEditor=this._createRightHandSideEditor(i,n.modifiedEditor||{}),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=a.createInstance(SB,this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._options.renderSideBySide?this._setStrategy(new qB(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new ZB(this._createDataSource(),this._options.enableSplitViewResizing)),this._register(d.onDidColorThemeChange((t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)})));const g=pS.getDiffEditorContributions();for(const e of g)try{this._register(a.createInstance(e.ctor,this))}catch(p){Jo(p)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e,this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),1===this._state&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let i="monaco-diff-editor monaco-editor-background ";return t&&(i+="side-by-side "),i+=Vy(e.type),i}_recreateOverviewRulers(){this._options.renderOverviewRuler&&(this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._originalEditor.hasModel()&&(this._originalOverviewRuler=this._originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this._modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers())}_createLeftHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._originalDomNode,this._adjustOptionsForLeftHandSide(t),i);this._register(n.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._modifiedEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(n.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(n.onDidChangeConfiguration((e=>{n.getModel()&&(e.hasChanged(44)&&this._updateDecorationsRunner.schedule(),e.hasChanged(132)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(n.onDidChangeHiddenAreas((()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()}))),this._register(n.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})));const o=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(n.onDidContentSizeChange((t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),n}_createRightHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t),i);this._register(n.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._originalEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(n.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(n.onDidChangeConfiguration((e=>{n.getModel()&&(e.hasChanged(44)&&this._updateDecorationsRunner.schedule(),e.hasChanged(132)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(n.onDidChangeHiddenAreas((()=>{this._updateDecorationsRunner.cancel(),this._updateDecorations()}))),this._register(n.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}))),this._register(n.onDidChangeModelOptions((e=>{e.tabSize&&this._updateDecorationsRunner.schedule()})));const o=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(n.onDidContentSizeChange((t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),n}_createInnerEditor(e,t,i,n){return e.createInstance(MF,t,i,n)}dispose(){this._codeEditorService.removeDiffEditor(this),-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._options.renderOverviewRuler&&this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this._originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this._modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode),this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return h_.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(t){const i=tV(t,this._options),n=(o=this._options,s=i,{enableSplitViewResizing:o.enableSplitViewResizing!==s.enableSplitViewResizing,renderSideBySide:o.renderSideBySide!==s.renderSideBySide,maxComputationTime:o.maxComputationTime!==s.maxComputationTime,maxFileSize:o.maxFileSize!==s.maxFileSize,ignoreTrimWhitespace:o.ignoreTrimWhitespace!==s.ignoreTrimWhitespace,renderIndicators:o.renderIndicators!==s.renderIndicators,originalEditable:o.originalEditable!==s.originalEditable,diffCodeLens:o.diffCodeLens!==s.diffCodeLens,renderOverviewRuler:o.renderOverviewRuler!==s.renderOverviewRuler,diffWordWrap:o.diffWordWrap!==s.diffWordWrap});var o,s;this._options=i;const r=n.ignoreTrimWhitespace||n.renderIndicators,a=this._isVisible&&(n.maxComputationTime||n.maxFileSize);r?this._beginUpdateDecorations():a&&this._beginUpdateDecorationsSoon(),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t)),this._strategy.setEnableSplitViewResizing(this._options.enableSplitViewResizing),n.renderSideBySide&&(this._options.renderSideBySide?this._setStrategy(new qB(this._createDataSource(),this._options.enableSplitViewResizing)):this._setStrategy(new ZB(this._createDataSource(),this._options.enableSplitViewResizing)),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._options.renderSideBySide)),n.renderOverviewRuler&&(this._options.renderOverviewRuler?this._containerDomElement.appendChild(this._overviewDomElement):this._containerDomElement.removeChild(this._overviewDomElement))}getModel(){return{original:this._originalEditor.getModel(),modified:this._modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this._originalEditor.setModel(e?e.original:null),this._modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this._originalEditor.setScrollTop(0),this._modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._recreateOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport()}getContainerDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this._modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._modifiedEditor.getPosition()}setPosition(e,t="api"){this._modifiedEditor.setPosition(e,t)}revealLine(e,t=0){this._modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this._modifiedEditor.getSelection()}getSelections(){return this._modifiedEditor.getSelections()}setSelection(e,t="api"){this._modifiedEditor.setSelection(e,t)}setSelections(e,t="api"){this._modifiedEditor.setSelections(e,t)}revealLines(e,t,i=0){this._modifiedEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._modifiedEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._modifiedEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._modifiedEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._modifiedEditor.getSupportedActions()}saveViewState(){return{original:this._originalEditor.saveViewState(),modified:this._modifiedEditor.saveViewState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._originalEditor.restoreViewState(t.original),this._modifiedEditor.restoreViewState(t.modified)}}layout(e){this._elementSizeObserver.observe(e)}focus(){this._modifiedEditor.focus()}hasTextFocus(){return this._originalEditor.hasTextFocus()||this._modifiedEditor.hasTextFocus()}trigger(e,t,i){this._modifiedEditor.trigger(e,t,i)}changeDecorations(e){return this._modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._options.renderOverviewRuler)return;if(!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const t=this._elementSizeObserver.getHeight(),i=this._getReviewHeight(),n=e.ENTIRE_DIFF_OVERVIEW_WIDTH-2*e.ONE_OVERVIEW_WIDTH;this._modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:e.ONE_OVERVIEW_WIDTH,right:n+e.ONE_OVERVIEW_WIDTH,height:t-i}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:e.ONE_OVERVIEW_WIDTH,height:t-i}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout((()=>this._beginUpdateDecorations()),e.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t||!(!e||!t)&&e.toString()===t.toString()}_beginUpdateDecorations(){this._beginUpdateDecorationsTimeout=-1;const t=this._originalEditor.getModel(),i=this._modifiedEditor.getModel();if(!t||!i)return;this._diffComputationToken++;const n=this._diffComputationToken,o=1024*this._options.maxFileSize*1024,s=e=>{const t=e.getValueLength();return 0===o||t<=o};s(t)&&s(i)?(this._setState(1),this._editorWorkerService.computeDiff(t.uri,i.uri,this._options.ignoreTrimWhitespace,this._options.maxComputationTime).then((e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=e,this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())}),(e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())}))):e._equals(t.uri,this._lastOriginalWarning)&&e._equals(i.uri,this._lastModifiedWarning)||(this._lastOriginalWarning=t.uri,this._lastModifiedWarning=i.uri,this._notificationService.warn($m(0,"Cannot compare files because one file is too large.")))}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this._originalEditor),this._modifiedEditorState.clean(this._modifiedEditor)}_updateDecorations(){if(!this._originalEditor.getModel()||!this._modifiedEditor.getModel())return;const e=this._diffComputationResult?this._diffComputationResult.changes:[],t=this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces()),i=this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces()),n=this._strategy.getEditorsDiffDecorations(e,this._options.ignoreTrimWhitespace,this._options.renderIndicators,t,i);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this._originalEditor,this._originalOverviewRuler,n.original,!1),this._modifiedEditorState.apply(this._modifiedEditor,this._modifiedOverviewRuler,n.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){const t=Object.assign({},e);return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._options.renderSideBySide?t.wordWrapOverride1=this._options.diffWordWrap:(t.wordWrapOverride1="off",t.wordWrapOverride2="off"),e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.readOnly=!this._options.originalEditable,t.extraEditorClassName="original-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}_adjustOptionsForRightHandSide(t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.wordWrapOverride1=this._options.diffWordWrap,i.revealHorizontalRightPadding=Ef.revealHorizontalRightPadding.defaultValue+e.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",Object.assign(Object.assign({},i),{dimension:{height:0,width:0}})}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const t=this._elementSizeObserver.getWidth(),i=this._elementSizeObserver.getHeight(),n=this._getReviewHeight(),o=this._strategy.layout();this._originalDomNode.style.width=o+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=t-o+"px",this._modifiedDomNode.style.left=o+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=i-n+"px",this._overviewDomElement.style.width=e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=t-e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(e.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:o,height:i-n}),this._modifiedEditor.layout({width:t-o-(this._options.renderOverviewRuler?e.ENTIRE_DIFF_OVERVIEW_WIDTH:0),height:i-n}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(i-n,t,n),this._layoutOverviewViewport()}_layoutOverviewViewport(){const e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){const e=this._modifiedEditor.getLayoutInfo();if(!e)return null;const t=this._modifiedEditor.getScrollTop(),i=this._modifiedEditor.getScrollHeight(),n=Math.max(0,e.height),o=Math.max(0,n-0),s=i>0?o/i:0;return{height:Math.max(0,Math.floor(e.height*s)),top:Math.floor(t*s)}}_createDataSource(){return{getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getOptions:()=>({renderOverviewRuler:this._options.renderOverviewRuler}),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this._originalEditor,getModifiedEditor:()=>this._modifiedEditor}}_setStrategy(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const i=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===i.length||e=a?n=s+1:(n=s,o=s)}return i[n]}_getEquivalentLineForOriginalLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.originalStartLineNumber));if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-i;return r<=o?n+Math.min(r,s):n+s-o+r}_getEquivalentLineForModifiedLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.modifiedStartLineNumber));if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-n;return r<=s?i+Math.min(r,o):i+o-s+r}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};HB.ONE_OVERVIEW_WIDTH=15,HB.ENTIRE_DIFF_OVERVIEW_WIDTH=30,HB.UPDATE_DIFF_DECORATIONS_DELAY=200,HB=AB([RB(3,IB),RB(4,kB),RB(5,Dy),RB(6,n_),RB(7,r_),RB(8,Ry),RB(9,rF),RB(10,DB),RB(11,MB)],HB);class zB extends Uo{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=e.getColor(Zk)||(e.getColor(jk)||Hk).transparent(2),i=e.getColor(Yk)||(e.getColor(Uk)||zk).transparent(2),n=!t.equals(this._insertColor)||!i.equals(this._removeColor);return this._insertColor=t,this._removeColor=i,n}getEditorsDiffDecorations(e,t,i,n,o){o=o.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber)),n=n.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber));const s=this._getViewZones(e,n,o,i),r=this._getOriginalEditorDecorations(s,e,t,i),a=this._getModifiedEditorDecorations(s,e,t,i);return{original:{decorations:r.decorations,overviewZones:r.overviewZones,zones:s.original},modified:{decorations:a.decorations,overviewZones:a.overviewZones,zones:s.modified}}}}class jB{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._indexe.afterLineNumber-t.afterLineNumber,_=(e,t)=>{if(null===t.domNode&&e.length>0){const i=e[e.length-1];if(i.afterLineNumber===t.afterLineNumber&&null===i.domNode)return void(i.heightInLines+=t.heightInLines)}e.push(t)},v=new jB(this._modifiedForeignVZ),b=new jB(this._originalForeignVZ);let C=1,w=1;for(let y=0,S=this._lineChanges.length;y<=S;y++){const i=y0?-1:0),g=i.modifiedStartLineNumber+(i.modifiedEndLineNumber>0?-1:0),c=i.originalEndLineNumber>0?UB._getViewLineCount(this._originalEditor,i.originalStartLineNumber,i.originalEndLineNumber):0,h=i.modifiedEndLineNumber>0?UB._getViewLineCount(this._modifiedEditor,i.modifiedStartLineNumber,i.modifiedEndLineNumber):0,p=Math.max(i.originalStartLineNumber,i.originalEndLineNumber),m=Math.max(i.modifiedStartLineNumber,i.modifiedEndLineNumber)):(u+=1e7+c,g+=1e7+h,p=u,m=g);let n=[],x=[];if(o){let e;e=i?i.originalEndLineNumber>0?i.originalStartLineNumber-C:i.modifiedStartLineNumber-w:s.getLineCount()-C+1;for(let t=0;ts&&x.push({afterLineNumber:i,heightInLines:o-s,domNode:null,marginDomNode:null})}i&&(C=(i.originalEndLineNumber>0?i.originalEndLineNumber:i.originalStartLineNumber)+1,w=(i.modifiedEndLineNumber>0?i.modifiedEndLineNumber:i.modifiedStartLineNumber)+1)}for(;v.current&&v.current.afterLineNumber<=m;){let e;e=v.current.afterLineNumber<=g?u-g+v.current.afterLineNumber:p;let o=null;i&&i.modifiedStartLineNumber<=v.current.afterLineNumber&&v.current.afterLineNumber<=i.modifiedEndLineNumber&&(o=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),n.push({afterLineNumber:e,heightInLines:v.current.height/t,domNode:null,marginDomNode:o}),v.advance()}for(;b.current&&b.current.afterLineNumber<=p;){let t;t=b.current.afterLineNumber<=u?g-u+b.current.afterLineNumber:m,x.push({afterLineNumber:t,heightInLines:b.current.height/e,domNode:null}),b.advance()}if(null!==i&&XB(i)){const e=this._produceOriginalFromDiff(i,c,h);e&&n.push(e)}if(null!==i&&QB(i)){const e=this._produceModifiedFromDiff(i,c,h);e&&x.push(e)}let k=0,L=0;for(n=n.sort(f),x=x.sort(f);k=t.heightInLines?(e.heightInLines-=t.heightInLines,L++):(t.heightInLines-=e.heightInLines,k++)}for(;k(e.domNode||(e.domNode=JB()),e)))}}function $B(e,t,i,n,o){return{range:new qo(e,t,i,n),options:o}}const KB={charDelete:RP.register({description:"diff-editor-char-delete",className:"char-delete"}),charDeleteWholeLine:RP.register({description:"diff-editor-char-delete-whole-line",className:"char-delete",isWholeLine:!0}),charInsert:RP.register({description:"diff-editor-char-insert",className:"char-insert"}),charInsertWholeLine:RP.register({description:"diff-editor-char-insert-whole-line",className:"char-insert",isWholeLine:!0}),lineInsert:RP.register({description:"diff-editor-line-insert",className:"line-insert",marginClassName:"gutter-insert",isWholeLine:!0}),lineInsertWithSign:RP.register({description:"diff-editor-line-insert-with-sign",className:"line-insert",linesDecorationsClassName:"insert-sign "+Fy.asClassName(BB),marginClassName:"gutter-insert",isWholeLine:!0}),lineDelete:RP.register({description:"diff-editor-line-delete",className:"line-delete",marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteWithSign:RP.register({description:"diff-editor-line-delete-with-sign",className:"line-delete",linesDecorationsClassName:"delete-sign "+Fy.asClassName(VB),marginClassName:"gutter-delete",isWholeLine:!0}),lineDeleteMargin:RP.register({description:"diff-editor-line-delete-margin",marginClassName:"gutter-delete"})};class qB extends zB{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new QF(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart((()=>this._onSashDragStart())),this._sash.onDidChange((e=>this._onSashDrag(e))),this._sash.onDidEnd((()=>this._onSashDragEnd())),this._sash.onDidReset((()=>this._onSashReset()))}setEnableSplitViewResizing(e){const t=!1===e;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?HB.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let i=Math.floor((e||.5)*t);const n=Math.floor(.5*t);return i=this._disableSash?n:i||n,t>2*qB.MINIMUM_EDITOR_WIDTH?(it-qB.MINIMUM_EDITOR_WIDTH&&(i=t-qB.MINIMUM_EDITOR_WIDTH)):i=n,this._sashPosition!==i&&(this._sashPosition=i),this._sash.layout(),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?HB.ENTIRE_DIFF_OVERVIEW_WIDTH:0),i=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=i/t,this._dataSource.relayoutEditors()}_onSashDragEnd(){this._sash.layout()}_onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}_getViewZones(e,t,i){const n=this._dataSource.getOriginalEditor(),o=this._dataSource.getModifiedEditor();return new GB(e,t,i,n,o).getViewZones()}_getOriginalEditorDecorations(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=String(this._removeColor),r={decorations:[],overviewZones:[]},a=o.getModel(),l=o._getViewModel();for(const d of t)if(QB(d)){r.decorations.push({range:new qo(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824),options:n?KB.lineDeleteWithSign:KB.lineDelete}),XB(d)&&d.charChanges||r.decorations.push($B(d.originalStartLineNumber,1,d.originalEndLineNumber,1073741824,KB.charDeleteWholeLine));const e=eV(a,l,d.originalStartLineNumber,d.originalEndLineNumber);if(r.overviewZones.push(new KT(e.startLineNumber,e.endLineNumber,0,s)),d.charChanges)for(const t of d.charChanges)if(QB(t))if(i)for(let e=t.originalStartLineNumber;e<=t.originalEndLineNumber;e++){let i,n;i=e===t.originalStartLineNumber?t.originalStartColumn:a.getLineFirstNonWhitespaceColumn(e),n=e===t.originalEndLineNumber?t.originalEndColumn:a.getLineLastNonWhitespaceColumn(e),r.decorations.push($B(e,i,e,n,KB.charDelete))}else r.decorations.push($B(t.originalStartLineNumber,t.originalStartColumn,t.originalEndLineNumber,t.originalEndColumn,KB.charDelete))}return r}_getModifiedEditorDecorations(e,t,i,n){const o=this._dataSource.getModifiedEditor(),s=String(this._insertColor),r={decorations:[],overviewZones:[]},a=o.getModel(),l=o._getViewModel();for(const d of t)if(XB(d)){r.decorations.push({range:new qo(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824),options:n?KB.lineInsertWithSign:KB.lineInsert}),QB(d)&&d.charChanges||r.decorations.push($B(d.modifiedStartLineNumber,1,d.modifiedEndLineNumber,1073741824,KB.charInsertWholeLine));const e=eV(a,l,d.modifiedStartLineNumber,d.modifiedEndLineNumber);if(r.overviewZones.push(new KT(e.startLineNumber,e.endLineNumber,0,s)),d.charChanges)for(const t of d.charChanges)if(XB(t))if(i)for(let e=t.modifiedStartLineNumber;e<=t.modifiedEndLineNumber;e++){let i,n;i=e===t.modifiedStartLineNumber?t.modifiedStartColumn:a.getLineFirstNonWhitespaceColumn(e),n=e===t.modifiedEndLineNumber?t.modifiedEndColumn:a.getLineLastNonWhitespaceColumn(e),r.decorations.push($B(e,i,e,n,KB.charInsert))}else r.decorations.push($B(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn,KB.charInsert))}return r}}qB.MINIMUM_EDITOR_WIDTH=100;class GB extends UB{constructor(e,t,i,n,o){super(e,t,i,n,o)}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){return null}_produceOriginalFromDiff(e,t,i){return i>t?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i-t,domNode:null}:null}_produceModifiedFromDiff(e,t,i){return t>i?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-i,domNode:null}:null}}class ZB extends zB{constructor(e,t){super(e),this._decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange((t=>{this._decorationsLeft!==t.decorationsLeft&&(this._decorationsLeft=t.decorationsLeft,e.relayoutEditors())})))}setEnableSplitViewResizing(e){}_getViewZones(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=this._dataSource.getModifiedEditor();return new YB(e,t,i,o,s,n).getViewZones()}_getOriginalEditorDecorations(e,t,i,n){const o=String(this._removeColor),s={decorations:[],overviewZones:[]},r=this._dataSource.getOriginalEditor(),a=r.getModel(),l=r._getViewModel();let d=0;for(const h of t)if(QB(h)){for(s.decorations.push({range:new qo(h.originalStartLineNumber,1,h.originalEndLineNumber,1073741824),options:KB.lineDeleteMargin});d=h.originalStartLineNumber)break;d++}let t=0;if(d0,S=P_(1e4);let x=0,k=0,L=null;for(let s=t.originalStartLineNumber;s<=t.originalEndLineNumber;s++){const r=s-t.originalStartLineNumber,_=this._originalModel.getLineTokens(s),b=_.getLineContent(),D=m[f++],E=Sb.filter(w,s,1,b.length+1);if(D){let t=0;for(const e of D.breakOffsets){const s=_.sliceAndInflate(t,e,0),r=b.substring(t,e);x=Math.max(x,this._renderOriginalLine(k++,r,s,Sb.extractWrapped(E,t,e),y,a,l,n,o,d,h,c,u,g,p,i,S,C)),t=e}for(L||(L=[]);L.lengthe.afterLineNumber-t.afterLineNumber))}_renderOriginalLine(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p,m,f,_){f.appendASCIIString('
');const v=Hb.isBasicASCII(t,s),b=Hb.containsRTL(t,v,r),C=Mb(new Eb(a.isMonospace&&!l,a.canUseHalfwidthRightwardsArrow,t,!1,v,b,0,i,n,m,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,c,u,g,p!==uf.OFF,null),f);if(f.appendASCIIString("
"),this._renderIndicators){const t=document.createElement("div");t.className=`delete-sign ${Fy.asClassName(VB)}`,t.setAttribute("style",`position:absolute;top:${e*d}px;width:${h}px;height:${d}px;right:0;`),_.appendChild(t)}return C.characterMapping.getAbsoluteOffset(C.characterMapping.length)}}function XB(e){return e.modifiedEndLineNumber>0}function QB(e){return e.originalEndLineNumber>0}function JB(){const e=document.createElement("div");return e.className="diagonal-fill",e}function eV(e,t,i,n){const o=e.getLineCount();return i=Math.min(o,Math.max(1,i)),n=Math.min(o,Math.max(1,n)),t.coordinatesConverter.convertModelRangeToViewRange(new qo(i,e.getLineMinColumn(i),n,e.getLineMaxColumn(n)))}function tV(e,t){return{enableSplitViewResizing:ef(e.enableSplitViewResizing,t.enableSplitViewResizing),renderSideBySide:ef(e.renderSideBySide,t.renderSideBySide),maxComputationTime:nf(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:nf(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:ef(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:ef(e.renderIndicators,t.renderIndicators),originalEditable:ef(e.originalEditable,t.originalEditable),diffCodeLens:ef(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:ef(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:(i=e.diffWordWrap,n=t.diffWordWrap,af(i,n,["off","on","inherit"]))};var i,n}zy(((e,t)=>{const i=e.getColor(jk);i&&t.addRule(`.monaco-editor .char-insert, .monaco-diff-editor .char-insert { background-color: ${i}; }`);const n=e.getColor($k)||i;n&&t.addRule(`.monaco-editor .line-insert, .monaco-diff-editor .line-insert { background-color: ${n}; }`);const o=e.getColor(qk)||n;o&&(t.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${o}; }`),t.addRule(`.monaco-editor .gutter-insert, .monaco-diff-editor .gutter-insert { background-color: ${o}; }`));const s=e.getColor(Uk);s&&t.addRule(`.monaco-editor .char-delete, .monaco-diff-editor .char-delete { background-color: ${s}; }`);const r=e.getColor(Kk)||s;r&&t.addRule(`.monaco-editor .line-delete, .monaco-diff-editor .line-delete { background-color: ${r}; }`);const a=e.getColor(Gk)||r;a&&(t.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${a}; }`),t.addRule(`.monaco-editor .gutter-delete, .monaco-diff-editor .gutter-delete { background-color: ${a}; }`));const l=e.getColor(Xk);l&&t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${"hc"===e.type?"dashed":"solid"} ${l}; }`);const d=e.getColor(Qk);d&&t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${"hc"===e.type?"dashed":"solid"} ${d}; }`);const h=e.getColor(Vx);h&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${h}; }`);const c=e.getColor(Jk);c&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${c}; }`);const u=e.getColor(Wx);u&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport {\n\t\t\t\tbackground: ${u};\n\t\t\t}\n\t\t`);const g=e.getColor(Hx);g&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:hover {\n\t\t\t\tbackground: ${g};\n\t\t\t}\n\t\t`);const p=e.getColor(zx);p&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:active {\n\t\t\t\tbackground: ${p};\n\t\t\t}\n\t\t`);const m=e.getColor(eL);t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${m} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${m} 50%, ${m} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)}));var iV=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},nV=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let oV=class extends Uo{constructor(e){super(),this._themeService=e,this._onCodeEditorAdd=this._register(new $o),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new $o),this.onCodeEditorRemove=this._onCodeEditorRemove.event,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._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}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]))}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.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((t=>t.removeDecorations(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)}}};oV=iV([nV(0,Ry)],oV);var sV=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},rV=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let aV=class extends oV{constructor(e,t){super(t),this.onCodeEditorAdd((()=>this._checkContextKey())),this.onCodeEditorRemove((()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=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}openCodeEditor(e,t,i){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const i=t.resource.scheme;if(i===IC.http||i===IC.https)return Pw(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};aV=sV([rV(0,Dy),rV(1,Ry)],aV),dv(r_,aV);const lV=s_("layoutService");var dV=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},hV=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let cV=class{constructor(e){this._codeEditorService=e,this.onDidLayout=ds.None}get dimension(){return this._dimension||(this._dimension=JC(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}};cV=dV([hV(0,r_)],cV);let uV=class extends cV{constructor(e,t){super(t),this._container=e}get hasContainer(){return!1}get container(){return this._container}};uV=dV([hV(1,r_)],uV),dv(lV,cV);const gV=s_("dialogService");var pV=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},mV=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},fV=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function _V(e){return e.scheme===IC.file?e.fsPath:e.path}let vV=0;class bV{constructor(e,t,i,n,o,s,r){this.id=++vV,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=s,this.sourceOrder=r,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 CV{constructor(e,t){this.resourceLabel=e,this.reason=t}}class wV{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements){(0===n.reason?e:t).push(n.resourceLabel)}let i=[];return e.length>0&&i.push($m(0,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push($m(0,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}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 yV{constructor(e,t,i,n,o,s,r){this.id=++vV,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=s,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new wV),this.removedResources.has(t)||this.removedResources.set(t,new CV(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new wV),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new CV(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class SV{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)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){let e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?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)1===t.type&&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 fP(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let r=0,a=this._past.length;r=t||s.id!==e.elements[n])&&(i=!1,o=0),i||1!==s.type||s.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let r=this._future.length-1;r>=0;r--,n++){const o=this._future[r];i&&(n>=t||o.id!==e.elements[n])&&(i=!1,s=r),i||1!==o.type||o.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==s&&(this._future=this._future.slice(s+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 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?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 xV{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=s,i=n))}return[t,i]}canUndo(e){if(e instanceof vP){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).hasPastElements()}return!1}_onError(e,t){Jo(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 s=this._acquireLocks(i);let r;try{r=t()}catch(a){return s(),n.dispose(),this._onError(a,e)}return r?r.then((()=>(s(),n.dispose(),o())),(t=>(s(),n.dispose(),this._onError(t,e)))):(s(),n.dispose(),o())}_invokeWorkspacePrepare(e){return fV(this,void 0,void 0,(function*(){if(void 0===e.actual.prepareUndoRedo)return Uo.None;const t=e.actual.prepareUndoRedo();return void 0===t?Uo.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(Uo.None);const i=e.actual.prepareUndoRedo();return i?ga(i)?t(i):i.then((e=>t(e))):t(Uo.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||kV);return new xV(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new DV(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new DV}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,$m(0,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,$m(0,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const r of i.editStacks)r.getClosestPastElement()!==t&&o.push(r.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,$m(0,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const r of i.editStacks)r.locked&&s.push(r.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,$m(0,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,$m(0,"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 i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,n){return fV(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const o=yield this._dialogService.show(oF.Info,$m(0,"Would you like to undo '{0}' across all files?",t.label),[$m(0,"Undo in {0} Files",i.editStacks.length),$m(0,"Undo this File"),$m(0,"Cancel")],{cancelId:2});if(2===o.choice)return;if(1===o.choice)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const s=this._checkWorkspaceUndo(e,t,i,!1);if(s)return s.returnValue;n=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const s=this._checkWorkspaceUndo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.undo()),i,o,(()=>this._continueUndoInGroup(t.groupId,n)))}))}_resourceUndo(e,t,i){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,(()=>t.actual.undo()),new xV([e]),n,(()=>this._continueUndoInGroup(t.groupId,i))))));{const e=$m(0,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&(s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,i=n))}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof vP){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?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[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return fV(this,void 0,void 0,(function*(){if(1!==(yield this._dialogService.show(oF.Info,$m(0,"Would you like to undo '{0}'?",i.label),[$m(0,"Yes"),$m(0,"No")],{cancelId:1})).choice)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 s=o.getClosestFutureElement();s&&(s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,$m(0,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const r of i.editStacks)r.locked&&s.push(r.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,$m(0,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,$m(0,"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)}_executeWorkspaceRedo(e,t,i){return fV(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.redo()),i,n,(()=>this._continueRedoInGroup(t.groupId)))}))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(i=>(e.moveForward(t),this._safeInvokeWithLocks(t,(()=>t.actual.redo()),new xV([e]),i,(()=>this._continueRedoInGroup(t.groupId))))));{const e=$m(0,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&(s.groupId===e&&(!t||s.groupOrder=0;t--,this._valueLen--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to!1)){return new RV(new OV(e))}static forStrings(){return new RV(new IV)}static forConfigKeys(){return new RV(new TV)}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new AV,this._root.segment=i.value());const o=[];for(n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new AV,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new AV,n.right.segment=i.value()),o.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new AV,n.mid.segment=i.value()),o.push([0,n]),n=n.mid}}const s=n.value;n.value=t,n.key=e;for(let r=o.length-1;r>=0;r--){const e=o[r][1];e.updateHeight();const t=e.balanceFactor();if(t<-1||t>1){const t=o[r][0],i=o[r+1][0];if(1===t&&1===i)o[r][1]=e.rotateLeft();else if(-1===t&&-1===i)o[r][1]=e.rotateRight();else if(1===t&&-1===i)e.right=o[r+1][1]=o[r+1][1].rotateRight(),o[r][1]=e.rotateLeft();else{if(-1!==t||1!==i)throw new Error;e.left=o[r+1][1]=o[r+1][1].rotateLeft(),o[r][1]=e.rotateRight()}if(r>0)switch(o[r-1][0]){case-1:o[r-1][1].left=o[r][1];break;case 1:o[r-1][1].right=o[r][1];break;case 0:o[r-1][1].mid=o[r][1]}else this._root=o[0][1]}}return s}get(e){var t;return null===(t=this._getNode(e))||void 0===t?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===(null==t?void 0:t.value)&&void 0===(null==t?void 0:t.mid))}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 s=this._root;for(;s;){const e=n.cmp(s.segment);if(e>0)o.push([-1,s]),s=s.left;else if(e<0)o.push([1,s]),s=s.right;else{if(!n.hasNext())break;n.next(),o.push([0,s]),s=s.mid}}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const e=this._min(s.right),{key:t,value:i,segment:n}=e;this._delete(e.key,!1),s.key=t,s.value=i,s.segment=n}else{const e=null!==(i=s.left)&&void 0!==i?i:s.right;if(o.length>0){const[t,i]=o[o.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}for(let e=o.length-1;e>=0;e--){const t=o[e][1];t.updateHeight();const i=t.balanceFactor();if(i>1?(t.right.balanceFactor()>=0||(t.right=t.right.rotateRight()),o[e][1]=t.rotateLeft()):i<-1&&(t.left.balanceFactor()<=0||(t.left=t.left.rotateLeft()),o[e][1]=t.rotateRight()),e>0)switch(o[e-1][0]){case-1:o[e-1][1].left=o[e][1];break;case 1:o[e-1][1].right=o[e][1];break;case 0:o[e-1][1].mid=o[e][1]}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,n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=n.value||i,n=n.mid}}return n&&n.value||i}findSuperstr(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())return i.mid?this._entries(i.mid):void 0;t.next(),i=i.mid}}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}*_entries(e){e&&(e.left&&(yield*this._entries(e.left)),e.value&&(yield[e.key,e.value]),e.mid&&(yield*this._entries(e.mid)),e.right&&(yield*this._entries(e.right)))}}class PV{constructor(e,t){this.uri=e,this.value=t}}class FV{constructor(e,t){this[EV]="ResourceMap",e instanceof FV?(this.map=new Map(e.map),this.toKey=null!=t?t:FV.defaultToKey):(this.map=new Map,this.toKey=null!=e?e:FV.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),new PV(e,t)),this}get(e){var t;return null===(t=this.map.get(this.toKey(e)))||void 0===t?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){void 0!==t&&(e=e.bind(t));for(let[i,n]of this.map)e(n.value,n.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(EV=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}}FV.defaultToKey=e=>e.toString();class BV{constructor(){this[NV]="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 null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}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]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(NV=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,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(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),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 VV extends BV{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}function WV(e,t,i){return Math.min(Math.max(e,t),i)}class HV{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class zV{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},UV=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};const $V=s_("ILanguageFeatureDebounceService");var KV;!function(e){const t=new WeakMap;let i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(KV||(KV={}));class qV{constructor(e,t,i,n,o,s){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=o,this._max=s,this._cache=new VV(50,.7)}_key(e){return e.id+this._registry.all(e).reduce(((e,t)=>_a(KV.of(t),e)),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?WV(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 zV(6),this._cache.set(i,n));const o=WV(n.update(t),this._min,this._max);return this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new HV;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return WV(0|this._overall()||this._default,this._min,this._max)}}let GV=class{constructor(e){this._logService=e,this._data=new Map}for(e,t,i){var n,o,s;const r=null!==(n=null==i?void 0:i.min)&&void 0!==n?n:50,a=null!==(o=null==i?void 0:i.max)&&void 0!==o?o:Math.pow(r,2),l=null!==(s=null==i?void 0:i.key)&&void 0!==s?s:void 0,d=`${KV.of(e)},${r}${l?","+l:""}`;let h=this._data.get(d);return h||(h=new qV(this._logService,t,e,0|this._overallAverage()||1.5*r,r,a),this._data.set(d,h)),h}_overallAverage(){let e=new HV;for(let t of this._data.values())e.update(t.default());return e.value}};GV=jV([UV(0,tb)],GV),dv($V,GV,!0);const ZV=s_("IWorkspaceEditService");class YV{constructor(e){this.metadata=e}static convert(e){return e.edits.map((e=>{if(Zs(t=e)&&Ps.isUri(t.resource)&&Zs(t.edit))return new XV(e.resource,e.edit,e.modelVersionId,e.metadata);var t;if(function(e){return Zs(e)&&(Boolean(e.newUri)||Boolean(e.oldUri))}(e))return new QV(e.oldUri,e.newUri,e.options,e.metadata);throw new Error("Unsupported edit")}))}}class XV extends YV{constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class QV extends YV{constructor(e,t,i,n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}const JV=Object.freeze({id:"editor",order:5,type:"object",title:$m(0,"Editor"),scope:5}),eW=Object.assign(Object.assign({},JV),{properties:{"editor.tabSize":{type:"number",default:Km.tabSize,minimum:1,markdownDescription:$m(0,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.insertSpaces":{type:"boolean",default:Km.insertSpaces,markdownDescription:$m(0,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.detectIndentation":{type:"boolean",default:Km.detectIndentation,markdownDescription:$m(0,"Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.")},"editor.trimAutoWhitespace":{type:"boolean",default:Km.trimAutoWhitespace,description:$m(0,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Km.largeFileOptimizations,description:$m(0,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:$m(0,"Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[$m(0,"Only suggest words from the active document."),$m(0,"Suggest words from all open documents of the same language."),$m(0,"Suggest words from all open documents.")],description:$m(0,"Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[$m(0,"Semantic highlighting enabled for all color themes."),$m(0,"Semantic highlighting disabled for all color themes."),$m(0,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:$m(0,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:$m(0,"Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:$m(0,"Lines above this length will not be tokenized for performance reasons")},"editor.language.brackets":{type:"array",default:!1,description:$m(0,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:$m(0,"The opening bracket character or string sequence.")},{type:"string",description:$m(0,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:"array",default:!1,description:$m(0,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:$m(0,"The opening bracket character or string sequence.")},{type:"string",description:$m(0,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:$m(0,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:50,description:$m(0,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:$m(0,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:$m(0,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:$m(0,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:$m(0,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[$m(0,"Lines will never wrap."),$m(0,"Lines will wrap at the viewport width."),$m(0,"Lines will wrap according to the `#editor.wordWrap#` setting.")]}}});for(const _he of Lf){const e=_he.schema;if(void 0!==e)if(void 0!==(tW=e).type||void 0!==tW.anyOf)eW.properties[`editor.${_he.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(eW.properties[t]=e[t])}var tW;let iW=null;function nW(){return null===iW&&(iW=Object.create(null),Object.keys(eW.properties).forEach((e=>{iW[e]=!0}))),iW}My.as(eO).registerConfiguration(eW);class oW{static insert(e,t){return{range:new qo(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}class sW{constructor(e={},t=[],i=[]){this._contents=e,this._keys=t,this._overrides=i,this.isFrozen=!1,this.overrideConfigurations=new Map}get contents(){return this.checkAndFreeze(this._contents)}get overrides(){return this.checkAndFreeze(this._overrides)}get keys(){return this.checkAndFreeze(this._keys)}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?sv(this.contents,e):this.contents}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?sv(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){const t=tr(this.contents),i=tr(this.overrides),n=[...this.keys];for(const o of e){this.mergeContents(t,o.contents);for(const e of o.overrides){const[t]=i.filter((t=>jo(t.identifiers,e.identifiers)));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=Qo(t.keys)):i.push(tr(e))}for(const e of o.keys)-1===n.indexOf(e)&&n.push(e)}return new sW(t,n,i)}freeze(){return this.isFrozen=!0,this}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;let i={};for(const n of Qo([...Object.keys(this.contents),...Object.keys(t)])){let e=this.contents[n],o=t[n];o&&("object"==typeof e&&"object"==typeof o?(e=tr(e),this.mergeContents(e,o)):e=o),i[n]=e}return new sW(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&Zs(e[i])&&Zs(t[i])?this.mergeContents(e[i],t[i]):e[i]=tr(t[i])}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?va(e):e}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=e=>{e&&(i?this.mergeContents(i,e):i=tr(e))};for(const o of this.overrides)jo(o.identifiers,[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}}setValue(e,t){this.addKey(e),iv(this.contents,e,t,(e=>{throw new Error(e)}))}removeValue(e){this.removeKey(e)&&nv(this.contents,e)}addKey(e){let t=this.keys.length;for(let i=0;i{}))}for(const s of Object.keys(n))hO.test(s)&&o.push({identifiers:cO(s),keys:Object.keys(n[s]),contents:tv(n[s],(e=>{}))});super(n,i,o)}}class aW{constructor(e,t,i=new sW,n=new sW,o=new FV,s=new sW,r=new FV,a=!0){this._defaultConfiguration=e,this._localUserConfiguration=t,this._remoteUserConfiguration=i,this._workspaceConfiguration=n,this._folderConfigurations=o,this._memoryConfiguration=s,this._memoryConfigurationByResource=r,this._freeze=a,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new FV,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidateConfigurationModel(t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new sW,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidateConfigurationModel(t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),s=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,r=t.overrideIdentifier?this._defaultConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this._defaultConfiguration.freeze().getValue(e),a=t.overrideIdentifier?this.userConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this.userConfiguration.freeze().getValue(e),l=t.overrideIdentifier?this.localUserConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this.localUserConfiguration.freeze().getValue(e),d=t.overrideIdentifier?this.remoteUserConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this.remoteUserConfiguration.freeze().getValue(e),h=i?t.overrideIdentifier?this._workspaceConfiguration.freeze().override(t.overrideIdentifier).getValue(e):this._workspaceConfiguration.freeze().getValue(e):void 0,c=o?t.overrideIdentifier?o.freeze().override(t.overrideIdentifier).getValue(e):o.freeze().getValue(e):void 0,u=t.overrideIdentifier?s.override(t.overrideIdentifier).getValue(e):s.getValue(e),g=n.getValue(e),p=Qo(ba(n.overrides.map((e=>e.identifiers)))).filter((t=>void 0!==n.getOverrideValue(e,t)));return{defaultValue:r,userValue:a,userLocalValue:l,userRemoteValue:d,workspaceValue:h,workspaceFolderValue:c,memoryValue:u,value:g,default:void 0!==r?{value:this._defaultConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this._defaultConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,user:void 0!==a?{value:this.userConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this.userConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,userLocal:void 0!==l?{value:this.localUserConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this.localUserConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,userRemote:void 0!==d?{value:this.remoteUserConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this.remoteUserConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,workspace:void 0!==h?{value:this._workspaceConfiguration.freeze().getValue(e),override:t.overrideIdentifier?this._workspaceConfiguration.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,workspaceFolder:void 0!==c?{value:null==o?void 0:o.freeze().getValue(e),override:t.overrideIdentifier?null==o?void 0:o.freeze().getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,memory:void 0!==u?{value:s.getValue(e),override:t.overrideIdentifier?s.getOverrideValue(e,t.overrideIdentifier):void 0}:void 0,overrideIdentifiers:p.length?p:void 0}}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration),this._freeze&&this._userConfiguration.freeze()),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidateConfigurationModel(e,t){let i=this.getConsolidatedConfigurationModelForResource(e,t);return e.overrideIdentifier?i.override(e.overrideIdentifier):i}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.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._freeze&&(this._workspaceConfiguration=this._workspaceConfiguration.freeze())),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._freeze&&(t=t.freeze()),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},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){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.user),n=this.parseConfigurationModel(e.workspace),o=e.folders.reduce(((e,t)=>(e.set(Ps.revive(t[0]),this.parseConfigurationModel(t[1])),e)),new FV);return new aW(t,i,new sW,n,o,new sW,new FV,!1)}static parseConfigurationModel(e){return new sW(e.contents,e.keys,e.overrides).freeze()}}class lW{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._previousConfiguration=void 0;const o=new Set;e.keys.forEach((e=>o.add(e))),e.overrides.forEach((([,e])=>e.forEach((e=>o.add(e))))),this.affectedKeys=[...o.values()];const s=new sW;this.affectedKeys.forEach((e=>s.setValue(e,{}))),this.affectedKeysTree=s.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=aW.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;if(this.doesAffectedKeysTreeContains(this.affectedKeysTree,e)){if(t){const n=this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,o=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!zo(n,o)}return!0}return!1}doesAffectedKeysTreeContains(e,t){let i,n=tv({[t]:!0},(()=>{}));for(;"object"==typeof n&&(i=Object.keys(n)[0]);){if(!(e=e[i]))return!1;n=n[i]}return!0}}const dW=/^(cursor|delete)/;class hW extends Uo{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._currentChord=null,this._currentChordChecker=new Wv,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=cW.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Vv,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:ds.None}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){const i=this.resolveKeyboardEvent(e);if(i.isChord())return null;const[n]=i.getDispatchParts();if(null===n)return null;const o=this._contextKeyService.getContext(t),s=this._currentChord?this._currentChord.keypress:null;return this._getResolver().resolve(o,s,n)}_enterChordMode(e,t){this._currentChord={keypress:e,label:t},this._currentChordStatusMessage=this._notificationService.status($m(0,"({0}) was pressed. Waiting for second key of chord...",t));const i=Date.now();this._currentChordChecker.cancelAndSet((()=>{this._documentHasFocus()?Date.now()-i>5e3&&this._leaveChordMode():this._leaveChordMode()}),500)}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchParts();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=cW.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=cW.EMPTY,null===this._currentSingleModifier?(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.getParts();return this._ignoreSingleModifiers=new cW(o),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let n=!1;if(e.isChord())return!1;let o=null,s=null;if(i){const[t]=e.getSingleModifierDispatchParts();o=t,s=t}else[o]=e.getDispatchParts(),s=this._currentChord?this._currentChord.keypress:null;if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const r=this._contextKeyService.getContext(t),a=e.getLabel(),l=this._getResolver().resolve(r,s,o);return this._logService.trace("KeybindingService#dispatch",a,null==l?void 0:l.commandId),l&&l.enterChord?(n=!0,this._enterChordMode(o,a),n):(this._currentChord&&(l&&l.commandId||(this._notificationService.status($m(0,"The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),n=!0)),this._leaveChordMode(),l&&l.commandId&&(l.bubble||(n=!0),void 0===l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,(e=>this._notificationService.warn(e))):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,(e=>this._notificationService.warn(e))),dW.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding"})),n)}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class cW{constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}cW.EMPTY=new cW(null);const uW=s_("keybindingService");class gW{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const n of e){const e=n.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=gW.handleRemovals([].concat(e).concat(t));for(let n=0,o=this._keybindings.length;n=0;n--){let e=i[n];if(e.command===t.command)continue;const o=e.keypressParts.length>1,s=t.keypressParts.length>1;o&&s&&e.keypressParts[1]!==t.keypressParts[1]||gW.whenIsEntirelyIncluded(e.when,t.when)&&this._removeFromLookupMap(e)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);if(void 0!==t)for(let i=0,n=t.length;i=0;n--){const e=i[n];if(t.contextMatchesRules(e.when))return e}return i[i.length-1]}resolve(e,t,i){this._log(`| Resolving ${i}${t?` chorded from ${t}`:""}`);let n=null;if(null!==t){const e=this._map.get(t);if(void 0===e)return this._log("\\ No keybinding entries."),null;n=[];for(let t=0,o=e.length;t1&&null!==o.keypressParts[1]?(this._log(`\\ From ${n.length} keybinding entries, matched chord, when: ${pW(o.when)}, source: ${mW(o)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${n.length} keybinding entries, matched ${o.command}, when: ${pW(o.when)}, source: ${mW(o)}.`),{enterChord:!1,leaveChord:o.keypressParts.length>1,commandId:o.command,commandArgs:o.commandArgs,bubble:o.bubble}):(this._log(`\\ From ${n.length} keybinding entries, no when clauses matched the context.`),null)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){let n=t[i];if(gW._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function pW(e){return e?`${e.serialize()}`:"no when condition"}function mW(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}class fW{constructor(e,t,i,n,o,s,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.keypressParts=e?_W(e.getDispatchParts()):[],e&&0===this.keypressParts.length&&(this.keypressParts=_W(e.getSingleModifierDispatchParts())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=r}}function _W(e){let t=[];for(let i=0,n=e.length;ithis._getLabel(e)))}getAriaLabel(){return CW.toLabel(this._os,this._parts,(e=>this._getAriaLabel(e)))}getElectronAccelerator(){return this._parts.length>1||this._parts[0].isDuplicateModifierCase()?null:wW.toLabel(this._os,this._parts,(e=>this._getElectronAccelerator(e)))}isChord(){return this._parts.length>1}getParts(){return this._parts.map((e=>this._getPart(e)))}_getPart(e){return new CC(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchParts(){return this._parts.map((e=>this._getDispatchPart(e)))}getSingleModifierDispatchParts(){return this._parts.map((e=>this._getSingleModifierDispatchPart(e)))}}{constructor(e,t){super(t,e.parts)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Os.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Os.toString(e.keyCode)}_getElectronAccelerator(e){return Os.toElectronAccelerator(e.keyCode)}_getDispatchPart(e){return SW.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+=Os.toString(e.keyCode),t}_getSingleModifierDispatchPart(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=Ca[e];if(-1!==t)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 83;case 52:return 81;case 53:return 87;case 54:return 89;case 55:return 88;case 56:return 0;case 57:return 80;case 58:return 90;case 59:return 86;case 60:return 82;case 61:return 84;case 62:return 85;case 106:return 92}return 0}static _resolveSimpleUserBinding(e){if(!e)return null;if(e instanceof vC)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new vC(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveUserBinding(e,t){const i=_W(e.map((e=>this._resolveSimpleUserBinding(e))));return i.length>0?[new SW(new bC(i),t)]:[]}}const xW=s_("labelService"),kW=s_("contextService");function LW(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&Ps.isUri(t.uri)}class DW{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}}}var EW,NW,IW,TW,MW,OW,AW,RW,PW,FW,BW,VW,WW;$m(0,"Code Workspace"),(NW=EW||(EW={})).noSelection=$m(0,"No selection"),NW.singleSelectionRange=$m(0,"Line {0}, Column {1} ({2} selected)"),NW.singleSelection=$m(0,"Line {0}, Column {1}"),NW.multiSelectionRange=$m(0,"{0} selections ({1} characters selected)"),NW.multiSelection=$m(0,"{0} selections"),NW.emergencyConfOn=$m(0,"Now changing the setting `accessibilitySupport` to 'on'."),NW.openingDocs=$m(0,"Now opening the Editor Accessibility documentation page."),NW.readonlyDiffEditor=$m(0," in a read-only pane of a diff editor."),NW.editableDiffEditor=$m(0," in a pane of a diff editor."),NW.readonlyEditor=$m(0," in a read-only code editor"),NW.editableEditor=$m(0," in a code editor"),NW.changeConfigToOnMac=$m(0,"To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),NW.changeConfigToOnWinLinux=$m(0,"To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),NW.auto_on=$m(0,"The editor is configured to be optimized for usage with a Screen Reader."),NW.auto_off=$m(0,"The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),NW.tabFocusModeOnMsg=$m(0,"Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),NW.tabFocusModeOnMsgNoKb=$m(0,"Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."),NW.tabFocusModeOffMsg=$m(0,"Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),NW.tabFocusModeOffMsgNoKb=$m(0,"Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),NW.openDocMac=$m(0,"Press Command+H now to open a browser window with more information related to editor accessibility."),NW.openDocWinLinux=$m(0,"Press Control+H now to open a browser window with more information related to editor accessibility."),NW.outroMsg=$m(0,"You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),NW.showAccessibilityHelpAction=$m(0,"Show Accessibility Help"),(IW||(IW={})).inspectTokensAction=$m(0,"Developer: Inspect Tokens"),(TW||(TW={})).gotoLineActionLabel=$m(0,"Go to Line/Column..."),(MW||(MW={})).helpQuickAccessActionLabel=$m(0,"Show all Quick Access Providers"),(AW=OW||(OW={})).quickCommandActionLabel=$m(0,"Command Palette"),AW.quickCommandHelp=$m(0,"Show And Run Commands"),(PW=RW||(RW={})).quickOutlineActionLabel=$m(0,"Go to Symbol..."),PW.quickOutlineByCategoryActionLabel=$m(0,"Go to Symbol by Category..."),(BW=FW||(FW={})).editorViewAccessibleLabel=$m(0,"Editor content"),BW.accessibilityHelpMessage=$m(0,"Press Alt+F1 for Accessibility Options."),(VW||(VW={})).toggleHighContrast=$m(0,"Toggle High Contrast Theme"),(WW||(WW={})).bulkEditServiceSummary=$m(0,"Made {0} edits in {1} files");const HW=s_("workspaceTrustManagementService");var zW;!function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],o={start:e.start,end:Math.min(t.start,e.end)},s={start:Math.max(t.end,e.start),end:e.end};return i(o)||n.push(o),i(s)||n.push(s),n}}(zW||(zW={}));var jW,UW;function $W(e,t,i){const n=i.mode===jW.ALIGN?i.offset:i.offset+i.size,o=i.mode===jW.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-n?n:0}(UW=jW||(jW={}))[UW.AVOID=0]="AVOID",UW[UW.ALIGN=1]="ALIGN";class KW extends Uo{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Uo.None,this.toDisposeOnSetContainer=Uo.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Mw(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Aw(this.view),this.setContainer(e,t),this._register(es((()=>this.setContainer(null,1))))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,null===(i=this.shadowRootHostElement)||void 0===i||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=1!==t,this.useShadowDOM=3===t,this.useShadowDOM){this.shadowRootHostElement=Mw(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=qW,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Mw("slot"))}else this.container.appendChild(this.view);const i=new Cs;KW.BUBBLE_UP_EVENTS.forEach((e=>{i.add(WC(this.container,e,(e=>{this.onDOMEvent(e,!1)})))})),KW.BUBBLE_DOWN_EVENTS.forEach((e=>{i.add(WC(this.container,e,(e=>{this.onDOMEvent(e,!0)}),!0))})),this.toDisposeOnSetContainer=i}}show(e){this.isVisible()&&this.hide(),RC(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2500",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Ow(this.view),this.toDisposeOnClean=e.render(this.view)||Uo.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||Vs&&mC?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;let e,t=this.delegate.getAnchor();if(ww(t)){let i=nw(t);e={top:i.top,left:i.left,width:i.width,height:i.height}}else e={top:t.y,left:t.x,width:t.width||1,height:t.height||2};const i=sw(this.view),n=lw(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0;let r,a;if(0===(this.delegate.anchorAxisAlignment||0)){const t={offset:e.top-window.pageYOffset,size:e.height,position:0===o?0:1},l={offset:e.left,size:e.width,position:0===s?0:1,mode:jW.ALIGN};r=$W(window.innerHeight,n,t)+window.pageYOffset,zW.intersects({start:r,end:r+n},{start:t.offset,end:t.offset+t.size})&&(l.mode=jW.AVOID),a=$W(window.innerWidth,i,l)}else{const t={offset:e.left,size:e.width,position:0===s?0:1},l={offset:e.top,size:e.height,position:0===o?0:1,mode:jW.ALIGN};a=$W(window.innerWidth,i,t),zW.intersects({start:a,end:a+i},{start:t.offset,end:t.offset+t.size})&&(l.mode=jW.AVOID),r=$W(window.innerHeight,n,l)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===s?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const l=nw(this.container);this.view.style.top=r-(this.useFixedPosition?nw(this.view).top:l.top)+"px",this.view.style.left=a-(this.useFixedPosition?nw(this.view).left:l.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),Aw(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!dw(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}KW.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],KW.BUBBLE_DOWN_EVENTS=["click"];let qW='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t@font-face {\n\t\tfont-family: "codicon";\n\t\tfont-display: block;\n\t\tsrc: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t: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; }\n\t: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; }\n\t: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; }\n\t: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; }\n';var GW=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ZW=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let YW=class extends Uo{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Uo.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new KW(this.container,1)),this.layout(),this._register(e.onDidLayout((()=>this.layout())))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t!==this.container&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.contextView.show(e);const n=es((()=>{this.currentViewDisposable===n&&this.hideContextView()}));return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};YW=GW([ZW(0,lV)],YW);const XW=/\//g;function QW(e){switch(e){case 0:return"";case 1:return"[^/\\\\]*?";default:return"(?:[/\\\\]|[^/\\\\]+[/\\\\]|[/\\\\][^/\\\\]+)*?"}}function JW(e,t){if(!e)return[];const i=[];let n=!1,o=!1,s="";for(const r of e){switch(r){case t:if(!n&&!o){i.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1}s+=r}return s&&i.push(s),i}function eH(e){if(!e)return"";let t="";const i=JW(e,"/");if(i.every((e=>"**"===e)))t=".*";else{let e=!1;i.forEach(((n,o)=>{if("**"===n)return void(e||(t+=QW(2),e=!0));let s=!1,r="",a=!1,l="";for(const e of n)if("}"!==e&&s)r+=e;else if(!a||"]"===e&&l)switch(e){case"{":s=!0;continue;case"[":a=!0;continue;case"}":{const e=`(?:${JW(r,",").map((e=>eH(e))).join("|")})`;t+=e,s=!1,r="";break}case"]":t+="["+l+"]",a=!1,l="";break;case"?":t+="[^/\\\\]";continue;case"*":t+=QW(1);continue;default:t+=Xo(e)}else{let t;t="-"===e?e:"^"!==e&&"!"!==e||l?"/"===e?"":Xo(e):"^",l+=t}ohH(e,t))).filter((e=>e!==dH)),e),n=i.length;if(!n)return dH;if(1===n)return i[0];const o=function(t,n){for(let o=0,s=i.length;o!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);r.length&&(o.allPaths=r);return o}(i,t):(o=sH.exec(uH(i,t)))?gH(o[1].substr(1),i,!0):(o=rH.exec(uH(i,t)))?gH(o[1],i,!1):function(e){try{const t=new RegExp(`^${eH(e)}$`);return function(i){return t.lastIndex=0,"string"==typeof i&&t.test(i)?e:null}}catch(t){return dH}}(i);return aH.set(n,s),cH(s,e)}function cH(e,t){return"string"==typeof t?e:function(i,n){return FA(i,t.base,!Vo)?e(i.substr(t.base.length+1),n):null}}function uH(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function gH(e,t,i){const n=Fr===Pr.sep,o=n?e:e.replace(XW,Fr),s=Fr+o,r=Pr.sep+e,a=i?function(i,a){return"string"!=typeof i||i!==o&&!i.endsWith(s)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,s){return"string"!=typeof i||i!==o&&(n||i!==e)?null:t};return a.allPaths=[(i?"*/":"./")+e],a}function pH(e,t={}){if(!e)return lH;if("string"==typeof e||function(e){const t=e;if(!t)return!1;return"string"==typeof t.base&&"string"==typeof t.pattern}(e)){const i=hH(e,t);if(i===dH)return lH;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=mH(Object.getOwnPropertyNames(e).map((i=>function(e,t,i){if(!1===t)return dH;const n=hH(e,i);if(n===dH)return dH;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,o,s,r)=>{if(!r||!n(t,o))return null;const a=r(i.replace("$(basename)",s));return(l=a)&&"function"==typeof l.then?a.then((t=>t?e:null)):a?e:null;var l};return t.requiresSiblings=!0,t}}return n}(i,e[i],t))).filter((e=>e!==dH))),n=i.length;if(!n)return dH;if(!i.some((e=>!!e.requiresSiblings))){if(1===n)return i[0];const e=function(e,t){for(let n=0,o=i.length;n!!e.allBasenames));t&&(e.allBasenames=t.allBasenames);const o=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return o.length&&(e.allPaths=o),e}const o=function(e,t,n){let o;for(let s=0,r=i.length;s!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);r.length&&(o.allPaths=r);return o}(e,t)}function mH(e,t){const i=e.filter((e=>!!e.basenames));if(i.length<2)return e;const n=i.reduce(((e,t)=>{const i=t.basenames;return i?e.concat(i):e}),[]);let o;if(t){o=[];for(let e=0,i=n.length;e{const i=t.patterns;return i?e.concat(i):e}),[]);const s=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?o[i]:null};s.basenames=n,s.patterns=o,s.allBasenames=n;const r=e.filter((e=>!e.basenames));return r.push(s),r}let fH=[],_H=[],vH=[];function bH(e,t=!1){!function(e,t,i){const n=function(e,t){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:t,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?pH(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(Pr.sep)>=0}}(e,t);fH.push(n),n.userConfigured?vH.push(n):_H.push(n);i&&!n.userConfigured&&fH.forEach((e=>{e.mime===n.mime||e.userConfigured||(n.extension&&(e.extension,n.extension),n.filename&&(e.filename,n.filename),n.filepattern&&(e.filepattern,n.filepattern),n.firstline&&(e.firstline,n.firstline))}))}(e,!1,t)}function CH(e,t){let i;if(e)switch(e.scheme){case IC.file:i=e.fsPath;break;case IC.data:i=JA.parseMetaData(e).get(JA.META_DATA_LABEL);break;default:i=e.path}if(!i)return[uE.unknown];i=i.toLowerCase();const n=wa(i),o=wH(i,n,vH);if(o)return[o,uE.text];const s=wH(i,n,_H);if(s)return[s,uE.text];if(t){const e=function(e){Ns(e)&&(e=e.substr(1));if(e.length>0)for(let t=fH.length-1;t>=0;t--){const i=fH[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i.mime}return}(t);if(e)return[e,uE.text]}return[uE.unknown]}function wH(e,t,i){var n;let o,s,r;for(let a=i.length-1;a>=0;a--){const l=i[a];if(t===l.filenameLowercase){o=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const i=l.filepatternOnPath?e:t;(null===(n=l.filepatternLowercase)||void 0===n?void 0:n.call(l,i))&&(s=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&t.endsWith(l.extensionLowercase)&&(r=l)}return o?o.mime:s?s.mime:r?r.mime:void 0}const yH=Object.prototype.hasOwnProperty;bv.register("vs.editor.nullLanguage",{});class SH{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register("vs.editor.nullLanguage",0),this._register("plaintext",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]||"vs.editor.nullLanguage"}}class xH extends Uo{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new $o),this.onDidChange=this._onDidChange.event,xH.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new SH,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(pO.onDidChangeLanguages((e=>{this._initializeFromRegistry()}))))}dispose(){xH.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},fH=fH.filter((e=>e.userConfigured)),_H=[];const e=[].concat(pO.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((e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach((e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier})),t.mimetypes.forEach((e=>{this._mimeTypesMap[e]=t.identifier}))})),My.as(eO).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;yH.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(let e of t.extensions)bH({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let a of t.filenames)bH({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(let a of t.filenamePatterns)bH({id:i,mime:n,filepattern:a},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);Sa(t)||bH({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(r){Jo(r)}}e.aliases.push(i);let o=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const a of o)a&&0!==a.length&&e.aliases.push(a);const s=null!==o&&o.length>0;if(s&&null===o[0]);else{const t=(s?o[0]:null)||i;!s&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&yH.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return yH.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&yH.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){if(!e&&!t)return[];const i=CH(e,t);return xa(i.map((e=>this.getLanguageIdByMimeType(e))))}}xH.instanceCount=0;class kH extends Uo{constructor(e=!1){super(),this._onDidEncounterLanguage=this._register(new $o),this.onDidEncounterLanguage=this._onDidEncounterLanguage.event,this._onDidChange=this._register(new $o({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,kH.instanceCount++,this._encounteredLanguages=new Set,this._registry=this._register(new xH(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange((()=>this._onDidChange.fire())))}dispose(){kH.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 ka(i,null)}createById(e){return new LH(this.onDidChange,(()=>this._createAndGetLanguageIdentifier(e)))}createByFilepathOrFirstLine(e,t){return new LH(this.onDidChange,(()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)}))}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e="plaintext"),this._encounteredLanguages.has(e)||(this._encounteredLanguages.add(e),Es.getOrCreate(e),this._onDidEncounterLanguage.fire(e)),e}}kH.instanceCount=0;class LH{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({onLastListenerRemove:()=>{this._dispose()}})),this._emitter.event}_evaluate(){const e=this._selector();e!==this.languageId&&(this.languageId=e,this._emitter&&this._emitter.fire(this.languageId))}}function DH(e){let t=e.definition;for(;t instanceof br;)t=t.definition;return`.codicon-${e.id}:before { content: '${t.fontCharacter}'; }`}function EH(...e){return function(t,i){for(let n=0,o=e.length;n0?[{start:0,end:t.length}]:[]:null}function TH(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function MH(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let o=null;return(o=MH(e,t,i+1,n+1))?WH({start:n,end:n+1},o):null}return MH(e,t,i,n+1)}function OH(e){return 97<=e&&e<=122}function AH(e){return 65<=e&&e<=90}function RH(e){return 48<=e&&e<=57}function PH(e){return 32===e||9===e||10===e||13===e}const FH=new Set;function BH(e){return PH(e)||FH.has(e)}function VH(e){return OH(e)||AH(e)||RH(e)}function WH(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function HH(e,t){for(let i=t;i0&&!VH(e.charCodeAt(i-1)))return i}return e.length}function zH(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let o=null,s=n+1;for(o=zH(e,t,i+1,n+1);!o&&(s=HH(t,s))60)return null;const i=function(e){let t=0,i=0,n=0,o=0,s=0;for(let r=0;r.2&&t<.8&&n>.6&&o<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,o=0;for(e=e.toLowerCase();o0&&BH(e.charCodeAt(i-1)))return i;return e.length}"()[]{}<>`'\"-/;:,.?!".split("").forEach((e=>FH.add(e.charCodeAt(0))));const KH=EH(NH,jH,TH),qH=EH(NH,jH,(function(e,t){return MH(e.toLowerCase(),t.toLowerCase(),0,0)})),GH=new VV(1e4);function ZH(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=GH.get(e);n||(n=new RegExp(La(e),"i"),GH.set(e,n));const o=n.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:i?qH(e,t):KH(e,t)}function YH(e,t,i,n,o,s){const r=Math.min(13,e.length);for(;i1;n--){const o=e[n]+i,s=t[t.length-1];s&&s.end===o?s.end=o+1:t.push({start:o,end:o+1})}return t}function QH(){const e=[],t=[];for(let i=0;i<=128;i++)t[i]=0;for(let i=0;i<=128;i++)e.push(t.slice(0));return e}function JH(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const ez=JH(256),tz=JH(256),iz=QH(),nz=QH(),oz=QH();function sz(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 40:case 91:return!0;case void 0:return!1;default:return!!or(i)}}function rz(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function az(e,t,i){return t[e]!==i[e]}var lz,dz;function hz(e,t,i,n,o,s,r){const a=e.length>128?128:e.length,l=n.length>128?128:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!function(e,t,i,n,o,s,r=!1){for(;t=i&&a>=n;)o[r]===s[a]&&(tz[r]=a,r--),a--}(a,l,i,s,t,o);let d=1,h=1,c=i,u=s;const g=[!1];for(d=1,c=i;cr,v=_?nz[d][h-1]+(iz[d][h-1]>0?-5:0):0,b=u>r+1&&iz[d][h-1]>0,C=b?nz[d][h-2]+(iz[d][h-2]>0?-5:0):0;if(b&&(!_||C>=v)&&(!m||C>=f))nz[d][h]=C,oz[d][h]=3,iz[d][h]=0;else if(_&&(!m||v>=f))nz[d][h]=v,oz[d][h]=2,iz[d][h]=0;else{if(!m)throw new Error("not possible");nz[d][h]=f,oz[d][h]=1,iz[d][h]=iz[d-1][h-1]+1}}}if(!g[0]&&!r)return;d--,h--;const p=[nz[d][h],s];let m=0,f=0;for(;d>=1;){let e=h;do{const t=oz[d][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+d-1]===o[s+h-1]&&!az(e+s-1,n,o)&&m+1>iz[d][e]&&(e=h),e===h?m++:m=1,f||(f=e),d--,h=e-1,p.push(h)}l===a&&(p[0]+=2);const _=f-a;return p[0]-=_,p}function cz(e,t,i,n,o,s,r,a,l,d,h){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let c=1,u=!1;return r===i-n?c=e[i]===o[r]?7:5:!az(r,o,s)||0!==r&&az(r-1,o,s)?!sz(s,r)||0!==r&&sz(s,r-1)?(sz(s,r-1)||rz(s,r-1))&&(c=5,u=!0):c=5:(c=e[i]===o[r]?7:5,u=!0),c>1&&i===n&&(h[0]=!0),u||(u=az(r,o,s)||sz(s,r-1)||rz(s,r-1)),i===n?r>l&&(c-=u?3:5):c+=d?u?2:0:u?0:1,r+1===a&&(c-=u?3:5),c}function uz(e,t,i,n,o,s,r){return function(e,t,i,n,o,s,r,a){let l=hz(e,t,i,n,o,s,a);if(l&&!r)return l;if(e.length>=3){const t=Math.min(7,e.length-1);for(let r=i+1;rl[0])&&(l=e))}}}return l}(e,t,i,n,o,s,!0,r)}function gz(e,t){if(t+1>=e.length)return;const i=e[t],n=e[t+1];return i!==n?e.slice(0,t)+n+i+e.slice(t+2):void 0}(dz=lz||(lz={})).Default=[-100,0],dz.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]};const pz=new RegExp(`\\$\\(${Ys.iconNameExpression}(?:${Ys.iconModifierExpression})?\\)`,"g"),mz=new RegExp(Ys.iconNameCharacter),fz=new RegExp(`(\\\\)?${pz.source}`,"g");const _z=new RegExp(`\\\\${pz.source}`,"g");const vz=new RegExp(`(\\s)?(\\\\)?${pz.source}(\\s)?`,"g");function bz(e){return-1===e.indexOf("$(")?e:e.replace(vz,((e,t,i,n)=>i?e:t||n||""))}function Cz(e){const t=e.indexOf("$(");return-1===t?{text:e}:function(e,t){const i=[];let n="";function o(e){if(e){n+=e;for(const t of e)i.push(d)}}let s,r,a=-1,l="",d=0,h=t;const c=e.length;o(e.substr(0,t));for(;hthis.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Ho||Vo?[10]:[]],keyDown:!0}}),this.menuElement=n,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Cs),this.initializeOrUpdateStyleSheet(e,{}),this._register($S.addTarget(n)),BC(n,yw.KEY_DOWN,(e=>{new SC(e).equals(2)&&e.preventDefault()})),i.enableMnemonics&&this.menuDisposables.add(BC(n,yw.KEY_DOWN,(e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){Sw(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof Ez&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}}))),Vo&&this._register(BC(n,yw.KEY_DOWN,(e=>{const t=new SC(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Sw(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Sw(e,!0))}))),this._register(BC(this.domNode,yw.MOUSE_OUT,(e=>{dw(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())}))),this._register(BC(this.actionsList,yw.MOUSE_OVER,(e=>{let t=e.target;if(t&&dw(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}))),this._register($S.addTarget(this.actionsList)),this._register(BC(this.actionsList,WS.Tap,(e=>{let t=e.initialTarget;if(t&&dw(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})));let o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new sT(n,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const s=this.scrollableElement.getDomNode();s.style.position="",this._register(BC(n,WS.Change,(e=>{Sw(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})}))),this._register(BC(s,yw.MOUSE_UP,(e=>{e.preventDefault()}))),n.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((e=>{var t;return!(null===(t=i.submenuIds)||void 0===t?void 0:t.has(e.id))})),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter((e=>!(e instanceof Nz))).forEach(((e,t,i)=>{e.updatePositionInSet(t+1,i.length)}))}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(gw(e)?this.styleSheet=fw(e):(Lz.globalStyleSheet||(Lz.globalStyleSheet=fw()),this.styleSheet=Lz.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${DH(br.menuSelection)}\n${DH(br.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.4;\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tpadding: 0.5em 0 0 0;\n\tmargin-bottom: 0.5em;\n\twidth: 100%;\n\theight: 0px !important;\n\tmargin-left: .8em !important;\n\tmargin-right: .8em !important;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tborder: thin solid transparent; /* prevents jumping behaviour on hover or focus */\n}\n\n\n/* High Contrast Theming */\n:host-context(.hc-black) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: .5em 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 1.8em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tpadding: 0.2em 0 0 0;\n\tmargin-bottom: 0.2em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){i+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const n=e.scrollbarSliderBackground;n&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${n};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderHoverBackground;o&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`);const s=e.scrollbarSliderActiveBackground;s&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${s};\n\t\t\t\t}\n\t\t\t`)}return i}(t,gw(e))}style(e){const t=this.getContainer();this.initializeOrUpdateStyleSheet(t,e);const i=e.foregroundColor?`${e.foregroundColor}`:"",n=e.backgroundColor?`${e.backgroundColor}`:"",o=e.borderColor?`1px solid ${e.borderColor}`:"",s=e.shadowColor?`0 2px 4px ${e.shadowColor}`:"";t.style.border=o,this.domNode.style.color=i,this.domNode.style.backgroundColor=n,t.style.boxShadow=s,this.viewItems&&this.viewItems.forEach((t=>{(t instanceof Dz||t instanceof Nz)&&t.style(e)}))}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(BC(this.element,yw.MOUSE_UP,(e=>{if(Sw(e,!0),Rf){if(new EC(e).rightButton)return;this.onClick(e)}else setTimeout((()=>{this.onClick(e)}),0)}))),this._register(BC(this.element,yw.CONTEXT_MENU,(e=>{Sw(e,!0)}))))}),100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Lw(this.element,Mw("a.action-menu-item")),this._action.id===Jw.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Lw(this.item,Mw("span.menu-item-check"+br.menuSelection.cssSelector)),this.check.setAttribute("role","none"),this.label=Lw(this.item,Mw("span.action-label")),this.options.label&&this.options.keybinding&&(Lw(this.item,Mw("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item&&this.item.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){RC(this.label);let e=bz(this.getAction().label);if(e){const t=function(e){const t=yz,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=yz.exec(e);if(i){e=Mr(e),Sz.lastIndex=0;let t=Sz.exec(e);for(;t&&t[1];)t=Sz.exec(e);const n=e=>e.replace(/&&/g,"&");t?this.label.append(Da(n(e.substr(0,t.index))," "),Mw("u",{"aria-hidden":"true"},t[3]),Ea(n(e.substr(t.index+t[0].length))," ")):this.label.innerText=n(e).trim(),this.item&&this.item.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.getAction().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.getAction().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.getAction().checked;this.item.classList.toggle("checked",!!e),void 0!==e?(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(){if(!this.menuStyle)return;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?`thin solid ${this.menuStyle.selectionBorderColor}`:"";this.item&&(this.item.style.color=t?t.toString():"",this.item.style.backgroundColor=i?i.toString():""),this.check&&(this.check.style.color=t?t.toString():""),this.container&&(this.container.style.border=n)}style(e){this.menuStyle=e,this.applyStyle()}}class Ez extends Dz{constructor(e,t,i,n){super(e,e,n),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new Cs),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:xz.Right,this.showScheduler=new Hv((()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))}),250),this.hideScheduler=new Hv((()=>{this.element&&!dw(mw(),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=Lw(this.item,Mw("span.submenu-indicator"+br.menuSubmenu.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(BC(this.element,yw.KEY_UP,(e=>{let t=new SC(e);(t.equals(17)||t.equals(3))&&(Sw(e,!0),this.createSubmenu(!0))}))),this._register(BC(this.element,yw.KEY_DOWN,(e=>{let t=new SC(e);mw()===this.item&&(t.equals(17)||t.equals(3))&&Sw(e,!0)}))),this._register(BC(this.element,yw.MOUSE_OVER,(e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())}))),this._register(BC(this.element,yw.MOUSE_LEAVE,(e=>{this.mouseOver=!1}))),this._register(BC(this.element,yw.FOCUS_OUT,(e=>{this.element&&!dw(mw(),this.element)&&this.hideScheduler.schedule()}))),this._register(this.parentData.parent.onScroll((()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)}))))}updateEnabled(){}onClick(e){Sw(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(t){}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=$W(e.width,t.width,{position:n===xz.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new SC(e).equals(15)&&(Sw(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))}))),this.submenuDisposables.add(BC(this.submenuContainer,yw.KEY_DOWN,(e=>{new SC(e).equals(15)&&Sw(e,!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&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){if(super.applyStyle(),!this.menuStyle)return;const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=e?`${e}`:""),this.parentData.submenu&&this.parentData.submenu.style(this.menuStyle)}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Nz extends oB{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?`${e.separatorColor}`:"")}}function Iz(e,t){const i=Object.create(null);for(let n in t){const o=t[n];o&&(i[n]=cD(o,e))}return i}function Tz(e,t,i){function n(){const n=Iz(e.getColorTheme(),t);"function"==typeof i?i(n):i.style(n)}return n(),e.onDidColorThemeChange(n)}function Mz(e,t,i){return Tz(t,Object.assign(Object.assign({},Oz),i||{}),e)}const Oz={listFocusBackground:tL,listFocusForeground:iL,listFocusOutline:nL,listActiveSelectionBackground:oL,listActiveSelectionForeground:sL,listActiveSelectionIconForeground:rL,listFocusAndSelectionBackground:oL,listFocusAndSelectionForeground:sL,listInactiveSelectionBackground:aL,listInactiveSelectionIconForeground:dL,listInactiveSelectionForeground:lL,listInactiveFocusBackground:hL,listInactiveFocusOutline:cL,listHoverBackground:uL,listHoverForeground:gL,listDropBackground:pL,listSelectionOutline:hx,listHoverOutline:hx,listFilterWidgetBackground:CL,listFilterWidgetOutline:wL,listFilterWidgetNoMatchesOutline:yL,listMatchesShadow:px,treeIndentGuidesStroke:SL,tableColumnsBorder:xL,tableOddRowsBackgroundColor:kL},Az={shadowColor:px,borderColor:IL,foregroundColor:TL,backgroundColor:ML,selectionForegroundColor:OL,selectionBackgroundColor:AL,selectionBorderColor:RL,separatorColor:PL,scrollbarShadow:Vx,scrollbarSliderBackground:Wx,scrollbarSliderHoverBackground:Hx,scrollbarSliderActiveBackground:zx};class Rz{constructor(e,t,i,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.themeService=o,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let i;this.focusToReturn=document.activeElement;let n=ww(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:n=>{let o=e.getMenuClassName?e.getMenuClassName():"";o&&(n.className+=" "+o),this.options.blockMouse&&(this.block=n.appendChild(Mw(".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",BC(this.block,yw.MOUSE_DOWN,(e=>e.stopPropagation())));const s=new Cs,r=e.actionRunner||new Qw;var a,l;return r.onBeforeRun(this.onActionRun,this,s),r.onDidRun(this.onDidActionRun,this,s),i=new Lz(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:r,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)}),s.add((a=i,Tz(this.themeService,Object.assign(Object.assign({},Az),l),a))),i.onDidCancel((()=>this.contextViewService.hideContextView(!0)),null,s),i.onDidBlur((()=>this.contextViewService.hideContextView(!0)),null,s),s.add(BC(window,yw.BLUR,(()=>this.contextViewService.hideContextView(!0)))),s.add(BC(window,yw.MOUSE_DOWN,(e=>{if(e.defaultPrevented)return;let t=new EC(e),i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}}))),ta(s,i)},focus:()=>{i&&i.focus(!!e.autoSelectFirstItem)},onHide:t=>{e.onHide&&e.onHide(!!t),this.block&&(this.block.remove(),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},n,!!n)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&!Na(e.error)&&this.notificationService.error(e.error)}}var Pz=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Fz=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let Bz=class extends Uo{constructor(e,t,i,n,o){super(),this._onDidShowContextMenu=new $o,this._onDidHideContextMenu=new $o,this.contextMenuHandler=new Rz(i,e,t,n,o)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{e.onHide&&e.onHide(t),this._onDidHideContextMenu.fire()}})),Vw.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};function Vz(e){let t=JSON.parse(e);return t=Wz(t),t}function Wz(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return Ps.revive(e);case 2:return new RegExp(e.source,e.flags);case 14:return new Date(e.source)}if(e instanceof L_||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;iUo.None,registerValidator:()=>Uo.None,registerExternalUriResolver:()=>Uo.None,setDefaultExternalOpener(){},registerExternalOpener:()=>Uo.None,open(){return jz(this,void 0,void 0,(function*(){return!1}))},resolveExternalUri(e){return jz(this,void 0,void 0,(function*(){return{resolved:e,dispose(){}}}))}});function Kz(e,t){return Ps.isUri(e)?$r(e.scheme,t):Br(e,t+":")}function qz(e,...t){return t.some((t=>Kz(e,t)))}var Gz=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Zz=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},Yz=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Xz=class{constructor(e){this._commandService=e}open(e,t){return Yz(this,void 0,void 0,(function*(){if(!Kz(e,IC.command))return!1;if(!(null==t?void 0:t.allowCommands))return!0;"string"==typeof e&&(e=Ps.parse(e));let i=[];try{i=Vz(decodeURIComponent(e.query))}catch(n){try{i=Vz(e.query)}catch(o){}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0}))}};Xz=Gz([Zz(0,iy)],Xz);let Qz=class{constructor(e){this._editorService=e}open(e,t){return Yz(this,void 0,void 0,(function*(){"string"==typeof e&&(e=Ps.parse(e));const{selection:i,uri:n}=function(e){let t;const i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);return(e=n).scheme===IC.file&&(e=ZA(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:(null==t?void 0:t.fromUserGesture)?Hz.USER:Hz.API},null==t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}))}};Qz=Gz([Zz(0,r_)],Qz);let Jz=class{constructor(e,t){this._openers=new Hs,this._validators=new Hs,this._resolvers=new Hs,this._resolvedUriTargets=new FV((e=>e.with({path:null,fragment:null,query:null}).toString())),this._externalOpeners=new Hs,this._defaultExternalOpener={openExternal:e=>Yz(this,void 0,void 0,(function*(){return qz(e,IC.http,IC.https)?Pw(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>Yz(this,void 0,void 0,(function*(){return!(!(null==t?void 0:t.openExternal)&&!qz(e,IC.mailto,IC.http,IC.https,IC.vsls))&&(yield this._doOpenExternal(e,t),!0)}))}),this._openers.push(new Xz(t)),this._openers.push(new Qz(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}registerValidator(e){return{dispose:this._validators.push(e)}}registerExternalUriResolver(e){return{dispose:this._resolvers.push(e)}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){return{dispose:this._externalOpeners.push(e)}}open(e,t){var i;return Yz(this,void 0,void 0,(function*(){const n="string"==typeof e?Ps.parse(e):e,o=null!==(i=this._resolvedUriTargets.get(n))&&void 0!==i?i:e;for(const e of this._validators)if(!(yield e.shouldOpen(o)))return!1;for(const i of this._openers){if(yield i.open(e,t))return!0}return!1}))}resolveExternalUri(e,t){return Yz(this,void 0,void 0,(function*(){for(const n of this._resolvers)try{const i=yield n.resolveExternalUri(e,t);if(i)return this._resolvedUriTargets.has(i.resolved)||this._resolvedUriTargets.set(i.resolved,e),i}catch(i){}throw new Error("Could not resolve external URI: "+e.toString())}))}_doOpenExternal(e,t){return Yz(this,void 0,void 0,(function*(){const i="string"==typeof e?Ps.parse(e):e;let n,o;try{n=(yield this.resolveExternalUri(i,t)).resolved}catch(s){n=i}if(o="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),null==t?void 0:t.allowContributedOpeners){const e="string"==typeof(null==t?void 0:t.allowContributedOpeners)?null==t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners){if(yield t.openExternal(o,{sourceUri:i,preferredOpenerId:e},Ia.None))return!0}}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Ia.None)}))}dispose(){this._validators.clear()}};var ej,tj,ij;Jz=Gz([Zz(0,r_),Zz(1,iy)],Jz),(tj=ej||(ej={}))[tj.Hint=1]="Hint",tj[tj.Info=2]="Info",tj[tj.Warning=4]="Warning",tj[tj.Error=8]="Error",function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=$m(0,"Error"),t[e.Warning]=$m(0,"Warning"),t[e.Info]=$m(0,"Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case oF.Error:return e.Error;case oF.Warning:return e.Warning;case oF.Info:return e.Info;case oF.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return oF.Error;case e.Warning:return oF.Warning;case e.Info:return oF.Info;case e.Hint:return oF.Ignore}}}(ej||(ej={})),function(e){const t="";function i(e,i){let n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"==typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(ej.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}(ij||(ij={}));const nj=s_("markerService");var oj=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},sj=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};class rj extends Uo{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(es((()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()})))}update(e,t){const i=[...this._markersData.keys()];this._markersData.clear();const n=this.model.deltaDecorations(i,t);for(let o=0;othis._onModelAdded(e))),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((e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)}))}_onModelAdded(e){const t=new rj(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==IC.inMemory&&e.uri.scheme!==IC.internal&&e.uri.scheme!==IC.vscode||this._markerService&&this._markerService.read({resource:e.uri}).map((e=>e.owner)).forEach((t=>this._markerService.remove(t,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500}),i=t.map((t=>({range:this._createDecorationRange(e.model,t),options:this._createDecorationOption(t)})));e.update(t,i)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let i=qo.lift(t);if(t.severity!==ej.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const t=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(1===t||i.endColumn>=t)return i;const n=e.getWordAtPosition(i.getStartPosition());n&&(i=new qo(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){let n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0}};aj=oj([sj(0,Dv),sj(1,nj)],aj);class lj{constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}static create(e,t){return new lj(e,new dj(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}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 qo(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn):e}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,s]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new lj(this._startLineNumber,n),new lj(this._startLineNumber+s,o)]}applyEdit(e,t){const[i,n,o]=JR(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 er(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 e=i-t;return void(this._startLineNumber-=e)}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this._startLineNumber=0,void this._tokens.clear();if(t<0){const n=-t;this._startLineNumber-=n,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(0===t&&0===i)return;const s=e.lineNumber-this._startLineNumber;if(s<0)return void(this._startLineNumber+=t);s>=this._tokens.getMaxDeltaLine()+1||this._tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}class dj{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)){let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let s=n;for(;se||h===e&&u>=t)&&(he||r===e&&g>=t){if(ro?p-=o-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>o)){d=!0;continue}p-=o-i}else if(uo)){d=!0;continue}u===t?(g=i,p=g+(p-o)):(g=0,p=g+(p-o))}else if(u>n){if(0===a&&!d){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=o-i,p-=o-i}const f=4*l;s[f]=u,s[f+1]=g,s[f+2]=p,s[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let d=0;d=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},uj=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let gj=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hashTable=new fj,this._hasWarnedOverlappingTokens=!1}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let s;if(o)s=o.metadata,this._logService.getLevel()===ib.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${ys.getForeground(s)}, fontStyle ${ys.getFontStyle(s).toString(2)}`);else{let o=this._legend.tokenTypes[e];const r=[];if(o){let e=t;for(let t=0;e>0&&t>=1;e>0&&this._logService.getLevel()===ib.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),r.push("not-in-legend"));const n=this._themeService.getColorTheme().getTokenStyleMetadata(o,r,i);if(void 0===n)s=2147483647;else{if(s=0,void 0!==n.italic){s|=1|(n.italic?1:0)<<10}if(void 0!==n.bold){s|=2|(n.bold?2:0)<<10}if(void 0!==n.underline){s|=4|(n.underline?4:0)<<10}if(void 0!==n.strikethrough){s|=8|(n.strikethrough?8:0)<<10}if(n.foreground){s|=16|n.foreground<<14}0===s&&(s=2147483647)}}else this._logService.getLevel()===ib.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,o="not-in-legend";this._hashTable.add(e,t,n,s),this._logService.getLevel()===ib.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${o}) / ${t} (${r.join(" ")}): foreground ${ys.getForeground(s)}, fontStyle ${ys.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0)}};function pj(e,t,i){const n=e.data,o=e.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),r=[];let a=0,l=1,d=0;for(;ae&&0===n[5*t];)t--;if(t-1===e){let e=h;for(;e+1h&&(t.warnOverlappingSemanticTokens(r,h+1),m=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=fj._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+10?i[0]:[]}(e,t),r=yield Promise.all(s.map((e=>vj(this,void 0,void 0,(function*(){let s,r=null;try{s=yield e.provideDocumentSemanticTokens(t,e===i?n:null,o)}catch(a){r=a,s=null}return s&&(bj(s)||Cj(s))||(s=null),new wj(e,s,r)})))));for(const e of r){if(e.error)throw e.error;if(e.tokens)return e}return r.length>0?r[0]:null}))}class xj{constructor(e,t){this.provider=e,this.tokens=t}}function kj(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}function Lj(e,t,i,n){return vj(this,void 0,void 0,(function*(){const o=kj(e,t),s=yield Promise.all(o.map((e=>vj(this,void 0,void 0,(function*(){let o;try{o=yield e.provideDocumentRangeSemanticTokens(t,i,n)}catch(s){Ta(s),o=null}return o&&bj(o)||(o=null),new xj(e,o)})))));for(const e of s)if(e.tokens)return e;return s.length>0?s[0]:null}))}ny.registerCommand("_provideDocumentSemanticTokensLegend",((e,...t)=>vj(void 0,void 0,void 0,(function*(){const[i]=t;Js(i instanceof Ps);const n=e.get(Dv).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(lb),s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:null}(o,n);return s?s[0].getLegend():e.get(iy).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)})))),ny.registerCommand("_provideDocumentSemanticTokens",((e,...t)=>vj(void 0,void 0,void 0,(function*(){const[i]=t;Js(i instanceof Ps);const n=e.get(Dv).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(lb);if(!yj(o,n))return e.get(iy).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const s=yield Sj(o,n,null,null,Ia.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!bj(a))return;const l=_j({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l})))),ny.registerCommand("_provideDocumentRangeSemanticTokensLegend",((e,...t)=>vj(void 0,void 0,void 0,(function*(){const[i,n]=t;Js(i instanceof Ps);const o=e.get(Dv).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(lb),r=kj(s,o);if(0===r.length)return;if(1===r.length)return r[0].getLegend();if(!n||!qo.isIRange(n))return r[0].getLegend();const a=yield Lj(s,o,qo.lift(n),Ia.None);return a?a.provider.getLegend():void 0})))),ny.registerCommand("_provideDocumentRangeSemanticTokens",((e,...t)=>vj(void 0,void 0,void 0,(function*(){const[i,n]=t;Js(i instanceof Ps),Js(qo.isIRange(n));const o=e.get(Dv).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(lb),r=yield Lj(s,o,qo.lift(n),Ia.None);return r&&r.tokens?_j({id:0,type:"full",data:r.tokens.data}):void 0}))));var Dj=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ej=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};function Nj(e){return e.toString()}function Ij(e){const t=new Ma,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}class Tj{constructor(e,t,i){this._modelEventListeners=new Cs,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose((()=>t(e)))),this._modelEventListeners.add(e.onDidChangeLanguage((t=>i(e,t))))}_disposeLanguageSelection(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null)}dispose(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()}setLanguage(e){this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange((()=>this.model.setMode(e.languageId))),this.model.setMode(e.languageId)}}const Mj=Vo||Ho?1:2;class Oj{constructor(e,t,i,n,o,s,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=s,this.versionId=r,this.alternativeVersionId=a}}let Aj=class e extends Uo{constructor(e,t,i,n,o,s,r,a,l){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=i,this._logService=n,this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=r,this._languageFeatureDebounceService=a,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._semanticStyling=this._register(new Fj(this._themeService,this._languageService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration((()=>this._updateModelOptions()))),this._updateModelOptions(),this._register(new Pj(this._semanticStyling,this,this._themeService,this._configurationService,this._languageFeatureDebounceService,l))}static _readModelOptions(e,t){var i;let n=Km.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let o=n;if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(o=t),o<1&&(o=1)}let s=Km.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(s="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let r=Mj;const a=e.eol;"\r\n"===a?r=2:"\n"===a&&(r=1);let l=Km.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let d=Km.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(d="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let h=Km.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(h="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let c=Km.bracketPairColorizationOptions;return(null===(i=e.editor)||void 0===i?void 0:i.bracketPairColorization)&&"object"==typeof e.editor.bracketPairColorization&&(c={enabled:!!e.editor.bracketPairColorization.enabled}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:s,detectIndentation:d,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:h,bracketPairColorizationOptions:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===Xs||2===Xs?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(t,i,n){let o=this._modelCreationOptionsByLanguageAndResource[t+i];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:t,resource:i}),r=this._getEOL(i,t);o=e._readModelOptions({editor:s,eol:r},n),this._modelCreationOptionsByLanguageAndResource[t+i]=o}return o}_updateModelOptions(){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((e=>{e.sharesUndoRedoStack||t.push(e)})),t.sort(((e,t)=>e.time-t.time));t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),s=new LP(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Nj(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=Ij(s)===e.sha1;if(n||e.sharesUndoRedoStack){for(const e of t.past)sR(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)sR(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,(e=>sR(e)&&e.matchesResource(i))),n&&(s._overwriteVersionId(e.versionId),s._overwriteAlternativeVersionId(e.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=Nj(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new Tj(s,(e=>this._onWillDispose(e)),((e,t)=>this._onDidChangeLanguage(e,t)));return this._models[r]=a,a}createModel(e,t,i,n=!1){let o;return t?(o=this._createModelData(e,t.languageId,i,n),this.setMode(o.model,t)):o=this._createModelData(e,"plaintext",i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[Nj(e.uri)];i&&i.setLanguage(t)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||e.future.length>0){for(const i of e.past)sR(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri));for(const i of e.future)sR(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri))}}const a=e.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(s)if(!o&&r>a){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(t.uri,!1,(e=>sR(e)&&e.matchesResource(t.uri))),this._insertDisposedModel(new Oj(t.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,r,Ij(t),t.getVersionId(),t.getAlternativeVersionId()));else if(!o){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[i],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[t.getLanguageId()+t.uri],this._onModelRemoved.fire(t)}_onDidChangeLanguage(t,i){const n=i.oldLanguage,o=t.getLanguageId(),s=this.getCreationOptions(n,t.uri,t.isForSimpleWidget),r=this.getCreationOptions(o,t.uri,t.isForSimpleWidget);e._setModelOptionsForModel(t,r,s),this._onModelModeChanged.fire({model:t,oldLanguageId:n})}};Aj.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,Aj=Dj([Ej(0,ev),Ej(1,eb),Ej(2,Ry),Ej(3,tb),Ej(4,mP),Ej(5,rv),Ej(6,pv),Ej(7,$V),Ej(8,lb)],Aj);function Rj(e,t,i){var n;const o=null===(n=i.getValue("editor.semanticHighlighting",{overrideIdentifier:e.getLanguageId(),resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"==typeof o?o:t.getColorTheme().semanticHighlighting}let Pj=class extends Uo{constructor(e,t,i,n,o,s){super(),this._watchers=Object.create(null),this._semanticStyling=e;const r=e=>{this._watchers[e.uri.toString()]=new Vj(e,this._semanticStyling,i,o,s)},a=(e,t)=>{t.dispose(),delete this._watchers[e.uri.toString()]},l=()=>{for(let e of t.getModels()){const t=this._watchers[e.uri.toString()];Rj(e,i,n)?t||r(e):t&&a(e,t)}};this._register(t.onModelAdded((e=>{Rj(e,i,n)&&r(e)}))),this._register(t.onModelRemoved((e=>{const t=this._watchers[e.uri.toString()];t&&a(e,t)}))),this._register(n.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.semanticHighlighting")&&l()}))),this._register(i.onDidColorThemeChange(l))}};Pj=Dj([Ej(1,Dv),Ej(2,Ry),Ej(3,ev),Ej(4,$V),Ej(5,lb)],Pj);class Fj extends Uo{constructor(e,t,i){super(),this._themeService=e,this._languageService=t,this._logService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange((()=>{this._caches=new WeakMap})))}get(e){return this._caches.has(e)||this._caches.set(e,new gj(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}}class Bj{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}let Vj=class e extends Uo{constructor(t,i,n,o,s){super(),this._isDisposed=!1,this._model=t,this._semanticStyling=i,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:e.REQUEST_MIN_DELAY,max:e.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Hv((()=>this._fetchDocumentSemanticTokensNow()),e.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._register(this._model.onDidChangeContent((()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(this._model.onDidChangeLanguage((()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)})));const r=()=>{bs(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const e of this._provider.all(t))"function"==typeof e.onDidChange&&this._documentProvidersChangeListeners.push(e.onDidChange((()=>this._fetchDocumentSemanticTokens.schedule(0))))};r(),this._register(this._provider.onDidChange((()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(n.onDidColorThemeChange((e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!yj(this._provider,this._model))return void(this._currentDocumentResponse&&this._model.setSemanticTokens(null,!1));const e=new as,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=Sj(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e;const o=[],s=this._model.onDidChangeContent((e=>{o.push(e)})),r=new ps(!1);n.then((e=>{if(this._debounceInformation.update(this._model,r.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),e){const{provider:t,tokens:i}=e,n=this._semanticStyling.get(t);this._setDocumentSemanticTokens(t,i||null,n,o)}else this._setDocumentSemanticTokens(null,null,null,o)}),(e=>{e&&(Na(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||Jo(e),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),o.length>0&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))}))}static _copy(e,t,i,n,o){for(let s=0;s{o.length>0&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed)t&&i&&t.releaseDocumentSemanticTokens(i.resultId);else if(t&&n){if(!i)return this._model.setSemanticTokens(null,!0),void r();if(Cj(i)){if(!s)return void this._model.setSemanticTokens(null,!0);if(0===i.edits.length)i={resultId:i.resultId,data:s.data};else{let t=0;for(const e of i.edits)t+=(e.data?e.data.length:0)-e.deleteCount;const n=s.data,o=new Uint32Array(n.length+t);let r=n.length,a=o.length;for(let s=i.edits.length-1;s>=0;s--){const t=i.edits[s],l=r-(t.start+t.deleteCount);l>0&&(e._copy(n,r-l,o,a-l,l),a-=l),t.data&&(e._copy(t.data,0,o,a-t.data.length,t.data.length),a-=t.data.length),r=t.start}r>0&&e._copy(n,0,o,0,r),i={resultId:i.resultId,data:o}}}if(bj(i)){this._currentDocumentResponse=new Bj(t,i.resultId,i.data);const e=pj(i,n,this._model.getLanguageId());if(o.length>0)for(const t of o)for(const i of e)for(const e of t.changes)i.applyEdit(e.range,e.text);this._model.setSemanticTokens(e,!0)}else this._model.setSemanticTokens(null,!0);r()}else this._model.setSemanticTokens(null,!1)}};Vj.REQUEST_MIN_DELAY=300,Vj.REQUEST_MAX_DELAY=2e3,Vj=Dj([Ej(2,Ry),Ej(3,$V),Ej(4,lb)],Vj);const Wj=new RegExp(`(\\\\)?\\$\\((${Ys.iconNameExpression}(?:${Ys.iconModifierExpression})?)\\)`,"g");function Hj(e){const t=new Array;let i,n=0,o=0;for(;null!==(i=Wj.exec(e));){o=i.index||0,t.push(e.substring(n,o)),n=(i.index||0)+i[0].length;const[,s,r]=i;t.push(s?`$(${r})`:zj({id:r}))}return n{this._register(BC(this._element,e,(e=>{this.enabled?this._onDidClick.fire(e):Sw(e)})))})),this._register(BC(this._element,yw.KEY_DOWN,(e=>{const t=new SC(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._element.blur(),i=!0),i&&Sw(t,!0)}))),this._register(BC(this._element,yw.MOUSE_OVER,(e=>{this._element.classList.contains("disabled")||this.setHoverBackground()}))),this._register(BC(this._element,yw.MOUSE_OUT,(e=>{this.applyStyles()}))),this.focusTracker=this._register(kw(this._element)),this._register(this.focusTracker.onDidFocus((()=>this.setHoverBackground()))),this._register(this.focusTracker.onDidBlur((()=>this.applyStyles()))),this.applyStyles()}get onDidClick(){return this._onDidClick.event}setHoverBackground(){let e;e=this.options.secondary?this.buttonSecondaryHoverBackground?this.buttonSecondaryHoverBackground.toString():null:this.buttonHoverBackground?this.buttonHoverBackground.toString():null,e&&(this._element.style.backgroundColor=e)}style(e){this.buttonForeground=e.buttonForeground,this.buttonBackground=e.buttonBackground,this.buttonHoverBackground=e.buttonHoverBackground,this.buttonSecondaryForeground=e.buttonSecondaryForeground,this.buttonSecondaryBackground=e.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=e.buttonSecondaryHoverBackground,this.buttonBorder=e.buttonBorder,this.applyStyles()}applyStyles(){if(this._element){let e,t;this.options.secondary?(t=this.buttonSecondaryForeground?this.buttonSecondaryForeground.toString():"",e=this.buttonSecondaryBackground?this.buttonSecondaryBackground.toString():""):(t=this.buttonForeground?this.buttonForeground.toString():"",e=this.buttonBackground?this.buttonBackground.toString():"");const i=this.buttonBorder?this.buttonBorder.toString():"";this._element.style.color=t,this._element.style.backgroundColor=e,this._element.style.borderWidth=i?"1px":"",this._element.style.borderStyle=i?"solid":"",this._element.style.borderColor=i}}get element(){return this._element}set label(e){this._element.classList.add("monaco-text-button"),this.options.supportIcons?Dw(this._element,...Hj(e)):this._element.textContent=e,"string"==typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=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")}}const $j={badgeBackground:QS.fromHex("#4D4D4D"),badgeForeground:QS.fromHex("#FFFFFF")};class Kj{constructor(e,t){this.count=0,this.options=t||Object.create(null),Ko(this.options,$j,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=Lw(e,Mw(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=Oa(this.countFormat,this.count),this.element.title=Oa(this.titleFormat,this.count),this.applyStyles()}style(e){this.badgeBackground=e.badgeBackground,this.badgeForeground=e.badgeForeground,this.badgeBorder=e.badgeBorder,this.applyStyles()}applyStyles(){if(this.element){const e=this.badgeBackground?this.badgeBackground.toString():"",t=this.badgeForeground?this.badgeForeground.toString():"",i=this.badgeBorder?this.badgeBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}}}const qj={progressBarBackground:QS.fromHex("#0E70C0")};class Gj extends Uo{constructor(e,t){super(),this.options=t||Object.create(null),Ko(this.options,qj,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this.showDelayedScheduler=this._register(new Hv((()=>Ow(this.element)),0)),this.longRunningScheduler=this._register(new Hv((()=>this.infiniteLongRunning()),Gj.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e)}create(e){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.element.appendChild(this.bit),this.applyStyles()}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove("active","infinite","infinite-long-running","discrete"),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add("done"),this.element.classList.contains("infinite")?(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("discrete","done","infinite-long-running"),this.element.classList.add("active","infinite"),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add("infinite-long-running")}getContainer(){return this.element}style(e){this.progressBarBackground=e.progressBarBackground,this.applyStyles()}applyStyles(){if(this.bit){const e=this.progressBarBackground?this.progressBarBackground.toString():"";this.bit.style.backgroundColor=e}}}Gj.LONG_RUNNING_INFINITE_THRESHOLD=1e4;class Zj{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const Yj=new Zj("id#");const Xj={},Qj=new Zj("quick-input-button-icon-");function Jj(e){if(!e)return;let t;const i=e.dark.toString();return Xj[i]?t=Xj[i]:(t=Qj.nextId(),bw(`.${t}`,`background-image: ${Fw(e.light||e.dark)}`),bw(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${Fw(e.dark)}`),Xj[i]=t),t}const eU={ctrlCmd:!1,alt:!1};var tU,iU,nU,oU;function sU(e,t={}){const i=rU(t);return lU(i,function(e,t){const i={type:1,children:[]};let n=0,o=i;const s=[],r=new aU(e);for(;!r.eos();){let e=r.next();const i="\\"===e&&0!==hU(r.peek(),t);if(i&&(e=r.next()),!i&&dU(e,t)&&e===r.peek()){r.advance(),2===o.type&&(o=s.pop());const i=hU(e,t);if(o.type===i||5===o.type&&6===i)o=s.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),o.children.push(e),s.push(o),o=e}}else if("\n"===e)2===o.type&&(o=s.pop()),o.children.push({type:8});else if(2!==o.type){const t={type:2,content:e};o.children.push(t),s.push(o),o=t}else o.content+=e}2===o.type&&(o=s.pop());return i}(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),i}function rU(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}(iU=tU||(tU={}))[iU.Blur=1]="Blur",iU[iU.Gesture=2]="Gesture",iU[iU.Other=3]="Other",(oU=nU||(nU={}))[oU.NONE=0]="NONE",oU[oU.FIRST=1]="FIRST",oU[oU.SECOND=2]="SECOND",oU[oU.LAST=3]="LAST";class aU{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 lU(e,t,i,n){let o;if(2===t.type)o=document.createTextNode(t.content||"");else if(3===t.type)o=document.createElement("b");else if(4===t.type)o=document.createElement("i");else if(7===t.type&&n)o=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");i.disposables.add(WC(e,"click",(e=>{i.callback(String(t.index),e)}))),o=e}else 8===t.type?o=document.createElement("br"):1===t.type&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach((e=>{lU(o,e,i,n)}))}function dU(e,t){return 0!==hU(e,t)}function hU(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}class cU{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 uU{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new cU(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 gU=Mw,pU={inputBackground:QS.fromHex("#3C3C3C"),inputForeground:QS.fromHex("#CCCCCC"),inputValidationInfoBorder:QS.fromHex("#55AAFF"),inputValidationInfoBackground:QS.fromHex("#063B49"),inputValidationWarningBorder:QS.fromHex("#B89500"),inputValidationWarningBackground:QS.fromHex("#352A05"),inputValidationErrorBorder:QS.fromHex("#BE1100"),inputValidationErrorBackground:QS.fromHex("#5A1D1D")};class mU extends zI{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||Object.create(null),Ko(this.options,pU,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=null!==(n=this.options.tooltip)&&void 0!==n?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Lw(e,gU(".monaco-inputbox.idle"));let o=this.options.flexibleHeight?"textarea":"input",s=Lw(this.element,gU(".ibwrapper"));if(this.input=Lw(s,gU(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="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Lw(s,gU("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new nT(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Lw(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll((e=>this.input.scrollTop=e.scrollTop)));const t=this._register(new zF(document,"selectionchange")),i=ds.filter(t.event,(()=>{const e=document.getSelection();return(null==e?void 0:e.anchorNode)===s}));this._register(i(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,(()=>this.onValueChange())),this.onblur(this.input,(()=>this.onBlur())),this.onfocus(this.input,(()=>this.onFocus())),this.ignoreGesture(this.input),setTimeout((()=>this.updateMirror()),0),this.options.actions&&(this.actionbar=this._register(new rB(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:lw(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}get width(){return sw(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){t=(parseFloat(this.mirror.style.paddingLeft||"")||0)+(parseFloat(this.mirror.style.paddingRight||"")||0)}this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=i.border?`1px solid ${i.border}`:"",(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),null==e?void 0:e.type}stylesForType(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t,i=()=>e.style.width=sw(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:t=>{if(!this.message)return null;e=Lw(t,gU(".monaco-inputbox-container")),i();const n={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?sU(this.message.content,n):function(e,t={}){const i=rU(t);return i.textContent=e,i}(this.message.content,n);o.classList.add(this.classForType(this.message.type));const s=this.stylesForType(this.message.type);return o.style.backgroundColor=s.background?s.background.toString():"",o.style.color=s.foreground?s.foreground.toString():"",o.style.border=s.border?`1px solid ${s.border}`:"",Lw(e,o),null},onHide:()=>{this.state="closed"},layout:i}),t=3===this.message.type?$m(0,"Error: {0}",this.message.content):2===this.message.type?$m(0,"Warning: {0}",this.message.content):$m(0,"Info: {0}",this.message.content),$w(t),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}style(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){const e=this.inputBackground?this.inputBackground.toString():"",t=this.inputForeground?this.inputForeground.toString():"",i=this.inputBorder?this.inputBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor="inherit",this.input.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=lw(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;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar&&this.actionbar.dispose(),super.dispose()}}class fU extends mU{constructor(e,t,i){const n=$m(0,"for history"),o=` or ⇅ ${n}`,s=` (⇅ ${n})`;super(e,t,i),this.history=new uU(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?o:s,t=this.placeholder+e;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{e.target.textContent||r()}))})),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,(()=>r())),this.onblur(this.input,(()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(s)||e(o)}))}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(){this.value&&this.value!==this.getCurrentValue()&&this.history.add(this.value)}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),e&&(this.value=e,Kw(this.value))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Kw(this.value))}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()||this.history.last()}}const _U=Mw;class vU extends Uo{constructor(e){super(),this.parent=e,this.onKeyDown=e=>BC(this.inputBox.inputElement,yw.KEY_DOWN,(t=>{e(new SC(t))})),this.onMouseDown=e=>BC(this.inputBox.inputElement,yw.MOUSE_DOWN,(t=>{e(new EC(t))})),this.onDidChange=e=>this.inputBox.onDidChange(e),this.container=Lw(this.parent,_U(".quick-input-box")),this.inputBox=this._register(new mU(this.container,void 0))}get value(){return this.inputBox.value}set value(e){this.inputBox.value=e}select(e=null){this.inputBox.select(e)}isSelectionAtEnd(){return this.inputBox.isSelectionAtEnd()}get placeholder(){return this.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.inputBox.getAriaLabel()}set ariaLabel(e){this.inputBox.setAriaLabel(e)}get password(){return"password"===this.inputBox.inputElement.type}set password(e){this.inputBox.inputElement.type=e?"password":"text"}setAttribute(e,t){this.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===oF.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===oF.Info?1:e===oF.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===oF.Info?1:e===oF.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}class bU{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=null!==(i=null==t?void 0:t.supportIcons)&&void 0!==i&&i,this.domNode=Lw(e,Mw("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=bU.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&zo(this.highlights,t)||(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t{n="\r\n"===e?-1:0,o+=i;for(const i of t)i.end<=o||(i.start>=o&&(i.start+=n),i.end>=o&&(i.end+=n));return i+=n,"⏎"}))}}class CU{constructor(e="",t=!1){var i,n,o;if(this.value=e,"string"!=typeof this.value)throw Ms("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=null!==(i=t.isTrusted)&&void 0!==i?i:void 0,this.supportThemeIcons=null!==(n=t.supportThemeIcons)&&void 0!==n&&n,this.supportHtml=null!==(o=t.supportHtml)&&void 0!==o&&o)}appendText(e,t=0){var i;return this.value+=function(e){return e.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")}(this.supportThemeIcons?(i=e,i.replace(fz,((e,t)=>t?e:`\\${e}`))):e).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}}function wU(e){return yU(e)?!e.value:!Array.isArray(e)||e.every(wU)}function yU(e){return e instanceof CU||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function SU(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1"):e}var xU=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class kU{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t){var i;return xU(this,void 0,void 0,(function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(void 0===e||Gs(e)||e instanceof HTMLElement)n=e;else if(ua(e.markdown)){this._hoverWidget||this.show($m(0,"Loading..."),t),this._cancellationTokenSource=new as;const i=this._cancellationTokenSource.token;if(n=yield e.markdown(i),void 0===n&&(n=e.markdownNotSupportedFallback),this.isDisposed||i.isCancellationRequested)return}else n=null!==(i=e.markdown)&&void 0!==i?i:e.markdownNotSupportedFallback;this.show(n,t)}))}show(e,t){const i=this._hoverWidget;if(this.hasContent(e)){const n={content:e,target:this.target,showPointer:"element"===this.hoverDelegate.placement,hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!i};this._hoverWidget=this.hoverDelegate.showHover(n,t)}null==i||i.dispose()}hasContent(e){return!!e&&(!yU(e)||!!e.value)}get isDisposed(){var e;return null===(e=this._hoverWidget)||void 0===e?void 0:e.isDisposed}dispose(){var e,t;null===(e=this._hoverWidget)||void 0===e||e.dispose(),null===(t=this._cancellationTokenSource)||void 0===t||t.dispose(!0),this._cancellationTokenSource=void 0}}class LU{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 DU extends Uo{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new LU(Lw(e,Mw(".monaco-icon-label")))),this.labelContainer=Lw(this.domNode.element,Mw(".monaco-icon-label-container"));const i=Lw(this.labelContainer,Mw("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new LU(Lw(this.labelContainer,Mw("span.monaco-icon-description-container")))),(null==t?void 0:t.supportHighlights)||(null==t?void 0:t.supportIcons)?this.nameNode=new NU(i,!!t.supportIcons):this.nameNode=new EU(i),(null==t?void 0:t.supportDescriptionHighlights)?this.descriptionNodeFactory=()=>new bU(Lw(this.descriptionContainer.element,Mw("span.label-description")),{supportIcons:!!t.supportIcons}):this.descriptionNodeFactory=()=>this._register(new LU(Lw(this.descriptionContainer.element,Mw("span.label-description")))),this.hoverDelegate=null==t?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"];i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough")),this.domNode.className=n.join(" "),this.setupHover((null==i?void 0:i.descriptionTitle)?this.labelContainer:this.element,null==i?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof bU?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,null==i?void 0:i.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(null==i?void 0:i.descriptionTitle)||""),this.descriptionNode.empty=!t))}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),t)if(this.hoverDelegate){const i=function(e,t,i){let n,o;const s=(t,i)=>{var s;t&&(null==o||o.dispose(),o=void 0),i&&(null==n||n.dispose(),n=void 0),null===(s=e.onDidHideHover)||void 0===s||s.call(e)},r=(n,s,r)=>new Vv((()=>xU(this,void 0,void 0,(function*(){o&&!o.isDisposed||(o=new kU(e,r||t,n>0),yield o.update(i,s))}))),n),a=BC(t,yw.MOUSE_OVER,(()=>{if(n)return;const i=new Cs;i.add(BC(t,yw.MOUSE_LEAVE,(e=>s(!1,e.fromElement===t)),!0)),i.add(BC(t,yw.MOUSE_DOWN,(()=>s(!0,!0)),!0));const o={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>o.x=e.x+10;i.add(BC(t,yw.MOUSE_MOVE,e,!0))}i.add(r(e.delay,!1,o)),n=i}),!0);return{show:e=>{s(!1,!0),r(0,e)},hide:()=>{s(!0,!0)},update:e=>xU(this,void 0,void 0,(function*(){i=e,yield null==o?void 0:o.update(i)})),dispose:()=>{a.dispose(),s(!0,!0)}}}(this.hoverDelegate,e,t);i&&this.customHovers.set(e,i)}else!function(e,t){Gs(t)?e.title=bz(t):(null==t?void 0:t.markdownNotSupportedFallback)?e.title=t.markdownNotSupportedFallback:e.removeAttribute("title")}(e,t);else e.removeAttribute("title")}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}}class EU{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!zo(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=Lw(this.container,Mw("a.label-name",{id:null==t?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:n,end:n+e.length},s=i.map((e=>zW.intersect(o,e))).filter((e=>!zW.isEmpty(e))).map((({start:e,end:t})=>({start:e-n,end:t-n})));return n=o.end+t.length,s}))}(e,i,null==t?void 0:t.matches);for(let o=0;o{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}));function OU(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=n.startsWith(i),r=o.startsWith(i);if(s!==r)return s?-1:1;if(s&&r){if(n.lengtho.length)return 1}return 0}(e,t,i);if(s)return s;const r=n.endsWith(i);if(r!==o.endsWith(i))return r?-1:1;const a=function(e,t,i=!1){const n=e||"",o=t||"",s=MU.value.collator.compare(n,o);return MU.value.collatorIsNumeric&&0===s&&n!==o?n({collator:new Intl.Collator(void 0,{numeric:!0})}))),new jv((()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})})));var AU=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},RU=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const PU=Mw;class FU{constructor(e){this.hidden=!1,this._onChecked=new $o,this.onChecked=this._onChecked.event,Object.assign(this,e)}get checked(){return!!this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire(e))}dispose(){this._onChecked.dispose()}}class BU{get templateId(){return BU.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Lw(e,PU(".quick-input-list-entry"));const i=Lw(t.entry,PU("label.quick-input-list-label"));t.toDisposeTemplate.push(WC(i,yw.CLICK,(e=>{t.checkbox.offsetParent||e.preventDefault()}))),t.checkbox=Lw(i,PU("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(WC(t.checkbox,yw.CHANGE,(e=>{t.element.checked=t.checkbox.checked})));const n=Lw(i,PU(".quick-input-list-rows")),o=Lw(n,PU(".quick-input-list-row")),s=Lw(n,PU(".quick-input-list-row"));t.label=new DU(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const r=Lw(o,PU(".quick-input-list-entry-keybinding"));t.keybinding=new TU(r,Xs);const a=Lw(s,PU(".quick-input-list-label-meta"));return t.detail=new DU(a,{supportHighlights:!0,supportIcons:!0}),t.separator=Lw(t.entry,PU(".quick-input-list-separator")),t.actionBar=new rB(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){i.toDisposeElement=bs(i.toDisposeElement),i.element=e,i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked((e=>i.checkbox.checked=e)));const{labelHighlights:n,descriptionHighlights:o,detailHighlights:s}=e,r=Object.create(null);r.matches=n||[],r.descriptionTitle=e.saneDescription,r.descriptionMatches=o||[],r.extraClasses=e.item.iconClasses,r.italic=e.item.italic,r.strikethrough=e.item.strikethrough,i.label.setLabel(e.saneLabel,e.saneDescription,r),i.keybinding.set(e.item.keybinding),e.saneDetail&&i.detail.setLabel(e.saneDetail,void 0,{matches:s,title:e.saneDetail}),e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator),i.actionBar.clear();const a=e.item.buttons;a&&a.length?(i.actionBar.push(a.map(((t,i)=>{let n=t.iconClass||(t.iconPath?Jj(t.iconPath):void 0);t.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible");const o=new Xw(`id-${i}`,"",n,!0,(()=>RU(this,void 0,void 0,(function*(){e.fireButtonTriggered({button:t,item:e.item})}))));return o.tooltip=t.tooltip||"",o})),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=bs(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=bs(e.toDisposeElement),e.toDisposeTemplate=bs(e.toDisposeTemplate)}}BU.ID="listelement";class VU{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return BU.ID}}var WU,HU;(HU=WU||(WU={}))[HU.First=1]="First",HU[HU.Second=2]="Second",HU[HU.Last=3]="Last",HU[HU.Next=4]="Next",HU[HU.Previous=5]="Previous",HU[HU.NextPage=6]="NextPage",HU[HU.PreviousPage=7]="PreviousPage";class zU{constructor(e,t,i){this.parent=e,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnMeta=!0,this.sortByLabel=!0,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._onKeyDown=new $o,this.onKeyDown=this._onKeyDown.event,this._onLeave=new $o,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Lw(this.parent,PU(".quick-input-list"));const n=new VU,o=new jU;this.list=i.createList("QuickInput",this.container,n,[new BU],{identityProvider:{getId:e=>e.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown((e=>{const t=new SC(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(Ho?e.metaKey:e.ctrlKey)&&this.list.setFocus(Aa(this.list.length));break;case 16:{const e=this.list.getFocus();1===e.length&&0===e[0]&&this._onLeave.fire();break}case 18:{const e=this.list.getFocus();1===e.length&&e[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(t)}))),this.disposables.push(this.list.onMouseDown((e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()}))),this.disposables.push(BC(this.container,yw.CLICK,(e=>{(e.x||e.y)&&this._onLeave.fire()}))),this.disposables.push(this.list.onMouseMiddleClick((e=>{this._onLeave.fire()}))),this.disposables.push(this.list.onContextMenu((e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))}))),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return ds.map(this.list.onDidChangeFocus,(e=>e.elements.map((e=>e.item))))}get onDidChangeSelection(){return ds.map(this.list.onDidChangeSelection,(e=>({items:e.elements.map((e=>e.item)),event:e.browserEvent})))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{t.hidden||(t.checked=e)}))}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=bs(this.elementDisposables);const t=e=>this.fireButtonTriggered(e);this.inputElements=e,this.elements=e.reduce(((i,n,o)=>{var s,r,a;if("separator"!==n.type){const l=o&&e[o-1],d=n.label&&n.label.replace(/\r?\n/g," "),h=n.meta&&n.meta.replace(/\r?\n/g," "),c=n.description&&n.description.replace(/\r?\n/g," "),u=n.detail&&n.detail.replace(/\r?\n/g," "),g=n.ariaLabel||[d,c,u].map((e=>Ra(e))).filter((e=>!!e)).join(", "),p=this.parent.classList.contains("show-checkboxes");i.push(new FU({hasCheckbox:p,index:o,item:n,saneLabel:d,saneMeta:h,saneAriaLabel:g,saneDescription:c,saneDetail:u,labelHighlights:null===(s=n.highlights)||void 0===s?void 0:s.label,descriptionHighlights:null===(r=n.highlights)||void 0===r?void 0:r.description,detailHighlights:null===(a=n.highlights)||void 0===a?void 0:a.detail,checked:!1,separator:l&&"separator"===l.type?l:void 0,fireButtonTriggered:t}))}return i}),[]),this.elementDisposables.push(...this.elements),this.elementDisposables.push(...this.elements.map((e=>e.onChecked((()=>this.fireCheckedEvents()))))),this.elementsToIndexes=this.elements.reduce(((e,t,i)=>(e.set(t.item,i),e)),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map((e=>e.item))}setFocusedElements(e){if(this.list.setFocus(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e)))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e))))}getCheckedElements(){return this.elements.filter((e=>e.checked)).map((e=>e.item))}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===WU.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=WU.First),e===WU.Previous&&0===this.list.getFocus()[0]&&(e=WU.Last),e===WU.Second&&this.list.length<2&&(e=WU.First),e){case WU.First:this.list.focusFirst();break;case WU.Second:this.list.focusNth(1);break;case WU.Last:this.list.focusLast();break;case WU.Next:this.list.focusNext();break;case WU.Previous:this.list.focusPrevious();break;case WU.NextPage:this.list.focusNextPage();break;case WU.PreviousPage:this.list.focusPreviousPage()}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${44*Math.floor(e/44)}px)`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let t;this.elements.forEach((i=>{const n=this.matchOnLabel?Qs(wz(e,Cz(i.saneLabel))):void 0,o=this.matchOnDescription?Qs(wz(e,Cz(i.saneDescription||""))):void 0,s=this.matchOnDetail?Qs(wz(e,Cz(i.saneDetail||""))):void 0,r=this.matchOnMeta?Qs(wz(e,Cz(i.saneMeta||""))):void 0;if(n||o||s||r?(i.labelHighlights=n,i.descriptionHighlights=o,i.detailHighlights=s,i.hidden=!1):(i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!i.item.alwaysShow),i.separator=void 0,!this.sortByLabel){const e=i.index&&this.inputElements[i.index-1];t=e&&"separator"===e.type?e:t,t&&!i.hidden&&(i.separator=t,t=void 0)}}))}else this.elements.forEach((e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.separator=t&&"separator"===t.type?t:void 0}));const t=this.elements.filter((e=>!e.hidden));if(this.sortByLabel&&e){const i=e.toLowerCase();t.sort(((e,t)=>function(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];if(n.length&&!o.length)return-1;if(!n.length&&o.length)return 1;if(0===n.length&&0===o.length)return 0;return OU(e.saneLabel,t.saneLabel,i)}(e,t,i)))}return this.elementsToIndexes=t.reduce(((e,t,i)=>(e.set(t.item,i),e)),new Map),this.list.splice(0,this.list.length,t),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(t.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=bs(this.elementDisposables),this.disposables=bs(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}style(e){this.list.style(e)}}AU([VS],zU.prototype,"onDidChangeFocus",null),AU([VS],zU.prototype,"onDidChangeSelection",null);class jU{getWidgetAriaLabel(){return $m(0,"Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var UU=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const $U=Mw,KU={iconClass:br.quickInputBack.classNames,tooltip:$m(0,"Back"),handle:-1};class qU extends Uo{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.noValidationMessage=qU.noPromptMessage,this._severity=oF.Ignore,this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new $o),this.onDidHideEmitter=this._register(new $o),this.onDisposeEmitter=this._register(new $o),this.visibleDisposables=this._register(new Cs),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&&!Vs;this._ignoreFocusOut=e&&!Vs,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!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=>{-1!==this.buttons.indexOf(e)&&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.update())}hide(){this.visible&&this.ui.hide()}didHide(e=tU.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||" "===this.ui.title.innerHTML||(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this.busy&&!this.busyDelay&&(this.busyDelay=new Vv,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 e=this.buttons.filter((e=>e===KU));this.ui.leftActionBar.push(e.map(((e,t)=>{const i=new Xw(`id-${t}`,"",e.iconClass||Jj(e.iconPath),!0,(()=>UU(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter((e=>e!==KU));this.ui.rightActionBar.push(t.map(((e,t)=>{const i=new Xw(`id-${t}`,"",e.iconClass||Jj(e.iconPath),!0,(()=>UU(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1})}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,Dw(this.ui.message,...Hj(i))),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?$m(0,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==oF.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()}}qU.noPromptMessage=$m(0,"Press 'Enter' to confirm your input or 'Escape' to cancel");class GU extends qU{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._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=this.ui.isScreenReaderOptimized()?nU.NONE:nU.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.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,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}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){if(this._value!==e){if(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 sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=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?eU:this.ui.keyMods}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.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(WU.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{this.doSetValue(e,!0)}))),this.visibleDisposables.add(this.ui.inputBox.onMouseDown((e=>{this.autoFocusOnList||this.ui.list.clearFocus()}))),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown((e=>{switch(e.keyCode){case 18:this.ui.list.focus(WU.Next),this.canSelectMany&&this.ui.list.domFocus(),Sw(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(WU.Previous):this.ui.list.focus(WU.Last),this.canSelectMany&&this.ui.list.domFocus(),Sw(e,!0);break;case 12:this.ui.list.focus(WU.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Sw(e,!0);break;case 11:this.ui.list.focus(WU.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Sw(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(WU.First),Sw(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(WU.Last),Sw(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.ui.list.onDidChangeFocus((e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&jo(e,this._activeItems,((e,t)=>e===t))||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.list.onDidChangeSelection((({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&jo(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&1===t.button))}))),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&jo(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))}))),this.visibleDisposables.add(this.ui.list.onButtonTriggered((e=>this.onDidTriggerItemButtonEmitter.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 BC(this.ui.container,yw.KEY_UP,(e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new SC(e),i=t.keyCode;this._quickNavigate.keybindings.some((e=>{const[n,o]=e.getParts();return!o&&(n.shiftKey&&4===i?!(t.ctrlKey||t.altKey||t.metaKey):!(!n.altKey||6!==i)||(!(!n.ctrlKey||5!==i)||!(!n.metaKey||57!==i)))}))&&(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._hideInput&&this._items.length>0;this.ui.container.classList.toggle("hidden-input",t&&!this.description);const i={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!t,progressBar:!t,visibleCount:!0,count:this.canSelectMany,ok:"default"===this.ok?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||"");const n=this.ariaLabel||this.placeholder||GU.DEFAULT_ARIA_LABEL;if(this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),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 nU.NONE:this._itemActivation=nU.FIRST;break;case nU.SECOND:this.ui.list.focus(WU.Second),this._itemActivation=nU.FIRST;break;case nU.LAST:this.ui.list.focus(WU.Last),this._itemActivation=nU.FIRST;break;default:this.trySelectFirst()}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||"",this.ui.setComboboxAccessibility(!0),i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(WU.First)),this.keepScrollPosition&&(this.scrollTop=e)}}GU.DEFAULT_ARIA_LABEL=$m(0,"Type to narrow down results.");class ZU extends Uo{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,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.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};this._register(BC(window,yw.KEY_DOWN,e,!0)),this._register(BC(window,yw.KEY_UP,e,!0)),this._register(BC(window,yw.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Lw(this.parentElement,$U(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=fw(e),i=Lw(e,$U(".quick-input-titlebar")),n=this._register(new rB(i));n.domNode.classList.add("quick-input-left-action-bar");const o=Lw(i,$U(".quick-input-title")),s=this._register(new rB(i));s.domNode.classList.add("quick-input-right-action-bar");const r=Lw(e,$U(".quick-input-description")),a=Lw(e,$U(".quick-input-header")),l=Lw(a,$U("input.quick-input-check-all"));l.type="checkbox",this._register(WC(l,yw.CHANGE,(e=>{const t=l.checked;y.setAllVisibleChecked(t)}))),this._register(BC(l,yw.CLICK,(e=>{(e.x||e.y)&&u.setFocus()})));const d=Lw(a,$U(".quick-input-description")),h=Lw(a,$U(".quick-input-and-message")),c=Lw(h,$U(".quick-input-filter")),u=this._register(new vU(c));u.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Lw(c,$U(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new Kj(g,{countFormat:$m(0,"{0} Results")}),m=Lw(c,$U(".quick-input-count"));m.setAttribute("aria-live","polite");const f=new Kj(m,{countFormat:$m(0,"{0} Selected")}),_=Lw(a,$U(".quick-input-action")),v=new Uj(_);v.label=$m(0,"OK"),this._register(v.onDidClick((e=>{this.onDidAcceptEmitter.fire()})));const b=Lw(a,$U(".quick-input-action")),C=new Uj(b);C.label=$m(0,"Custom"),this._register(C.onDidClick((e=>{this.onDidCustomEmitter.fire()})));const w=Lw(h,$U(`#${this.idPrefix}message.quick-input-message`)),y=this._register(new zU(e,this.idPrefix+"list",this.options));this._register(y.onChangedAllVisibleChecked((e=>{l.checked=e}))),this._register(y.onChangedVisibleCount((e=>{p.setCount(e)}))),this._register(y.onChangedCheckedCount((e=>{f.setCount(e)}))),this._register(y.onLeave((()=>{setTimeout((()=>{u.setFocus(),this.controller instanceof GU&&this.controller.canSelectMany&&y.clearFocus()}),0)}))),this._register(y.onDidChangeFocus((()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")})));const S=new Gj(e);S.getContainer().classList.add("quick-input-progress");const x=kw(e);return this._register(x),this._register(BC(e,yw.FOCUS,(e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0}),!0)),this._register(x.onDidBlur((()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(tU.Blur),this.previousFocusElement=void 0}))),this._register(BC(e,yw.FOCUS,(e=>{u.setFocus()}))),this._register(BC(e,yw.KEY_DOWN,(t=>{const i=new SC(t);switch(i.keyCode){case 3:Sw(t,!0),this.onDidAcceptEmitter.fire();break;case 9:Sw(t,!0),this.hide(tU.Gesture);break;case 2:if(!i.altKey&&!i.ctrlKey&&!i.metaKey){const n=[".action-label.codicon"];e.classList.contains("show-checkboxes")?n.push("input"):n.push("input[type=text]"),this.getUI().list.isDisplayed()&&n.push(".monaco-list");const o=e.querySelectorAll(n.join(", "));i.shiftKey&&i.target===o[0]?(Sw(t,!0),o[o.length-1].focus()):i.shiftKey||i.target!==o[o.length-1]||(Sw(t,!0),o[0].focus())}}}))),this.ui={container:e,styleSheet:t,leftActionBar:n,titleBar:i,title:o,description1:r,description2:d,rightActionBar:s,checkAll:l,filterContainer:c,inputBox:u,visibleCountContainer:g,visibleCount:p,countContainer:m,count:f,okContainer:_,ok:v,message:w,customButtonContainer:b,customButton:C,list:y,progressBar:S,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setComboboxAccessibility:e=>this.setComboboxAccessibility(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e)},this.updateStyles(),this.ui}pick(e,t={},i=Ia.None){return new Promise(((n,o)=>{let s=e=>{s=n,t.onKeyMods&&t.onKeyMods(r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept((()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(e),r.hide())}})),r.onDidChangeActive((e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)})),r.onDidChangeSelection((e=>{if(!r.canSelectMany){const t=e[0];t&&(s(t),r.hide())}})),r.onDidTriggerItemButton((e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter((e=>e!==i[0])),o=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=o}}})))),r.onDidChangeValue((e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])})),i.onCancellationRequested((()=>{r.hide()})),r.onDidHide((()=>{bs(l),s(void 0)}))];r.title=t.title,r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then((([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter((e=>"separator"!==e.type&&e.picked))),a&&(r.activeItems=[a])})),r.show(),Promise.resolve(e).then(void 0,(e=>{o(e),r.hide()}))}))}createQuickPick(){const e=this.getUI();return new GU(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i&&i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(oF.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Dw(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,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="";const n=this.options.backKeybindingLabel();KU.tooltip=n?$m(0,"Back ({0})",n):$m(0,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}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.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[e.checkBox?"add":"remove"]("show-checkboxes"),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.getAction().enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.getAction().enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t;const i=this.controller;if(i){const n=!(null===(t=this.ui)||void 0===t?void 0:t.container.contains(document.activeElement));if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!n){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=Qs(e.parentElement);(null==e?void 0:e.offsetParent)?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}i.didHide(e)}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,ZU.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,contrastBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e?e.toString():"",this.ui.container.style.backgroundColor=t?t.toString():"",this.ui.container.style.color=i?i.toString():"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.inputBox.style(this.styles.inputBox),this.ui.count.style(this.styles.countBadge),this.ui.ok.style(this.styles.button),this.ui.customButton.style(this.styles.button),this.ui.progressBar.style(this.styles.progressBar),this.ui.list.style(this.styles.list);const s=[];this.styles.list.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`),this.styles.list.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}}ZU.MAX_WIDTH=600;class YU{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach((n=>n.splice(e,t,i)))}}class XU extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function QU(e,t){const i=[];for(let n of t){if(e.start>=n.range.end)continue;if(e.end({range:JU(e.range,n),size:e.size}))),r=i.map(((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size})));this.groups=function(...e){return function(e){const t=[];let i=null;for(let n of e){const e=n.range.start,o=n.range.end,s=n.size;i&&s===i.size?i.range.end=o:(i={range:{start:e,end:o},size:s},t.push(i))}return t}(e.reduce(((e,t)=>e.concat(t)),[]))}(o,r,s),this._size=this.groups.reduce(((e,t)=>e+t.size*(t.range.end-t.range.start)),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;let t=0,i=0;for(let n of this.groups){const o=n.range.end-n.range.start,s=i+o*n.size;if(e{for(const i of e){this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}})),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var i$=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const n$={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class o${constructor(e){this.elements=e}update(){}getData(){return this.elements}}class s${constructor(e){this.elements=e}update(){}getData(){return this.elements}}class r${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;ti,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class l${constructor(e,t,i,n=n$){if(this.virtualDelegate=t,this.domId="list_id_"+ ++l$.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Av(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Uo.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Uo.None,this.onDragLeaveTimeout=Uo.None,this.disposables=new Cs,this._onDidChangeContentHeight=new $o,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=new e$;for(const o of i)this.renderers.set(o.templateId,o);this.cache=this.disposables.add(new t$(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","boolean"!=typeof n.mouseSupport||n.mouseSupport),this._horizontalScrolling=Pa(n,(e=>e.horizontalScrolling),n$.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=void 0===n.additionalScrollHeight?0:n.additionalScrollHeight,this.accessibilityProvider=new a$(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows";Pa(n,(e=>e.transformOptimization),n$.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add($S.addTarget(this.rowsContainer)),this.scrollable=new YI({forceIntegerValues:!0,smoothScrollDuration:Pa(n,(e=>e.smoothScrolling),!1)?125:0,scheduleAtNextAnimationFrame:e=>KC(e)}),this.scrollableElement=this.disposables.add(new oT(this.rowsContainer,{alwaysConsumeMouseWheel:Pa(n,(e=>e.alwaysConsumeMouseWheel),n$.alwaysConsumeMouseWheel),horizontal:1,vertical:Pa(n,(e=>e.verticalScrollMode),n$.verticalScrollMode),useShadows:Pa(n,(e=>e.useShadows),n$.useShadows),mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(BC(this.rowsContainer,WS.Change,(e=>this.onTouchChange(e)))),this.disposables.add(BC(this.scrollableElement.getDomNode(),"scroll",(e=>e.target.scrollTop=0))),this.disposables.add(BC(this.domNode,"dragover",(e=>this.onDragOver(this.toDragEvent(e))))),this.disposables.add(BC(this.domNode,"drop",(e=>this.onDrop(this.toDragEvent(e))))),this.disposables.add(BC(this.domNode,"dragleave",(e=>this.onDragLeave(this.toDragEvent(e))))),this.disposables.add(BC(this.domNode,"dragend",(e=>this.onDragEnd(e)))),this.setRowLineHeight=Pa(n,(e=>e.setRowLineHeight),n$.setRowLineHeight),this.setRowHeight=Pa(n,(e=>e.setRowHeight),n$.setRowHeight),this.supportDynamicHeights=Pa(n,(e=>e.supportDynamicHeights),n$.supportDynamicHeights),this.dnd=Pa(n,(e=>e.dnd),n$.dnd),this.layout()}get contentHeight(){return this.rangeMap.size}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:rw(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}updateOptions(e){void 0!==e.additionalScrollHeight&&(this.additionalScrollHeight=e.additionalScrollHeight,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.mouseWheelScrollSensitivity&&this.scrollableElement.updateOptions({mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),void 0!==e.fastScrollSensitivity&&this.scrollableElement.updateOptions({fastScrollSensitivity:e.fastScrollSensitivity})}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=zW.intersect(n,o),r=new Map;for(let C=s.end-1;C>=s.start;C--){const e=this.items[C];if(e.dragStartDisposable.dispose(),e.row){let t=r.get(e.templateId);t||(t=[],r.set(e.templateId,t));const i=this.renderers.get(e.templateId);i&&i.disposeElement&&i.disposeElement(e.element,C,e.row.templateData,e.size),t.push(e.row)}e.row=null}const a={start:e+t,end:this.items.length},l=zW.intersect(a,n),d=zW.relativeComplement(a,n),h=i.map((e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Uo.None,checkedDisposable:Uo.None})));let c;0===e&&t>=this.items.length?(this.rangeMap=new e$,this.rangeMap.splice(0,0,h),c=this.items,this.items=h):(this.rangeMap.splice(e,t,h),c=this.items.splice(e,t,...h));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=JU(l,u),m=zW.intersect(g,p);for(let C=m.start;CJU(e,u))),v=[{start:e,end:e+i.length},..._].map((e=>zW.intersect(g,e))),b=this.getNextToLastElement(v);for(const C of v)for(let e=C.start;ee.element))}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=KC((()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger((()=>this.updateScrollWidth())):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10})}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let i={height:"number"==typeof e?e:aw(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:rw(this.domNode)})}render(e,t,i,n,o,s=!1){const r=this.getRenderRange(t,i),a=zW.relativeComplement(r,e),l=zW.relativeComplement(e,r),d=this.getNextToLastElement(a);if(s){const t=zW.intersect(e,r);for(let e=t.start;en.row.domNode.setAttribute("aria-checked",String(!!e));e(s.value),n.checkedDisposable=s.onDidChange(e)}n.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(n.row.domNode,t):this.rowsContainer.appendChild(n.row.domNode)),this.updateItemInDOM(n,e);const r=this.renderers.get(n.templateId);if(!r)throw new Error(`No renderer found for template id ${n.templateId}`);r&&r.renderElement(n.element,e,n.row.templateData,n.size);const a=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!a,a&&(n.dragStartDisposable=BC(n.row.domNode,"dragstart",(e=>this.onDragStart(n.element,a,e)))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=Rf?"-moz-fit-content":"fit-content",e.width=rw(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2==0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.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.additionalScrollHeight}get onMouseClick(){return ds.map(this.disposables.add(new zF(this.domNode,"click")).event,(e=>this.toMouseEvent(e)))}get onMouseDblClick(){return ds.map(this.disposables.add(new zF(this.domNode,"dblclick")).event,(e=>this.toMouseEvent(e)))}get onMouseMiddleClick(){return ds.filter(ds.map(this.disposables.add(new zF(this.domNode,"auxclick")).event,(e=>this.toMouseEvent(e))),(e=>1===e.browserEvent.button))}get onMouseDown(){return ds.map(this.disposables.add(new zF(this.domNode,"mousedown")).event,(e=>this.toMouseEvent(e)))}get onContextMenu(){return ds.any(ds.map(this.disposables.add(new zF(this.domNode,"contextmenu")).event,(e=>this.toMouseEvent(e))),ds.map(this.disposables.add(new zF(this.domNode,WS.Contextmenu)).event,(e=>this.toGestureEvent(e))))}get onTouchStart(){return ds.map(this.disposables.add(new zF(this.domNode,"touchstart")).event,(e=>this.toTouchEvent(e)))}get onTap(){return ds.map(this.disposables.add(new zF(this.rowsContainer,WS.Tap)).event,(e=>this.toGestureEvent(e)))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}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 t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(eB.TEXT,t),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(n,i)),void 0===e&&(e=String(n.length));const t=Mw(".monaco-drag-image");t.textContent=e,document.body.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout((()=>document.body.removeChild(t)),0)}this.currentDragData=new o$(n),iB.CurrentDragAndDropData=new s$(n),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),iB.CurrentDragAndDropData&&"vscode-ui"===iB.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(iB.CurrentDragAndDropData)this.currentDragData=iB.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new r$}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"==typeof t?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let i;if(e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof t&&0===t.effect?"copy":"move",i="boolean"!=typeof t&&t.feedback?t.feedback:void 0===e.index?[-1]:[e.index],i=Qo(i).filter((e=>e>=-1&&ee-t)),i=-1===i[0]?[-1]:i,n=this.currentDragFeedback,o=i,Array.isArray(n)&&Array.isArray(o)?jo(n,o):n===o)return!0;var n,o;if(this.currentDragFeedback=i,this.currentDragFeedbackDisposable.dispose(),-1===i[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=es((()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")}));else{for(const e of i){const t=this.items[e];t.dropTarget=!0,t.row&&t.row.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=es((()=>{for(const e of i){const t=this.items[e];t.dropTarget=!1,t.row&&t.row.domNode.classList.remove("drop-target")}}))}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Fv((()=>this.clearDragOverFeedback()),100),this.currentDragData&&(null===(i=(t=this.dnd).onDragLeave)||void 0===i||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,iB.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,iB.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Uo.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=iw(this.domNode).top;this.dragOverAnimationDisposable=function(e){const t=()=>{e(),i=KC(t)};let i=KC(t);return es((()=>i.dispose()))}(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Fv((()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}),1e3),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}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,s;e===this.elementTop(n.start)?(o=n.start,s=0):n.end-n.start>1&&(o=n.start+1,s=this.elementTop(o)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},u$=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class g${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((e=>e.templateData===i));if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}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((t=>t.templateData===e));t<0||this.renderedElements.splice(t,1)}}class p${constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new $o,this.onChange=this._onChange.event}get name(){return this._trait}get renderer(){return new g$(this)}splice(e,t,i){var n;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,s=e+t,r=[...this.sortedIndexes.filter((t=>tt?i+e:-1)).filter((e=>-1!==e)),...this.sortedIndexes.filter((e=>e>=s)).map((e=>e+o))],a=this.length+o;if(this.sortedIndexes.length>0&&0===r.length&&a>0){const t=null!==(n=this.sortedIndexes.find((t=>t>=e)))&&void 0!==n?n:a-1;r.push(Math.min(t,a-1))}this.renderer.splice(e,t,i.length),this._set(r,r),this.length=a}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(T$),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=I$(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return Fa(this.sortedIndexes,e,T$)>=0}dispose(){bs(this._onChange)}}c$([VS],p$.prototype,"renderer",null);class m$ extends p${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 f${constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,i.map((()=>!1)));const n=this.trait.get().map((e=>this.identityProvider.getId(this.view.element(e)).toString())),o=i.map((e=>n.indexOf(this.identityProvider.getId(e).toString())>-1));this.trait.splice(e,t,o)}}function _$(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function v$(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&(!!e.parentElement&&v$(e.parentElement))}class b${constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Cs,this.multipleSelectionDisposables=new Cs,this.onKeyDown.filter((e=>3===e.keyCode)).on(this.onEnter,this,this.disposables),this.onKeyDown.filter((e=>16===e.keyCode)).on(this.onUpArrow,this,this.disposables),this.onKeyDown.filter((e=>18===e.keyCode)).on(this.onDownArrow,this,this.disposables),this.onKeyDown.filter((e=>11===e.keyCode)).on(this.onPageUpArrow,this,this.disposables),this.onKeyDown.filter((e=>12===e.keyCode)).on(this.onPageDownArrow,this,this.disposables),this.onKeyDown.filter((e=>9===e.keyCode)).on(this.onEscape,this,this.disposables),!1!==i.multipleSelectionSupport&&this.onKeyDown.filter((e=>(Ho?e.metaKey:e.ctrlKey)&&31===e.keyCode)).on(this.onCtrlA,this,this.multipleSelectionDisposables)}get onKeyDown(){return ds.chain(this.disposables.add(new zF(this.view.domNode,"keydown")).event).filter((e=>!_$(e.target))).map((e=>new SC(e)))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionDisposables.clear(),e.multipleSelectionSupport&&this.onKeyDown.filter((e=>(Ho?e.metaKey:e.ctrlKey)&&31===e.keyCode)).on(this.onCtrlA,this,this.multipleSelectionDisposables))}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Aa(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()}}c$([VS],b$.prototype,"onKeyDown",null),(h$=d$||(d$={}))[h$.Idle=0]="Idle",h$[h$.Typing=1]="Typing";const C$=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=93&&e.keyCode<=102||e.keyCode>=80&&e.keyCode<=90)}};class w${constructor(e,t,i,n){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.delegate=n,this.enabled=!1,this.state=d$.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Cs,this.disposables=new Cs,this.updateOptions(e.options)}updateOptions(e){void 0===e.enableKeyboardNavigation||!!e.enableKeyboardNavigation?this.enable():this.disable(),void 0!==e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=ds.chain(this.enabledDisposables.add(new zF(this.view.domNode,"keydown")).event).filter((e=>!_$(e.target))).filter((()=>this.automaticKeyboardNavigation||this.triggered)).map((e=>new SC(e))).filter((e=>this.delegate.mightProducePrintableCharacter(e))).forEach((e=>e.preventDefault())).map((e=>e.browserEvent.key)).event,t=ds.debounce(e,(()=>null),800);ds.reduce(ds.any(e,t),((e,t)=>null===t?null:(e||"")+t))(this.onInput,this,this.enabledDisposables),t(this.onClear,this,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));i&&$w(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=d$.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===d$.Idle?1:0;this.state=d$.Typing;for(let o=0;o!_$(e.target))).map((e=>new SC(e))).filter((e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey))).on(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!(n&&n instanceof HTMLElement&&-1!==n.tabIndex))return;const o=window.getComputedStyle(n);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function S$(e){return Ho?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function x$(e){return e.browserEvent.shiftKey}const k$={isSelectionSingleChangeEvent:S$,isSelectionRangeChangeEvent:x$};class L${constructor(e){this.list=e,this.disposables=new Cs,this._onPointer=new $o,this.onPointer=this._onPointer.event,!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||k$),this.mouseSupport=void 0===e.options.mouseSupport||!!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($S.addTarget(e.getHTMLElement()))),ds.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||k$))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){v$(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(v$(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(_$(e.browserEvent.target)||v$(e.browserEvent.target))return;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionRangeChangeEvent(e)||this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),(i=e.browserEvent)instanceof MouseEvent&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(_$(e.browserEvent.target)||v$(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(void 0===i){const e=this.list.getFocus()[0];i=null!=e?e:t,this.list.setAnchor(i)}const n=Math.min(i,t),o=Math.max(i,t),s=Aa(n,o+1),r=this.list.getSelection(),a=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;for(;o>=0&&e[o]===t-(i-o);)n.push(e[o--]);n.reverse(),o=i;for(;o=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){n++,o++;continue}e[n]e!==t));this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class D${constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&e.listBackground.isOpaque()&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&i.push(`\n\t\t\t\t.monaco-list${t}.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`),e.listFilterWidgetBackground&&i.push(`.monaco-list-type-filter { background-color: ${e.listFilterWidgetBackground} }`),e.listFilterWidgetOutline&&i.push(`.monaco-list-type-filter { border: 1px solid ${e.listFilterWidgetOutline}; }`),e.listFilterWidgetNoMatchesOutline&&i.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${e.listFilterWidgetNoMatchesOutline}; }`),e.listMatchesShadow&&i.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${e.listMatchesShadow}; }`),e.tableColumnsBorder&&i.push(`\n\t\t\t\t.monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t}`),e.tableOddRowsBackgroundColor&&i.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=i.join("\n")}}const E$={listFocusBackground:QS.fromHex("#7FB0D0"),listActiveSelectionBackground:QS.fromHex("#0E639C"),listActiveSelectionForeground:QS.fromHex("#FFFFFF"),listActiveSelectionIconForeground:QS.fromHex("#FFFFFF"),listFocusAndSelectionBackground:QS.fromHex("#094771"),listFocusAndSelectionForeground:QS.fromHex("#FFFFFF"),listInactiveSelectionBackground:QS.fromHex("#3F3F46"),listInactiveSelectionIconForeground:QS.fromHex("#FFFFFF"),listHoverBackground:QS.fromHex("#2A2D2E"),listDropBackground:QS.fromHex("#383B3D"),treeIndentGuidesStroke:QS.fromHex("#a9a9a9"),tableColumnsBorder:QS.fromHex("#cccccc").transparent(.2),tableOddRowsBackgroundColor:QS.fromHex("#cccccc").transparent(.04)},N$={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}}};function I$(e,t){const i=[];let n=0,o=0;for(;n=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){i.push(e[n]),n++,o++;continue}e[n]e-t;class M${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 s of this.renderers)s.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const s of this.renderers)s.disposeElement&&s.disposeElement(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class O${constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof o?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class A${constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var o,s;null===(s=(o=this.dnd).onDragLeave)||void 0===s||s.call(o,e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class R${constructor(e,t,i,n,o=N$){var s;this.user=e,this._options=o,this.focus=new p$("focused"),this.anchor=new p$("anchor"),this.eventBufferer=new Ba,this._ariaLabel="",this.disposables=new Cs,this._onDidDispose=new $o,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(s=this._options.accessibilityProvider)||void 0===s?void 0:s.getWidgetRole():"list";this.selection=new m$("listbox"!==r),Ko(o,E$,!1);const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new O$(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map((e=>new M$(e.templateId,[...a,e])));const l=Object.assign(Object.assign({},o),{dnd:o.dnd&&new A$(this,o.dnd)});if(this.view=new l$(t,i,n,l),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const e=fw(this.view.domNode);this.styleController=new D$(e,this.view.domId)}if(this.spliceable=new YU([new f$(this.focus,this.view,o.identityProvider),new f$(this.selection,this.view,o.identityProvider),new f$(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 y$(this,this.view)),("boolean"!=typeof o.keyboardSupport||o.keyboardSupport)&&(this.keyboardController=new b$(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||C$;this.typeLabelController=new w$(this,this.view,o.keyboardNavigationLabelProvider,e),this.disposables.add(this.typeLabelController)}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()),!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return ds.map(this.eventBufferer.wrapEvent(this.focus.onChange),(e=>this.toListEvent(e)))}get onDidChangeSelection(){return ds.map(this.eventBufferer.wrapEvent(this.selection.onChange),(e=>this.toListEvent(e)))}get domId(){return this.view.domId}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=ds.chain(this.disposables.add(new zF(this.view.domNode,"keydown")).event).map((e=>new SC(e))).filter((t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode)).map(jF).filter((()=>!1)).event,i=ds.chain(this.disposables.add(new zF(this.view.domNode,"keyup")).event).forEach((()=>e=!1)).map((e=>new SC(e))).filter((e=>58===e.keyCode||e.shiftKey&&68===e.keyCode)).map(jF).map((({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})).event,n=ds.chain(this.view.onContextMenu).filter((t=>!e)).map((({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:{x:i.pageX+1,y:i.pageY},browserEvent:i}))).event;return ds.any(t,i,n)}get onKeyDown(){return this.disposables.add(new zF(this.view.domNode,"keydown")).event}get onDidFocus(){return ds.signal(this.disposables.add(new zF(this.view.domNode,"focus",!0)).event)}createMouseController(e){return new L$(this)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e),this.typeLabelController&&this.typeLabelController.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),null===(t=this.keyboardController)||void 0===t||t.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new XU(this.user,`Invalid start index: ${e}`);if(t<0)throw new XU(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents((()=>this.spliceable.splice(e,t,i)))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new XU(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(void 0!==e){if(e<0||e>=this.length)throw new XU(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return ka(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new XU(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,n);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);s>-1&&this.setFocus([s],i)}focusNextPage(e,t){return u$(this,void 0,void 0,(function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.view.element(i),o=this.getFocusedElements()[0];if(o!==n){const n=this.findPreviousIndex(i,!1,t);n>-1&&o!==this.view.element(n)?this.setFocus([n],e):this.setFocus([i],e)}else{const n=this.view.getScrollTop();this.view.setScrollTop(n+this.view.renderHeight-this.view.elementHeight(i)),this.view.getScrollTop()!==n&&(this.setFocus([]),yield Pv(0),yield this.focusNextPage(e,t))}}))}focusPreviousPage(e,t){return u$(this,void 0,void 0,(function*(){let i;const n=this.view.getScrollTop();i=0===n?this.view.indexAt(n):this.view.indexAfter(n-1);const o=this.view.element(i),s=this.getFocusedElements()[0];if(s!==o){const n=this.findNextIndex(i,!1,t);n>-1&&s!==this.view.element(n)?this.setFocus([n],e):this.setFocus([i],e)}else{const i=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==i&&(this.setFocus([]),yield Pv(0),yield this.focusPreviousPage(e,t))}}))}focusLast(e,t){if(0===this.length)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(0===this.length)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%=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){if(e<0||e>=this.length)throw new XU(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(vr(t)){const e=o-this.view.renderHeight;this.view.setScrollTop(e*WV(t,0,1)+n)}else{const e=n+o,t=i+this.view.renderHeight;n=t||(n=t&&o>=this.view.renderHeight?this.view.setScrollTop(n):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new XU(this.user,`Invalid index ${e}`);const t=this.view.getScrollTop(),i=this.view.elementTop(e),n=this.view.elementHeight(e);if(it+this.view.renderHeight)return null;const o=n-this.view.renderHeight;return Math.abs((t-i)/o)}getHTMLElement(){return this.view.domNode}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map((e=>this.view.element(e))),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;(null===(e=this.accessibilityProvider)||void 0===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",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}c$([VS],R$.prototype,"onDidChangeFocus",null),c$([VS],R$.prototype,"onDidChangeSelection",null),c$([VS],R$.prototype,"onContextMenu",null),c$([VS],R$.prototype,"onKeyDown",null),c$([VS],R$.prototype,"onDidFocus",null);class P${constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Uo.None}}renderElement(e,t,i,n){if(i.disposable&&i.disposable.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,n);const s=new as,r=o.resolve(e,s.token);i.disposable={dispose:()=>s.cancel()},this.renderer.renderPlaceholder(e,i.data),r.then((t=>this.renderer.renderElement(t,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 F${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}}const B$={separatorBorder:QS.transparent};class V${constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){e!==this.visible&&(e?(this.size=WV(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e),this.view.setVisible&&this.view.setVisible(e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){return this.disposable.dispose(),this.view}}class W$ extends V${layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class H$ extends V${layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var z$,j$,U$,$$;(j$=z$||(z$={}))[j$.Idle=0]="Idle",j$[j$.Busy=1]="Busy",($$=U$||(U$={})).Distribute={type:"distribute"},$$.Split=function(e){return{type:"split",index:e}},$$.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};class K$ extends Uo{constructor(e,t={}){var i,n,o,s,r;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=z$.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=null!==(i=t.orientation)&&void 0!==i?i:0,this.inverseAltBehavior=null!==(n=t.inverseAltBehavior)&&void 0!==n&&n,this.proportionalLayout=null===(o=t.proportionalLayout)||void 0===o||o,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Lw(this.el,Mw(".sash-container")),this.viewContainer=Mw(".split-view-container"),this.scrollable=new YI({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:KC}),this.scrollableElement=this._register(new oT(this.viewContainer,{vertical:0===this.orientation?null!==(s=t.scrollbarVisibility)&&void 0!==s?s:1:2,horizontal:1===this.orientation?null!==(r=t.scrollbarVisibility)&&void 0!==r?r:1:2},this.scrollable)),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll((e=>{this.viewContainer.scrollTop=e.scrollTop,this.viewContainer.scrollLeft=e.scrollLeft}))),Lw(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||B$),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=fr(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)})),this.contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.saveProportions())}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())}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)for(let n=0;n1===this.viewItems[e].priority)),o=t.filter((e=>2===this.viewItems[e].priority));this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map((e=>e.size/this.contentSize)))}onSashStart({sash:e,start:t,alt:i}){for(const r of this.viewItems)r.enabled=!1;const n=this.sashItems.findIndex((t=>t.sash===e)),o=ta(BC(document.body,"keydown",(e=>s(this.sashDragState.current,e.altKey))),BC(document.body,"keyup",(()=>s(this.sashDragState.current,!1)))),s=(e,t)=>{const i=this.viewItems.map((e=>e.size));let s,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t){if(n===this.sashItems.length-1){const e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}}if(!t){const e=Aa(n,-1),t=Aa(n+1,this.viewItems.length),o=e.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),a=e.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t])),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),d=0===t.length?Number.NEGATIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize)),0),h=Math.max(o,d),c=Math.min(l,a),u=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"==typeof u){const e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);s={index:u,limitDelta:e.visible?h-t:h+t,size:e.size}}if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?c+t:c-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:s,snapAfter:r,disposable:o}};s(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:s,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,n,void 0,void 0,s,r,a,l);if(o){const e=t===this.sashItems.length-1,i=this.viewItems.map((e=>e.size)),n=e?t:t+1,o=this.viewItems[n],s=o.size-o.maximumSize,r=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-h,i,void 0,void 0,s,r)}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=WV(t="number"==typeof t?t:e.size,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==z$.Idle)throw new Error("Cant modify splitview");if(this.state=z$.Busy,e<0||e>=this.viewItems.length)return;const i=Aa(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>1===this.viewItems[e].priority)),e],o=i.filter((e=>2===this.viewItems[e].priority)),s=this.viewItems[e];t=WV(t=Math.round(t),s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(n,o),this.state=z$.Idle}distributeViewSizes(){const e=[];let t=0;for(const r of this.viewItems)r.maximumSize-r.minimumSize>0&&(e.push(r),t+=r.size);const i=Math.floor(t/e.length);for(const r of e)r.size=WV(i,r.minimumSize,r.maximumSize);const n=Aa(this.viewItems.length),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));this.relayout(o,s)}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!==z$.Idle)throw new Error("Cant modify splitview");this.state=z$.Busy;const o=Mw(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const s=e.onDidChange((e=>this.onViewChange(d,e))),r=es((()=>this.viewContainer.removeChild(o))),a=ta(s,r);let l;l="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;const d=0===this.orientation?new W$(o,e,l,a):new H$(o,e,l,a);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){let e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash};const t=0===this.orientation?new QF(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:1})):new QF(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:0})),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),o=ds.map(t.onDidStart,n)(this.onSashStart,this),s=ds.map(t.onDidChange,n)(this.onSashChange,this),r=ds.map(t.onDidEnd,(()=>this.sashItems.findIndex((e=>e.sash===t))))(this.onSashEnd,this),a=t.onDidReset((()=>{const e=this.sashItems.findIndex((e=>e.sash===t)),i=Aa(e,-1),n=Aa(e+1,this.viewItems.length),o=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(n);("number"!=typeof o||this.viewItems[o].visible)&&("number"!=typeof s||this.viewItems[s].visible)&&this._onDidSashReset.fire(e)})),l=ta(o,s,r,a,t),d={sash:t,disposable:l};this.sashItems.splice(i-1,0,d)}let h;o.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(h=[t.index]),n||this.relayout([i],h),this.state=z$.Idle,n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.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((e=>e.size)),n,o,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const d=Aa(e,-1),h=Aa(e+1,this.viewItems.length);if(o)for(const y of o)Va(d,y),Va(h,y);if(n)for(const y of n)Wa(d,y),Wa(h,y);const c=d.map((e=>this.viewItems[e])),u=d.map((e=>i[e])),g=h.map((e=>this.viewItems[e])),p=h.map((e=>i[e])),m=d.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),f=d.reduce(((e,t)=>e+(this.viewItems[t].maximumSize-i[t])),0),_=0===h.length?Number.POSITIVE_INFINITY:h.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),v=0===h.length?Number.NEGATIVE_INFINITY:h.reduce(((e,t)=>e+(i[t]-this.viewItems[t].maximumSize)),0),b=Math.max(m,v,s),C=Math.min(_,f,r);let w=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;w=i!==e.visible,e.setVisible(i,a.size)}if(!w&&l){const e=this.viewItems[l.index],i=te+t.size),0);let i=this.size-t;const n=Aa(this.viewItems.length-1,-1),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));for(const r of s)Va(n,r);for(const r of o)Wa(n,r);"number"==typeof e&&Wa(n,e);for(let r=0;0!==i&&re+t.size),0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach((e=>e.sash.layout())),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?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((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const o=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const s=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let a=0;a0||this.startSnappingEnabled)?e.state=1:h&&t[a]&&(r0)return;if(!e.visible&&e.snap)return t}}dispose(){super.dispose(),bs(this.viewItems),this.viewItems=[],this.sashItems.forEach((e=>e.disposable.dispose())),this.sashItems=[]}}var q$,G$;class Z${constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Z$.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map((e=>[e.templateId,e])));this.renderers=[];for(const o of e){const e=n.get(o.templateId);if(!e)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=Lw(e,Mw(".monaco-table-tr")),i=[],n=[];for(let s=0;snew Y$(e,t))),a={size:r.reduce(((e,t)=>e+t.column.weight),0),views:r.map((e=>({size:e.column.weight,view:e})))};this.splitview=this.disposables.add(new K$(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new Z$(n,o,(e=>this.splitview.getViewSize(e)));var d;this.list=this.disposables.add(new R$(e,this.domNode,(d=i,{getHeight:e=>d.getHeight(e),getTemplateId:()=>Z$.TemplateId}),[l],s)),ds.any(...r.map((e=>e.onDidLayout)))((([e,t])=>l.layoutColumn(e,t)),null,this.disposables),this.splitview.onDidSashReset((e=>{const t=n.reduce(((e,t)=>e+t.weight),0),i=n[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)}),null,this.disposables),this.styleElement=fw(this.domNode),this.style({})}get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}X$.InstanceCount=0,(G$=q$||(q$={}))[G$.Unknown=0]="Unknown",G$[G$.Twistie=1]="Twistie",G$[G$.Element=2]="Element";class Q$ extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class J${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 eK(e){return"object"==typeof e&&"visibility"in e&&"data"in e}function tK(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function iK(e){return"boolean"==typeof e.collapsible}class nK{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Ba,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 Av(Ov),this.collapseByDefault=void 0!==n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=void 0!==n.autoExpandSingleChildren&&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=zs.empty(),n={}){if(0===e.length)throw new Q$(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,s){var r;void 0===n&&(n=zs.empty()),void 0===s&&(s=null!==(r=o.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,o);const l=[...n],d=t[t.length-1],h=new Ha({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,d),...l,...a.children.slice(d+i)].map((t=>e.getId(t.element).toString()))}).ComputeDiff(!1);if(h.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,o);const c=t.slice(0,-1),u=(t,i,n)=>{if(s>0)for(let r=0;rt.originalStart-e.originalStart)))u(g,p,g-(m.originalStart+m.originalLength)),g=m.originalStart,p=m.modifiedStart-d,this.spliceSimple([...c,g],m.originalLength,zs.slice(l,p,p+m.modifiedLength),o);u(g,p,g)}spliceSimple(e,t,i=zs.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:r,listIndex:a,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),h=[],c=zs.map(i,(e=>this.createTreeNode(e,r,r.visible?1:0,l,h,n))),u=e[e.length-1],g=r.children.length>0;let p=0;for(let y=u;y>=0&&ys.getId(e.element).toString()))):r.lastDiffIds=r.children.map((e=>s.getId(e.element).toString())):r.lastDiffIds=void 0;let b=0;for(const y of v)y.visible&&b++;if(0!==b)for(let y=u+m.length;ye+(t.visible?t.renderNodeCount:0)),0);this._updateAncestorsRenderNodeCount(r,_-e),this.list.splice(a,e,h)}if(v.length>0&&o){const e=t=>{o(t),t.children.forEach(e)};v.forEach(e)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:v});const C=r.children.length>0;g!==C&&this.setCollapsible(e.slice(0,-1),C);let w=r;for(;w;){if(2===w.visibility){this.refilterDelayer.trigger((()=>this.refilter()));break}w=w.parent}}rerender(e){if(0===e.length)throw new Q$(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);void 0===t&&(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);void 0===t&&(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),s=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!iK(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e-1){n=-1;break}n=e}}n>-1&&this._setCollapseState([...e,n],t)}return s}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=s-(-1===t?0:1);return this.list.splice(t+1,a,r.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(iK(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})),!iK(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,s){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&o.push(r);const l=e.children||zs.empty(),d=n&&0!==a&&!r.collapsed,h=zs.map(l,(e=>this.createTreeNode(e,r,a,d,o,s)));let c=0,u=1;for(const g of h)r.children.push(g),u+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=c++);return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=c,r.visible=2===a?c>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=u):(r.renderNodeCount=0,n&&o.pop()),s&&s(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)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),0===o)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===o)e.visibleChildrenCount=0;else{let t=0;for(const s of e.children)r=this._updateNodeAfterFilterChange(s,o,i,n&&!e.collapsed)||r,s.visible&&(s.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===o?r:1===o,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)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"boolean"==typeof i?(e.filterData=void 0,i?1:0):eK(i)?(e.filterData=i.data,tK(i.visibility)):(e.filterData=void 0,tK(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new Q$(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new Q$(this.user,"Invalid tree location");const r=t.children[s];return{node:r,listIndex:i,revealed:n,visible:o&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[s,...r]=e;if(s<0||s>t.children.length)throw new Q$(this.user,"Invalid tree location");for(let a=0;ae.element))),this.data=e}}function aK(e){return e instanceof o$?new rK(e):e}class lK{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Uo.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(aK(e),t)}onDragOver(e,t,i,n,o=!0){const s=this.dnd.onDragOver(aK(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return s;if(r&&"boolean"!=typeof s&&s.autoExpand&&(this.autoExpandDisposable=Fv((()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0}),500)),"boolean"==typeof s||!s.accept||void 0===s.bubble||s.feedback){if(!o){return{accept:"boolean"==typeof s?s:s.accept,effect:"boolean"==typeof s?void 0:s.effect,feedback:[i]}}return s}if(1===s.bubble){const i=this.modelProvider(),o=i.getNodeLocation(t),s=i.getParentNodeLocation(o),r=i.getNode(s),a=s&&i.getListIndex(s);return this.onDragOver(e,r,a,n,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),d=a.getListIndex(l),h=a.getListRenderCount(l);return Object.assign(Object.assign({},s),{feedback:Aa(d,d+h)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(aK(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}class dK{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight&&this.delegate.setDynamicHeight(e.element,t)}}(sK=oK||(oK={})).None="none",sK.OnHover="onHover",sK.Always="always";class hK{constructor(e,t=[]){this._elements=t,this.onDidChange=ds.forEach(e,(e=>this._elements=e))}get elements(){return this._elements}}class cK{constructor(e,t,i,n,o={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=cK.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new LS,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Uo.None,this.disposables=new Cs,this.templateId=e.templateId,this.updateOptions(o),ds.map(i,(e=>e.node))(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent&&(this.indent=WV(e.indent,0,40)),void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==oK.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const e=new Cs;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Lw(e,Mw(".monaco-tl-row")),i=Lw(t,Mw(".monaco-tl-indent")),n=Lw(t,Mw(".monaco-tl-twistie")),o=Lw(t,Mw(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:Uo.None,templateData:s}}renderElement(e,t,i,n){"number"==typeof n&&(this.renderedNodes.set(e,{templateData:i,height:n}),this.renderedElements.set(e.element,e));const o=cK.DefaultIndent+(e.depth-1)*this.indent;i.twistie.style.paddingLeft=`${o}px`,i.indent.style.width=o+this.indent-16+"px",this.renderTwistie(e,i),"number"==typeof n&&this.renderIndentGuides(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.templateData,n),"number"==typeof n&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this.renderTwistie(e,t.templateData),this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderIndentGuides(e,t.templateData))}renderTwistie(e,t){t.twistie.classList.remove(...br.treeItemExpanded.classNamesArray);let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...br.treeItemExpanded.classNamesArray),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded")}renderIndentGuides(e,t){if(RC(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Cs,n=this.modelProvider();let o=e;for(;;){const e=n.getNodeLocation(o),s=n.getParentNodeLocation(e);if(!s)break;const r=n.getNode(s),a=Mw(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(es((()=>this.renderedIndentGuides.delete(r,a)))),o=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach((e=>{const n=i.getNodeLocation(e);try{const o=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):o&&t.add(i.getNode(o))}catch(o){}})),this.activeIndentNodes.forEach((e=>{t.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.remove("active")))})),t.forEach((e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.add("active")))})),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),bs(this.disposables)}}cK.DefaultIndent=8;class uK{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 Cs,e.onWillRefilter(this.reset,this,this.disposables)}get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}filter(e,t){if(this._filter){const i=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return i;let n;if(n="boolean"==typeof i?i?1:0:eK(i)?tK(i.visibility):i,0===n)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:lz.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),n=Array.isArray(i)?i:[i];for(const o of n){const e=o&&o.toString();if(void 0===e)return{data:lz.Default,visibility:!0};const t=hz(this._pattern,this._lowercasePattern,0,e,e.toLowerCase(),0,!0);if(t)return this._matchCount++,1===n.length?{data:t,visibility:!0}:{data:{label:e,score:t},visibility:!0}}return this.tree.options.filterOnType?2:{data:lz.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){bs(this.disposables)}}class gK{constructor(e,t,i,n,o){this.tree=e,this.view=i,this.filter=n,this.keyboardNavigationDelegate=o,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new $o,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new $o,this.enabledDisposables=new Cs,this.disposables=new Cs,this.domNode=Mw(`.monaco-list-type-filter.${this.positionClassName}`),this.domNode.draggable=!0,this.disposables.add(BC(this.domNode,"dragstart",(()=>this.onDragStart()))),this.messageDomNode=Lw(i.getHTMLElement(),Mw(".monaco-list-type-filter-message")),this.labelDomNode=Lw(this.domNode,Mw("span.label"));const s=Lw(this.domNode,Mw(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=Lw(s,Mw("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),this.disposables.add(BC(this.filterOnTypeDomNode,"input",(()=>this.onDidChangeFilterOnType()))),this.clearDomNode=Lw(s,Mw("button.clear"+br.treeFilterClear.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=$m(0,"Clear"),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}get enabled(){return this._enabled}get pattern(){return this._pattern}get filterOnType(){return this._filterOnType}updateOptions(e){e.simpleKeyboardNavigation?this.disable():this.enable(),void 0!==e.filterOnType&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType,this.updateFilterOnTypeTitleAndIcon()),void 0!==e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=this.enabledDisposables.add(new zF(this.view.getHTMLElement(),"keydown")),t=ds.chain(e.event).filter((e=>!_$(e.target)||e.target===this.filterOnTypeDomNode)).filter((e=>"Dead"!==e.key&&!/^Media/.test(e.key))).map((e=>new SC(e))).filter(this.keyboardNavigationEventFilter||(()=>!0)).filter((()=>this.automaticKeyboardNavigation||this.triggered)).filter((e=>this.keyboardNavigationDelegate.mightProducePrintableCharacter(e)&&!(18===e.keyCode||16===e.keyCode||15===e.keyCode||17===e.keyCode)||(this.pattern.length>0||this.triggered)&&(9===e.keyCode||1===e.keyCode)&&!e.altKey&&!e.ctrlKey&&!e.metaKey||1===e.keyCode&&(Ho?e.altKey&&!e.metaKey:e.ctrlKey)&&!e.shiftKey)).forEach((e=>{e.stopPropagation(),e.preventDefault()})).event,i=this.enabledDisposables.add(new zF(this.clearDomNode,"click"));ds.chain(ds.any(t,i.event)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(),this.render(),this._enabled=!0,this.triggered=!1}disable(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.clear(),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)}onEventOrInput(e){"string"==typeof e?this.onInput(e):e instanceof MouseEvent||9===e.keyCode||1===e.keyCode&&(Ho?e.altKey:e.ctrlKey)?this.onInput(""):1===e.keyCode?this.onInput(0===this.pattern.length?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)}onInput(e){const t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,(e=>!lz.isDefault(e.filterData)));const i=this.tree.getFocus();if(i.length>0){const e=i[0];null===this.tree.getRelativeTop(e)&&this.tree.reveal(e,.5)}this.render(),e||(this.triggered=!1)}onDragStart(){const e=this.view.getHTMLElement(),{left:t}=nw(e),i=e.clientWidth,n=i/2,o=this.domNode.clientWidth,s=new Cs;let r=this.positionClassName;const a=()=>{switch(r){case"nw":this.domNode.style.top="4px",this.domNode.style.left="4px";break;case"ne":this.domNode.style.top="4px",this.domNode.style.left=i-o-6+"px"}},l=()=>{this.positionClassName=r,this.domNode.className=`monaco-list-type-filter ${this.positionClassName}`,this.domNode.style.top="",this.domNode.style.left="",bs(s)};a(),this.domNode.classList.remove(r),this.domNode.classList.add("dragging"),s.add(es((()=>this.domNode.classList.remove("dragging")))),s.add(BC(document,"dragover",(e=>(e=>{e.preventDefault();const i=e.clientX-t;e.dataTransfer&&(e.dataTransfer.dropEffect="none"),r=il()))),iB.CurrentDragAndDropData=new tB("vscode-ui"),s.add(es((()=>iB.CurrentDragAndDropData=void 0)))}onDidSpliceModel(){this._enabled&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}onDidChangeFilterOnType(){this.tree.updateOptions({filterOnType:this.filterOnTypeDomNode.checked}),this.tree.refilter(),this.tree.domFocus(),this.render(),this.updateFilterOnTypeTitleAndIcon()}updateFilterOnTypeTitleAndIcon(){this.filterOnType?(this.filterOnTypeDomNode.classList.remove(...br.treeFilterOnTypeOff.classNamesArray),this.filterOnTypeDomNode.classList.add(...br.treeFilterOnTypeOn.classNamesArray),this.filterOnTypeDomNode.title=$m(0,"Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...br.treeFilterOnTypeOn.classNamesArray),this.filterOnTypeDomNode.classList.add(...br.treeFilterOnTypeOff.classNamesArray),this.filterOnTypeDomNode.title=$m(0,"Enable Filter on Type"))}render(){const e=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=$m(0,"No elements found"),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),this.domNode.classList.toggle("no-matches",e),this.domNode.title=$m(0,"Matched {0} out of {1} elements",this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"…"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)}shouldAllowFocus(e){return!(this.enabled&&this.pattern&&!this.filterOnType)||(this.filter.totalCount>0&&this.filter.matchCount<=1||!lz.isDefault(e.filterData))}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),bs(this.disposables)}}function pK(e){let t=q$.Unknown;return cw(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=q$.Twistie:cw(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(t=q$.Element),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function mK(e,t){t(e),e.children.forEach((e=>mK(e,t)))}class fK{constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new $o,this.onDidChange=this._onDidChange.event}get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}set(e,t){!(null==t?void 0:t.__forceEvent)&&jo(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 e=this;this._onDidChange.fire({get elements(){return e.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 e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach((e=>mK(e,i))),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach((e=>mK(e,n)));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach((e=>mK(e,s)));const r=[];for(const a of this.nodes){const e=this.identityProvider.getId(a.element).toString();if(i.has(e)){const t=o.get(e);t&&r.push(t)}else r.push(a)}if(this.nodes.length>0&&0===r.length){const e=this.getFirstViewElementWithTrait();e&&r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class _K extends L${constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(_$(e.browserEvent.target)||v$(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(o="function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick,o&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e);if(t.collapsible){const i=this.tree.model,s=i.getNodeLocation(t),r=e.browserEvent.altKey;if(this.tree.setFocus([s]),i.setCollapsed(s,void 0,r),o&&n)return}super.onViewPointer(e)}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&super.onDoubleClick(e)}}class vK extends R${constructor(e,t,i,n,o,s,r,a){super(e,t,i,n,a),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=r}createMouseController(e){return new _K(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];let s;i.forEach(((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i),this.anchorTrait.has(t)&&(s=e+i)})),n.length>0&&super.setFocus(Qo([...super.getFocus(),...n])),o.length>0&&super.setSelection(Qo([...super.getSelection(),...o])),"number"==typeof s&&super.setAnchor(s)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map((e=>this.element(e))),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map((e=>this.element(e))),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class bK{constructor(e,t,i,n,o={}){this._user=e,this._options=o,this.eventBufferer=new Ba,this.disposables=new Cs,this._onWillRefilter=new $o,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new $o;const s=new dK(i),r=new Ua,a=new Ua,l=new hK(a.event);this.renderers=n.map((e=>new cK(e,(()=>this.model),r.event,l,o)));for(let g of this.renderers)this.disposables.add(g);let d;var h,c;o.keyboardNavigationLabelProvider&&(d=new uK(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:d}),this.disposables.add(d)),this.focus=new fK((()=>this.view.getFocusedElements()[0]),o.identityProvider),this.selection=new fK((()=>this.view.getSelectedElements()[0]),o.identityProvider),this.anchor=new fK((()=>this.view.getAnchorElement()),o.identityProvider),this.view=new vK(e,t,s,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},(h=()=>this.model,(c=o)&&Object.assign(Object.assign({},c),{identityProvider:c.identityProvider&&{getId:e=>c.identityProvider.getId(e.element)},dnd:c.dnd&&new lK(h,c.dnd),multipleSelectionController:c.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>c.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element})),isSelectionRangeChangeEvent:e=>c.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},accessibilityProvider:c.accessibilityProvider&&Object.assign(Object.assign({},c.accessibilityProvider),{getSetSize(e){const t=h(),i=t.getNodeLocation(e),n=t.getParentNodeLocation(i);return t.getNode(n).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:c.accessibilityProvider&&c.accessibilityProvider.isChecked?e=>c.accessibilityProvider.isChecked(e.element):void 0,getRole:c.accessibilityProvider&&c.accessibilityProvider.getRole?e=>c.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>c.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>c.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:c.accessibilityProvider&&c.accessibilityProvider.getWidgetRole?()=>c.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:c.accessibilityProvider&&c.accessibilityProvider.getAriaLevel?e=>c.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:c.accessibilityProvider.getActiveDescendantId&&(e=>c.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:c.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},c.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:e=>c.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}),enableKeyboardNavigation:c.simpleKeyboardNavigation}))),{tree:this})),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const u=ds.forEach(this.model.onDidSplice,(e=>{this.eventBufferer.bufferEvents((()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)}))}));if(u((()=>null),null,this.disposables),a.input=ds.chain(ds.any(u,this.focus.onDidChange,this.selection.onDidChange)).debounce((()=>null),0).map((()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);return[...e.values()]})).event,!1!==o.keyboardSupport){const e=ds.chain(this.view.onKeyDown).filter((e=>!_$(e.target))).map((e=>new SC(e)));e.filter((e=>15===e.keyCode)).on(this.onLeftArrow,this,this.disposables),e.filter((e=>17===e.keyCode)).on(this.onRightArrow,this,this.disposables),e.filter((e=>10===e.keyCode)).on(this.onSpace,this,this.disposables)}if(o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||C$;this.typeFilterController=new gK(this,this.model,this.view,d,e),this.focusNavigationFilter=e=>this.typeFilterController.shouldAllowFocus(e),this.disposables.add(this.typeFilterController)}this.styleElement=fw(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===oK.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return ds.map(this.view.onMouseDblClick,pK)}get onPointer(){return ds.map(this.view.onPointer,pK)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return ds.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(Object.assign(Object.assign({},this._options),{enableKeyboardNavigation:this._options.simpleKeyboardNavigation})),this.typeFilterController&&this.typeFilterController.updateOptions(this._options),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===oK.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeIndentGuidesStroke.transparent(.4)}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join("\n"),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)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map((e=>this.model.getNode(e)));this.selection.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map((e=>this.model.getNode(e)));this.focus.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setFocus(n,t,!0)}focusNext(e=1,t=!1,i,n=this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);-1!==i&&this.view.reveal(i,t)}getRelativeTop(e){const t=this.model.getListIndex(e);return-1===t?null:this.view.getRelativeTop(t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some((e=>e.visible)))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){bs(this.disposables),this.view.dispose()}}class CK{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new nK(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare:(e,t)=>i.sorter.compare(e.element,t.element)}),this.identityProvider=i.identityProvider}setChildren(e,t=zs.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=zs.empty(),i){const n=new Set,o=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{var t;if(null===e.element)return;const s=e;if(n.add(s.element),this.nodes.set(s.element,s),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.add(e),this.nodesByIdentity.set(e,s)}null===(t=i.onDidCreateNode)||void 0===t||t.call(i,s)},onDidDeleteNode:e=>{var t;if(null===e.element)return;const s=e;if(n.has(s.element)||this.nodes.delete(s.element),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.has(e)||this.nodesByIdentity.delete(e)}null===(t=i.onDidDeleteNode)||void 0===t||t.call(i,s)}}))}preserveCollapseState(e=zs.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),zs.map(e,(e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t)return Object.assign(Object.assign({},e),{children:this.preserveCollapseState(e.children)});const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible,n=void 0!==e.collapsed?e.collapsed:t.collapsed;return Object.assign(Object.assign({},e),{collapsible:i,collapsed:n,children:this.preserveCollapseState(e.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(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Q$(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new Q$(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Q$(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(null===e)return[];const t=this.nodes.get(e);if(!t)throw new Q$(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function wK(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:zs.map(zs.from(e.children),wK),collapsible:e.collapsible,collapsed:e.collapsed}}function yK(e){const t=[e.element],i=e.incompressible||!1;let n,o;for(;[o,n]=zs.consume(zs.from(e.children),2),1===o.length&&!o[0].incompressible;)e=o[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:zs.map(zs.concat(o,n),yK),collapsible:e.collapsible,collapsed:e.collapsed}}function SK(e,t=0){let i;return i=tSK(e,0))),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function xK(e){return SK(e,0)}function kK(e,t,i){return e.element===t?Object.assign(Object.assign({},e),{children:i}):Object.assign(Object.assign({},e),{children:zs.map(zs.from(e.children),(e=>kK(e,t,i)))})}class LK{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new CK(e,t,i),this.enabled=void 0===i.compressionEnabled||i.compressionEnabled,this.identityProvider=i.identityProvider}get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}setChildren(e,t=zs.empty(),i){const n=i.diffIdentityProvider&&(o=i.diffIdentityProvider,{getId:e=>e.elements.map((e=>o.getId(e).toString())).join("\0")});var o;if(null===e){const e=zs.map(t,this.enabled?yK:wK);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const s=this.nodes.get(e);if(!s)throw new Error("Unknown compressed tree node");const r=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),d=kK(xK(r),e,t),h=(this.enabled?yK:wK)(d),c=l.children.map((e=>e===r?h:e));this._setChildren(l.element,c,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=zs.map(t,xK),n=zs.map(i,e?yK:wK);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}}))}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(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?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(null===e)return null;const t=this.nodes.get(e);if(!t)throw new Q$(this.user,`Tree element not found: ${e}`);return t}}const DK=e=>e[e.length-1];class EK{constructor(e,t){this.unwrapper=e,this.node=t}get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map((e=>new EK(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}}class NK{constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||DK;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new J$((e=>new EK(n,e))),this.model=new LK(e,function(e,t){return{splice(i,n,o){t.splice(i,n,o.map((t=>e.map(t))))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}(this.nodeMapper,t),function(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter:(i,n)=>t.filter.filter(e(i),n)}})}(n,i))}get onDidSplice(){return ds.map(this.model.onDidSplice,(({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map((e=>this.nodeMapper.map(e))),deletedNodes:t.map((e=>this.nodeMapper.map(e)))})))}get onDidChangeCollapseState(){return ds.map(this.model.onDidChangeCollapseState,(({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t})))}get onDidChangeRenderNodeCount(){return ds.map(this.model.onDidChangeRenderNodeCount,(e=>this.nodeMapper.map(e)))}setChildren(e,t=zs.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return null==t?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 IK=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};class TK extends bK{constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=zs.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new CK(e,t,i)}}class MK{constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===o.element.elements.length?(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){i.compressedTreeNode?this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}IK([VS],MK.prototype,"compressedTreeNodeProvider",null);class OK extends TK{constructor(e,t,i,n,o={}){const s=()=>this;super(e,t,i,n.map((e=>new MK(s,e))),function(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(o){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}(s,o))}setChildren(e,t=zs.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new NK(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var AK=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function RK(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function PK(e,t){return!!t.parent&&(t.parent===e||PK(e,t.parent))}class FK{constructor(e){this.node=e}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}}class BK{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(...br.treeItemLoading.classNamesArray),!0):(t.classList.remove(...br.treeItemLoading.classNamesArray),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function VK(e){return{browserEvent:e.browserEvent,elements:e.elements.map((e=>e.element))}}function WK(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class HK extends o${constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function zK(e){return e instanceof o$?new HK(e):e}class jK{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((e=>e.element)),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(zK(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(zK(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(zK(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function UK(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new jK(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element})),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}),sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),additionalScrollHeight:e.additionalScrollHeight})}function $K(e,t){t(e),e.children.forEach((e=>$K(e,t)))}class KK{constructor(e,t,i,n,o,s={}){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 J$((e=>new FK(e))),this.disposables=new Cs,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=void 0!==s.autoExpandSingleChildren&&s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,i,n,s),this.root=RK({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}get onDidChangeFocus(){return ds.map(this.tree.onDidChangeFocus,VK)}get onDidChangeSelection(){return ds.map(this.tree.onDidChangeSelection,VK)}get onMouseDblClick(){return ds.map(this.tree.onMouseDblClick,WK)}get onPointer(){return ds.map(this.tree.onPointer,WK)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,i,n,o){const s=new dK(i),r=n.map((e=>new BK(e,this.nodeMapper,this._onDidChangeNodeSlowState.event))),a=UK(o)||{};return new TK(e,t,s,r,a)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return AK(this,void 0,void 0,(function*(){this.refreshPromises.forEach((e=>e.cancel())),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}))}_updateChildren(e=this.root.element,t=!0,i=!1,n,o){return AK(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new Q$(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield ds.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch(r){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();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)}expand(e,t=!1){return AK(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new Q$(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield ds.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(yield this.root.refreshPromise,yield ds.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&&(yield this.root.refreshPromise,yield ds.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map((e=>e.element))}setFocus(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map((e=>e.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 Q$(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,n){return AK(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)}))}refreshNode(e,t,i){return AK(this,void 0,void 0,(function*(){let n;return this.subTreeRefreshPromises.forEach(((o,s)=>{!n&&function(e,t){return e===t||PK(e,t)||PK(t,e)}(s,e)&&(n=o.then((()=>this.refreshNode(e,t,i))))})),n||this.doRefreshSubTree(e,t,i)}))}doRefreshSubTree(e,t,i){return AK(this,void 0,void 0,(function*(){let n;e.refreshPromise=new Promise((e=>n=e)),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally((()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}));try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield $v.settled(o.map((e=>this.doRefreshSubTree(e,t,i))))}finally{n()}}))}doRefreshNode(e,t,i){return AK(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if($a(t))n=Promise.resolve(t);else{const i=Pv(800);i.then((()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)}),(e=>null)),n=t.finally((()=>i.cancel()))}}else n=Promise.resolve(zs.empty());try{const o=yield n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Na(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 $a(i)?this.processChildren(i):(t=Iv((()=>AK(this,void 0,void 0,(function*(){return this.processChildren(yield i)})))),this.refreshPromises.set(e,t),t.finally((()=>{this.refreshPromises.delete(e)})))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Jo))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map;for(const d of e.children)if(s.set(d.element,d),this.identityProvider){const e=this.tree.isCollapsed(d);r.set(d.id,{node:d,collapsed:e})}const a=[],l=o.map((t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=RK({element:t,parent:e,hasChildren:o});return o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(i.collapsedByDefault=!1,a.push(i)),i}const l=this.identityProvider.getId(t).toString(),d=r.get(l);if(d){const e=d.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?d.collapsed?(e.children.forEach((e=>$K(e,(e=>this.nodes.delete(e.element))))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const h=RK({element:t,parent:e,id:l,hasChildren:o});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(h),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(h),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(h):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(h.collapsedByDefault=!1,a.push(h)),h}));for(const d of s.values())$K(d,(e=>this.nodes.delete(e.element)));for(const d of l)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t,i){const n=e.children.map((e=>this.asTreeElement(e,t))),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.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 i=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?zs.map(e.children,(e=>this.asTreeElement(e,t))):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}class qK{constructor(e){this.node=e}get element(){return{elements:this.node.element.elements.map((e=>e.element)),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map((e=>new qK(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class GK{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(...br.treeItemLoading.classNamesArray),!0):(t.classList.remove(...br.treeItemLoading.classNamesArray),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=bs(this.disposables)}}class ZK extends KK{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new J$((e=>new qK(e))),this.filter=r.filter}createTree(e,t,i,n,o){const s=new dK(i),r=n.map((e=>new GK(e,this.nodeMapper,(()=>this.compressibleNodeMapper),this._onDidChangeNodeSlowState.event))),a=function(e){const t=e&&UK(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((e=>e.element)))})})}(o)||{};return new OK(e,t,s,r,a)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))}return t},o=n(this.tree.getSelection()),s=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let d=!1;const h=e=>{const t=e.element;if(t)for(let n=0;n{const t=this.filter.filter(e,1),i="boolean"==typeof(n=t)?n?1:0:eK(n)?tK(n.visibility):tK(n);var n;if(2===i)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===i}))),super.processChildren(e)}}class YK extends bK{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new CK(e,t,i)}}new Ly("isMac",Ho,$m(0,"Whether the operating system is macOS")),new Ly("isLinux",Vo,$m(0,"Whether the operating system is Linux"));const XK=new Ly("isWindows",Rs,$m(0,"Whether the operating system is Windows"));new Ly("isWeb",Fs,$m(0,"Whether the platform is a web browser")),new Ly("isMacNative",Ho&&!Fs,$m(0,"Whether the operating system is macOS on a non-browser platform")),new Ly("isIOS",Vs,$m(0,"Whether the operating system is iOS")),new Ly("isDevelopment",!1,!0);new Ly("inputFocus",!1,$m(0,"Whether keyboard focus is inside an input box"));var QK=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},JK=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};const eq=s_("listService");let tq=class{constructor(e){this._themeService=e,this.disposables=new Cs,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}get lastFocusedList(){return this._lastFocusedWidget}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&(null===(t=this._lastFocusedWidget)||void 0===t||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,null===(i=this._lastFocusedWidget)||void 0===i||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;const e=new D$(fw(),"");this.disposables.add(Mz(e,this._themeService))}if(this.lists.some((t=>t.widget===e)))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),ta(e.onDidFocus((()=>this.setLastFocusedList(e))),es((()=>this.lists.splice(this.lists.indexOf(i),1))),e.onDidDispose((()=>{this.lists=this.lists.filter((e=>e!==i)),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)})))}dispose(){this.disposables.dispose()}};tq=QK([JK(0,Ry)],tq);const iq=new Ly("listFocus",!0),nq=new Ly("listSupportsMultiselect",!0),oq=ry.and(iq,ry.not("inputFocus")),sq=new Ly("listHasSelectionOrFocus",!1),rq=new Ly("listDoubleSelection",!1),aq=new Ly("listMultiSelection",!1),lq=new Ly("listSelectionNavigation",!1),dq=new Ly("treeElementCanCollapse",!1),hq=new Ly("treeElementHasParent",!1),cq=new Ly("treeElementCanExpand",!1),uq=new Ly("treeElementHasChild",!1);function gq(e,t){const i=e.createScoped(t.getHTMLElement());return iq.bindTo(i),i}const pq="workbench.list.horizontalScrolling",mq="workbench.tree.indent",fq="workbench.list.smoothScrolling",_q="workbench.list.mouseWheelScrollSensitivity",vq="workbench.list.fastScrollSensitivity",bq="workbench.tree.expandMode";function Cq(e){return"alt"===e.getValue("workbench.list.multiSelectModifier")}class wq extends Uo{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Cq(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("workbench.list.multiSelectModifier")&&(this.useAltAsMultipleSelectionModifier=Cq(this.configurationService))})))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:S$(e)}isSelectionRangeChangeEvent(e){return x$(e)}}function yq(e,t,i){var n;const o=new Cs;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>i.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(t.getValue(fq)),mouseWheelScrollSensitivity:t.getValue(_q),fastScrollSensitivity:t.getValue(vq),multipleSelectionController:null!==(n=e.multipleSelectionController)&&void 0!==n?n:o.add(new wq(t))}),o]}let Sq=class extends R${constructor(e,t,i,n,o,s,r,a,l,d){const h=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(l.getValue(pq)),[c,u]=yq(o,l,d);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Iz(a.getColorTheme(),Oz)),c),{horizontalScrolling:h})),this.disposables.add(u),this.contextKeyService=gq(s,this),this.themeService=a,this.listSupportsMultiSelect=nq.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport);lq.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=sq.bindTo(this.contextKeyService),this.listDoubleSelection=rq.bindTo(this.contextKeyService),this.listMultiSelection=aq.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Cq(l),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration("workbench.list.multiSelectModifier")&&(this._useAltAsMultipleSelectionModifier=Cq(l));let t={};if(e.affectsConfiguration(pq)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(pq));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(fq)){const e=Boolean(l.getValue(fq));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(_q)){const e=l.getValue(_q);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(vq)){const e=l.getValue(vq);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new Dq(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=Mz(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),super.dispose()}};Sq=QK([JK(5,Dy),JK(6,eq),JK(7,Ry),JK(8,ev),JK(9,uW)],Sq);let xq=class extends class{constructor(e,t,i,n,o={}){const s=()=>this.model,r=n.map((e=>new P$(e,s)));this.list=new R$(e,t,i,r,function(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new F$(e,t.accessibilityProvider)})}(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return ds.map(this.list.onMouseDblClick,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onPointer(){return ds.map(this.list.onPointer,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onDidChangeSelection(){return ds.map(this.list.onDidChangeSelection,(({elements:e,indexes:t,browserEvent:i})=>({elements:e.map((e=>this._model.get(e))),indexes:t,browserEvent:i})))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Aa(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()}}{constructor(e,t,i,n,o,s,r,a,l,d){const h=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(l.getValue(pq)),[c,u]=yq(o,l,d);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Iz(a.getColorTheme(),Oz)),c),{horizontalScrolling:h})),this.disposables=new Cs,this.disposables.add(u),this.contextKeyService=gq(s,this),this.themeService=a,this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=nq.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport);lq.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this._useAltAsMultipleSelectionModifier=Cq(l),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),o.overrideStyles&&this.disposables.add(Mz(this,a,o.overrideStyles)),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration("workbench.list.multiSelectModifier")&&(this._useAltAsMultipleSelectionModifier=Cq(l));let t={};if(e.affectsConfiguration(pq)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(pq));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(fq)){const e=Boolean(l.getValue(fq));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(_q)){const e=l.getValue(_q);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(vq)){const e=l.getValue(vq);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new Dq(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=Mz(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),this.disposables.dispose(),super.dispose()}};xq=QK([JK(5,Dy),JK(6,eq),JK(7,Ry),JK(8,ev),JK(9,uW)],xq);let kq=class extends X${constructor(e,t,i,n,o,s,r,a,l,d,h){const c=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(d.getValue(pq)),[u,g]=yq(s,d,h);super(e,t,i,n,o,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Iz(l.getColorTheme(),Oz)),u),{horizontalScrolling:c})),this.disposables.add(g),this.contextKeyService=gq(r,this),this.themeService=l,this.listSupportsMultiSelect=nq.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport);lq.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=sq.bindTo(this.contextKeyService),this.listDoubleSelection=rq.bindTo(this.contextKeyService),this.listMultiSelection=aq.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Cq(d),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),s.overrideStyles&&this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(d.onDidChangeConfiguration((e=>{e.affectsConfiguration("workbench.list.multiSelectModifier")&&(this._useAltAsMultipleSelectionModifier=Cq(d));let t={};if(e.affectsConfiguration(pq)&&void 0===this.horizontalScrolling){const e=Boolean(d.getValue(pq));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(fq)){const e=Boolean(d.getValue(fq));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(_q)){const e=d.getValue(_q);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(vq)){const e=d.getValue(vq);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new Eq(this,Object.assign({configurationService:d},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=Mz(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),this.disposables.dispose(),super.dispose()}};kq=QK([JK(6,Dy),JK(7,eq),JK(8,Ry),JK(9,ev),JK(10,uW)],kq);class Lq extends Uo{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new $o),this.onDidOpen=this._onDidOpen.event,this._register(ds.filter(this.widget.onDidChangeSelection,(e=>e.browserEvent instanceof KeyboardEvent))((e=>this.onSelectionFromKeyboard(e)))),this._register(this.widget.onPointer((e=>this.onPointer(e.element,e.browserEvent)))),this._register(this.widget.onMouseDblClick((e=>this.onMouseDblClick(e.element,e.browserEvent)))),"boolean"!=typeof(null==t?void 0:t.openOnSingleClick)&&(null==t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue("workbench.list.openMode")),this._register(null==t?void 0:t.configurationService.onDidChangeConfiguration((()=>{this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue("workbench.list.openMode"))})))):this.openOnSingleClick=null===(i=null==t?void 0:t.openOnSingleClick)||void 0===i||i}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,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 n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,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 Dq extends Lq{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Eq extends Lq{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Nq extends Lq{constructor(e,t){super(e,t)}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function Iq(e,t){let i=!1;return n=>{if(n.toKeybinding().isModifierKey())return!1;if(i)return i=!1,!1;const o=t.softDispatch(n,e);return o&&o.enterChord?(i=!0,!1):(i=!1,!0)}}let Tq=class extends TK{constructor(e,t,i,n,o,s,r,a,l,d,h){const{options:c,getAutomaticKeyboardNavigation:u,disposable:g}=Pq(t,o,s,l,d,h);super(e,t,i,n,c),this.disposables.add(g),this.internals=new Fq(this,o,u,o.overrideStyles,s,r,a,l,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Tq=QK([JK(5,Dy),JK(6,eq),JK(7,Ry),JK(8,ev),JK(9,uW),JK(10,NS)],Tq);let Mq=class extends OK{constructor(e,t,i,n,o,s,r,a,l,d,h){const{options:c,getAutomaticKeyboardNavigation:u,disposable:g}=Pq(t,o,s,l,d,h);super(e,t,i,n,c),this.disposables.add(g),this.internals=new Fq(this,o,u,o.overrideStyles,s,r,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Mq=QK([JK(5,Dy),JK(6,eq),JK(7,Ry),JK(8,ev),JK(9,uW),JK(10,NS)],Mq);let Oq=class extends YK{constructor(e,t,i,n,o,s,r,a,l,d,h,c){const{options:u,getAutomaticKeyboardNavigation:g,disposable:p}=Pq(t,s,r,d,h,c);super(e,t,i,n,o,u),this.disposables.add(p),this.internals=new Fq(this,s,g,s.overrideStyles,r,a,l,d,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Oq=QK([JK(6,Dy),JK(7,eq),JK(8,Ry),JK(9,ev),JK(10,uW),JK(11,NS)],Oq);let Aq=class extends KK{constructor(e,t,i,n,o,s,r,a,l,d,h,c){const{options:u,getAutomaticKeyboardNavigation:g,disposable:p}=Pq(t,s,r,d,h,c);super(e,t,i,n,o,u),this.disposables.add(p),this.internals=new Fq(this,s,g,s.overrideStyles,r,a,l,d,c),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Aq=QK([JK(6,Dy),JK(7,eq),JK(8,Ry),JK(9,ev),JK(10,uW),JK(11,NS)],Aq);let Rq=class extends ZK{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u){const{options:g,getAutomaticKeyboardNavigation:p,disposable:m}=Pq(t,r,a,h,c,u);super(e,t,i,n,o,s,g),this.disposables.add(m),this.internals=new Fq(this,r,p,r.overrideStyles,a,l,d,h,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function Pq(e,t,i,n,o,s){var r;const a=()=>{let e=Boolean(i.getContextKeyValue("listAutomaticKeyboardNavigation"));return e&&(e=Boolean(n.getValue("workbench.list.automaticKeyboardNavigation"))),e},l=s.isScreenReaderOptimized(),d=t.simpleKeyboardNavigation||l?"simple":n.getValue("workbench.list.keyboardNavigation"),h=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(n.getValue(pq)),[c,u]=yq(t,n,o),g=t.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:"number"==typeof n.getValue(mq)?n.getValue(mq):void 0,renderIndentGuides:n.getValue("workbench.tree.renderIndentGuides"),smoothScrolling:Boolean(n.getValue(fq)),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:"simple"===d,filterOnType:"filter"===d,horizontalScrolling:h,keyboardNavigationEventFilter:Iq(e,o),additionalScrollHeight:g,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(r=t.expandOnlyOnTwistieClick)&&void 0!==r?r:"doubleClick"===n.getValue(bq)})}}Rq=QK([JK(7,Dy),JK(8,eq),JK(9,Ry),JK(10,ev),JK(11,uW),JK(12,NS)],Rq);let Fq=class{constructor(e,t,i,n,o,s,r,a,l){this.tree=e,this.themeService=r,this.disposables=[],this.contextKeyService=gq(o,e),this.listSupportsMultiSelect=nq.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport);lq.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.hasSelectionOrFocus=sq.bindTo(this.contextKeyService),this.hasDoubleSelection=rq.bindTo(this.contextKeyService),this.hasMultiSelection=aq.bindTo(this.contextKeyService),this.treeElementCanCollapse=dq.bindTo(this.contextKeyService),this.treeElementHasParent=hq.bindTo(this.contextKeyService),this.treeElementCanExpand=cq.bindTo(this.contextKeyService),this.treeElementHasChild=uq.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Cq(a);const d=new Set;d.add("listAutomaticKeyboardNavigation");const h=()=>{const t=l.isScreenReaderOptimized()?"simple":a.getValue("workbench.list.keyboardNavigation");e.updateOptions({simpleKeyboardNavigation:"simple"===t,filterOnType:"filter"===t})};this.updateStyleOverrides(n);const c=()=>{const t=e.getFocus()[0];if(!t)return;const i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))};this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection((()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)}))})),e.onDidChangeFocus((()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),c()})),e.onDidChangeCollapseState(c),e.onDidChangeModel(c),a.onDidChangeConfiguration((n=>{let o={};if(n.affectsConfiguration("workbench.list.multiSelectModifier")&&(this._useAltAsMultipleSelectionModifier=Cq(a)),n.affectsConfiguration(mq)){const e=a.getValue(mq);o=Object.assign(Object.assign({},o),{indent:e})}if(n.affectsConfiguration("workbench.tree.renderIndentGuides")){const e=a.getValue("workbench.tree.renderIndentGuides");o=Object.assign(Object.assign({},o),{renderIndentGuides:e})}if(n.affectsConfiguration(fq)){const e=Boolean(a.getValue(fq));o=Object.assign(Object.assign({},o),{smoothScrolling:e})}if(n.affectsConfiguration("workbench.list.keyboardNavigation")&&h(),n.affectsConfiguration("workbench.list.automaticKeyboardNavigation")&&(o=Object.assign(Object.assign({},o),{automaticKeyboardNavigation:i()})),n.affectsConfiguration(pq)&&void 0===t.horizontalScrolling){const e=Boolean(a.getValue(pq));o=Object.assign(Object.assign({},o),{horizontalScrolling:e})}if(n.affectsConfiguration(bq)&&void 0===t.expandOnlyOnTwistieClick&&(o=Object.assign(Object.assign({},o),{expandOnlyOnTwistieClick:"doubleClick"===a.getValue(bq)})),n.affectsConfiguration(_q)){const e=a.getValue(_q);o=Object.assign(Object.assign({},o),{mouseWheelScrollSensitivity:e})}if(n.affectsConfiguration(vq)){const e=a.getValue(vq);o=Object.assign(Object.assign({},o),{fastScrollSensitivity:e})}Object.keys(o).length>0&&e.updateOptions(o)})),this.contextKeyService.onDidChangeContext((t=>{t.affectsSome(d)&&e.updateOptions({automaticKeyboardNavigation:i()})})),l.onDidChangeScreenReaderOptimized((()=>h()))),this.navigator=new Nq(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){bs(this.styler),this.styler=e?Mz(this.tree,this.themeService,e):Uo.None}dispose(){this.disposables=bs(this.disposables),bs(this.styler),this.styler=void 0}};Fq=QK([JK(4,Dy),JK(5,eq),JK(6,Ry),JK(7,ev),JK(8,NS)],Fq);var Bq,Vq;My.as(eO).registerConfiguration({id:"workbench",order:7,title:$m(0,"Workbench"),type:"object",properties:{"workbench.list.multiSelectModifier":{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[$m(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),$m(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:$m(0,"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.")},"workbench.list.openMode":{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:$m(0,"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.")},[pq]:{type:"boolean",default:!1,description:$m(0,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[mq]:{type:"number",default:8,minimum:4,maximum:40,description:$m(0,"Controls tree indentation in pixels.")},"workbench.tree.renderIndentGuides":{type:"string",enum:["none","onHover","always"],default:"onHover",description:$m(0,"Controls whether the tree should render indent guides.")},[fq]:{type:"boolean",default:!1,description:$m(0,"Controls whether lists and trees have smooth scrolling.")},[_q]:{type:"number",default:1,description:$m(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[vq]:{type:"number",default:5,description:$m(0,"Scrolling speed multiplier when pressing `Alt`.")},"workbench.list.keyboardNavigation":{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[$m(0,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),$m(0,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),$m(0,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:$m(0,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},"workbench.list.automaticKeyboardNavigation":{type:"boolean",default:!0,markdownDescription:$m(0,"Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.")},[bq]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:$m(0,"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.")}}}),(Vq=Bq||(Bq={}))[Vq.PRESERVE=0]="PRESERVE",Vq[Vq.LAST=1]="LAST";const Wq="workbench.contributions.quickaccess";My.add(Wq,new class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort(((e,t)=>t.prefix.length-e.prefix.length)),es((()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)}))}getQuickAccessProviders(){return xa([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find((t=>e.startsWith(t.prefix)))||void 0||this.defaultProvider}});const Hq=s_("quickInputService");var zq=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jq=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let Uq=class extends Uo{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=My.as(Wq),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;const[o,s]=this.getOrInstantiateProvider(e),r=this.visibleQuickAccess,a=null==r?void 0:r.descriptor;if(r&&s&&a===s)return e===s.prefix||(null==i?void 0:i.preserveValue)||(r.picker.value=e),void this.adjustValueSelection(r.picker,s,i);if(s&&!(null==i?void 0:i.preserveValue)){let t;if(r&&a&&a!==s){const e=r.value.substr(a.prefix.length);e&&(t=`${s.prefix}${e}`)}if(!t){const e=null==o?void 0:o.defaultFilterValue;e===Bq.LAST?t=this.lastAcceptedPickerValues.get(s):"string"==typeof e&&(t=`${s.prefix}${e}`)}"string"==typeof t&&(e=t)}const l=new Cs,d=l.add(this.quickInputService.createQuickPick());let h;d.value=e,this.adjustValueSelection(d,s,i),d.placeholder=null==s?void 0:s.placeholder,d.quickNavigate=null==i?void 0:i.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!r,("number"==typeof(null==i?void 0:i.itemActivation)||(null==i?void 0:i.quickNavigateConfiguration))&&(d.itemActivation=null!==(n=null==i?void 0:i.itemActivation)&&void 0!==n?n:nU.SECOND),d.contextKey=null==s?void 0:s.contextKey,d.filterValue=e=>e.substring(s?s.prefix.length:0),(null==s?void 0:s.placeholder)&&(d.ariaLabel=null==s?void 0:s.placeholder),t&&(h=new Uv,l.add(kr(d.onWillAccept)((e=>{e.veto(),d.hide()})))),l.add(this.registerPickerListeners(d,o,s,e));const c=l.add(new as);return o&&l.add(o.provide(d,c.token)),kr(d.onDidHide)((()=>{0===d.selectedItems.length&&c.cancel(),l.dispose(),null==h||h.complete(d.selectedItems.slice(0))})),d.show(),t?null==h?void 0:h.p:void 0}adjustValueSelection(e,t,i){var n;let o;o=(null==i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null==t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n){const o=new Cs,s=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return o.add(es((()=>{s===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)}))),o.add(e.onDidChangeValue((e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{preserveValue:!0}):s.value=e}))),i&&o.add(e.onDidAccept((()=>{this.lastAcceptedPickerValues.set(i,e.value)}))),o}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};Uq=zq([jq(0,Hq),jq(1,n_)],Uq);var $q=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Kq=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let qq=class extends jy{constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=n,this.layoutService=o,this.contexts=new Map}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Uq))),this._quickAccess}createController(e=this.layoutService,t){var i,n;const o={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),returnFocus:()=>e.focus(),createList:(e,t,i,n,o)=>this.instantiationService.createInstance(Sq,e,t,i,n,o),styles:this.computeStyles()},s=this._register(new ZU(Object.assign(Object.assign({},o),t)));return s.layout(e.dimension,null!==(n=null===(i=e.offset)||void 0===i?void 0:i.top)&&void 0!==n?n:0),this._register(e.onDidLayout((t=>{var i,n;return s.layout(t,null!==(n=null===(i=e.offset)||void 0===i?void 0:i.top)&&void 0!==n?n:0)}))),this._register(s.onShow((()=>this.resetContextKeys()))),this._register(s.onHide((()=>this.resetContextKeys()))),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Ly(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),t&&t.set(!0))}resetContextKeys(){this.contexts.forEach((e=>{e.get()&&e.reset()}))}pick(e,t={},i=Ia.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},Iz(this.theme,{quickInputBackground:ak,quickInputForeground:lk,quickInputTitleBackground:dk,contrastBorder:dx,widgetShadow:px})),inputBox:Iz(this.theme,{inputForeground:fx,inputBackground:mx,inputBorder:_x,inputValidationInfoBackground:wx,inputValidationInfoForeground:yx,inputValidationInfoBorder:Sx,inputValidationWarningBackground:xx,inputValidationWarningForeground:kx,inputValidationWarningBorder:Lx,inputValidationErrorBackground:Dx,inputValidationErrorForeground:Ex,inputValidationErrorBorder:Nx}),countBadge:Iz(this.theme,{badgeBackground:Fx,badgeForeground:Bx,badgeBorder:dx}),button:Iz(this.theme,{buttonForeground:Ox,buttonBackground:Ax,buttonHoverBackground:Rx,buttonBorder:dx}),progressBar:Iz(this.theme,{progressBarBackground:jx}),keybindingLabel:Iz(this.theme,{keybindingLabelBackground:uk,keybindingLabelForeground:gk,keybindingLabelBorder:pk,keybindingLabelBottomBorder:mk,keybindingLabelShadow:px}),list:Iz(this.theme,{listBackground:ak,listInactiveFocusForeground:DL,listInactiveSelectionIconForeground:EL,listInactiveFocusBackground:NL,listFocusOutline:hx,listInactiveFocusOutline:hx,pickerGroupBorder:ck,pickerGroupForeground:hk})}}};qq=$q([Kq(0,n_),Kq(1,Dy),Kq(2,Ry),Kq(3,NS),Kq(4,lV)],qq);var Gq=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Zq=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let Yq=class extends qq{constructor(e,t,i,n,o,s){super(t,i,n,o,new uV(e.getContainerDomNode(),s)),this.host=void 0;const r=Qq.get(e);if(r){const t=r.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return t.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};Yq=Gq([Zq(1,n_),Zq(2,Dy),Zq(3,Ry),Zq(4,NS),Zq(5,r_)],Yq);let Xq=class{constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}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(Yq,e);this.mapEditorToService.set(e,t),kr(e.onDidDispose)((()=>{i.dispose(),this.mapEditorToService.delete(e)}))}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},i=Ia.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}};Xq=Gq([Zq(0,n_),Zq(1,r_)],Xq);class Qq{constructor(e){this.editor=e,this.widget=new Jq(this.editor)}static get(e){return e.getContribution(Qq.ID)}dispose(){this.widget.dispose()}}Qq.ID="editor.controller.quickInput";class Jq{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Jq.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}Jq.ID="editor.contrib.quickInputWidget",gS(Qq.ID,Qq);class eG{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}}const tG=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class iG{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(tG);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=QS.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class nG{constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];const t=[];let i=0;for(let n=0,o=e.length;n{const i=function(e,t){return et?1:0}(e.token,t.token);return 0!==i?i:e.index-t.index}));let i=0,n="000000",o="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(o=t.background)}const s=new iG;for(let h of t)s.getId(h);const r=s.getId(n),a=s.getId(o),l=new sG(i,r,a),d=new rG(l);for(let h=0,c=e.length;h>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const oG=/\b(comment|string|regex|regexp)\b/;class sG{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<10|this._foreground<<14|this._background<<23)>>>0}clone(){return new sG(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<10|this._foreground<<14|this._background<<23)>>>0}}class rG{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;-1===t?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return void 0!==o?o.match(n):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);const o=e.indexOf(".");let s,r;-1===o?(s=e,r=""):(s=e.substring(0,o),r=e.substring(o+1));let a=this._children.get(s);void 0===a&&(a=new rG(this._mainRule.clone()),this._children.set(s,a)),a.insert(r,t,i,n)}}const aG={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[tk]:"#FFFFFE",[ik]:"#000000",[vk]:"#E5EBF1",[PE]:"#D3D3D3",[FE]:"#939393",[bk]:"#ADD6FF4D"}},lG={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[tk]:"#1E1E1E",[ik]:"#D4D4D4",[vk]:"#3A3D41",[PE]:"#404040",[FE]:"#707070",[bk]:"#ADD6FF26"}},dG={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[tk]:"#000000",[ik]:"#FFFFFF",[PE]:"#FFFFFF",[FE]:"#FFFFFF"}};class hG{getIcon(e){const t=hB();let i=e.defaults;for(;Fy.isThemeIcon(i);){const e=t.getIcon(i.id);if(!e)return;i=e.defaults}return i}}const cG=My.as(ix),uG=My.as(Wy);class gG{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(pG(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(let t in this.themeData.colors)e.set(t,QS.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=mG(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,QS.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);return i||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=cG.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case"vs":return Oy.LIGHT;case"hc-black":return Oy.HIGH_CONTRAST;default:return Oy.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const i=mG(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=nG.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=ys.getForeground(n),s=ys.getFontStyle(n);return{foreground:o,italic:Boolean(1&s),bold:Boolean(2&s),underline:Boolean(4&s),strikethrough:Boolean(8&s)}}}function pG(e){return"vs"===e||"vs-dark"===e||"hc-black"===e}function mG(e){switch(e){case"vs":return aG;case"vs-dark":return lG;case"hc-black":return dG}}function fG(e){const t=mG(e);return new gG(e,t)}const _G=s_("themeService");var vG=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},bG=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let CG=class extends Uo{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new $o,this._accessibilityModeEnabledContext=IS.bindTo(this._contextKeyService);const i=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(i(),this._onDidChangeScreenReaderOptimized.fire())}))),i(),this.onDidChangeScreenReaderOptimized((()=>i()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}getAccessibilitySupport(){return this._accessibilitySupport}};CG=vG([bG(0,Dy),bG(1,ev)],CG);var wG=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},yG=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let SG=class{constructor(e){this._commandService=e}createMenu(e,t,i){return new xG(e,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t,this)}};SG=wG([yG(0,iy)],SG);let xG=class e{constructor(e,t,i,n,o){this._id=e,this._options=t,this._commandService=i,this._contextKeyService=n,this._menuService=o,this._disposables=new Cs,this._menuGroups=[],this._contextKeys=new Set,this._build();const s=new Hv((()=>{this._build(),this._onDidChange.fire(this)}),t.eventDebounceDelay);this._disposables.add(s),this._disposables.add(Zy.onDidChangeMenu((t=>{t.has(e)&&s.schedule()})));const r=this._disposables.add(new Cs);this._onDidChange=new $o({onFirstListenerAdd:()=>{const e=new Hv((()=>this._onDidChange.fire(this)),t.eventDebounceDelay);r.add(e),r.add(n.onDidChangeContext((t=>{t.affectsSome(this._contextKeys)&&e.schedule()})))},onLastListenerRemove:r.clear.bind(r)}),this.onDidChange=this._onDidChange.event}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const t=Zy.getMenuItems(this._id);let i;t.sort(e._compareMenuItems);for(const e of t){const t=e.group||"";i&&i[0]===t||(i=[t,[]],this._menuGroups.push(i)),i[1].push(e),this._collectContextKeys(e)}}_collectContextKeys(t){if(e._fillInKbExprKeys(t.when,this._contextKeys),Ky(t)){if(t.command.precondition&&e._fillInKbExprKeys(t.command.precondition,this._contextKeys),t.command.toggled){const i=t.command.toggled.condition||t.command.toggled;e._fillInKbExprKeys(i,this._contextKeys)}}else this._options.emitEventsForSubmenuChanges&&Zy.getMenuItems(t.submenu).forEach(this._collectContextKeys,this)}getActions(e){const t=[];for(let i of this._menuGroups){const[n,o]=i,s=[];for(const t of o)if(this._contextKeyService.contextMatchesRules(t.when)){const i=Ky(t)?new Xy(t.command,t.alt,e,this._contextKeyService,this._commandService):new Yy(t,this._menuService,this._contextKeyService,e);s.push(i)}s.length>0&&t.push([n,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(let i of e.keys())t.add(i)}static _compareMenuItems(t,i){let n=t.group,o=i.group;if(n!==o){if(!n)return 1;if(!o)return-1;if("navigation"===n)return-1;if("navigation"===o)return 1;let e=n.localeCompare(o);if(0!==e)return e}let s=t.order||0,r=i.order||0;return sr?1:e._compareTitles(Ky(t)?t.command.title:t.title,Ky(i)?i.command.title:i.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};xG=wG([yG(2,iy),yG(3,Dy),yG(4,Gy)],xG);var kG=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},LG=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},DG=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let EG=class extends Uo{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",(Bf||Vf)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const e=new Uv;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch((t=>DG(this,void 0,void 0,(function*(){t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)}))))};this.layoutService.hasContainer&&(this._register(BC(this.layoutService.container,"click",e)),this._register(BC(this.layoutService.container,"keydown",e)))}writeText(e,t){return DG(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(o){}const i=document.activeElement,n=document.body.appendChild(Mw("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(n)}))}readText(e){return DG(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return""}}))}readFindText(){return DG(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return DG(this,void 0,void 0,(function*(){this.findText=e}))}};EG=kG([LG(0,lV),LG(1,tb)],EG);var NG=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},IG=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};class TG{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class MG extends TG{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}MG.INSTANCE=new MG;class OG extends TG{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=RV.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration((e=>{if(6===e.source){const e=Array.from(zs.map(this._values,(([e])=>e)));this._values.clear(),i.fire(new PG(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...zs.map(n,(([e])=>e))),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new PG(t))}}))}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(OG._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(OG._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:n=Array.isArray(i)?JSON.stringify(i):i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}OG._keyPrefix="config.";class AG{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class RG{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class PG{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class FG{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class BG{constructor(e){this._onDidChangeContext=new Ka({merge:e=>new FG(e)}),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 AG(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 WG(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)}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 RG(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new RG(e))}getContext(e){return this._isDisposed?MG.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute("data-keybinding-context")){const t=e.getAttribute("data-keybinding-context");return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}}let VG=class extends BG{constructor(e){super(0),this._contexts=new Map,this._toDispose=new Cs,this._lastContextId=0;const t=new OG(this._myContextId,e,this._onDidChangeContext);this._contexts.set(this._myContextId,t),this._toDispose.add(t)}dispose(){this._onDidChangeContext.dispose(),this._isDisposed=!0,this._toDispose.dispose()}getContextValuesContainer(e){return this._isDisposed?MG.INSTANCE:this._contexts.get(e)||MG.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");let t=++this._lastContextId;return this._contexts.set(t,new TG(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};VG=NG([IG(0,ev)],VG);class WG extends BG{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new Rr,this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute("data-keybinding-context")){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", "))}this._domNode.setAttribute("data-keybinding-context",String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(this._onDidChangeContext.fire,this._onDidChangeContext)}dispose(){this._isDisposed||(this._onDidChangeContext.dispose(),this._parent.disposeContext(this._myContextId),this._parentChangeListener.dispose(),this._domNode.removeAttribute("data-keybinding-context"),this._isDisposed=!0)}getContextValuesContainer(e){return this._isDisposed?MG.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)}}ny.registerCommand("setContext",(function(e,t,i){e.get(Dy).createKey(String(t),i)})),ny.registerCommand({id:"getContextKeyInfo",handler:()=>[...Ly.all()].sort(((e,t)=>e.key.localeCompare(t.key))),description:{description:$m(0,"A command that returns information about context keys"),args:[]}}),ny.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(let i of Ly.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort(((e,t)=>e.key.localeCompare(t.key)))}));class HG{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}}class zG{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(let t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(this._hashFn(t),n),n.incoming.set(this._hashFn(e),i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(let 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 HG(e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){let e=[];for(let[t,i]of this._nodes)e.push(`${t}, (incoming)[${[...i.incoming.keys()].join(", ")}], (outgoing)[${[...i.outgoing.keys()].join(",")}]`);return e.join("\n")}findCycleSlow(){for(let[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(let[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}class jG extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=null!==(t=e.findCycleSlow())&&void 0!==t?t:`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}}class UG{constructor(e=new tF,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(n_,this)}createChild(e){return new UG(e,this._strict,this)}invokeFunction(e,...t){let i=$G.traceInvocation(e),n=!1;try{return e({get:e=>{if(n)throw qa("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(e,i);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof av?(i=$G.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=$G.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=t_.getServiceDependencies(e).sort(((e,t)=>e.index-t.index)),o=[];for(const r of n){let t=this._getOrCreateServiceInstance(r.id,i);t||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${r.id}.`,!1),o.push(t)}let s=n.length>0?n[0].index:t.length;if(t.length!==s){let e=s-t.length;t=e>0?t.concat(new Array(e)):t.slice(0,s)}return new e(...[...t,...o])}_setServiceInstance(e,t){if(this._services.get(e)instanceof av)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let i=this._getServiceInstanceOrDescriptor(e);return i instanceof av?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){const n=new zG((e=>e.id.toString()));let o=0;const s=[{id:e,desc:t,_trace:i}];for(;s.length;){const t=s.pop();if(n.lookupOrInsertNode(t),o++>1e3)throw new jG(n);for(let i of t_.getServiceDependencies(t.desc.ctor)){let o=this._getServiceInstanceOrDescriptor(i.id);if(o||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),o instanceof av){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};n.insertEdge(t,e),s.push(e)}}}for(;;){const e=n.roots();if(0===e.length){if(!n.isEmpty())throw new jG(n);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof av){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}n.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof av)return this._createServiceInstance(t,i,n,o);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){if(i){const i=new jv((()=>this._createInstance(e,t,n)));return new Proxy(Object.create(null),{get(e,t){if(t in e)return e[t];let n=i.value,o=n[t];return"function"!=typeof o||(o=o.bind(n),e[t]=o),o},set:(e,t,n)=>(i.value[t]=n,!0)})}return this._createInstance(e,t,n)}_throwIfStrict(e,t){if(this._strict)throw new Error(e)}}class $G{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return $G._None}static traceCreation(e){return $G._None}branch(e,t){let i=new $G(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;$G._totals+=e;let t=!1;this.type,this.name,function e(i,n){let o=[],s=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,o.push(`${s}CREATES -> ${r}`);let n=e(i+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}(1,this),e.toFixed(2),$G._totals.toFixed(2)}}$G._None=new class extends $G{constructor(){super(-1,null)}stop(){}branch(){return this}},$G._totals=0;class KG{constructor(){this._byResource=new FV,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 FV,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){let i=this._byResource.get(e);return null==i?void 0:i.get(t)}delete(e,t){let i=!1,n=!1,o=this._byResource.get(e);o&&(i=o.delete(t));let s=this._byOwner.get(t);if(s&&(n=s.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return"string"==typeof e?null!==(i=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==i?i:zs.empty():Ps.isUri(e)?null!==(o=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==o?o:zs.empty():zs.map(zs.concat(...this._byOwner.values()),(e=>e[1]))}}class qG{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new FV,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(e.scheme===IC.inMemory||e.scheme===IC.walkThrough||e.scheme===IC.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e}))i===ej.Error?t.errors+=1:i===ej.Warning?t.warnings+=1:i===ej.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 GG{constructor(){this._onMarkerChanged=new Ga({delay:0,merge:GG._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new KG,this._stats=new qG(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(Za(i)){this._data.delete(t,e)&&this._onMarkerChanged.fire([t])}else{const n=[];for(const o of i){const i=GG._toMarker(e,t,o);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:c,tags:u}=i;if(s)return a=a>0?a:1,l=l>0?l:1,d=d>=a?d:a,h=h>0?h:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:d,endColumn:h,relatedInformation:c,tags:u}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(GG._accept(i,n)){const e=t.push(i);if(o>0&&e===o)break}return t}return[]}if(t||i){const e=this._data.values(null!=i?i:t),s=[];for(const t of e)for(const e of t)if(GG._accept(e,n)){const t=s.push(e);if(o>0&&t===o)return s}return s}{const e=[];for(let t of this._data.values())for(let i of t)if(GG._accept(i,n)){const t=e.push(i);if(o>0&&t===o)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new FV;for(let i of e)for(let e of i)t.set(e,!0);return Array.from(t.keys())}}var ZG,YG,XG=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};(YG=ZG||(ZG={}))[YG.None=0]="None",YG[YG.Initialized=1]="Initialized",YG[YG.Closed=2]="Closed";class QG extends Uo{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new $o),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=ZG.None,this.cache=new Map,this.flushDelayer=new Rv(QG.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;null===(t=e.changed)||void 0===t||t.forEach(((e,t)=>this.accept(t,e))),null===(i=e.deleted)||void 0===i||i.forEach((e=>this.accept(e,void 0)))}accept(e,t){if(this.state===ZG.Closed)return;let i=!1;if(Tr(t))i=this.cache.delete(e);else{this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0)}i&&this._onDidChangeStorage.fire(e)}get(e,t){const i=this.cache.get(e);return Tr(i)?t:i}getBoolean(e,t){const i=this.get(e);return Tr(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return Tr(i)?t:parseInt(i,10)}set(e,t){return XG(this,void 0,void 0,(function*(){if(this.state===ZG.Closed)return;if(Tr(t))return this.delete(e);const i=String(t);return this.cache.get(e)!==i?(this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire(e),this.doFlush()):void 0}))}delete(e){return XG(this,void 0,void 0,(function*(){if(this.state===ZG.Closed)return;return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire(e),this.doFlush()):void 0}))}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return XG(this,void 0,void 0,(function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally((()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()}))}))}doFlush(e){return XG(this,void 0,void 0,(function*(){return this.flushDelayer.trigger((()=>this.flushPending()),e)}))}dispose(){this.flushDelayer.dispose(),super.dispose()}}QG.DEFAULT_FLUSH_DELAY=100;class JG{constructor(){this.onDidChangeItemsExternal=ds.None,this.items=new Map}updateItems(e){return XG(this,void 0,void 0,(function*(){e.insert&&e.insert.forEach(((e,t)=>this.items.set(t,e))),e.delete&&e.delete.forEach((e=>this.items.delete(e)))}))}}const eZ="__$__targetStorageMarker",tZ=s_("storageService");var iZ,nZ;(nZ=iZ||(iZ={}))[nZ.NONE=0]="NONE",nZ[nZ.SHUTDOWN=1]="SHUTDOWN";class oZ extends Uo{constructor(e={flushInterval:oZ.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Ka),this._onDidChangeTarget=this._register(new Ka),this._onWillSaveState=this._register(new $o),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===eZ?(0===e?this._globalKeyTargets=void 0:1===e&&(this._workspaceKeyTargets=void 0),this._onDidChangeTarget.fire({scope:e})):this._onDidChangeValue.fire({scope:e,key:t,target:this.getKeyTargets(e)[t]})}get(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getNumber(e,i)}store(e,t,i,n){Tr(t)?this.remove(e,i):this.withPausedEmitters((()=>{var o;this.updateKeyTarget(e,i,n),null===(o=this.getStorage(i))||void 0===o||o.set(e,t)}))}remove(e,t){this.withPausedEmitters((()=>{var i;this.updateKeyTarget(e,t,void 0),null===(i=this.getStorage(t))||void 0===i||i.delete(e)}))}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){var n,o;const s=this.getKeyTargets(t);"number"==typeof i?s[e]!==i&&(s[e]=i,null===(n=this.getStorage(t))||void 0===n||n.set(eZ,JSON.stringify(s))):"number"==typeof s[e]&&(delete s[e],null===(o=this.getStorage(t))||void 0===o||o.set(eZ,JSON.stringify(s)))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get globalKeyTargets(){return this._globalKeyTargets||(this._globalKeyTargets=this.loadKeyTargets(0)),this._globalKeyTargets}getKeyTargets(e){return 0===e?this.globalKeyTargets:this.workspaceKeyTargets}loadKeyTargets(e){const t=this.get(eZ,e);if(t)try{return JSON.parse(t)}catch(i){}return Object.create(null)}}oZ.DEFAULT_FLUSH_INTERVAL=6e4;function sZ(e,t,i,n,o){if(Array.isArray(e)){let s=0;for(const r of e){const e=sZ(r,t,i,n,o);if(10===e)return e;e>s&&(s=e)}return s}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:l,pattern:d,scheme:h,hasAccessToAllModels:c,notebookType:u}=e;if(!n&&!c)return 0;let g=0;if(h)if(h===t.scheme)g=10;else{if("*"!==h)return 0;g=5}if(l)if(l===i)g=10;else{if("*"!==l)return 0;g=Math.max(g,5)}if(u)if(u===o)g=10;else{if("*"!==u)return 0;g=Math.max(g,5)}if(d){let e;if(e="string"==typeof d?d:Object.assign(Object.assign({},d),{base:Vr(d.base)}),e!==t.fsPath&&(s=e,r=t.fsPath,!s||"string"!=typeof r||!pH(s)(r,void 0,a)))return 0;g=10}return g}return 0;var s,r,a}function rZ(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(rZ):!!e.exclusive)}class aZ{constructor(e){this._notebookTypeResolver=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),es((()=>{if(i){const e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}}))}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(let i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,(e=>t.push(e.provider))),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,(e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))})),t}_orderedForEach(e,t){if(e){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}}_updateScores(e){var t;const i=null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e.uri),n={uri:e.uri.toString(),language:e.getLanguageId(),notebookType:i};if(!this._lastCandidate||this._lastCandidate.language!==n.language||this._lastCandidate.uri!==n.uri||this._lastCandidate.notebookType!==n.notebookType){this._lastCandidate=n;for(let t of this._entries)if(t._score=sZ(t.selector,e.uri,e.getLanguageId(),Ya(e),i),rZ(t.selector)&&t._score>0){for(let e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(aZ._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:e._timet._time?-1:0}}dv(lb,class{constructor(){this.referenceProvider=new aZ(this._score.bind(this)),this.renameProvider=new aZ(this._score.bind(this)),this.codeActionProvider=new aZ(this._score.bind(this)),this.definitionProvider=new aZ(this._score.bind(this)),this.typeDefinitionProvider=new aZ(this._score.bind(this)),this.declarationProvider=new aZ(this._score.bind(this)),this.implementationProvider=new aZ(this._score.bind(this)),this.documentSymbolProvider=new aZ(this._score.bind(this)),this.inlayHintsProvider=new aZ(this._score.bind(this)),this.colorProvider=new aZ(this._score.bind(this)),this.codeLensProvider=new aZ(this._score.bind(this)),this.documentFormattingEditProvider=new aZ(this._score.bind(this)),this.documentRangeFormattingEditProvider=new aZ(this._score.bind(this)),this.onTypeFormattingEditProvider=new aZ(this._score.bind(this)),this.signatureHelpProvider=new aZ(this._score.bind(this)),this.hoverProvider=new aZ(this._score.bind(this)),this.documentHighlightProvider=new aZ(this._score.bind(this)),this.selectionRangeProvider=new aZ(this._score.bind(this)),this.foldingRangeProvider=new aZ(this._score.bind(this)),this.linkProvider=new aZ(this._score.bind(this)),this.inlineCompletionsProvider=new aZ(this._score.bind(this)),this.completionProvider=new aZ(this._score.bind(this)),this.linkedEditingRangeProvider=new aZ(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new aZ(this._score.bind(this)),this.documentSemanticTokensProvider=new aZ(this._score.bind(this))}_score(e){var t;return null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e)}},!0);var lZ=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},dZ=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},hZ=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class cZ{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 uZ=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Xa(new cZ(t))):Promise.reject(new Error("Model not found"))}};uZ=lZ([dZ(0,Dv)],uZ);class gZ{show(){return gZ.NULL_PROGRESS_RUNNER}showWhile(e,t){return hZ(this,void 0,void 0,(function*(){yield e}))}}gZ.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class pZ{info(e){return this.notify({severity:oF.Info,message:e})}warn(e){return this.notify({severity:oF.Warning,message:e})}error(e){return this.notify({severity:oF.Error,message:e})}notify(e){switch(e.severity){case oF.Error:case oF.Warning:}return pZ.NO_OP}status(e,t){return Uo.None}}pZ.NO_OP=new class{};let mZ=class{constructor(e){this._onWillExecuteCommand=new $o,this._onDidExecuteCommand=new $o,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=ny.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)}}};mZ=lZ([dZ(0,n_)],mZ);let fZ=class extends hW{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const r=e=>{const t=new Cs;t.add(BC(e,yw.KEY_DOWN,(e=>{const t=new SC(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))),t.add(BC(e,yw.KEY_UP,(e=>{const t=new SC(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()}))),this._domNodeListeners.push(new _Z(e,t))},a=e=>{for(let t=0;t{e.getOption(54)||r(e.getContainerDomNode())};this._register(s.onCodeEditorAdd(l)),this._register(s.onCodeEditorRemove((e=>{e.getOption(54)||a(e.getContainerDomNode())}))),s.listCodeEditors().forEach(l);const d=e=>{r(e.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove((e=>{a(e.getContainerDomNode())}))),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,i,n){const o=fC(t,Xs),s=new Cs;return o&&(this._dynamicKeybindings.push({keybinding:o.parts,command:e,when:n,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),s.add(es((()=>{for(let t=0;tthis._log(e)))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const e=o.when||void 0,s=o.keybinding;if(s){const r=SW.resolveUserBinding(s,Xs);for(const s of r)i[n++]=new fW(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new fW(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){const t=new vC(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new SW(t,Xs)}};fZ=lZ([dZ(0,Dy),dZ(1,iy),dZ(2,tS),dZ(3,rF),dZ(4,tb),dZ(5,r_)],fZ);class _Z extends Uo{constructor(e,t){super(),this.domNode=e,this._register(t)}}function vZ(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof Ps)}class bZ{constructor(){this._onDidChangeConfiguration=new $o,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new aW(new rW,new sW)}getValue(e,t){const i="string"==typeof e?e:void 0,n=vZ(e)?e:vZ(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[e,t]=n;this.getValue(e)!==t&&(this._configuration.updateValue(e,t),i.push(e))}if(i.length>0){const e=new lW({keys:i,overrides:[]},t,this._configuration);e.source=7,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let CZ=class{constructor(e){this.configurationService=e,this._onDidChangeConfiguration=new $o,this.configurationService.onDidChangeConfiguration((e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})}))}getValue(e,t,i){const n=(er.isIPosition(t)?t:null)?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0;return void 0===n?this.configurationService.getValue():this.configurationService.getValue(n)}};CZ=lZ([dZ(0,ev)],CZ);let wZ=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:Vo||Ho?"\n":"\r\n"}};wZ=lZ([dZ(0,ev)],wZ);class yZ{constructor(){const e=Ps.from({scheme:yZ.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new DW({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}function SZ(e,t,i){if(!t)return;if(!(e instanceof bZ))return;const n=[];Object.keys(t).forEach((e=>{(function(e){return nW()[`editor.${e}`]||!1})(e)&&n.push([`editor.${e}`,t[e]]),i&&function(e){return nW()[`diffEditor.${e}`]||!1}(e)&&n.push([`diffEditor.${e}`,t[e]])})),n.length>0&&e.updateValues(n)}yZ.SCHEME="inmemory";let xZ=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return hZ(this,void 0,void 0,(function*(){const t=new Map;for(let o of e){if(!(o instanceof XV))throw new Error("bad edit - only text edits are supported");const e=this._modelService.getModel(o.resource);if(!e)throw new Error("bad edit - model not found");if("number"==typeof o.versionId&&e.getVersionId()!==o.versionId)throw new Error("bad state - model changed in the meantime");let i=t.get(e);i||(i=[],t.set(e,i)),i.push(oW.replaceMove(qo.lift(o.textEdit.range),o.textEdit.text))}let i=0,n=0;for(const[e,o]of t)e.pushStackElement(),e.pushEditOperations([],o,(()=>[])),e.pushStackElement(),n+=1,i+=o.length;return{ariaSummary:Oa(WW.bulkEditServiceSummary,i,n)}}))}};xZ=lZ([dZ(0,Dv)],xZ);let kZ=class extends YW{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}};kZ=lZ([dZ(0,lV),dZ(1,r_)],kZ);let LZ=class extends Bz{constructor(e,t,i,n,o){super(e,t,i,n,o),this.configure({blockMouse:!1})}};var DZ;LZ=lZ([dZ(0,tS),dZ(1,rF),dZ(2,LB),dZ(3,uW),dZ(4,Ry)],LZ),dv(ev,bZ),dv(Jv,CZ),dv(eb,wZ),dv(kW,yZ),dv(xW,class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}}),dv(tS,class{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}),dv(gV,class{confirm(e){return this.doConfirm(e).then((e=>({confirmed:e,checkboxChecked:!1})))}doConfirm(e){let t=e.message;return e.detail&&(t=t+"\n\n"+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}}),dv(rF,pZ),dv(nj,GG),dv(rv,class extends kH{constructor(){super()}}),dv(_G,class extends Uo{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 hG,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set("vs",fG("vs")),this._knownThemes.set("vs-dark",fG("vs-dark")),this._knownThemes.set("hc-black",fG("hc-black"));const e=function(e){const t=new $o,i=hB();return i.onDidChange((()=>t.fire())),null==e||e.onDidProductIconThemeChange((()=>t.fire())),{onDidChange:t.event,getCSS(){const t=e?e.getProductIconTheme():new hG,n={},o=e=>{const i=t.getIcon(e);if(!i)return;const o=i.font;return o?(n[o.id]=o.definition,`.codicon-${e.id}:before { content: '${i.fontCharacter}'; font-family: ${Bw(o.id)}; }`):`.codicon-${e.id}:before { content: '${i.fontCharacter}'; }`},s=[];for(let e of i.getIcons()){const t=o(e);t&&s.push(t)}for(let e in n){const t=n[e],i=t.weight?`font-weight: ${t.weight};`:"",o=t.style?`font-style: ${t.style};`:"",r=t.src.map((e=>`${Fw(e.location)} format('${e.format}')`)).join(", ");s.push(`@font-face { src: ${r}; font-family: ${Bw(e)};${i}${o} font-display: block; }`)}return s.join("\n")}}}(this);var t,i;this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme("vs"),e.onDidChange((()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),t="(forced-colors: active)",i=()=>{this._updateActualTheme()},window.matchMedia(t).addEventListener("change",i)}registerEditorContainer(e){return gw(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=fw(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),Uo.None}_registerShadowDomContainer(e){const t=fw(e);return t.className="monaco-colors",t.textContent=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let e=0;e{t.base===e&&t.notifyBaseUpdated()})),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get("vs"),this._desiredTheme=t,this._updateActualTheme()}_updateActualTheme(){const e=this._autoDetectHighContrast&&window.matchMedia("(forced-colors: active)").matches?this._knownThemes.get("hc-black"):this._desiredTheme;this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._updateActualTheme()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};uG.getThemingParticipants().forEach((e=>e(this._theme,i,this._environment)));const n=[];for(const s of cG.getColors()){const e=this._theme.getColor(s.id,!0);e&&n.push(`${tx(s.id)}: ${e.toString()};`)}i.addRule(`.monaco-editor { ${n.join("\n")} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){const t=[];for(let i=1,n=e.length;ie.textContent=this._allCSS))}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}),dv(tb,class extends ab{constructor(){super(new rb)}}),dv(Dv,Aj),dv(Gw,aj),dv(Dy,VG),dv(MB,gZ),dv(tZ,class extends oZ{constructor(){super(),this.globalStorage=this._register(new QG(new JG)),this.workspaceStorage=this._register(new QG(new JG)),this._register(this.workspaceStorage.onDidChangeStorage((e=>this.emitDidChangeValue(1,e)))),this._register(this.globalStorage.onDidChangeStorage((e=>this.emitDidChangeValue(0,e))))}getStorage(e){return 0===e?this.globalStorage:this.workspaceStorage}}),dv(kB,gb),dv(ZV,xZ),dv(HW,class{constructor(){this._neverEmitter=new $o,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}),dv(Zw,uZ),dv(NS,CG),dv(eq,tq),dv(iy,mZ),dv(uW,fZ),dv(Hq,Xq),dv(LB,kZ),dv(Uz,Jz),dv(IB,EG),dv(DB,LZ),dv(Gy,SG),function(e){const t=new tF;for(const[o,s]of hv())t.set(o,s);const i=new UG(t,!0);t.set(n_,i),e.get=function(e){const n=t.get(e);if(!n)throw new Error("Missing service "+e);return n instanceof av?i.invokeFunction((t=>t.get(e))):n};let n=!1;e.initialize=function(e){if(n)return i;n=!0;for(const[i,n]of hv())t.get(i)||t.set(i,n);for(const i in e)if(e.hasOwnProperty(i)){const n=s_(i);t.get(n)instanceof av&&t.set(n,e[i])}return i}}(DZ||(DZ={}));var EZ=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},NZ=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let IZ=0,TZ=!1;function MZ(e){if(!e){if(TZ)return;TZ=!0}!function(e){Ww=document.createElement("div"),Ww.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),Ww.appendChild(e),e};Hw=t(),zw=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("role","complementary"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),Ww.appendChild(e),e};jw=i(),Uw=i(),e.appendChild(Ww)}(e||document.body)}let OZ=class extends MF{constructor(e,t,i,n,o,s,r,a,l,d,h,c){const u=Object.assign({},t);u.ariaLabel=u.ariaLabel||FW.editorViewAccessibleLabel,u.ariaLabel=u.ariaLabel+";"+FW.accessibilityHelpMessage,super(e,u,{},i,n,o,s,a,l,d,h,c),this._standaloneKeybindingService=r instanceof fZ?r:null,MZ(u.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return null;const n="DYNAMIC_"+ ++IZ,o=ry.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return Uo.None;const t=e.id,i=e.label,n=ry.and(ry.equals("editorId",this.getId()),ry.deserialize(e.precondition)),o=e.keybindings,s=ry.and(n,ry.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),d=new Cs,h=this.getId()+":"+t;if(d.add(ny.registerCommand(h,l)),r){const e={command:{id:h,title:i},when:n,group:r,order:a};d.add(Zy.appendMenuItem(qy.EditorContext,e))}if(Array.isArray(o))for(const u of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,u,l,s));const c=new JM(h,i,i,n,l,this._contextKeyService);return this._actions[t]=c,d.add(es((()=>{delete this._actions[t]}))),d}_triggerCommand(e,t){if(this._codeEditorService instanceof aV)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};OZ=EZ([NZ(2,n_),NZ(3,r_),NZ(4,iy),NZ(5,Dy),NZ(6,uW),NZ(7,Ry),NZ(8,rF),NZ(9,NS),NZ(10,pv),NZ(11,lb)],OZ);let AZ=class extends OZ{constructor(e,t,i,n,o,s,r,a,l,d,h,c,u,g,p){const m=Object.assign({},t);SZ(d,m,!1);const f=a.registerEditorContainer(e);"string"==typeof m.theme&&a.setTheme(m.theme),void 0!==m.autoDetectHighContrast&&a.setAutoDetectHighContrast(Boolean(m.autoDetectHighContrast));const _=m.model;let v;if(delete m.model,super(e,m,i,n,o,s,r,a,l,h,g,p),this._configurationService=d,this._standaloneThemeService=a,this._register(f),void 0===_){const e=u.getLanguageIdByMimeType(m.language)||m.language||"plaintext";v=PZ(c,u,m.value||"",e,void 0),this._ownsModel=!0}else v=_,this._ownsModel=!1;if(this._attachModel(v),v){const e={oldModelUrl:null,newModelUrl:v.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){SZ(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};AZ=EZ([NZ(2,n_),NZ(3,r_),NZ(4,iy),NZ(5,Dy),NZ(6,uW),NZ(7,_G),NZ(8,rF),NZ(9,ev),NZ(10,NS),NZ(11,Dv),NZ(12,rv),NZ(13,pv),NZ(14,lb)],AZ);let RZ=class extends HB{constructor(e,t,i,n,o,s,r,a,l,d,h,c){const u=Object.assign({},t);SZ(l,u,!0);const g=r.registerEditorContainer(e);"string"==typeof u.theme&&r.setTheme(u.theme),void 0!==u.autoDetectHighContrast&&r.setAutoDetectHighContrast(Boolean(u.autoDetectHighContrast)),super(e,u,{},c,o,n,i,s,r,a,d,h),this._configurationService=l,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){SZ(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(OZ,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)}};function PZ(e,t,i,n,o){if(i=i||"",!n){const n=i.indexOf("\n");let s=i;return-1!==n&&(s=i.substring(0,n)),FZ(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return FZ(e,i,t.createById(n),o)}function FZ(e,t,i,n){return e.createModel(t,i,n)}function BZ(e,t,i){return DZ.initialize(i||{}).createInstance(AZ,e,t)}function VZ(e){return DZ.get(r_).onCodeEditorAdd((t=>{e(t)}))}function WZ(e,t,i){return DZ.initialize(i||{}).createInstance(RZ,e,t)}function HZ(e,t){return new d_(e,t)}function zZ(e,t,i){const n=DZ.get(rv),o=n.getLanguageIdByMimeType(t)||t;return PZ(DZ.get(Dv),n,e,o,i)}function jZ(e,t){const i=DZ.get(rv);DZ.get(Dv).setMode(e,i.createById(t))}function UZ(e,t,i){if(e){DZ.get(nj).changeOne(t,e.uri,i)}}function $Z(e){return DZ.get(nj).read(e)}function KZ(e){return DZ.get(nj).onMarkerChanged(e)}function qZ(e){return DZ.get(Dv).getModel(e)}function GZ(){return DZ.get(Dv).getModels()}function ZZ(e){return DZ.get(Dv).onModelAdded(e)}function YZ(e){return DZ.get(Dv).onModelRemoved(e)}function XZ(e){return DZ.get(Dv).onModelLanguageChanged((t=>{e({model:t.model,oldLanguage:t.oldLanguageId})}))}function QZ(e){return function(e,t,i){return new Cb(e,t,i)}(DZ.get(Dv),DZ.get(pv),e)}function JZ(e,t){const i=DZ.get(rv),n=DZ.get(_G);return n.registerEditorContainer(e),gC.colorizeElement(n,i,e,t)}function eY(e,t,i){const n=DZ.get(rv);return DZ.get(_G).registerEditorContainer(document.body),gC.colorize(n,e,t,i)}function tY(e,t,i=4){return DZ.get(_G).registerEditorContainer(document.body),gC.colorizeModelLine(e,t,i)}function iY(e,t){Es.getOrCreate(t);const i=(n=t,Es.get(n)||{getInitialState:()=>xv,tokenize:(e,t,i)=>kv(n,i)});var n;const o=Is(e),s=[];let r=i.getInitialState();for(let a=0,l=o.length;a=100){n-=100;const e=i.split(".");if(e.unshift(i),n=0&&(n.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw Qb(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!=typeof i.next)throw Qb(e,"the next state must be a string value in rule: "+t);{let o=i.next;if(!/^(@pop|@push|@popall)$/.test(o)&&("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(e,Jb(e,o,"",[],""))))throw Qb(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=o}}return"number"==typeof i.goBack&&(n.goBack=i.goBack),"string"==typeof i.switchTo&&(n.switchTo=i.switchTo),"string"==typeof i.log&&(n.log=i.log),"string"==typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){const n=[];for(let o=0,s=i.length;o0&&"^"===i[0],this.name=this.name+": "+i,this.regex=hY(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=uY(e,this.name,t)}}function pY(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const i={};i.languageId=e,i.includeLF=aY(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"==typeof t.start?t.start:null,i.ignoreCase=aY(t.ignoreCase,!1),i.unicode=aY(t.unicode,!1),i.tokenPostfix=lY(t.tokenPostfix,"."+i.languageId),i.defaultToken=lY(t.defaultToken,"source"),i.usesEmbedded=!1;const n=t;function o(e,s,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw Qb(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw Qb(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new gY(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw Qb(i,"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: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw Qb(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=aY(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}s.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw Qb(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(let r in t.tokenizer)if(t.tokenizer.hasOwnProperty(r)){i.start||(i.start=r);const e=t.tokenizer[r];i.tokenizer[r]=new Array,o("tokenizer."+r,i.tokenizer[r],e)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw Qb(i,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(let r of t.brackets){let e=r;if(e&&Array.isArray(e)&&3===e.length&&(e={token:e[2],open:e[0],close:e[1]}),e.open===e.close)throw Qb(i,"open and close brackets in a 'brackets' attribute must be different: "+e.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof e.open||"string"!=typeof e.token||"string"!=typeof e.close)throw Qb(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:e.token+i.tokenPostfix,open:Yb(i,e.open),close:Yb(i,e.close)})}return i.brackets=s,i.noThrow=!0,i}var mY=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function fY(e){pO.registerLanguage(e)}function _Y(){let e=[];return e=e.concat(pO.getLanguages()),e}function vY(e){return DZ.get(rv).languageIdCodec.encodeLanguageId(e)}function bY(e,t){const i=DZ.get(rv).onDidEncounterLanguage((n=>{n===e&&(i.dispose(),t())}));return i}function CY(e,t){if(!DZ.get(rv).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return bv.register(e,t,100)}class wY{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return yY.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 os(n.tokens,n.endState)}}class yY{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,s=e.length;o0&&o[s-1]===a)continue;let d=e.startIndex;0===l?d=0:dmY(this,void 0,void 0,(function*(){const i=yield Promise.resolve(t.create());return i?"function"==typeof i.getInitialState?kY(e,i):new lC(DZ.get(rv),DZ.get(_G),e,pY(e,i)):null}))};return Es.registerFactory(e,i)}function DY(e,t){if(!DZ.get(rv).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return SY(t)?LY(e,{create:()=>t}):Es.register(e,kY(e,t))}function EY(e,t){return SY(t)?LY(e,{create:()=>t}):Es.register(e,(i=t,new lC(DZ.get(rv),DZ.get(_G),e,pY(e,i))));var i}function NY(e,t){return DZ.get(lb).referenceProvider.register(e,t)}function IY(e,t){return DZ.get(lb).renameProvider.register(e,t)}function TY(e,t){return DZ.get(lb).signatureHelpProvider.register(e,t)}function MY(e,t){return DZ.get(lb).hoverProvider.register(e,{provideHover:(e,i,n)=>{const o=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n)).then((e=>{if(e)return!e.range&&o&&(e.range=new qo(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),e.range||(e.range=new qo(i.lineNumber,i.column,i.lineNumber,i.column)),e}))}})}function OY(e,t){return DZ.get(lb).documentSymbolProvider.register(e,t)}function AY(e,t){return DZ.get(lb).documentHighlightProvider.register(e,t)}function RY(e,t){return DZ.get(lb).linkedEditingRangeProvider.register(e,t)}function PY(e,t){return DZ.get(lb).definitionProvider.register(e,t)}function FY(e,t){return DZ.get(lb).implementationProvider.register(e,t)}function BY(e,t){return DZ.get(lb).typeDefinitionProvider.register(e,t)}function VY(e,t){return DZ.get(lb).codeLensProvider.register(e,t)}function WY(e,t,i){return DZ.get(lb).codeActionProvider.register(e,{providedCodeActionKinds:null==i?void 0:i.providedCodeActionKinds,provideCodeActions:(e,i,n,o)=>{const s=DZ.get(nj).read({resource:e.uri}).filter((e=>qo.areIntersectingOrTouching(e,i)));return t.provideCodeActions(e,i,{markers:s,only:n.only},o)},resolveCodeAction:t.resolveCodeAction})}function HY(e,t){return DZ.get(lb).documentFormattingEditProvider.register(e,t)}function zY(e,t){return DZ.get(lb).documentRangeFormattingEditProvider.register(e,t)}function jY(e,t){return DZ.get(lb).onTypeFormattingEditProvider.register(e,t)}function UY(e,t){return DZ.get(lb).linkProvider.register(e,t)}function $Y(e,t){return DZ.get(lb).completionProvider.register(e,t)}function KY(e,t){return DZ.get(lb).colorProvider.register(e,t)}function qY(e,t){return DZ.get(lb).foldingRangeProvider.register(e,t)}function GY(e,t){return DZ.get(lb).declarationProvider.register(e,t)}function ZY(e,t){return DZ.get(lb).selectionRangeProvider.register(e,t)}function YY(e,t){return DZ.get(lb).documentSemanticTokensProvider.register(e,t)}function XY(e,t){return DZ.get(lb).documentRangeSemanticTokensProvider.register(e,t)}function QY(e,t){return DZ.get(lb).inlineCompletionsProvider.register(e,t)}function JY(e,t){return DZ.get(lb).inlayHintsProvider.register(e,t)}const eX=s_("IEditorCancelService"),tX=new Ly("cancellableOperation",!1,$m(0,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));dv(eX,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext((e=>({key:tX.bindTo(e.get(Dy)),tokens:new Hs}))),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},!0);class iX extends as{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext((t=>t.get(eX).add(e,this)))}dispose(){this._unregister(),super.dispose()}}dS(new class extends sS{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:tX})}runEditorCommand(e,t){e.get(eX).cancel(t)}});class nX{constructor(e,t){if(this.flags=t,0!=(1&this.flags)){const t=e.getModel();this.modelVersionId=t?Oa("{0}#{1}",t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;0!=(4&this.flags)?this.position=e.getPosition():this.position=null,0!=(2&this.flags)?this.selection=e.getSelection():this.selection=null,0!=(8&this.flags)?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof nX))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 nX(e,this.flags))}}class oX extends iX{constructor(e,t,i,n){super(e,n),this._listener=new Cs,4&t&&this._listener.add(e.onDidChangeCursorPosition((e=>{i&&qo.containsPosition(i,e.position)||this.cancel()}))),2&t&&this._listener.add(e.onDidChangeCursorSelection((e=>{i&&qo.containsRange(i,e.selection)||this.cancel()}))),8&t&&this._listener.add(e.onDidScrollChange((e=>this.cancel()))),1&t&&(this._listener.add(e.onDidChangeModel((e=>this.cancel()))),this._listener.add(e.onDidChangeModelContent((e=>this.cancel()))))}dispose(){this._listener.dispose(),super.dispose()}}class sX extends as{constructor(e,t){super(t),this._listener=e.onDidChangeContent((()=>this.cancel()))}dispose(){this._listener.dispose(),super.dispose()}}function rX(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===h_.ICodeEditor}function aX(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===h_.IDiffEditor}function lX(e){return rX(e)?e:aX(e)?e.getModifiedEditor():null}class dX{static _handleEolEdits(e,t){let i,n=[];for(let o of t)"number"==typeof o.eol&&(i=o.eol),o.range&&"string"==typeof o.text&&n.push(o);return"number"==typeof i&&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=dX._handleEolEdits(e,t);1===n.length&&dX._isFullModelReplaceEdit(e,n[0])?e.executeEdits("formatEditsCommand",n.map((e=>oW.replace(qo.lift(e.range),e.text)))):e.executeEdits("formatEditsCommand",n.map((e=>oW.replaceMove(qo.lift(e.range),e.text)))),i&&e.pushUndoStop()}}class hX{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}var cX,uX=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function gX(e){if(!(e=e.filter((e=>e.range))).length)return;let{range:t}=e[0];for(let o=1;oa.provideDocumentRangeFormattingEdits(e,e.getFullModelRange(),t,i)})}return n}class mX{static setFormatterSelector(e){return{dispose:mX._selectors.unshift(e)}}static select(e,t,i){return uX(this,void 0,void 0,(function*(){if(0===e.length)return;const n=zs.first(mX._selectors);return n?yield n(e,t,i):void 0}))}}function fX(e,t,i,n,o,s){return uX(this,void 0,void 0,(function*(){const r=e.get(n_),{documentRangeFormattingEditProvider:a}=e.get(lb),l=rX(t)?t.getModel():t,d=a.ordered(l),h=yield mX.select(d,l,n);h&&(o.report(h),yield r.invokeFunction(_X,h,t,i,s))}))}function _X(e,t,i,n,o){return uX(this,void 0,void 0,(function*(){const s=e.get(kB);let r,a;rX(i)?(r=i.getModel(),a=new oX(i,5,void 0,o)):(r=i,a=new sX(i,o));let l=[],d=0;for(let e of Ml(n).sort(qo.compareRangesUsingStarts))d>0&&qo.areIntersectingOrTouching(l[d-1],e)?l[d-1]=qo.fromPositions(l[d-1].getStartPosition(),e.getEndPosition()):d=l.push(e);const h=e=>uX(this,void 0,void 0,(function*(){return(yield t.provideDocumentRangeFormattingEdits(r,e,r.getFormattingOptions(),a.token))||[]})),c=(e,t)=>{if(!e.length||!t.length)return!1;const i=e.reduce(((e,t)=>qo.plusRange(e,t.range)),e[0].range);if(!t.some((e=>qo.intersectRanges(i,e.range))))return!1;for(let n of e)for(let e of t)if(qo.intersectRanges(n.range,e.range))return!0;return!1},u=[],g=[];try{for(let e of l){if(a.token.isCancellationRequested)return!0;g.push(yield h(e))}for(let e=0;e({text:e.text,range:qo.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(qo.areIntersectingOrTouching(i,t))return[new ar(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return!0}))}function vX(e,t,i,n,o){return uX(this,void 0,void 0,(function*(){const s=e.get(n_),r=e.get(lb),a=rX(t)?t.getModel():t,l=pX(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),d=yield mX.select(l,a,i);d&&(n.report(d),yield s.invokeFunction(bX,d,t,i,o))}))}function bX(e,t,i,n,o){return uX(this,void 0,void 0,(function*(){const s=e.get(kB);let r,a,l;rX(i)?(r=i.getModel(),a=new oX(i,5,void 0,o)):(r=i,a=new sX(i,o));try{const e=yield t.provideDocumentFormattingEdits(r,r.getFormattingOptions(),a.token);if(l=yield s.computeMoreMinimalEdits(r.uri,e),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||0===l.length)return!1;if(rX(i))dX.execute(i,l,2!==n),2!==n&&(gX(l),i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1));else{const[{range:e}]=l,t=new ar(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);r.pushEditOperations([t],l.map((e=>({text:e.text,range:qo.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(qo.areIntersectingOrTouching(i,t))return[new ar(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return!0}))}function CX(e,t,i,n,o,s,r){const a=t.onTypeFormattingEditProvider.ordered(i);return 0===a.length||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(i,n,o,s,r)).catch(Ta).then((t=>e.computeMoreMinimalEdits(i.uri,t)))}mX._selectors=new Hs,ny.registerCommand("_executeFormatRangeProvider",(function(e,...t){return uX(this,void 0,void 0,(function*(){const[i,n,o]=t;Js(Ps.isUri(i)),Js(qo.isIRange(n));const s=e.get(Zw),r=e.get(kB),a=e.get(lb),l=yield s.createModelReference(i);try{return function(e,t,i,n,o,s){return uX(this,void 0,void 0,(function*(){const r=t.documentRangeFormattingEditProvider.ordered(i);for(const t of r){let r=yield Promise.resolve(t.provideDocumentRangeFormattingEdits(i,n,o,s)).catch(Ta);if(gs(r))return yield e.computeMoreMinimalEdits(i.uri,r)}}))}(r,a,l.object.textEditorModel,qo.lift(n),o,Ia.None)}finally{l.dispose()}}))})),ny.registerCommand("_executeFormatDocumentProvider",(function(e,...t){return uX(this,void 0,void 0,(function*(){const[i,n]=t;Js(Ps.isUri(i));const o=e.get(Zw),s=e.get(kB),r=e.get(lb),a=yield o.createModelReference(i);try{return function(e,t,i,n,o){return uX(this,void 0,void 0,(function*(){const s=pX(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i);for(const t of s){let s=yield Promise.resolve(t.provideDocumentFormattingEdits(i,n,o)).catch(Ta);if(gs(s))return yield e.computeMoreMinimalEdits(i.uri,s)}}))}(s,r,a.object.textEditorModel,n,Ia.None)}finally{a.dispose()}}))})),ny.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){return uX(this,void 0,void 0,(function*(){const[i,n,o,s]=t;Js(Ps.isUri(i)),Js(er.isIPosition(n)),Js("string"==typeof o);const r=e.get(Zw),a=e.get(kB),l=e.get(lb),d=yield r.createModelReference(i);try{return CX(a,l,d.object.textEditorModel,er.lift(n),o,s,Ia.None)}finally{d.dispose()}}))})),Ef.wrappingIndent.defaultValue=0,Ef.glyphMargin.defaultValue=!1,Ef.autoIndent.defaultValue=3,Ef.overviewRulerLanes.defaultValue=2,mX.setFormatterSelector(((e,t,i)=>Promise.resolve(e[0])));const wX=Ol();wX.editor={create:BZ,onDidCreateEditor:VZ,createDiffEditor:WZ,createDiffNavigator:HZ,createModel:zZ,setModelLanguage:jZ,setModelMarkers:UZ,getModelMarkers:$Z,onDidChangeMarkers:KZ,getModels:GZ,getModel:qZ,onDidCreateModel:ZZ,onWillDisposeModel:YZ,onDidChangeModelLanguage:XZ,createWebWorker:QZ,colorizeElement:JZ,colorize:eY,colorizeModelLine:tY,tokenize:iY,defineTheme:nY,setTheme:oY,remeasureFonts:sY,registerCommand:rY,AccessibilitySupport:Qa,ContentWidgetPositionPreference:Ja,CursorChangeReason:el,DefaultEndOfLine:tl,EditorAutoIndentStrategy:il,EditorOption:nl,EndOfLinePreference:ol,EndOfLineSequence:sl,MinimapPosition:rl,MouseTargetType:al,OverlayWidgetPositionPreference:ll,OverviewRulerLane:dl,RenderLineNumbersType:hl,RenderMinimap:cl,ScrollbarVisibility:ul,ScrollType:gl,TextEditorCursorBlinkingStyle:pl,TextEditorCursorStyle:ml,TrackedRangeStickiness:fl,WrappingIndent:_l,InjectedTextCursorStops:vl,PositionAffinity:bl,ConfigurationChangedEvent:qm,BareFontInfo:Xf,FontInfo:Qf,TextModelResolvedOptions:ea,FindMatch:Zr,ApplyUpdateResult:Ym,EditorType:h_,EditorOptions:Ef},wX.languages={register:fY,getLanguages:_Y,onLanguage:bY,getEncodedLanguageId:vY,setLanguageConfiguration:CY,setColorMap:xY,registerTokensProviderFactory:LY,setTokensProvider:DY,setMonarchTokensProvider:EY,registerReferenceProvider:NY,registerRenameProvider:IY,registerCompletionItemProvider:$Y,registerSignatureHelpProvider:TY,registerHoverProvider:MY,registerDocumentSymbolProvider:OY,registerDocumentHighlightProvider:AY,registerLinkedEditingRangeProvider:RY,registerDefinitionProvider:PY,registerImplementationProvider:FY,registerTypeDefinitionProvider:BY,registerCodeLensProvider:VY,registerCodeActionProvider:WY,registerDocumentFormattingEditProvider:HY,registerDocumentRangeFormattingEditProvider:zY,registerOnTypeFormattingEditProvider:jY,registerLinkProvider:UY,registerColorProvider:KY,registerFoldingRangeProvider:qY,registerDeclarationProvider:GY,registerSelectionRangeProvider:ZY,registerDocumentSemanticTokensProvider:YY,registerDocumentRangeSemanticTokensProvider:XY,registerInlineCompletionsProvider:QY,registerInlayHintsProvider:JY,DocumentHighlightKind:Cl,CompletionItemKind:wl,CompletionItemTag:yl,CompletionItemInsertTextRule:Sl,SymbolKind:xl,SymbolTag:kl,IndentAction:Ll,CompletionTriggerKind:Dl,SignatureHelpTriggerKind:El,InlayHintKind:Nl,InlineCompletionTriggerKind:Il,FoldingRangeKind:Tl};const yX=wX.CancellationTokenSource,SX=wX.Emitter,xX=wX.KeyCode,kX=wX.KeyMod,LX=wX.Position,DX=wX.Range,EX=wX.Selection,NX=wX.SelectionDirection,IX=wX.MarkerSeverity,TX=wX.MarkerTag,MX=wX.Uri,OX=wX.Token,AX=wX.editor,RX=wX.languages;((null===(cX=us.MonacoEnvironment)||void 0===cX?void 0:cX.globalAPI)||"function"==typeof define&&define.amd)&&(self.monaco=wX),void 0!==self.require&&"function"==typeof self.require.config&&self.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"]});var PX=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",CancellationTokenSource:yX,Emitter:SX,KeyCode:xX,KeyMod:kX,Position:LX,Range:DX,Selection:EX,SelectionDirection:NX,MarkerSeverity:IX,MarkerTag:TX,Uri:MX,Token:OX,editor:AX,languages:RX}),FX=Object.defineProperty,BX=Object.getOwnPropertyDescriptor,VX=Object.getOwnPropertyNames,WX=Object.prototype.hasOwnProperty,HX={}; /*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/((e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of VX(t))WX.call(e,o)||!i&&"default"===o||FX(e,o,{get:()=>t[o],enumerable:!(n=BX(t,o))||n.enumerable})})(HX,PX);var zX={},jX={},UX=class{constructor(e){t(this,"_languageId"),t(this,"_loadingTriggered"),t(this,"_lazyLoadPromise"),t(this,"_lazyLoadPromiseResolve"),t(this,"_lazyLoadPromiseReject"),this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise(((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t}))}static getOrCreate(e){return jX[e]||(jX[e]=new UX(e)),jX[e]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,zX[this._languageId].loader().then((e=>this._lazyLoadPromiseResolve(e)),(e=>this._lazyLoadPromiseReject(e)))),this._lazyLoadPromise}};function $X(e){const t=e.id;zX[t]=e,HX.languages.register(e);const i=UX.getOrCreate(t);HX.languages.registerTokensProviderFactory(t,{create:async()=>(await i.load()).language}),HX.languages.onLanguage(t,(async()=>{const e=await i.load();HX.languages.setLanguageConfiguration(t,e.conf)}))}$X({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Po((()=>import("./abap.bfbdc491.js")),[])}),$X({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Po((()=>import("./apex.3a0bbd36.js")),[])}),$X({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Po((()=>import("./azcli.2a21dcc8.js")),[])}),$X({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Po((()=>import("./bat.cfc9382a.js")),[])}),$X({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Po((()=>import("./bicep.1efc561e.js")),[])}),$X({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Po((()=>import("./cameligo.94bd5dcf.js")),[])}),$X({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Po((()=>import("./clojure.8543305e.js")),[])}),$X({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Po((()=>import("./coffee.de0bee73.js")),[])}),$X({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Po((()=>import("./cpp.2c1314ec.js")),[])}),$X({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Po((()=>import("./cpp.2c1314ec.js")),[])}),$X({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Po((()=>import("./csharp.3ef4312c.js")),[])}),$X({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Po((()=>import("./csp.078b1205.js")),[])}),$X({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Po((()=>import("./css.28b1e2dc.js")),[])}),$X({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Po((()=>import("./dart.72c9207c.js")),[])}),$X({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Po((()=>import("./dockerfile.eea0f5a9.js")),[])}),$X({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Po((()=>import("./ecl.5e0f116e.js")),[])}),$X({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Po((()=>import("./elixir.0c870cc0.js")),[])}),$X({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Po((()=>import("./flow9.ddcaa44f.js")),[])}),$X({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Po((()=>import("./fsharp.637308b5.js")),[])}),$X({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Po((()=>import("./freemarker2.3d940f4d.js")),["assets/freemarker2.3d940f4d.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"]).then((e=>e.TagAutoInterpolationDollar))}),$X({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Po((()=>import("./freemarker2.3d940f4d.js")),["assets/freemarker2.3d940f4d.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"]).then((e=>e.TagAngleInterpolationDollar))}),$X({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Po((()=>import("./freemarker2.3d940f4d.js")),["assets/freemarker2.3d940f4d.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"]).then((e=>e.TagBracketInterpolationDollar))}),$X({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Po((()=>import("./freemarker2.3d940f4d.js")),["assets/freemarker2.3d940f4d.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"]).then((e=>e.TagAngleInterpolationBracket))}),$X({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Po((()=>import("./freemarker2.3d940f4d.js")),["assets/freemarker2.3d940f4d.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"]).then((e=>e.TagBracketInterpolationBracket))}),$X({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Po((()=>import("./freemarker2.3d940f4d.js")),["assets/freemarker2.3d940f4d.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"]).then((e=>e.TagAutoInterpolationDollar))}),$X({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Po((()=>import("./freemarker2.3d940f4d.js")),["assets/freemarker2.3d940f4d.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"]).then((e=>e.TagAutoInterpolationBracket))}),$X({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Po((()=>import("./go.a5321182.js")),[])}),$X({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Po((()=>import("./graphql.e74c3061.js")),[])}),$X({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Po((()=>import("./handlebars.d60239e4.js")),["assets/handlebars.d60239e4.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}),$X({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Po((()=>import("./hcl.980f5800.js")),[])}),$X({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Po((()=>import("./html.8733c5bd.js")),["assets/html.8733c5bd.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}),$X({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Po((()=>import("./ini.a565700d.js")),[])}),$X({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Po((()=>import("./java.b5b4e25c.js")),[])}),$X({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Po((()=>import("./javascript.f12ad6ac.js")),["assets/javascript.f12ad6ac.js","assets/typescript.d9c9e9c8.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}),$X({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Po((()=>import("./julia.4b9526f0.js")),[])}),$X({id:"kotlin",extensions:[".kt"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Po((()=>import("./kotlin.16b1631b.js")),[])}),$X({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Po((()=>import("./less.dfb20244.js")),[])}),$X({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Po((()=>import("./lexon.2174f6b1.js")),[])}),$X({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Po((()=>import("./lua.1b53f8d4.js")),[])}),$X({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Po((()=>import("./liquid.3556b947.js")),["assets/liquid.3556b947.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}),$X({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Po((()=>import("./m3.467f962e.js")),[])}),$X({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Po((()=>import("./markdown.559a7ab3.js")),[])}),$X({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Po((()=>import("./mips.d8754138.js")),[])}),$X({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Po((()=>import("./msdax.6f267d6f.js")),[])}),$X({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Po((()=>import("./mysql.af01dff1.js")),[])}),$X({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Po((()=>import("./objective-c.b75ffb36.js")),[])}),$X({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Po((()=>import("./pascal.44875784.js")),[])}),$X({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Po((()=>import("./pascaligo.0522f100.js")),[])}),$X({id:"perl",extensions:[".pl"],aliases:["Perl","pl"],loader:()=>Po((()=>import("./perl.a7f16129.js")),[])}),$X({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Po((()=>import("./pgsql.e49c480b.js")),[])}),$X({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Po((()=>import("./php.9456e17c.js")),[])}),$X({id:"pla",extensions:[".pla"],loader:()=>Po((()=>import("./pla.e446910d.js")),[])}),$X({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Po((()=>import("./postiats.51572fcb.js")),[])}),$X({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Po((()=>import("./powerquery.c06fb3d4.js")),[])}),$X({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Po((()=>import("./powershell.edac1ff2.js")),[])}),$X({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Po((()=>import("./protobuf.9ea19330.js")),[])}),$X({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Po((()=>import("./pug.9be1efca.js")),[])}),$X({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Po((()=>import("./python.ca55c43f.js")),["assets/python.ca55c43f.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}),$X({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Po((()=>import("./qsharp.e9c3e37c.js")),[])}),$X({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Po((()=>import("./r.000b11e3.js")),[])}),$X({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Po((()=>import("./razor.9fe8c487.js")),["assets/razor.9fe8c487.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}),$X({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Po((()=>import("./redis.fb351a5f.js")),[])}),$X({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Po((()=>import("./redshift.facc4811.js")),[])}),$X({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Po((()=>import("./restructuredtext.03b9c8d7.js")),[])}),$X({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Po((()=>import("./ruby.ac07c398.js")),[])}),$X({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Po((()=>import("./rust.7956447c.js")),[])}),$X({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Po((()=>import("./sb.64f7ffe9.js")),[])}),$X({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>Po((()=>import("./scala.ab6b2e4b.js")),[])}),$X({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Po((()=>import("./scheme.0a9f32af.js")),[])}),$X({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Po((()=>import("./scss.bb5a3a95.js")),[])}),$X({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Po((()=>import("./shell.11589447.js")),[])}),$X({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Po((()=>import("./solidity.731be3c2.js")),[])}),$X({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Po((()=>import("./sophia.96bd523a.js")),[])}),$X({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Po((()=>import("./sparql.f4d727b3.js")),[])}),$X({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Po((()=>import("./sql.ae52386d.js")),[])}),$X({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:()=>Po((()=>import("./st.b8efae94.js")),[])}),$X({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Po((()=>import("./swift.90f88698.js")),[])}),$X({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Po((()=>import("./systemverilog.95aaa20b.js")),[])}),$X({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Po((()=>import("./systemverilog.95aaa20b.js")),[])}),$X({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Po((()=>import("./tcl.66c7f2d0.js")),[])}),$X({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Po((()=>import("./twig.dc81619a.js")),[])}),$X({id:"typescript",extensions:[".ts",".tsx"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Po((()=>import("./typescript.d9c9e9c8.js")),["assets/typescript.d9c9e9c8.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}),$X({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Po((()=>import("./vb.e859ab61.js")),[])}),$X({id:"xml",extensions:[".xml",".dtd",".ascx",".csproj",".config",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Po((()=>import("./xml.a91646d8.js")),["assets/xml.a91646d8.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}),$X({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Po((()=>import("./yaml.3fb67a35.js")),[])}); /*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/ var KX=Object.defineProperty,qX=Object.getOwnPropertyDescriptor,GX=Object.getOwnPropertyNames,ZX=Object.prototype.hasOwnProperty,YX={};((e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of GX(t))ZX.call(e,o)||!i&&"default"===o||KX(e,o,{get:()=>t[o],enumerable:!(n=qX(t,o))||n.enumerable})})(YX,PX);var XX=class{constructor(e,i,n){t(this,"_onDidChange",new YX.Emitter),t(this,"_options"),t(this,"_modeConfiguration"),t(this,"_languageId"),this._languageId=e,this.setOptions(i),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},QX={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0}},JX={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},eQ=new XX("css",QX,JX),tQ=new XX("scss",QX,JX),iQ=new XX("less",QX,JX);function nQ(){return Po((()=>import("./cssMode.98579056.js")),["assets/cssMode.98579056.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}YX.languages.css={cssDefaults:eQ,lessDefaults:iQ,scssDefaults:tQ},YX.languages.onLanguage("less",(()=>{nQ().then((e=>e.setupMode(iQ)))})),YX.languages.onLanguage("scss",(()=>{nQ().then((e=>e.setupMode(tQ)))})),YX.languages.onLanguage("css",(()=>{nQ().then((e=>e.setupMode(eQ)))})); /*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/ var oQ=Object.defineProperty,sQ=Object.getOwnPropertyDescriptor,rQ=Object.getOwnPropertyNames,aQ=Object.prototype.hasOwnProperty,lQ={};((e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of rQ(t))aQ.call(e,o)||!i&&"default"===o||oQ(e,o,{get:()=>t[o],enumerable:!(n=sQ(t,o))||n.enumerable})})(lQ,PX);var dQ={format:{tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},suggest:{},data:{useDefaultDataProvider:!0}};function hQ(e){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:e===cQ,documentFormattingEdits:e===cQ,documentRangeFormattingEdits:e===cQ}}var cQ="html",uQ=vQ(cQ,dQ,hQ(cQ)),gQ=uQ.defaults,pQ=vQ("handlebars",dQ,hQ("handlebars")),mQ=pQ.defaults,fQ=vQ("razor",dQ,hQ("razor")),_Q=fQ.defaults;function vQ(e,i=dQ,n=hQ(e)){const o=new class{constructor(e,i,n){t(this,"_onDidChange",new lQ.Emitter),t(this,"_options"),t(this,"_modeConfiguration"),t(this,"_languageId"),this._languageId=e,this.setOptions(i),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}}(e,i,n);let s;const r=lQ.languages.onLanguage(e,(async()=>{s=(await Po((()=>import("./htmlMode.9b9c6e41.js")),["assets/htmlMode.9b9c6e41.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])).setupMode(o)}));return{defaults:o,dispose(){r.dispose(),null==s||s.dispose(),s=void 0}}} /*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/lQ.languages.html={htmlDefaults:gQ,razorDefaults:_Q,handlebarDefaults:mQ,htmlLanguageService:uQ,handlebarLanguageService:pQ,razorLanguageService:fQ,registerHTMLLanguageService:vQ};var bQ=Object.defineProperty,CQ=Object.getOwnPropertyDescriptor,wQ=Object.getOwnPropertyNames,yQ=Object.prototype.hasOwnProperty,SQ={};((e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of wQ(t))yQ.call(e,o)||!i&&"default"===o||bQ(e,o,{get:()=>t[o],enumerable:!(n=CQ(t,o))||n.enumerable})})(SQ,PX);var xQ=new class{constructor(e,i,n){t(this,"_onDidChange",new SQ.Emitter),t(this,"_diagnosticsOptions"),t(this,"_modeConfiguration"),t(this,"_languageId"),this._languageId=e,this.setDiagnosticsOptions(i),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}}("json",{validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},{documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0});SQ.languages.json={jsonDefaults:xQ},SQ.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]}),SQ.languages.onLanguage("json",(()=>{Po((()=>import("./jsonMode.00579f71.js")),["assets/jsonMode.00579f71.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"]).then((e=>e.setupMode(xQ)))})); /*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/ var kQ=Object.defineProperty,LQ=Object.getOwnPropertyDescriptor,DQ=Object.getOwnPropertyNames,EQ=Object.prototype.hasOwnProperty,NQ={};((e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of DQ(t))EQ.call(e,o)||!i&&"default"===o||kQ(e,o,{get:()=>t[o],enumerable:!(n=LQ(t,o))||n.enumerable})})(NQ,PX);var IQ=(e=>(e[e.None=0]="None",e[e.CommonJS=1]="CommonJS",e[e.AMD=2]="AMD",e[e.UMD=3]="UMD",e[e.System=4]="System",e[e.ES2015=5]="ES2015",e[e.ESNext=99]="ESNext",e))(IQ||{}),TQ=(e=>(e[e.None=0]="None",e[e.Preserve=1]="Preserve",e[e.React=2]="React",e[e.ReactNative=3]="ReactNative",e[e.ReactJSX=4]="ReactJSX",e[e.ReactJSXDev=5]="ReactJSXDev",e))(TQ||{}),MQ=(e=>(e[e.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",e[e.LineFeed=1]="LineFeed",e))(MQ||{}),OQ=(e=>(e[e.ES3=0]="ES3",e[e.ES5=1]="ES5",e[e.ES2015=2]="ES2015",e[e.ES2016=3]="ES2016",e[e.ES2017=4]="ES2017",e[e.ES2018=5]="ES2018",e[e.ES2019=6]="ES2019",e[e.ES2020=7]="ES2020",e[e.ESNext=99]="ESNext",e[e.JSON=100]="JSON",e[e.Latest=99]="Latest",e))(OQ||{}),AQ=(e=>(e[e.Classic=1]="Classic",e[e.NodeJs=2]="NodeJs",e))(AQ||{}),RQ=class{constructor(e,i,n,o){t(this,"_onDidChange",new NQ.Emitter),t(this,"_onDidExtraLibsChange",new NQ.Emitter),t(this,"_extraLibs"),t(this,"_removedExtraLibs"),t(this,"_eagerModelSync"),t(this,"_compilerOptions"),t(this,"_diagnosticsOptions"),t(this,"_workerOptions"),t(this,"_onDidExtraLibsChangeTimeout"),t(this,"_inlayHintsOptions"),this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(i),this.setWorkerOptions(n),this.setInlayHintsOptions(o),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(e,t){let i;if(i=void 0===t?`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t,this._extraLibs[i]&&this._extraLibs[i].content===e)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[i]&&(n=this._removedExtraLibs[i]+1),this._extraLibs[i]&&(n=this._extraLibs[i].version+1),this._extraLibs[i]={content:e,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let e=this._extraLibs[i];e&&e.version===n&&(delete this._extraLibs[i],this._removedExtraLibs[i]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(e){for(const t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),e&&e.length>0)for(const t of e){const e=t.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=t.content;let n=1;this._removedExtraLibs[e]&&(n=this._removedExtraLibs[e]+1),this._extraLibs[e]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){-1===this._onDidExtraLibsChangeTimeout&&(this._onDidExtraLibsChangeTimeout=window.setTimeout((()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)}),0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(e){this._compilerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(e){this._workerOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(e){this._inlayHintsOptions=e||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(e){}setEagerModelSync(e){this._eagerModelSync=e}getEagerModelSync(){return this._eagerModelSync}},PQ=new RQ({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{}),FQ=new RQ({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{});function BQ(){return Po((()=>import("./tsMode.ed62e547.js")),["assets/tsMode.ed62e547.js","assets/useVisualData.9b99c843.js","assets/useVisualData.0f5706e5.css","assets/preload-helper.fde915ab.js","assets/preload-helper.5407db1b.css","assets/index.7b4f7ca9.js","assets/index.59ee6ec9.css","assets/editorWorker.944419af.js","assets/plugin-vue_export-helper.21dcd24c.js","assets/useAnimate.644289ba.js"])}NQ.languages.typescript={ModuleKind:IQ,JsxEmit:TQ,NewLineKind:MQ,ScriptTarget:OQ,ModuleResolutionKind:AQ,typescriptVersion:"4.5.5",typescriptDefaults:PQ,javascriptDefaults:FQ,getTypeScriptWorker:()=>BQ().then((e=>e.getTypeScriptWorker())),getJavaScriptWorker:()=>BQ().then((e=>e.getJavaScriptWorker()))},NQ.languages.onLanguage("typescript",(()=>BQ().then((e=>e.setupTypeScript(PQ))))),NQ.languages.onLanguage("javascript",(()=>BQ().then((e=>e.setupJavaScript(FQ)))));var VQ=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},WQ=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},HQ=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const zQ=new Ly("selectionAnchorSet",!1);let jQ=class e{constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=zQ.bindTo(t),this.modelChangeListener=e.onDidChangeModel((()=>this.selectionAnchorSetContextKey.reset()))}static get(t){return t.getContribution(e.ID)}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition(),t=this.decorationId?[this.decorationId]:[],i=this.editor.deltaDecorations(t,[{range:ar.fromPositions(e,e),options:{description:"selection-anchor",stickiness:1,hoverMessage:(new CU).appendText($m(0,"Selection Anchor")),className:"selection-anchor"}}]);this.decorationId=i[0],this.selectionAnchorSetContextKey.set(!!this.decorationId),$w($m(0,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(ar.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){this.decorationId&&(this.editor.deltaDecorations([this.decorationId],[]),this.decorationId=void 0,this.selectionAnchorSetContextKey.set(!1))}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};jQ.ID="editor.contrib.selectionAnchorController",jQ=VQ([WQ(1,Dy)],jQ);gS(jQ.ID,jQ),hS(class extends rS{constructor(){super({id:"editor.action.setSelectionAnchor",label:$m(0,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:dI.editorTextFocus,primary:Al(2089,2080),weight:100}})}run(e,t){var i;return HQ(this,void 0,void 0,(function*(){null===(i=jQ.get(t))||void 0===i||i.setSelectionAnchor()}))}}),hS(class extends rS{constructor(){super({id:"editor.action.goToSelectionAnchor",label:$m(0,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:zQ})}run(e,t){var i;return HQ(this,void 0,void 0,(function*(){null===(i=jQ.get(t))||void 0===i||i.goToSelectionAnchor()}))}}),hS(class extends rS{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:$m(0,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:zQ,kbOpts:{kbExpr:dI.editorTextFocus,primary:Al(2089,2089),weight:100}})}run(e,t){var i;return HQ(this,void 0,void 0,(function*(){null===(i=jQ.get(t))||void 0===i||i.selectFromAnchorToCursor()}))}}),hS(class extends rS{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:$m(0,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:zQ,kbOpts:{kbExpr:dI.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return HQ(this,void 0,void 0,(function*(){null===(i=jQ.get(t))||void 0===i||i.cancelSelectionAnchor()}))}});const UQ=ox("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hc:"#A0A0A0"},$m(0,"Overview ruler marker color for matching brackets."));class $Q{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class KQ extends Uo{constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=[],this._updateBracketsSoon=this._register(new Hv((()=>this._updateBrackets()),50)),this._matchBrackets=this._editor.getOption(64),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition((e=>{"never"!==this._matchBrackets&&this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelContent((e=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModel((e=>{this._lastBracketsData=[],this._decorations=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelLanguageConfiguration((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(64)&&(this._matchBrackets=this._editor.getOption(64),this._decorations=this._editor.deltaDecorations(this._decorations,[]),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())}))),this._register(e.onDidBlurEditorWidget((()=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidFocusEditorWidget((()=>{this._updateBracketsSoon.schedule()})))}static get(e){return e.getContribution(KQ.ID)}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map((t=>{const i=t.getStartPosition(),n=e.bracketPairs.matchBracket(i);let o=null;if(n)n[0].containsPosition(i)?o=n[1].getStartPosition():n[1].containsPosition(i)&&(o=n[0].getStartPosition());else{const t=e.bracketPairs.findEnclosingBrackets(i);if(t)o=t[0].getStartPosition();else{const t=e.bracketPairs.findNextBracket(i);t&&t.range&&(o=t.range.getStartPosition())}}return o?new ar(o.lineNumber,o.column,o.lineNumber,o.column):new ar(i.lineNumber,i.column,i.lineNumber,i.column)}));this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach((n=>{const o=n.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const e=t.bracketPairs.findNextBracket(o);e&&e.range&&(s=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let r=null,a=null;if(s){s.sort(qo.compareRangesUsingStarts);const[t,i]=s;if(r=e?t.getStartPosition():t.getEndPosition(),a=e?i.getEndPosition():i.getStartPosition(),i.containsPosition(o)){const e=r;r=a,a=e}}r&&a&&i.push(new ar(r.lineNumber,r.column,a.lineNumber,a.column))})),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}_updateBrackets(){if("never"===this._matchBrackets)return;this._recomputeBrackets();let e=[],t=0;for(const i of this._lastBracketsData){let n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations=this._editor.deltaDecorations(this._decorations,e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return this._lastBracketsData=[],void(this._lastVersionId=0);const e=this._editor.getSelections();if(e.length>100)return this._lastBracketsData=[],void(this._lastVersionId=0);const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);let o=[],s=0;for(let h=0,c=e.length;h1&&o.sort(er.compare);let r=[],a=0,l=0,d=n.length;for(let h=0,c=o.length;h{const i=e.getColor(zE);i&&t.addRule(`.monaco-editor .bracket-match { background-color: ${i}; }`);const n=e.getColor(jE);n&&t.addRule(`.monaco-editor .bracket-match { border: 1px solid ${n}; }`)})),Zy.appendMenuItem(qy.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:$m(0,"Go to &&Bracket")},order:2});class qQ{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,o=this._selection.endColumn;if((!this._isMovingLeft||1!==n)&&(this._isMovingLeft||o!==e.getLineMaxColumn(i)))if(this._isMovingLeft){const s=new qo(i,n-1,i,n),r=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new qo(i,o,i,o),r)}else{const s=new qo(i,o,i,o+1),r=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new qo(i,n,i,n),r)}}computeCursorState(e,t){return this._isMovingLeft?new ar(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ar(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class GQ extends rS{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const o of n)i.push(new qQ(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}hS(class extends GQ{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:$m(0,"Move Selected Text Left"),alias:"Move Selected Text Left",precondition:dI.writable})}}),hS(class extends GQ{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:$m(0,"Move Selected Text Right"),alias:"Move Selected Text Right",precondition:dI.writable})}});hS(class extends rS{constructor(){super({id:"editor.action.transposeLetters",label:$m(0,"Transpose Letters"),alias:"Transpose Letters",precondition:dI.writable,kbOpts:{kbExpr:dI.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let i=t.getModel(),n=[],o=t.getSelections();for(let s of o){if(!s.isEmpty())continue;let e=s.startLineNumber,t=s.startColumn,o=i.getLineMaxColumn(e);if(1===e&&(1===t||2===t&&2===o))continue;let r=t===o?s.getPosition():$N.rightPosition(i,s.getPosition().lineNumber,s.getPosition().column),a=$N.leftPosition(i,r),l=$N.leftPosition(i,a),d=i.getValueInRange(qo.fromPositions(l,a)),h=i.getValueInRange(qo.fromPositions(a,r)),c=qo.fromPositions(l,r);n.push(new VN(c,h+d))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}});var ZQ=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const YQ=Ts||document.queryCommandSupported("cut"),XQ=Ts||document.queryCommandSupported("copy"),QQ=void 0!==navigator.clipboard&&!Rf||document.queryCommandSupported("paste");function JQ(e){return e.register(),e}const eJ=YQ?JQ(new nS({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Ts?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:qy.MenubarEditMenu,group:"2_ccp",title:$m(0,"Cu&&t"),order:1},{menuId:qy.EditorContext,group:"9_cutcopypaste",title:$m(0,"Cut"),when:dI.writable,order:1},{menuId:qy.CommandPalette,group:"",title:$m(0,"Cut"),order:1},{menuId:qy.SimpleEditorContext,group:"9_cutcopypaste",title:$m(0,"Cut"),when:dI.writable,order:1}]})):void 0,tJ=XQ?JQ(new nS({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Ts?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:qy.MenubarEditMenu,group:"2_ccp",title:$m(0,"&&Copy"),order:2},{menuId:qy.EditorContext,group:"9_cutcopypaste",title:$m(0,"Copy"),order:2},{menuId:qy.CommandPalette,group:"",title:$m(0,"Copy"),order:1},{menuId:qy.SimpleEditorContext,group:"9_cutcopypaste",title:$m(0,"Copy"),order:2}]})):void 0;Zy.appendMenuItem(qy.MenubarEditMenu,{submenu:qy.MenubarCopy,title:{value:$m(0,"Copy As"),original:"Copy As"},group:"2_ccp",order:3}),Zy.appendMenuItem(qy.EditorContext,{submenu:qy.EditorContextCopy,title:{value:$m(0,"Copy As"),original:"Copy As"},group:"9_cutcopypaste",order:3});const iJ=QQ?JQ(new nS({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Ts?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:qy.MenubarEditMenu,group:"2_ccp",title:$m(0,"&&Paste"),order:4},{menuId:qy.EditorContext,group:"9_cutcopypaste",title:$m(0,"Paste"),when:dI.writable,order:4},{menuId:qy.CommandPalette,group:"",title:$m(0,"Paste"),order:1},{menuId:qy.SimpleEditorContext,group:"9_cutcopypaste",title:$m(0,"Paste"),when:dI.writable,order:4}]})):void 0;class nJ extends rS{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:$m(0,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:dI.textInputFocus,primary:0,weight:100}})}run(e,t){if(!t.hasModel())return;!t.getOption(32)&&t.getSelection().isEmpty()||(_E.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),_E.forceCopyWithSyntaxHighlighting=!1)}}function oJ(e,t){e&&(e.addImplementation(1e4,"code-editor",((e,i)=>{const n=e.get(r_).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const e=n.getOption(32),i=n.getSelection();return i&&i.isEmpty()&&!e||document.execCommand(t),!0}return!1})),e.addImplementation(0,"generic-dom",((e,i)=>(document.execCommand(t),!0))))}oJ(eJ,"cut"),oJ(tJ,"copy"),iJ&&(iJ.addImplementation(1e4,"code-editor",((e,t)=>{const i=e.get(r_),n=e.get(IB),o=i.getFocusedCodeEditor();if(o&&o.hasTextFocus()){return!(!document.execCommand("paste")&&Fs)||ZQ(void 0,void 0,void 0,(function*(){const e=yield n.readText();if(""!==e){const t=vE.INSTANCE.get(e);let i=!1,n=null,s=null;t&&(i=o.getOption(32)&&!!t.isFromEmptySelection,n=void 0!==t.multicursorText?t.multicursorText:null,s=t.mode),o.trigger("keyboard","paste",{text:e,pasteOnNewLine:i,multicursorText:n,mode:s})}}))}return!1})),iJ.addImplementation(0,"generic-dom",((e,t)=>(document.execCommand("paste"),!0)))),XQ&&hS(nJ);class sJ{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||e.value.startsWith(this.value+sJ.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new sJ(this.value+sJ.sep+e)}}function rJ(e,t,i){return!!t.contains(e)&&(!i||!t.contains(i))}sJ.sep=".",sJ.None=new sJ("@@none@@"),sJ.Empty=new sJ(""),sJ.QuickFix=new sJ("quickfix"),sJ.Refactor=new sJ("refactor"),sJ.Source=new sJ("source"),sJ.SourceOrganizeImports=sJ.Source.append("organizeImports"),sJ.SourceFixAll=sJ.Source.append("fixAll");class aJ{constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}static fromUser(e,t){return e&&"object"==typeof e?new aJ(aJ.getKindFromUser(e,t.kind),aJ.getApplyFromUser(e,t.apply),aJ.getPreferredUser(e)):new aJ(t.kind,t.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new sJ(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}}var lJ=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class dJ{constructor(e,t){this.action=e,this.provider=t}resolve(e){var t;return lJ(this,void 0,void 0,(function*(){if((null===(t=this.provider)||void 0===t?void 0:t.resolveCodeAction)&&!this.action.edit){let t;try{t=yield this.provider.resolveCodeAction(this.action,e)}catch(i){Ta(i)}t&&(this.action.edit=t.edit)}return this}))}}class hJ extends Uo{constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(hJ.codeActionsComparator),this.validActions=this.allActions.filter((({action:e})=>!e.disabled))}static codeActionsComparator({action:e},{action:t}){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:gs(e.diagnostics)?gs(t.diagnostics)?e.diagnostics[0].message.localeCompare(t.diagnostics[0].message):-1:gs(t.diagnostics)?1:0}get hasAutoFix(){return this.validActions.some((({action:e})=>!!e.kind&&sJ.QuickFix.contains(new sJ(e.kind))&&!!e.isPreferred))}}const cJ={actions:[],documentation:void 0};function uJ(e,t,i,n,o,s){var r;const a=n.filter||{},l={only:null===(r=a.include)||void 0===r?void 0:r.value,trigger:n.type},d=new sX(t,s),h=function(e,t,i){return e.all(t).filter((e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some((e=>function(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some((i=>rJ(t,i,e.include)))||!e.includeSourceActions&&sJ.Source.contains(t))}(i,new sJ(e))))))}(e,t,a),c=new Cs,u=h.map((e=>lJ(this,void 0,void 0,(function*(){try{o.report(e);const n=yield e.provideCodeActions(t,i,l,d.token);if(n&&c.add(n),d.token.isCancellationRequested)return cJ;const s=((null==n?void 0:n.actions)||[]).filter((e=>e&&function(e,t){const i=t.kind?new sJ(t.kind):void 0;return!(!(!e.include||i&&e.include.contains(i))||e.excludes&&i&&e.excludes.some((t=>rJ(i,t,e.include)))||!e.includeSourceActions&&i&&sJ.Source.contains(i)||e.onlyIncludePreferredActions&&!t.isPreferred)}(a,e))),r=function(e,t,i){if(!e.documentation)return;const n=e.documentation.map((e=>({kind:new sJ(e.kind),command:e.command})));if(i){let e;for(const t of n)t.kind.contains(i)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return null==e?void 0:e.command}for(const o of t)if(o.kind)for(const e of n)if(e.kind.contains(new sJ(o.kind)))return e.command;return}(e,s,a.include);return{actions:s.map((t=>new dJ(t,e))),documentation:r}}catch(n){if(Na(n))throw n;return Ta(n),cJ}})))),g=e.onDidChange((()=>{const i=e.all(t);jo(i,h)||d.cancel()}));return Promise.all(u).then((e=>{const t=ba(e.map((e=>e.actions))),i=xa(e.map((e=>e.documentation)));return new hJ(t,i,c)})).finally((()=>{g.dispose(),d.dispose()}))}ny.registerCommand("_executeCodeActionProvider",(function(e,t,i,n,o){return lJ(this,void 0,void 0,(function*(){if(!(t instanceof Ps))throw Ms();const{codeActionProvider:s}=e.get(lb),r=e.get(Dv).getModel(t);if(!r)throw Ms();const a=ar.isISelection(i)?ar.liftSelection(i):qo.isIRange(i)?r.validateRange(i):void 0;if(!a)throw Ms();const l="string"==typeof n?new sJ(n):void 0,d=yield uJ(s,r,a,{type:1,filter:{includeSourceActions:!0,include:l}},TB.None,Ia.None),h=[],c=Math.min(d.validActions.length,"number"==typeof o?o:0);for(let e=0;ee.action))}finally{setTimeout((()=>d.dispose()),100)}}))}));var gJ=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},pJ=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let mJ=class e{constructor(t,i){this._messageWidget=new Rr,this._messageListeners=new Cs,this._editor=t,this._visible=e.MESSAGE_VISIBLE.bindTo(i),this._editorListener=this._editor.onDidAttemptReadOnlyEdit((()=>this._onDidAttemptReadOnlyEdit()))}static get(t){return t.getContribution(e.ID)}dispose(){this._editorListener.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){let i;$w(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new fJ(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidChangeCursorPosition((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidDispose((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidChangeModel((()=>this.closeMessage()))),this._messageListeners.add(new Vv((()=>this.closeMessage()),3e3)),this._messageListeners.add(this._editor.onMouseMove((e=>{e.target.position&&(i?i.containsPosition(e.target.position)||this.closeMessage():i=new qo(t.lineNumber-3,1,e.target.position.lineNumber+3,1))})))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(fJ.fadeOut(this._messageWidget.value))}_onDidAttemptReadOnlyEdit(){this._editor.hasModel()&&this.showMessage($m(0,"Cannot edit in read-only editor"),this._editor.getPosition())}};mJ.ID="editor.contrib.messageController",mJ.MESSAGE_VISIBLE=new Ly("messageVisible",!1,$m(0,"Whether the editor is currently showing an inline message")),mJ=gJ([pJ(1,Dy)],mJ);dS(new(sS.bindToContribution(mJ.get))({id:"leaveEditorMessage",precondition:mJ.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));class fJ{constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i-1},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage");const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");s.classList.add("message"),s.textContent=n,this._domNode.appendChild(s);const r=document.createElement("div");r.classList.add("anchor","below"),this._domNode.appendChild(r),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}static fadeOut(e){let t;const i=()=>{e.dispose(),clearTimeout(t),e.getDomNode().removeEventListener("animationend",i)};return t=setTimeout(i,110),e.getDomNode().addEventListener("animationend",i),e.getDomNode().classList.add("fadeOut"),{dispose:i}}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2]}}afterRender(e){this._domNode.classList.toggle("below",2===e)}}gS(mJ.ID,mJ);var _J=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},vJ=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},bJ=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class CJ extends Xw{constructor(e,t){super(e.command?e.command.id:e.title,e.title.replace(/\r\n|\r|\n/g," "),void 0,!e.disabled,t),this.action=e}}let wJ=class extends Uo{constructor(e,t,i,n,o){super(),this._editor=e,this._delegate=t,this._contextMenuService=i,this._languageFeaturesService=o,this._visible=!1,this._showingActions=this._register(new Rr),this._keybindingResolver=new yJ({getKeybindings:()=>n.getKeybindings()})}get isVisible(){return this._visible}show(e,t,i,n){return bJ(this,void 0,void 0,(function*(){const o=n.includeDisabledActions?t.allActions:t.validActions;if(!o.length)return void(this._visible=!1);if(!this._editor.getDomNode())throw this._visible=!1,_s();this._visible=!0,this._showingActions.value=t;const s=this.getMenuActions(e,o,t.documentation),r=er.isIPosition(i)?this._toCoords(i):i||{x:0,y:0},a=this._keybindingResolver.getResolver(),l=this._editor.getOption(115);this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>s,onHide:()=>{this._visible=!1,this._editor.focus()},autoSelectFirstItem:!0,getKeyBinding:e=>e instanceof CJ?a(e.action):void 0})}))}getMenuActions(e,t,i){var n,o;const s=e=>new CJ(e.action,(()=>this._delegate.onSelectCodeAction(e))),r=t.map(s),a=[...i],l=this._editor.getModel();if(l&&r.length)for(const d of this._languageFeaturesService.codeActionProvider.all(l))d._getAdditionalMenuItems&&a.push(...d._getAdditionalMenuItems({trigger:e.type,only:null===(o=null===(n=e.filter)||void 0===n?void 0:n.include)||void 0===o?void 0:o.value},t.map((e=>e.action))));return a.length&&r.push(new Jw,...a.map((e=>s(new dJ({title:e.title,command:e},void 0))))),r}_toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=nw(this._editor.getDomNode());return{x:i.left+t.left,y:i.top+t.top+t.height}}};wJ=_J([vJ(2,DB),vJ(3,uW),vJ(4,lb)],wJ);class yJ{constructor(e){this._keybindingProvider=e}getResolver(){const e=new Rl((()=>this._keybindingProvider.getKeybindings().filter((e=>yJ.codeActionCommands.indexOf(e.command)>=0)).filter((e=>e.resolvedKeybinding)).map((e=>{let t=e.commandArgs;return"editor.action.organizeImports"===e.command?t={kind:sJ.SourceOrganizeImports.value}:"editor.action.fixAll"===e.command&&(t={kind:sJ.SourceFixAll.value}),Object.assign({resolvedKeybinding:e.resolvedKeybinding},aJ.fromUser(t,{kind:sJ.None,apply:"never"}))}))));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.getValue());return null==i?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new sJ(e.kind);return t.filter((e=>e.kind.contains(i))).filter((t=>!t.preferred||e.isPreferred)).reduceRight(((e,t)=>e?e.kind.contains(t.kind)?t:e:t),void 0)}}yJ.codeActionCommands=["editor.action.refactor","editor.action.codeAction","editor.action.sourceAction","editor.action.organizeImports","editor.action.fixAll"];var SJ,xJ=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},kJ=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.Hidden={type:0};e.Showing=class{constructor(e,t,i,n){this.actions=e,this.trigger=t,this.editorPosition=i,this.widgetPosition=n,this.type=1}}}(SJ||(SJ={}));let LJ=class e extends Uo{constructor(e,t,i,n){var o;super(),this._editor=e,this._quickFixActionId=t,this._preferredFixActionId=i,this._keybindingService=n,this._onClick=this._register(new $o),this.onClick=this._onClick.event,this._state=SJ.Hidden,this._domNode=document.createElement("div"),this._domNode.className=br.lightBulb.classNames,this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent((e=>{const t=this._editor.getModel();(1!==this.state.type||!t||this.state.editorPosition.lineNumber>=t.getLineCount())&&this.hide()}))),$S.ignoreTarget(this._domNode),this._register(HC(this._domNode,VC((e=>{if(1!==this.state.type)return;this._editor.focus(),e.preventDefault();const{top:t,height:i}=nw(this._domNode),n=this._editor.getOption(59);let o=Math.floor(n/3);null!==this.state.widgetPosition.position&&this.state.widgetPosition.position.lineNumber{if(1!=(1&e.buttons))return;this.hide();const t=new qS;t.startMonitoring(e.target,e.buttons,KS,(()=>{}),(()=>{t.dispose()}))}))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(57)&&!this._editor.getOption(57).enabled&&this.hide()}))),this._updateLightBulbTitleAndIcon(),this._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitleAndIcon,this))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 1===this._state.type?this._state.widgetPosition:null}update(t,i,n){if(t.validActions.length<=0)return this.hide();const o=this._editor.getOptions();if(!o.get(57).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:r,column:a}=s.validatePosition(n),l=s.getOptions().tabSize,d=o.get(44),h=uT(s.getLineContent(r),l),c=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1);let u=r;if(!(d.spaceWidth*h>22))if(r>1&&!c(r-1))u-=1;else if(c(r+1)){if(a*d.spaceWidth<22)return this.hide()}else u+=1;this.state=new SJ.Showing(t,i,n,{position:{lineNumber:u,column:1},preference:e._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state=SJ.Hidden,this._editor.layoutContentWidget(this)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(1===this.state.type&&this.state.actions.hasAutoFix){this._domNode.classList.remove(...br.lightBulb.classNamesArray),this._domNode.classList.add(...br.lightbulbAutofix.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._preferredFixActionId);if(e)return void(this.title=$m(0,"Show Code Actions. Preferred Quick Fix Available ({0})",e.getLabel()))}this._domNode.classList.remove(...br.lightbulbAutofix.classNamesArray),this._domNode.classList.add(...br.lightBulb.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._quickFixActionId);this.title=e?$m(0,"Show Code Actions ({0})",e.getLabel()):$m(0,"Show Code Actions")}set title(e){this._domNode.title=e}};LJ._posPref=[0],LJ=xJ([kJ(3,uW)],LJ),zy(((e,t)=>{var i;const n=null===(i=e.getColor(tk))||void 0===i?void 0:i.transparent(.7),o=e.getColor(Vk);o&&t.addRule(`\n\t\t.monaco-editor .contentWidgets ${br.lightBulb.cssSelector} {\n\t\t\tcolor: ${o};\n\t\t\tbackground-color: ${n};\n\t\t}`);const s=e.getColor(Wk);s&&t.addRule(`\n\t\t.monaco-editor .contentWidgets ${br.lightbulbAutofix.cssSelector} {\n\t\t\tcolor: ${s};\n\t\t\tbackground-color: ${n};\n\t\t}`)}));var DJ,EJ=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},NJ=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},IJ=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},TJ=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,i):o?o.value=i:t.set(e,i),i},MJ=globalThis&&globalThis.__classPrivateFieldGet||function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)};let OJ=class extends Uo{constructor(e,t,i,n,o){super(),this._editor=e,this.delegate=n,this._activeCodeActions=this._register(new Rr),DJ.set(this,!1),this._codeActionWidget=new Rl((()=>this._register(o.createInstance(wJ,this._editor,{onSelectCodeAction:e=>IJ(this,void 0,void 0,(function*(){this.delegate.applyCodeAction(e,!0)}))})))),this._lightBulbWidget=new Rl((()=>{const e=this._register(o.createInstance(LJ,this._editor,t,i));return this._register(e.onClick((e=>this.showCodeActionList(e.trigger,e.actions,e,{includeDisabledActions:!1})))),e}))}dispose(){TJ(this,DJ,!0,"f"),super.dispose()}update(e){var t,i,n,o,s;return IJ(this,void 0,void 0,(function*(){if(1!==e.type)return void(null===(t=this._lightBulbWidget.rawValue)||void 0===t||t.hide());let r;try{r=yield e.actions}catch(a){return void Jo(a)}if(!MJ(this,DJ,"f"))if(this._lightBulbWidget.getValue().update(r,e.trigger,e.position),1===e.trigger.type){if(null===(i=e.trigger.filter)||void 0===i?void 0:i.include){const t=this.tryGetValidActionToApply(e.trigger,r);if(t){try{this._lightBulbWidget.getValue().hide(),yield this.delegate.applyCodeAction(t,!1)}finally{r.dispose()}return}if(e.trigger.context){const t=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,r);if(t&&t.action.disabled)return null===(n=mJ.get(this._editor))||void 0===n||n.showMessage(t.action.disabled,e.trigger.context.position),void r.dispose()}}const t=!!(null===(o=e.trigger.filter)||void 0===o?void 0:o.include);if(e.trigger.context&&(!r.allActions.length||!t&&!r.validActions.length))return null===(s=mJ.get(this._editor))||void 0===s||s.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=r,void r.dispose();this._activeCodeActions.value=r,this._codeActionWidget.getValue().show(e.trigger,r,e.position,{includeDisabledActions:t})}else this._codeActionWidget.getValue().isVisible?r.dispose():this._activeCodeActions.value=r}))}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length)return"first"===e.autoApply&&0===t.validActions.length||"ifSingle"===e.autoApply&&1===t.allActions.length?t.allActions.find((({action:e})=>e.disabled)):void 0}tryGetValidActionToApply(e,t){if(t.validActions.length)return"first"===e.autoApply&&t.validActions.length>0||"ifSingle"===e.autoApply&&1===t.validActions.length?t.validActions[0]:void 0}showCodeActionList(e,t,i,n){return IJ(this,void 0,void 0,(function*(){this._codeActionWidget.getValue().show(e,t,i,n)}))}};DJ=new WeakMap,OJ=EJ([NJ(4,n_)],OJ);var AJ,RJ=globalThis&&globalThis.__classPrivateFieldGet||function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)},PJ=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,i):o?o.value=i:t.set(e,i),i};const FJ=new Ly("supportedCodeAction","");class BJ extends Uo{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new Vv),this._register(this._markerService.onMarkerChanged((e=>this._onMarkerChanges(e)))),this._register(this._editor.onDidChangeCursorPosition((()=>this._onCursorChange())))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);return this._createEventAndSignalChange(e,t)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some((e=>jA(e,t.uri)))&&this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2})}),this._delay)}_onCursorChange(){this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2})}),this._delay)}_getRangeOfMarker(e){const t=this._editor.getModel();if(t)for(const i of this._markerService.read({resource:t.uri})){const n=t.validateRange(i);if(qo.intersectRanges(n,e))return qo.lift(n)}}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&2===e.type){const{lineNumber:e,column:n}=i.getPosition(),o=t.getLineContent(e);if(0===o.length)return;if(1===n){if(/\s/.test(o[0]))return}else if(n===t.getLineMaxColumn(e)){if(/\s/.test(o[o.length-1]))return}else if(/\s/.test(o[n-2])&&/\s/.test(o[n-1]))return}return i}_createEventAndSignalChange(e,t){const i=this._editor.getModel();if(!t||!i)return void this._signalChange(void 0);const n=this._getRangeOfMarker(t),o=n?n.getStartPosition():t.getStartPosition(),s={trigger:e,selection:t,position:o};return this._signalChange(s),s}}var VJ;!function(e){e.Empty={type:0};e.Triggered=class{constructor(e,t,i,n){this.trigger=e,this.rangeOrSelection=t,this.position=i,this._cancellablePromise=n,this.type=1,this.actions=n.catch((e=>{if(Na(e))return WJ;throw e}))}cancel(){this._cancellablePromise.cancel()}}}(VJ||(VJ={}));const WJ={allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1};class HJ extends Uo{constructor(e,t,i,n,o){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._codeActionOracle=this._register(new Rr),this._state=VJ.Empty,this._onDidChangeState=this._register(new $o),this.onDidChangeState=this._onDidChangeState.event,AJ.set(this,!1),this._supportedCodeActions=FJ.bindTo(n),this._register(this._editor.onDidChangeModel((()=>this._update()))),this._register(this._editor.onDidChangeModelLanguage((()=>this._update()))),this._register(this._registry.onDidChange((()=>this._update()))),this._update()}dispose(){RJ(this,AJ,"f")||(PJ(this,AJ,!0,"f"),super.dispose(),this.setState(VJ.Empty,!0))}_update(){if(RJ(this,AJ,"f"))return;this._codeActionOracle.value=void 0,this.setState(VJ.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(81)){const t=[];for(const i of this._registry.all(e))Array.isArray(i.providedCodeActionKinds)&&t.push(...i.providedCodeActionKinds);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new BJ(this._editor,this._markerService,(t=>{var i;if(!t)return void this.setState(VJ.Empty);const n=Iv((i=>uJ(this._registry,e,t.selection,t.trigger,TB.None,i)));1===t.trigger.type&&(null===(i=this._progressService)||void 0===i||i.showWhile(n,250)),this.setState(new VJ.Triggered(t.trigger,t.selection,t.position,n))}),void 0),this._codeActionOracle.value.trigger({type:2})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value&&this._codeActionOracle.value.trigger(e)}setState(e,t){e!==this._state&&(1===this._state.type&&this._state.cancel(),this._state=e,t||RJ(this,AJ,"f")||this._onDidChangeState.fire(e))}}AJ=new WeakMap;var zJ=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jJ=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},UJ=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function $J(e){return ry.regex(FJ.keys()[0],new RegExp("(\\s|^)"+Xo(e.value)+"\\b"))}const KJ={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:$m(0,"Kind of the code action to run.")},apply:{type:"string",description:$m(0,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[$m(0,"Always apply the first returned code action."),$m(0,"Apply the first returned code action if it is the only one."),$m(0,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:$m(0,"Controls if only preferred code actions should be returned.")}}};let qJ=class e extends Uo{constructor(e,t,i,n,o,s){super(),this._instantiationService=o,this._editor=e,this._model=this._register(new HJ(this._editor,s.codeActionProvider,t,i,n)),this._register(this._model.onDidChangeState((e=>this.update(e)))),this._ui=new Rl((()=>this._register(new OJ(e,YJ.Id,XJ.Id,{applyCodeAction:(e,t)=>UJ(this,void 0,void 0,(function*(){try{yield this._applyCodeAction(e)}finally{t&&this._trigger({type:2,filter:{}})}}))},this._instantiationService))))}static get(t){return t.getContribution(e.ID)}update(e){this._ui.getValue().update(e)}showCodeActions(e,t,i){return this._ui.getValue().showCodeActionList(e,t,i,{includeDisabledActions:!1})}manualTriggerAtCurrentPosition(e,t,i){var n;if(!this._editor.hasModel())return;null===(n=mJ.get(this._editor))||void 0===n||n.closeMessage();const o=this._editor.getPosition();this._trigger({type:1,filter:t,autoApply:i,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e){return this._instantiationService.invokeFunction(GJ,e,this._editor)}};function GJ(e,t,i){return UJ(this,void 0,void 0,(function*(){const n=e.get(ZV),o=e.get(iy),s=e.get(tS),r=e.get(rF);if(s.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred}),yield t.resolve(Ia.None),t.action.edit&&(yield n.apply(YV.convert(t.action.edit),{editor:i,label:t.action.title})),t.action.command)try{yield o.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(a){const e=function(e){return"string"==typeof e?e:e instanceof Error&&"string"==typeof e.message?e.message:void 0}(a);r.error("string"==typeof e?e:$m(0,"An unknown error occurred while applying the code action"))}}))}function ZJ(e,t,i,n){if(e.hasModel()){const o=qJ.get(e);o&&o.manualTriggerAtCurrentPosition(t,i,n)}}qJ.ID="editor.contrib.quickFixController",qJ=zJ([jJ(1,nj),jJ(2,Dy),jJ(3,MB),jJ(4,n_),jJ(5,lb)],qJ);class YJ extends rS{constructor(){super({id:YJ.Id,label:$m(0,"Quick Fix..."),alias:"Quick Fix...",precondition:ry.and(dI.writable,dI.hasCodeActionsProvider),kbOpts:{kbExpr:dI.editorTextFocus,primary:2132,weight:100}})}run(e,t){return ZJ(t,$m(0,"No code actions available"),void 0,void 0)}}YJ.Id="editor.action.quickFix";class XJ extends rS{constructor(){super({id:XJ.Id,label:$m(0,"Auto Fix..."),alias:"Auto Fix...",precondition:ry.and(dI.writable,$J(sJ.QuickFix)),kbOpts:{kbExpr:dI.editorTextFocus,primary:1620,mac:{primary:2644},weight:100}})}run(e,t){return ZJ(t,$m(0,"No auto fixes available"),{include:sJ.QuickFix,onlyIncludePreferredActions:!0},"ifSingle")}}XJ.Id="editor.action.autoFix",gS(qJ.ID,qJ),hS(YJ),hS(class extends rS{constructor(){super({id:"editor.action.refactor",label:$m(0,"Refactor..."),alias:"Refactor...",precondition:ry.and(dI.writable,dI.hasCodeActionsProvider),kbOpts:{kbExpr:dI.editorTextFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ry.and(dI.writable,$J(sJ.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:KJ}]}})}run(e,t,i){const n=aJ.fromUser(i,{kind:sJ.Refactor,apply:"never"});return ZJ(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?$m(0,"No preferred refactorings for '{0}' available",i.kind):$m(0,"No refactorings for '{0}' available",i.kind):n.preferred?$m(0,"No preferred refactorings available"):$m(0,"No refactorings available"),{include:sJ.Refactor.contains(n.kind)?n.kind:sJ.None,onlyIncludePreferredActions:n.preferred},n.apply)}}),hS(class extends rS{constructor(){super({id:"editor.action.sourceAction",label:$m(0,"Source Action..."),alias:"Source Action...",precondition:ry.and(dI.writable,dI.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ry.and(dI.writable,$J(sJ.Source))},description:{description:"Source Action...",args:[{name:"args",schema:KJ}]}})}run(e,t,i){const n=aJ.fromUser(i,{kind:sJ.Source,apply:"never"});return ZJ(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?$m(0,"No preferred source actions for '{0}' available",i.kind):$m(0,"No source actions for '{0}' available",i.kind):n.preferred?$m(0,"No preferred source actions available"):$m(0,"No source actions available"),{include:sJ.Source.contains(n.kind)?n.kind:sJ.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}),hS(class extends rS{constructor(){super({id:"editor.action.organizeImports",label:$m(0,"Organize Imports"),alias:"Organize Imports",precondition:ry.and(dI.writable,$J(sJ.SourceOrganizeImports)),kbOpts:{kbExpr:dI.editorTextFocus,primary:1581,weight:100}})}run(e,t){return ZJ(t,$m(0,"No organize imports action available"),{include:sJ.SourceOrganizeImports,includeSourceActions:!0},"ifSingle")}}),hS(XJ),hS(class extends rS{constructor(){super({id:"editor.action.fixAll",label:$m(0,"Fix All"),alias:"Fix All",precondition:ry.and(dI.writable,$J(sJ.SourceFixAll))})}run(e,t){return ZJ(t,$m(0,"No fix all action available"),{include:sJ.SourceFixAll,includeSourceActions:!0},"ifSingle")}}),dS(new class extends sS{constructor(){super({id:"editor.action.codeAction",precondition:ry.and(dI.writable,dI.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:KJ}]}})}runEditorCommand(e,t,i){const n=aJ.fromUser(i,{kind:sJ.Empty,apply:"ifSingle"});return ZJ(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?$m(0,"No preferred code actions for '{0}' available",i.kind):$m(0,"No code actions for '{0}' available",i.kind):n.preferred?$m(0,"No preferred code actions available"):$m(0,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}});var QJ=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class JJ{constructor(){this.lenses=[],this._disposables=new Cs}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function e0(e,t,i){return QJ(this,void 0,void 0,(function*(){const n=e.ordered(t),o=new Map,s=new JJ,r=n.map(((e,n)=>QJ(this,void 0,void 0,(function*(){o.set(e,n);try{const n=yield Promise.resolve(e.provideCodeLenses(t,i));n&&s.add(n,e)}catch(r){Ta(r)}}))));return yield Promise.all(r),s.lenses=s.lenses.sort(((e,t)=>e.symbol.range.startLineNumbert.symbol.range.startLineNumber?1:o.get(e.provider)o.get(t.provider)?1:e.symbol.range.startColumnt.symbol.range.startColumn?1:0)),s}))}ny.registerCommand("_executeCodeLensProvider",(function(e,...t){let[i,n]=t;Js(Ps.isUri(i)),Js("number"==typeof n||!n);const{codeLensProvider:o}=e.get(lb),s=e.get(Dv).getModel(i);if(!s)throw Ms();const r=[],a=new Cs;return e0(o,s,Ia.None).then((e=>{a.add(e);let t=[];for(const i of e.lenses)null==n||Boolean(i.symbol.command)?r.push(i.symbol):n-- >0&&i.provider.resolveCodeLens&&t.push(Promise.resolve(i.provider.resolveCodeLens(s,i.symbol,Ia.None)).then((e=>r.push(e||i.symbol))));return Promise.all(t)})).then((()=>r)).finally((()=>{setTimeout((()=>a.dispose()),100)}))}));var t0=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},i0=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};const n0=s_("ICodeLensCache");class o0{constructor(e,t){this.lineCount=e,this.data=t}}let s0=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new VV(20,.75);zv((()=>e.remove("codelens/cache",1)));const t="codelens/cache2",i=e.get(t,1,"{}");this._deserialize(i),kr(e.onWillSaveState)((i=>{i.reason===iZ.SHUTDOWN&&e.store(t,this._serialize(),1,1)}))}put(e,t){const i=t.lenses.map((e=>{var t;return{range:e.symbol.range,command:e.symbol.command&&{id:"",title:null===(t=e.symbol.command)||void 0===t?void 0:t.title}}})),n=new JJ;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new o0(e.getLineCount(),n);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const e of i.data.lenses)n.add(e.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const e in t){const i=t[e],n=[];for(const e of i.lines)n.push({range:new qo(e,1,e,11)});const o=new JJ;o.add({lenses:n,dispose(){}},this._fakeProvider),this._cache.set(e,new o0(i.lineCount,o))}}catch(t){}}};s0=t0([i0(0,tZ)],s0),dv(n0,s0);class r0{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){void 0===this._lastHeight?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return 0!==this._lastHeight&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class a0{constructor(e,t,i){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id="codelens.widget-"+a0._idPool++,this.updatePosition(i),this._domNode=document.createElement("span"),this._domNode.className=`codelens-decoration ${t}`}withCommands(e,t){this._commands.clear();let i=[],n=!1;for(let o=0;o{e.symbol.command&&l.push(e.symbol),n.addDecoration({range:e.symbol.range,options:RP.EMPTY},(e=>this._decorationIds[t]=e)),a=a?qo.plusRange(a,e.symbol.range):qo.lift(e.symbol.range)})),this._viewZone=new r0(a.startLineNumber-1,s,r),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new a0(this._editor,this._className,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t&&t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some(((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!(!i||qo.isEmpty(n.range)!==i.isEmpty())}))}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach(((e,i)=>{t.addDecoration({range:e.symbol.range,options:RP.EMPTY},(e=>this._decorationIds[i]=e))}))}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},c0=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},u0=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let g0=class{constructor(e,t,i,n,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=o,this._codeLensCache=s,this._disposables=new Cs,this._localToDispose=new Cs,this._lenses=[],this._oldCodeLensModels=new Cs,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Hv((()=>this._resolveCodeLensesInViewport()),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel((()=>this._onModelChange()))),this._disposables.add(this._editor.onDidChangeModelLanguage((()=>this._onModelChange()))),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(44)||e.hasChanged(16)||e.hasChanged(15))&&this._updateLensStyle(),e.hasChanged(14)&&this._onModelChange()}))),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._styleClassName="_"+Pl(this._editor.getId()).toString(16),this._styleElement=fw(gw(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),null===(e=this._currentCodeLensModel)||void 0===e||e.dispose(),this._styleElement.remove()}_getLayoutInfo(){let e,t=this._editor.getOption(16);return!t||t<5?(t=.9*this._editor.getOption(46)|0,e=this._editor.getOption(59)):e=t*Math.max(1.3,this._editor.getOption(59)/this._editor.getOption(46))|0,{codeLensHeight:e,fontSize:t}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(15),n=this._editor.getOption(44),o=`--codelens-font-family${this._styleClassName}`,s=`--codelens-font-features${this._styleClassName}`;let r=`\n\t\t.monaco-editor .codelens-decoration.${this._styleClassName} { line-height: ${e}px; font-size: ${t}px; padding-right: ${Math.round(.5*t)}px; font-feature-settings: var(${s}) }\n\t\t.monaco-editor .codelens-decoration.${this._styleClassName} span.codicon { line-height: ${e}px; font-size: ${t}px; }\n\t\t`;i&&(r+=`.monaco-editor .codelens-decoration.${this._styleClassName} { font-family: var(${o}), ${kf.fontFamily}}`),this._styleElement.textContent=r,this._editor.getContainerDomNode().style.setProperty(o,null!=i?i:"inherit"),this._editor.getContainerDomNode().style.setProperty(s,n.fontFeatureSettings),this._editor.changeViewZones((t=>{for(let i of this._lenses)i.updateHeight(e,t)}))}_localDispose(){var e,t,i;null===(e=this._getCodeLensModelPromise)||void 0===e||e.cancel(),this._getCodeLensModelPromise=void 0,null===(t=this._resolveCodeLensesPromise)||void 0===t||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),null===(i=this._currentCodeLensModel)||void 0===i||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e)return;if(!this._editor.getOption(14))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e))return void(t&&this._localToDispose.add(Fv((()=>{const i=this._codeLensCache.get(e);t===i&&(this._codeLensCache.delete(e),this._onModelChange())}),3e4)));for(const n of this._languageFeaturesService.codeLensProvider.all(e))if("function"==typeof n.onDidChange){let e=n.onDidChange((()=>i.schedule()));this._localToDispose.add(e)}const i=new Hv((()=>{var t;const n=Date.now();null===(t=this._getCodeLensModelPromise)||void 0===t||t.cancel(),this._getCodeLensModelPromise=Iv((t=>e0(this._languageFeaturesService.codeLensProvider,e,t))),this._getCodeLensModelPromise.then((t=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=t,this._codeLensCache.put(e,t);const o=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=o,this._renderCodeLensSymbols(t),this._resolveCodeLensesInViewportSoon()}),Jo)}),this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(es((()=>this._resolveCodeLensesScheduler.cancel()))),this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{let i=[],n=-1;this._lenses.forEach((e=>{e.isValid()&&n!==e.getLineNumber()?(e.update(t),n=e.getLineNumber()):i.push(e)}));let o=new l0;i.forEach((e=>{e.dispose(o,t),this._lenses.splice(this._lenses.indexOf(e),1)})),o.commit(e)}))})),i.schedule()}))),this._localToDispose.add(this._editor.onDidFocusEditorWidget((()=>{i.schedule()}))),this._localToDispose.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(this._editor.onDidLayoutChange((()=>{this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(es((()=>{if(this._editor.getModel()){const e=JF.capture(this._editor);this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{this._disposeAllLenses(e,t)}))})),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)}))),this._localToDispose.add(this._editor.onMouseDown((e=>{if(9!==e.target.type)return;let t=e.target.element;if("SPAN"===(null==t?void 0:t.tagName)&&(t=t.parentElement),"A"===(null==t?void 0:t.tagName))for(const i of this._lenses){let e=i.getCommand(t);if(e){this._commandService.executeCommand(e.id,...e.arguments||[]).catch((e=>this._notificationService.error(e)));break}}}))),i.schedule()}_disposeAllLenses(e,t){const i=new l0;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t,i=this._editor.getModel().getLineCount(),n=[];for(let r of e.lenses){let e=r.symbol.range.startLineNumber;e<1||e>i||(t&&t[t.length-1].symbol.range.startLineNumber===e?t.push(r):(t=[r],n.push(t)))}const o=JF.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const i=new l0;let o=0,r=0;for(;rthis._resolveCodeLensesInViewportSoon()))),o++,r++)}for(;othis._resolveCodeLensesInViewportSoon()))),r++;i.commit(e)}))})),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;null===(e=this._resolveCodeLensesPromise)||void 0===e||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach((e=>{const o=e.computeIfNecessary(t);o&&(i.push(o),n.push(e))})),0===i.length)return;const o=Date.now(),s=Iv((e=>{const o=i.map(((i,o)=>{const s=new Array(i.length),r=i.map(((i,n)=>i.symbol.command||"function"!=typeof i.provider.resolveCodeLens?(s[n]=i.symbol,Promise.resolve(void 0)):Promise.resolve(i.provider.resolveCodeLens(t,i.symbol,e)).then((e=>{s[n]=e}),Ta)));return Promise.all(r).then((()=>{e.isCancellationRequested||n[o].isDisposed()||n[o].updateCommands(s)}))}));return Promise.all(o)}));this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then((()=>{const e=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=e,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}),(e=>{Jo(e),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}))}getModel(){return this._currentCodeLensModel}};function p0(e,t,i,n){return Promise.resolve(i.provideColorPresentations(e,t,n))}g0.ID="css.editor.codeLens",g0=h0([c0(1,lb),c0(2,$V),c0(3,iy),c0(4,rF),c0(5,n0)],g0),gS(g0.ID,g0),hS(class extends rS{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:dI.hasCodeLensProvider,label:$m(0,"Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return u0(this,void 0,void 0,(function*(){if(!t.hasModel())return;const i=e.get(Hq),n=e.get(iy),o=e.get(rF),s=t.getSelection().positionLineNumber,r=t.getContribution(g0.ID);if(!r)return;const a=r.getModel();if(!a)return;const l=[];for(const e of a.lenses)e.symbol.command&&e.symbol.range.startLineNumber===s&&l.push({label:e.symbol.command.title,command:e.symbol.command});if(0===l.length)return;const d=yield i.pick(l,{canPickMany:!1});if(d){if(a.isDisposed)return yield n.executeCommand(this.id);try{yield n.executeCommand(d.command.id,...d.command.arguments||[])}catch(h){o.error(h)}}}))}}),ny.registerCommand("_executeDocumentColorProvider",(function(e,...t){const[i]=t;if(!(i instanceof Ps))throw Ms();const{colorProvider:n}=e.get(lb),o=e.get(Dv).getModel(i);if(!o)throw Ms();const s=[],r=n.ordered(o).reverse().map((e=>Promise.resolve(e.provideDocumentColors(o,Ia.None)).then((e=>{if(Array.isArray(e))for(let t of e)s.push({range:t.range,color:[t.color.red,t.color.green,t.color.blue,t.color.alpha]})}))));return Promise.all(r).then((()=>s))})),ny.registerCommand("_executeColorPresentationProvider",(function(e,...t){const[i,n]=t,{uri:o,range:s}=n;if(!(o instanceof Ps&&Array.isArray(i)&&4===i.length&&qo.isIRange(s)))throw Ms();const[r,a,l,d]=i,{colorProvider:h}=e.get(lb),c=e.get(Dv).getModel(o);if(!c)throw Ms();const u={range:s,color:{red:r,green:a,blue:l,alpha:d}},g=[],p=h.ordered(c).reverse().map((e=>Promise.resolve(e.provideColorPresentations(c,u,Ia.None)).then((e=>{Array.isArray(e)&&g.push(...e)}))));return Promise.all(p).then((()=>g))}));var m0=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},f0=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},_0=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const v0=Object.create({});let b0=class e extends Uo{constructor(t,i,n,o){super(),this._editor=t,this._configurationService=i,this._languageFeaturesService=n,this._localToDispose=this._register(new Cs),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=new Set,this._ruleFactory=new xD(this._editor),this._colorDecorationClassRefs=this._register(new Cs),this._debounceInformation=o.for(n.colorProvider,"Document Colors",{min:e.RECOMPUTE_TIME}),this._register(t.onDidChangeModel((()=>{this._isEnabled=this.isEnabled(),this.onModelChanged()}))),this._register(t.onDidChangeModelLanguage((()=>this.onModelChanged()))),this._register(n.colorProvider.onDidChange((()=>this.onModelChanged()))),this._register(t.onDidChangeConfiguration((()=>{let e=this._isEnabled;this._isEnabled=this.isEnabled(),e!==this._isEnabled&&(this._isEnabled?this.onModelChanged():this.removeAllDecorations())}))),this._timeoutTimer=null,this._computePromise=null,this._isEnabled=this.isEnabled(),this.onModelChanged()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&"object"==typeof i){const e=i.colorDecorators;if(e&&void 0!==e.enable&&!e.enable)return e.enable}return this._editor.getOption(17)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}onModelChanged(){if(this.stop(),!this._isEnabled)return;const e=this._editor.getModel();e&&this._languageFeaturesService.colorProvider.has(e)&&(this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{this._timeoutTimer||(this._timeoutTimer=new Vv,this._timeoutTimer.cancelAndSet((()=>{this._timeoutTimer=null,this.beginCompute()}),this._debounceInformation.get(e)))}))),this.beginCompute())}beginCompute(){this._computePromise=Iv((e=>_0(this,void 0,void 0,(function*(){const t=this._editor.getModel();if(!t)return Promise.resolve([]);const i=new ps(!1),n=yield function(e,t,i){const n=[],o=e.ordered(t).reverse().map((e=>Promise.resolve(e.provideDocumentColors(t,i)).then((t=>{if(Array.isArray(t))for(let i of t)n.push({colorInfo:i,provider:e})}))));return Promise.all(o).then((()=>n))}(this._languageFeaturesService.colorProvider,t,e);return this._debounceInformation.update(t,i.elapsed()),n})))),this._computePromise.then((e=>{this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}),Jo)}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map((e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:RP.EMPTY})));this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach(((t,i)=>this._colorDatas.set(t,e[i])))}updateColorDecorators(e){this._colorDecorationClassRefs.clear();let t=[];for(let i=0;ithis._colorDatas.has(e.id)));return 0===i.length?null:this._colorDatas.get(i[0].id)}isColorDecorationId(e){return this._colorDecoratorIds.has(e)}};b0.ID="editor.contrib.colorDetector",b0.RECOMPUTE_TIME=1e3,b0=m0([f0(1,ev),f0(2,lb),f0(3,$V)],b0),gS(b0.ID,b0);class C0{constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new $o,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new $o,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new $o,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){for(let i=0;i{this.backgroundColor=e.getColor(Ek)||QS.white}))),this._register(BC(this.pickedColorNode,yw.CLICK,(()=>this.model.selectNextColorPresentation()))),this._register(BC(o,yw.CLICK,(()=>{this.model.color=this.model.originalColor,this.model.flushColor()}))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this.pickedColorNode.style.backgroundColor=QS.Format.CSS.format(t.color)||"",this.pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){this.pickedColorNode.style.backgroundColor=QS.Format.CSS.format(e)||"",this.pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this.pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:"",this.pickedColorNode.prepend(w0(".codicon.codicon-color-mode"))}}class S0 extends Uo{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this.domNode=w0(".colorpicker-body"),Lw(e,this.domNode),this.saturationBox=new x0(this.domNode,this.model,this.pixelRatio),this._register(this.saturationBox),this._register(this.saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this.saturationBox.onColorFlushed(this.flushColor,this)),this.opacityStrip=new L0(this.domNode,this.model),this._register(this.opacityStrip),this._register(this.opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this.opacityStrip.onColorFlushed(this.flushColor,this)),this.hueStrip=new D0(this.domNode,this.model),this._register(this.hueStrip),this._register(this.hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this.hueStrip.onColorFlushed(this.flushColor,this))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new QS(new XS(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new QS(new XS(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=360*(1-e);this.model.color=new QS(new XS(360===i?0:i,t.s,t.v,t.a))}layout(){this.saturationBox.layout(),this.opacityStrip.layout(),this.hueStrip.layout()}}class x0 extends Uo{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new $o,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new $o,this.onColorFlushed=this._onColorFlushed.event,this.domNode=w0(".saturation-wrap"),Lw(e,this.domNode),this.canvas=document.createElement("canvas"),this.canvas.className="saturation-box",Lw(this.domNode,this.canvas),this.selection=w0(".saturation-selection"),Lw(this.domNode,this.selection),this.layout(),this._register(HC(this.domNode,(e=>this.onMouseDown(e)))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}onMouseDown(e){this.monitor=this._register(new qS);const t=nw(this.domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.buttons,KS,(e=>this.onDidChangePosition(e.posx-t.left,e.posy-t.top)),(()=>null));const i=zC(document,(()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)}),!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this.domNode.offsetWidth,this.height=this.domNode.offsetHeight,this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new QS(new XS(e.h,1,1,1)),i=this.canvas.getContext("2d"),n=i.createLinearGradient(0,0,this.canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this.canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this.canvas.width,this.canvas.height),i.fillStyle=QS.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=e*this.width+"px",this.selection.style.top=this.height-t*this.height+"px"}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class k0 extends Uo{constructor(e,t){super(),this.model=t,this._onDidChange=new $o,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new $o,this.onColorFlushed=this._onColorFlushed.event,this.domNode=Lw(e,w0(".strip")),this.overlay=Lw(this.domNode,w0(".overlay")),this.slider=Lw(this.domNode,w0(".slider")),this.slider.style.top="0px",this._register(HC(this.domNode,(e=>this.onMouseDown(e)))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onMouseDown(e){const t=this._register(new qS),i=nw(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.buttons,KS,(e=>this.onDidChangeTop(e.posy-i.top)),(()=>null));const n=zC(document,(()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")}),!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=(1-e)*this.height+"px"}}class L0 extends k0{constructor(e,t){super(e,t),this.domNode.classList.add("opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:i,b:n}=e.rgba,o=new QS(new ZS(t,i,n,1)),s=new QS(new ZS(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class D0 extends k0{constructor(e,t){super(e,t),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class E0 extends zI{constructor(e,t,i,n){super(),this.model=t,this.pixelRatio=i,this._register(Mf.onDidChange((()=>this.layout())));const o=w0(".colorpicker-widget");e.appendChild(o);const s=new y0(o,this.model,n);this.body=new S0(o,this.model,this.pixelRatio),this._register(s),this._register(this.body)}layout(){this.body.layout()}}var N0=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},I0=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},T0=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class M0{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let O0=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=1}computeSync(e,t){return[]}computeAsync(e,t,i){return Gv.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return T0(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return[];const e=b0.get(this._editor);if(!e)return[];for(const i of t){if(!e.isColorDecorationId(i.id))continue;const t=e.getColorData(i.range.getStartPosition());if(t){return[yield this._createColorHover(this._editor.getModel(),t.colorInfo,t.provider)]}}return[]}))}_createColorHover(e,t,i){return T0(this,void 0,void 0,(function*(){const n=e.getValueInRange(t.range),{red:o,green:s,blue:r,alpha:a}=t.color,l=new ZS(Math.round(255*o),Math.round(255*s),Math.round(255*r),a),d=new QS(l),h=yield p0(e,t,i,Ia.None),c=new C0(d,[],0);return c.colorPresentations=h||[],c.guessColorPresentation(d,n),new M0(this,qo.lift(t.range),c,i)}))}renderHoverParts(e,t){if(0===t.length||!this._editor.hasModel())return Uo.None;const i=new Cs,n=t[0],o=this._editor.getModel(),s=n.model,r=i.add(new E0(e.fragment,s,this._editor.getOption(129),this._themeService));e.setColorPicker(r);let a=new qo(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn);const l=()=>{let t,i;if(s.presentation.textEdit){t=[s.presentation.textEdit],i=new qo(s.presentation.textEdit.range.startLineNumber,s.presentation.textEdit.range.startColumn,s.presentation.textEdit.range.endLineNumber,s.presentation.textEdit.range.endColumn);const e=this._editor.getModel()._setTrackedRange(null,i,3);this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",t),i=this._editor.getModel()._getTrackedRange(e)||i}else t=[{range:a,text:s.presentation.label,forceMoveMarkers:!1}],i=a.setEndPosition(a.endLineNumber,a.startColumn+s.presentation.label.length),this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",t);s.presentation.additionalTextEdits&&(t=[...s.presentation.additionalTextEdits],this._editor.executeEdits("colorpicker",t),e.hide()),this._editor.pushUndoStop(),a=i},d=e=>p0(o,{range:a,color:{red:e.rgba.r/255,green:e.rgba.g/255,blue:e.rgba.b/255,alpha:e.rgba.a}},n.provider,Ia.None).then((e=>{s.colorPresentations=e||[]}));return i.add(s.onColorFlushed((e=>{d(e).then(l)}))),i.add(s.onDidChangeColor(d)),i}};O0=N0([I0(1,Ry)],O0);function A0(e,t){return!!e[t]}class R0{constructor(e,t){this.target=e.target,this.hasTriggerModifier=A0(e.event,t.triggerModifier),this.hasSideBySideModifier=A0(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class P0{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=A0(e,t.triggerModifier)}}class F0{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function B0(e){return"altKey"===e?Ho?new F0(57,"metaKey",6,"altKey"):new F0(5,"ctrlKey",6,"altKey"):Ho?new F0(6,"altKey",57,"metaKey"):new F0(6,"altKey",5,"ctrlKey")}class V0 extends Uo{constructor(e){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new $o),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new $o),this.onExecute=this._onExecute.event,this._onCancel=this._register(new $o),this.onCancel=this._onCancel.event,this._editor=e,this._opts=B0(this._editor.getOption(70)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration((e=>{if(e.hasChanged(70)){const e=B0(this._editor.getOption(70));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}}))),this._register(this._editor.onMouseMove((e=>this._onEditorMouseMove(new R0(e,this._opts))))),this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(new R0(e,this._opts))))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(new R0(e,this._opts))))),this._register(this._editor.onKeyDown((e=>this._onEditorKeyDown(new P0(e,this._opts))))),this._register(this._editor.onKeyUp((e=>this._onEditorKeyUp(new P0(e,this._opts))))),this._register(this._editor.onMouseDrag((()=>this._resetHandler()))),this._register(this._editor.onDidChangeCursorSelection((e=>this._onDidChangeCursorSelection(e)))),this._register(this._editor.onDidChangeModel((e=>this._resetHandler()))),this._register(this._editor.onDidChangeModelContent((()=>this._resetHandler()))),this._register(this._editor.onDidScrollChange((e=>{(e.scrollTopChanged||e.scrollLeftChanged)&&this._resetHandler()})))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var W0=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},H0=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let z0=class extends MF{constructor(e,t,i,n,o,s,r,a,l,d,h,c){super(e,Object.assign(Object.assign({},i.getRawOptions()),{overflowWidgetsDomNode:i.getOverflowWidgetsDomNode()}),{},n,o,s,r,a,l,d,h,c),this._parentEditor=i,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(i.onDidChangeConfiguration((e=>this._onParentConfigurationChanged(e))))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){Ko(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};z0=W0([H0(3,n_),H0(4,r_),H0(5,iy),H0(6,Dy),H0(7,Ry),H0(8,rF),H0(9,NS),H0(10,pv),H0(11,lb)],z0);const j0=new QS(new ZS(0,122,204)),U0={showArrow:!0,showFrame:!0,className:"",frameColor:j0,arrowColor:j0,keepEditorSelection:!1};class $0{constructor(e,t,i,n,o,s){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class K0{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class q0{constructor(e){this._editor=e,this._ruleName=q0._IdGenerator.nextId(),this._decorations=[],this._color=null,this._height=-1}dispose(){this.hide(),Cw(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){Cw(this._ruleName),bw(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){1===e.column&&(e={lineNumber:e.lineNumber,column:2}),this._decorations=this._editor.deltaDecorations(this._decorations,[{range:qo.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._editor.deltaDecorations(this._decorations,[])}}q0._IdGenerator=new Zj(".arrow-decoration-");class G0 extends Qw{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new $o),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Lw(e,Mw(".monaco-dropdown")),this._label=Lw(this._element,Mw(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const o of[yw.CLICK,yw.MOUSE_DOWN,WS.Tap])this._register(BC(this.element,o,(e=>Sw(e,!0))));for(const o of[yw.MOUSE_DOWN,WS.Tap])this._register(BC(this._label,o,(e=>{e instanceof MouseEvent&&e.detail>1||(this.visible?this.hide():this.show())})));this._register(BC(this._label,yw.KEY_UP,(e=>{const t=new SC(e);(t.equals(3)||t.equals(10))&&(Sw(e,!0),this.visible?this.hide():this.show())})));const n=i(this._label);n&&this._register(n),this._register($S.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 Z0 extends G0{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:e=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class Y0 extends nB{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new $o),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=Lw(e,Mw("a.action-label"));let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter((e=>!!e)):this.options.classNames&&(t=this.options.classNames),t.find((e=>"icon"===e))||t.push("codicon"),this.element.classList.add(...t),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new Z0(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility((e=>{var t;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)}))),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.options.anchorAlignmentProvider()}})}this.updateEnabled()}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}updateEnabled(){var e,t;const i=!this.getAction().enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",i),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",i)}}var X0=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Q0=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},J0=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function e1(e,t,i,n,o,s,r){const a=e.getActions(t);return function(e,t,i,n=(e=>"navigation"===e),o=Number.MAX_SAFE_INTEGER,s=(()=>!1),r=!1){let a,l;Array.isArray(t)?(a=t,l=t):(a=t.primary,l=t.secondary);const d=new Set;for(const[h,c]of e){let e;n(h)?(e=a,e.length>0&&r&&e.push(new Jw)):(e=l,e.length>0&&e.push(new Jw));for(let t of c){i&&(t=t instanceof Xy&&t.alt?t.alt:t);const n=e.push(t);t instanceof ey&&d.add({group:h,action:t,index:n-1})}}for(const{group:h,action:c,index:u}of d){const e=n(h)?a:l,t=c.actions;(t.length<=1||e.length+t.length-2<=o)&&s(c,h,e.length)&&e.splice(u,1,...t)}if(a!==l&&a.length>o){const e=a.splice(o,a.length-o);l.unshift(...e,new Jw)}}(a,i,!1,"string"==typeof n?e=>e===n:n,o,s,r),function(e){const t=new Cs;for(const[,i]of e)for(const e of i)t.add(e);return t}(a)}let t1=class extends oB{constructor(e,t,i,n,o){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:null==t?void 0:t.draggable}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Rr),this._altKey=Vw.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return J0(this,void 0,void 0,(function*(){e.preventDefault(),e.stopPropagation();try{yield this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}))}render(e){super.render(e),e.classList.add("menu-entry"),this._updateItemClass(this._menuItemAction.item);let t=!1,i=this._altKey.keyStatus.altKey||(Rs||Vo)&&this._altKey.keyStatus.shiftKey;const n=()=>{const e=t&&i;e!==this._wantsAltCommand&&(this._wantsAltCommand=e,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._menuItemAction.alt&&this._register(this._altKey.event((e=>{i=e.altKey||(Rs||Vo)&&e.shiftKey,n()}))),this._register(BC(e,"mouseleave",(e=>{t=!1,n()}))),this._register(BC(e,"mouseenter",(e=>{t=!0,n()})))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}updateTooltip(){if(this.label){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let n=t?$m(0,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),o=i?$m(0,"{0} ({1})",e,i):e;n+=`\n[${bW.modifierLabels[Xs].altKey}] ${o}`}this.label.title=n}}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;const{element:i,label:n}=this;if(!i||!n)return;const o=this._commandAction.checked&&(null===(t=e.toggled)||void 0===t?void 0:t.icon)?e.toggled.icon:e.icon;if(o)if(Fy.isThemeIcon(o)){const e=Fy.asClassNameArray(o);n.classList.add(...e),this._itemClassDispose.value=es((()=>{n.classList.remove(...e)}))}else o.light&&n.style.setProperty("--menu-entry-icon-light",Fw(o.light)),o.dark&&n.style.setProperty("--menu-entry-icon-dark",Fw(o.dark)),n.classList.add("icon"),this._itemClassDispose.value=es((()=>{n.classList.remove("icon"),n.style.removeProperty("--menu-entry-icon-light"),n.style.removeProperty("--menu-entry-icon-dark")}))}};t1=X0([Q0(2,uW),Q0(3,rF),Q0(4,Dy)],t1);let i1=class extends Y0{constructor(e,t,i){var n,o;const s=Object.assign({},null!=t?t:Object.create(null),{menuAsChild:null!==(n=null==t?void 0:t.menuAsChild)&&void 0!==n&&n,classNames:null!==(o=null==t?void 0:t.classNames)&&void 0!==o?o:Fy.isThemeIcon(e.item.icon)?Fy.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},i,s)}render(e){if(super.render(e),this.element){e.classList.add("menu-entry");const{icon:t}=this._action.item;t&&!Fy.isThemeIcon(t)&&(this.element.classList.add("icon"),t.light&&this.element.style.setProperty("--menu-entry-icon-light",Fw(t.light)),t.dark&&this.element.style.setProperty("--menu-entry-icon-dark",Fw(t.dark)))}}};i1=X0([Q0(2,DB)],i1);let n1=class extends nB{constructor(e,t,i,n,o,s,r,a){var l,d,h;let c;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=s,this._instaService=r,this._storageService=a,this._container=null,this._storageKey=`${e.item.submenu._debugName}_lastActionId`;let u=a.get(this._storageKey,1);u&&(c=e.actions.find((e=>u===e.id))),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(t1,c,void 0);const g=Object.assign({},null!=t?t:Object.create(null),{menuAsChild:null===(l=null==t?void 0:t.menuAsChild)||void 0===l||l,classNames:null!==(d=null==t?void 0:t.classNames)&&void 0!==d?d:["codicon","codicon-chevron-down"],actionRunner:null!==(h=null==t?void 0:t.actionRunner)&&void 0!==h?h:new Qw});this._dropdown=new Y0(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun((e=>{e.action instanceof Xy&&this.update(e.action)}))}update(e){var t,i;this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(t1,e,void 0),this._defaultAction.actionRunner=new class extends Qw{runAction(e,t){return J0(this,void 0,void 0,(function*(){yield e.run(void 0)}))}},this._container&&this._defaultAction.render((t=this._container,i=Mw(".action-container"),t.insertBefore(i,t.firstChild),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=Mw(".action-container");this._defaultAction.render(Lw(this._container,t)),this._register(BC(t,yw.KEY_DOWN,(e=>{const t=new SC(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())})));const i=Mw(".dropdown-action-container");this._dropdown.render(Lw(this._container,i)),this._register(BC(i,yw.KEY_DOWN,(e=>{var t;const i=new SC(e);i.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),null===(t=this._defaultAction.element)||void 0===t||t.focus(),i.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()}};function o1(e,t,i){return t instanceof Xy?e.createInstance(t1,t,void 0):t instanceof Yy?t.item.rememberDefaultAction?e.createInstance(n1,t,i):e.createInstance(i1,t,i):void 0}n1=X0([Q0(2,uW),Q0(3,rF),Q0(4,DB),Q0(5,Gy),Q0(6,n_),Q0(7,tZ)],n1);var s1=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},r1=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};const a1=s_("IPeekViewService");var l1,d1;dv(a1,class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const i=this._widgets.get(e);i&&(i.listener.dispose(),i.widget.dispose());this._widgets.set(e,{widget:t,listener:t.onDidClose((()=>{const i=this._widgets.get(e);i&&i.widget===t&&(i.listener.dispose(),this._widgets.delete(e))}))})}}),(d1=l1||(l1={})).inPeekEditor=new Ly("inReferenceSearchEditor",!0,$m(0,"Whether the current code editor is embedded inside peek")),d1.notInPeekEditor=d1.inPeekEditor.toNegated();let h1=class{constructor(e,t){e instanceof z0&&l1.inPeekEditor.bindTo(t)}dispose(){}};h1.ID="editor.contrib.referenceController",h1=s1([r1(1,Dy)],h1),gS(h1.ID,h1);const c1={headerBackgroundColor:QS.white,primaryHeadingColor:QS.fromHex("#333333"),secondaryHeadingColor:QS.fromHex("#6c6c6cb3")};let u1=class extends class{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._positionMarkerId=[],this._viewZone=null,this._disposables=new Cs,this.container=null,this._isShowing=!1,this.editor=e,this.options=tr(t),Ko(this.options,U0,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange((e=>{const t=this._getWidth(e);this.domNode.style.width=t+"px",this.domNode.style.left=this._getLeft(e)+"px",this._onWidth(t)})))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null})),this.editor.deltaDecorations(this._positionMarkerId,[]),this._positionMarkerId=[],this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new q0(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){let t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash&&this._resizeSash.layout()}get position(){const[e]=this._positionMarkerId;if(!e)return;const t=this.editor.getModel();if(!t)return;const i=t.getDecorationRange(e);return i?i.getStartPosition():void 0}show(e,t){const i=qo.isIRange(e)?qo.lift(e):qo.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:i,options:RP.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id)})),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()}_decoratingElementsHeight(){let e=this.editor.getOption(59),t=0;if(this.options.showArrow){t+=2*Math.round(e/3)}if(this.options.showFrame){t+=2*Math.round(e/9)}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"px";const s=document.createElement("div");s.style.overflow="hidden";const r=this.editor.getOption(59),a=Math.max(12,this.editor.getLayoutInfo().height/r*.8);t=Math.min(t,a);let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(r/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(r/9)),this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new $0(s,i.lineNumber,i.column,t,(e=>this._onViewZoneTop(e)),(e=>this._onViewZoneHeight(e))),this._viewZone.id=e.addZone(this._viewZone),this._overlayWidget=new K0("vs.editor.contrib.zoneWidget"+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)})),this.container&&this.options.showFrame){const e=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=e+"px",this.container.style.borderBottomWidth=e+"px"}let h=t*r-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,o),this.options.keepEditorSelection||this.editor.setSelection(e);const c=this.editor.getModel();if(c){const t=e.endLineNumber+1;t<=c.getLineCount()?this.revealLine(t,!1):this.revealLine(c.getLineCount(),!0)}}revealLine(e,t){t?this.editor.revealLineInCenter(e,0):this.editor.revealLine(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones((t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))}))}_initSash(){if(this._resizeSash)return;let e;this._resizeSash=this._disposables.add(new QF(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0),this._disposables.add(this._resizeSash.onDidStart((t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})}))),this._disposables.add(this._resizeSash.onDidEnd((()=>{e=void 0}))),this._disposables.add(this._resizeSash.onDidChange((t=>{if(e){let i=(t.currentY-e.startY)/this.editor.getOption(59),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>5&&o<35&&this._relayout(o)}})))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new $o,this.onDidClose=this._onDidClose.event,Ko(this.options,c1,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){let t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=Mw(".head"),this._bodyElement=Mw(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){const i=Mw(".peekview-title");this.options.supportOnTitleClick&&(i.classList.add("clickable"),WC(i,"click",(e=>this._onTitleClick(e)))),Lw(this._headElement,i),this._fillTitleIcon(i),this._primaryHeading=Mw("span.filename"),this._secondaryHeading=Mw("span.dirname"),this._metaHeading=Mw("span.meta"),Lw(i,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=Mw(".peekview-actions");Lw(this._headElement,n);const o=this._getActionBarOptions();this._actionbarWidget=new rB(n,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Xw("peekview.close",$m(0,"Close"),br.close.classNames,!0,(()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:o1.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:RC(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Ow(this._metaHeading)):Aw(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0)return void this.dispose();const i=Math.ceil(1.2*this.editor.getOption(59)),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};u1=s1([r1(2,n_)],u1);const g1=ox("peekViewTitle.background",{dark:lD(Xx,.1),light:lD(Xx,.1),hc:null},$m(0,"Background color of the peek view title area.")),p1=ox("peekViewTitleLabel.foreground",{dark:QS.white,light:QS.black,hc:QS.white},$m(0,"Color of the peek view title.")),m1=ox("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hc:"#FFFFFF99"},$m(0,"Color of the peek view title info.")),f1=ox("peekView.border",{dark:Xx,light:Xx,hc:dx},$m(0,"Color of the peek view borders and arrow.")),_1=ox("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:QS.black},$m(0,"Background color of the peek view result list."));ox("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:QS.white},$m(0,"Foreground color for line nodes in the peek view result list.")),ox("peekViewResult.fileForeground",{dark:QS.white,light:"#1E1E1E",hc:QS.white},$m(0,"Foreground color for file nodes in the peek view result list.")),ox("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},$m(0,"Background color of the selected entry in the peek view result list.")),ox("peekViewResult.selectionForeground",{dark:QS.white,light:"#6C6C6C",hc:QS.white},$m(0,"Foreground color of the selected entry in the peek view result list."));const v1=ox("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:QS.black},$m(0,"Background color of the peek view editor."));ox("peekViewEditorGutter.background",{dark:v1,light:v1,hc:v1},$m(0,"Background color of the gutter in the peek view editor.")),ox("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},$m(0,"Match highlight color in the peek view result list.")),ox("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},$m(0,"Match highlight color in the peek view editor.")),ox("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:hx},$m(0,"Match highlight border in the peek view editor."));var b1=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class C1{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=Yj.nextId()}get uri(){return this.link.uri}get range(){var e,t;return null!==(t=null!==(e=this._range)&&void 0!==e?e:this.link.targetSelectionRange)&&void 0!==t?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=null===(e=this.parent.getPreview(this))||void 0===e?void 0:e.preview(this.range);return t?$m(0,"symbol in {0} on line {1} at column {2}, {3}",$A(this.uri),this.range.startLineNumber,this.range.startColumn,t.value):$m(0,"symbol in {0} on line {1} at column {2}",$A(this.uri),this.range.startLineNumber,this.range.startColumn)}}class w1{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:s,endColumn:r}=e,a=i.getWordUntilPosition({lineNumber:n,column:o-t}),l=new qo(n,a.startColumn,n,o),d=new qo(s,r,s,1073741824),h=i.getValueInRange(l).replace(/^\s+/,""),c=i.getValueInRange(e);return{value:h+c+i.getValueInRange(d).replace(/\s+$/,""),highlight:{start:h.length,end:h.length+c.length}}}}class y1{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new FV}dispose(){bs(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return 1===e?$m(0,"1 symbol in {0}, full path {1}",$A(this.uri),this.uri.fsPath):$m(0,"{0} symbols in {1}, full path {2}",e,$A(this.uri),this.uri.fsPath)}resolve(e){return b1(this,void 0,void 0,(function*(){if(0!==this._previews.size)return this;for(let i of this.children)if(!this._previews.has(i.uri))try{const t=yield e.createModelReference(i.uri);this._previews.set(i.uri,new w1(t))}catch(t){Jo(t)}return this}))}}class S1{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new $o,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;let n;e.sort(S1._compareReferences);for(let o of e)if(n&&zA.isEqual(n.uri,o.uri,!0)||(n=new y1(this,o.uri),this.groups.push(n)),0===n.children.length||0!==S1._compareReferences(o,n.children[n.children.length-1])){const e=new C1(i===o,n,o,(e=>this._onDidChangeReferenceRange.fire(e)));this.references.push(e),n.children.push(e)}}dispose(){bs(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new S1(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?$m(0,"No results found"):1===this.references.length?$m(0,"Found 1 symbol in {0}",this.references[0].uri.fsPath):1===this.groups.length?$m(0,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):$m(0,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,n=i.children.indexOf(e),o=i.children.length,s=i.parent.groups.length;return 1===s||t&&n+10?(n=t?(n+1)%o:(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%s,i.parent.groups[n].children[0]):(n=(n+s-1)%s,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map(((i,n)=>({idx:n,prefixLen:lr(i.uri.toString(),e.toString()),offsetDist:100*Math.abs(i.range.startLineNumber-t.lineNumber)+Math.abs(i.range.startColumn-t.column)}))).sort(((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLent.offsetDist?1:0))[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&qo.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return zA.compare(e.uri,t.uri)||qo.compareRangesUsingStarts(e.range,t.range)}}function x1(e){if(!e)return;"string"==typeof e&&(e=Ps.file(e));const t=$A(e)||(e.scheme===IC.file?e.fsPath:e.path);return Rs&&function(e){const t=Vr(e);return Rs?!(e.length>3)&&VA(t)&&(2===e.length||92===t.charCodeAt(2)):t===Pr.sep}(t)?k1(t):t}function k1(e,t){return VA(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}var L1=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},D1=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let E1=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof S1||e instanceof y1}getChildren(e){if(e instanceof S1)return e.groups;if(e instanceof y1)return e.resolve(this._resolverService).then((e=>e.children));throw new Error("bad tree")}};E1=L1([D1(0,Zw)],E1);class N1{getHeight(){return 23}getTemplateId(e){return e instanceof y1?O1.id:R1.id}}let I1=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof C1){const i=null===(t=e.parent.getPreview(e))||void 0===t?void 0:t.preview(e.range);if(i)return i.value}return $A(e.uri)}};I1=L1([D1(0,uW)],I1);class T1{getId(e){return e instanceof C1?e.id:e.uri}}let M1=class extends Uo{constructor(e,t,i){super(),this._uriLabel=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new DU(n,{supportHighlights:!0})),this.badge=new Kj(Lw(n,Mw(".count"))),this._register(function(e,t,i){return Tz(t,{badgeBackground:(null==i?void 0:i.badgeBackground)||Fx,badgeForeground:(null==i?void 0:i.badgeForeground)||Bx,badgeBorder:dx},e)}(this.badge,i)),e.appendChild(n)}set(e,t){let i=qA(e.uri);this.file.setLabel(x1(e.uri),this._uriLabel.getUriLabel(i,{relative:!0}),{title:this._uriLabel.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat($m(0,"{0} references",n)):this.badge.setTitleFormat($m(0,"{0} reference",n))}};M1=L1([D1(1,xW),D1(2,Ry)],M1);let O1=class e{constructor(t){this._instantiationService=t,this.templateId=e.id}renderTemplate(e){return this._instantiationService.createInstance(M1,e)}renderElement(e,t,i){i.set(e.element,XH(e.filterData))}disposeTemplate(e){e.dispose()}};O1.id="FileReferencesRenderer",O1=L1([D1(0,n_)],O1);class A1{constructor(e){this.label=new bU(e)}set(e,t){var i;const n=null===(i=e.parent.getPreview(e))||void 0===i?void 0:i.preview(e.range);if(n&&n.value){const{value:e,highlight:i}=n;t&&!lz.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(e,XH(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(e,[i]))}else this.label.set(`${$A(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`)}}class R1{constructor(){this.templateId=R1.id}renderTemplate(e){return new A1(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}R1.id="OneReferenceRenderer";class P1{getWidgetAriaLabel(){return $m(0,"References")}getAriaLabel(e){return e.ariaMessage}}var F1=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},B1=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},V1=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class W1{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Cs,this._callOnModelChange=new Cs,this._callOnDispose.add(this._editor.onDidChangeModel((()=>this._onModelChanged()))),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e)for(let t of this._model.references)if(t.uri.toString()===e.uri.toString())return void this._addDecorations(t.parent)}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations((()=>this._onDecorationChanged())));const t=[],i=[];for(let o=0,s=e.children.length;o{e.equals(9)&&(this._keybindingService.dispatchEvent(e,e.target),e.stopPropagation())}),!0)),this._tree=this._instantiationService.createInstance(H1,"ReferencesWidget",this._treeContainer,new N1,[this._instantiationService.createInstance(O1),this._instantiationService.createInstance(R1)],this._instantiationService.createInstance(E1),t),this._splitView.addView({onDidChange:ds.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:e=>{this._preview.layout({height:this._dim.height,width:e})}},U$.Distribute),this._splitView.addView({onDidChange:ds.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:e=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${e}px`,this._tree.layout(this._dim.height,e)}},U$.Distribute),this._disposables.add(this._splitView.onDidSashChange((()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)}),void 0));let i=(e,t)=>{e instanceof C1&&("show"===t&&this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:t,source:"tree"}))};this._tree.onDidOpen((e=>{e.sideBySide?i(e.element,"side"):e.editorOptions.pinned?i(e.element,"goto"):i(e.element,"show")})),Aw(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new tw(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then((()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))}))}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=$m(0,"No results"),Ow(this._messageContainer),Promise.resolve(void 0)):(Aw(this._messageContainer),this._decorationsManager=new W1(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange((e=>this._tree.rerender(e)))),this._disposeOnNewModel.add(this._preview.onMouseDown((e=>{const{event:t,target:i}=e;if(2!==t.detail)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})}))),this.container.classList.add("results-loaded"),Ow(this._treeContainer),Ow(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(1===this._model.groups.length?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();return e instanceof C1?e:e instanceof y1&&e.children.length>0?e.children[0]:void 0}revealReference(e){return V1(this,void 0,void 0,(function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}))}_revealReference(e,t){return V1(this,void 0,void 0,(function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==IC.inMemory?this.setTitle(UA(e.uri),this._uriLabel.getUriLabel(qA(e.uri))):this.setTitle($m(0,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent||(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent)),this._tree.reveal(e);const n=yield i;if(!this._model)return void n.dispose();bs(this._previewModelReference);const o=n.object;if(o){const t=this._preview.getModel()===o.textEditorModel?0:1,i=qo.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(i),this._preview.revealRangeInCenter(i,t)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}))}};z1=F1([B1(3,Ry),B1(4,Zw),B1(5,n_),B1(6,a1),B1(7,xW),B1(8,mP),B1(9,uW),B1(10,rv),B1(11,pv)],z1);var j1=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},U1=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}},$1=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const K1=new Ly("referenceSearchVisible",!1,$m(0,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let q1=class e{constructor(e,t,i,n,o,s,r,a){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=s,this._storageService=r,this._configurationService=a,this._disposables=new Cs,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=K1.bindTo(i)}static get(t){return t.getContribution(e.ID)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),null===(e=this._widget)||void 0===e||e.dispose(),null===(t=this._model)||void 0===t||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage((()=>{this.closeWidget()}))),this._disposables.add(this._editor.onDidChangeModel((()=>{this._ignoreModelChangeEvent||this.closeWidget()})));const o="peekViewLayout",s=class{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch(n){}return{ratio:t||.7,heightInLines:i||18}}}.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(z1,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle($m(0,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose((()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()}))),this._disposables.add(this._widget.onDidSelectReference((e=>{let{element:t,kind:n}=e;if(t)switch(n){case"open":"editor"===e.source&&this._configurationService.getValue("editor.stablePeek")||this.openReference(t,!1,!1);break;case"side":this.openReference(t,!0,!1);break;case"goto":i?this._gotoReference(t):this.openReference(t,!1,!0)}})));const r=++this._requestIdPool;t.then((t=>{var i;if(r===this._requestIdPool&&this._widget)return null===(i=this._model)||void 0===i||i.dispose(),this._model=t,this._widget.setModel(this._model).then((()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle($m(0,"{0} ({1})",this._model.title,this._model.references.length));let t=this._editor.getModel().uri,i=new er(e.startLineNumber,e.startColumn),n=this._model.nearestReference(t,i);if(n)return this._widget.setSelection(n).then((()=>{this._widget&&"editor"===this._editor.getOption(77)&&this._widget.focusOnPreviewEditor()}))}}));t.dispose()}),(e=>{this._notificationService.error(e)}))}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return $1(this,void 0,void 0,(function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(n),yield this._gotoReference(n),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}))}revealReference(e){return $1(this,void 0,void 0,(function*(){this._editor.hasModel()&&this._model&&this._widget&&(yield this._widget.revealReference(e))}))}closeWidget(e=!0){var t,i;null===(t=this._widget)||void 0===t||t.dispose(),null===(i=this._model)||void 0===i||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(t){this._widget&&this._widget.hide(),this._ignoreModelChangeEvent=!0;const i=qo.lift(t.range).collapseToStart();return this._editorService.openCodeEditor({resource:t.uri,options:{selection:i,selectionSource:"code.jump"}},this._editor).then((t=>{var n;if(this._ignoreModelChangeEvent=!1,t&&this._widget)if(this._editor===t)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=e.get(t),s=this._model.clone();this.closeWidget(),t.focus(),null==o||o.toggleWidget(i,Iv((e=>Promise.resolve(s))),null!==(n=this._peekMode)&&void 0!==n&&n)}else this.closeWidget()}),(e=>{this._ignoreModelChangeEvent=!1,Jo(e)}))}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};function G1(e,t){const i=function(e){let t=e.get(r_).getFocusedCodeEditor();return t instanceof z0?t.getParentEditor():t}(e);if(!i)return;const n=q1.get(i);n&&t(n)}q1.ID="editor.contrib.referencesController",q1=j1([U1(2,Dy),U1(3,r_),U1(4,rF),U1(5,n_),U1(6,tZ),U1(7,ev)],q1),Jy.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Al(2089,60),when:ry.or(K1,l1.inPeekEditor),handler(e){G1(e,(e=>{e.changeFocusBetweenPreviewAndReferences()}))}}),Jy.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:ry.or(K1,l1.inPeekEditor),handler(e){G1(e,(e=>{e.goToNextOrPreviousReference(!0)}))}}),Jy.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:ry.or(K1,l1.inPeekEditor),handler(e){G1(e,(e=>{e.goToNextOrPreviousReference(!1)}))}}),ny.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),ny.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),ny.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),ny.registerCommand("closeReferenceSearch",(e=>G1(e,(e=>e.closeWidget())))),Jy.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:ry.and(l1.inPeekEditor,ry.not("config.editor.stablePeek"))}),Jy.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:ry.and(K1,ry.not("config.editor.stablePeek"))}),Jy.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ry.and(K1,oq,dq.negate(),cq.negate()),handler(e){var t;const i=null===(t=e.get(eq).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof C1&&G1(e,(e=>e.revealReference(i[0])))}}),Jy.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ry.and(K1,oq,dq.negate(),cq.negate()),handler(e){var t;const i=null===(t=e.get(eq).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof C1&&G1(e,(e=>e.openReference(i[0],!0,!0)))}}),ny.registerCommand("openReference",(e=>{var t;const i=null===(t=e.get(eq).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof C1&&G1(e,(e=>e.openReference(i[0],!1,!0)))}));var Z1=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Y1=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};const X1=new Ly("hasSymbols",!1,$m(0,"Whether there are symbol locations that can be navigated via keyboard-only.")),Q1=s_("ISymbolNavigationService");let J1=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=X1.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),null===(e=this._currentState)||void 0===e||e.dispose(),null===(t=this._currentMessage)||void 0===t||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1)return void this.reset();this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new e2(this._editorService),n=i.onDidChange((e=>{if(this._ignoreEditorChange)return;const i=this._editorService.getActiveCodeEditor();if(!i)return;const n=i.getModel(),o=i.getPosition();if(!n||!o)return;let s=!1,r=!1;for(const a of t.references)if(jA(a.uri,n.uri))s=!0,r=r||qo.containsPosition(a.range,o);else if(s)break;s&&r||this.reset()}));this._currentState=ta(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:qo.collapseToStart(t.range),selectionRevealType:3}},e).finally((()=>{this._ignoreEditorChange=!1}))}_showMessage(){var e;null===(e=this._currentMessage)||void 0===e||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?$m(0,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):$m(0,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};J1=Z1([Y1(0,Dy),Y1(1,r_),Y1(2,rF),Y1(3,uW)],J1),dv(Q1,J1,!0),dS(new class extends sS{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:X1,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,t){return e.get(Q1).revealNext(t)}}),Jy.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:X1,primary:9,handler(e){e.get(Q1).reset()}});let e2=class{constructor(e){this._listener=new Map,this._disposables=new Cs,this._onDidChange=new $o,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),bs(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,ta(e.onDidChangeCursorPosition((t=>this._onDidChange.fire({editor:e}))),e.onDidChangeModelContent((t=>this._onDidChange.fire({editor:e})))))}_onDidRemoveEditor(e){var t;null===(t=this._listener.get(e))||void 0===t||t.dispose(),this._listener.delete(e)}};e2=Z1([Y1(0,r_)],e2);var t2=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function i2(e,t,i,n){const o=i.ordered(e).map((i=>Promise.resolve(n(i,e,t)).then(void 0,(e=>{Ta(e)}))));return Promise.all(o).then((e=>{const t=[];for(let i of e)Array.isArray(i)?t.push(...i):i&&t.push(i);return t}))}function n2(e,t,i,n){return i2(t,i,e,((e,t,i)=>e.provideDefinition(t,i,n)))}function o2(e,t,i,n){return i2(t,i,e,((e,t,i)=>e.provideDeclaration(t,i,n)))}function s2(e,t,i,n){return i2(t,i,e,((e,t,i)=>e.provideImplementation(t,i,n)))}function r2(e,t,i,n){return i2(t,i,e,((e,t,i)=>e.provideTypeDefinition(t,i,n)))}function a2(e,t,i,n,o){return i2(t,i,e,((e,t,i)=>t2(this,void 0,void 0,(function*(){const s=yield e.provideReferences(t,i,{includeDeclaration:!0},o);if(!n||!s||2!==s.length)return s;const r=yield e.provideReferences(t,i,{includeDeclaration:!1},o);return r&&1===r.length?r:s}))))}function l2(e){return t2(this,void 0,void 0,(function*(){const t=yield e(),i=new S1(t,""),n=i.references.map((e=>e.link));return i.dispose(),n}))}lS("_executeDefinitionProvider",((e,t,i)=>{const n=n2(e.get(lb).definitionProvider,t,i,Ia.None);return l2((()=>n))})),lS("_executeTypeDefinitionProvider",((e,t,i)=>{const n=r2(e.get(lb).typeDefinitionProvider,t,i,Ia.None);return l2((()=>n))})),lS("_executeDeclarationProvider",((e,t,i)=>{const n=o2(e.get(lb).declarationProvider,t,i,Ia.None);return l2((()=>n))})),lS("_executeReferenceProvider",((e,t,i)=>{const n=a2(e.get(lb).referenceProvider,t,i,!1,Ia.None);return l2((()=>n))})),lS("_executeImplementationProvider",((e,t,i)=>{const n=s2(e.get(lb).implementationProvider,t,i,Ia.None);return l2((()=>n))}));var d2,h2,c2,u2,g2,p2,m2,f2,_2=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};Zy.appendMenuItem(qy.EditorContext,{submenu:qy.EditorContextPeek,title:$m(0,"Peek"),group:"navigation",order:100});const v2=new Set;function b2(e){const t=new e;return uS(t),v2.add(t.id),t}class C2{constructor(e,t){this.model=e,this.position=t}static is(e){return!(!e||"object"!=typeof e)&&(e instanceof C2||!(!er.isIPosition(e.position)||!e.model))}}class w2 extends rS{constructor(e,t){super(t),this.configuration=e}run(e,t,i){if(!t.hasModel())return Promise.resolve(void 0);const n=e.get(rF),o=e.get(r_),s=e.get(MB),r=e.get(Q1),a=e.get(lb),l=t.getModel(),d=t.getPosition(),h=C2.is(i)?i:new C2(l,d),c=new oX(t,5),u=Tv(this._getLocationModel(a,h.model,h.position,c.token),c.token).then((e=>_2(this,void 0,void 0,(function*(){var i;if(!e||c.token.isCancellationRequested)return;let n;if($w(e.ariaMessage),e.referenceAt(l.uri,d)){const e=this._getAlternativeCommand(t);e!==this.id&&v2.has(e)&&(n=t.getAction(e))}const s=e.references.length;if(0===s){if(!this.configuration.muteMessage){const e=l.getWordAtPosition(d);null===(i=mJ.get(t))||void 0===i||i.showMessage(this._getNoResultFoundMessage(e),d)}}else{if(1!==s||!n)return this._onResult(o,r,t,e);n.run()}}))),(e=>{n.error(e)})).finally((()=>{c.dispose()}));return s.showWhile(u,250),u}_onResult(e,t,i,n){return _2(this,void 0,void 0,(function*(){const o=this._getGoToPreference(i);if(i instanceof z0||!(this.configuration.openInPeek||"peek"===o&&n.references.length>1)){const s=n.firstReference(),r=n.references.length>1&&"gotoAndPeek"===o,a=yield this._openReference(i,e,s,this.configuration.openToSide,!r);r&&a?this._openInPeek(a,n):n.dispose(),"goto"===o&&t.put(s)}else this._openInPeek(i,n)}))}_openReference(e,t,i,n,o){return _2(this,void 0,void 0,(function*(){let s;if(Bl(i)&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const r=yield t.openCodeEditor({resource:i.uri,options:{selection:qo.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(r){if(o){const e=r.getModel(),t=r.deltaDecorations([],[{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout((()=>{r.getModel()===e&&r.deltaDecorations(t,[])}),350)}return r}}))}_openInPeek(e,t){const i=q1.get(e);i&&e.hasModel()?i.toggleWidget(e.getSelection(),Iv((e=>Promise.resolve(t))),this.configuration.openInPeek):t.dispose()}}class y2 extends w2{_getLocationModel(e,t,i,n){return _2(this,void 0,void 0,(function*(){return new S1(yield n2(e.definitionProvider,t,i,n),$m(0,"Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?$m(0,"No definition found for '{0}'",e.word):$m(0,"No definition found")}_getAlternativeCommand(e){return e.getOption(51).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(51).multipleDefinitions}}const S2=Fs&&!zf?2118:70;b2(((d2=class e extends y2{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,label:$m(0,"Go to Definition"),alias:"Go to Definition",precondition:ry.and(dI.hasDefinitionProvider,dI.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:dI.editorTextFocus,primary:S2,weight:100},contextMenuOpts:{group:"navigation",order:1.1}}),ny.registerCommandAlias("editor.action.goToDeclaration",e.id)}}).id="editor.action.revealDefinition",d2)),b2(((h2=class e extends y2{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:e.id,label:$m(0,"Open Definition to the Side"),alias:"Open Definition to the Side",precondition:ry.and(dI.hasDefinitionProvider,dI.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:dI.editorTextFocus,primary:Al(2089,S2),weight:100}}),ny.registerCommandAlias("editor.action.openDeclarationToTheSide",e.id)}}).id="editor.action.revealDefinitionAside",h2)),b2(((c2=class e extends y2{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.id,label:$m(0,"Peek Definition"),alias:"Peek Definition",precondition:ry.and(dI.hasDefinitionProvider,l1.notInPeekEditor,dI.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:dI.editorTextFocus,primary:582,linux:{primary:3140},weight:100},contextMenuOpts:{menuId:qy.EditorContextPeek,group:"peek",order:2}}),ny.registerCommandAlias("editor.action.previewDeclaration",e.id)}}).id="editor.action.peekDefinition",c2));class x2 extends w2{_getLocationModel(e,t,i,n){return _2(this,void 0,void 0,(function*(){return new S1(yield o2(e.declarationProvider,t,i,n),$m(0,"Declarations"))}))}_getNoResultFoundMessage(e){return e&&e.word?$m(0,"No declaration found for '{0}'",e.word):$m(0,"No declaration found")}_getAlternativeCommand(e){return e.getOption(51).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(51).multipleDeclarations}}b2(((u2=class e extends x2{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,label:$m(0,"Go to Declaration"),alias:"Go to Declaration",precondition:ry.and(dI.hasDeclarationProvider,dI.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{group:"navigation",order:1.3}})}_getNoResultFoundMessage(e){return e&&e.word?$m(0,"No declaration found for '{0}'",e.word):$m(0,"No declaration found")}}).id="editor.action.revealDeclaration",u2)),b2(class extends x2{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",label:$m(0,"Peek Declaration"),alias:"Peek Declaration",precondition:ry.and(dI.hasDeclarationProvider,l1.notInPeekEditor,dI.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:qy.EditorContextPeek,group:"peek",order:3}})}});class k2 extends w2{_getLocationModel(e,t,i,n){return _2(this,void 0,void 0,(function*(){return new S1(yield r2(e.typeDefinitionProvider,t,i,n),$m(0,"Type Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?$m(0,"No type definition found for '{0}'",e.word):$m(0,"No type definition found")}_getAlternativeCommand(e){return e.getOption(51).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(51).multipleTypeDefinitions}}b2(((g2=class e extends k2{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,label:$m(0,"Go to Type Definition"),alias:"Go to Type Definition",precondition:ry.and(dI.hasTypeDefinitionProvider,dI.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:dI.editorTextFocus,primary:0,weight:100},contextMenuOpts:{group:"navigation",order:1.4}})}}).ID="editor.action.goToTypeDefinition",g2)),b2(((p2=class e extends k2{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,label:$m(0,"Peek Type Definition"),alias:"Peek Type Definition",precondition:ry.and(dI.hasTypeDefinitionProvider,l1.notInPeekEditor,dI.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:qy.EditorContextPeek,group:"peek",order:4}})}}).ID="editor.action.peekTypeDefinition",p2));class L2 extends w2{_getLocationModel(e,t,i,n){return _2(this,void 0,void 0,(function*(){return new S1(yield s2(e.implementationProvider,t,i,n),$m(0,"Implementations"))}))}_getNoResultFoundMessage(e){return e&&e.word?$m(0,"No implementation found for '{0}'",e.word):$m(0,"No implementation found")}_getAlternativeCommand(e){return e.getOption(51).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(51).multipleImplementations}}b2(((m2=class e extends L2{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,label:$m(0,"Go to Implementations"),alias:"Go to Implementations",precondition:ry.and(dI.hasImplementationProvider,dI.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:dI.editorTextFocus,primary:2118,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}}).ID="editor.action.goToImplementation",m2)),b2(((f2=class e extends L2{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,label:$m(0,"Peek Implementations"),alias:"Peek Implementations",precondition:ry.and(dI.hasImplementationProvider,l1.notInPeekEditor,dI.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:dI.editorTextFocus,primary:3142,weight:100},contextMenuOpts:{menuId:qy.EditorContextPeek,group:"peek",order:5}})}}).ID="editor.action.peekImplementation",f2));class D2 extends w2{_getNoResultFoundMessage(e){return e?$m(0,"No references found for '{0}'",e.word):$m(0,"No references found")}_getAlternativeCommand(e){return e.getOption(51).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(51).multipleReferences}}b2(class extends D2{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",label:$m(0,"Go to References"),alias:"Go to References",precondition:ry.and(dI.hasReferenceProvider,l1.notInPeekEditor,dI.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:dI.editorTextFocus,primary:1094,weight:100},contextMenuOpts:{group:"navigation",order:1.45}})}_getLocationModel(e,t,i,n){return _2(this,void 0,void 0,(function*(){return new S1(yield a2(e.referenceProvider,t,i,!0,n),$m(0,"References"))}))}}),b2(class extends D2{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",label:$m(0,"Peek References"),alias:"Peek References",precondition:ry.and(dI.hasReferenceProvider,l1.notInPeekEditor,dI.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:qy.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,n){return _2(this,void 0,void 0,(function*(){return new S1(yield a2(e.referenceProvider,t,i,!1,n),$m(0,"References"))}))}});class E2 extends w2{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",label:$m(0,"Go to Any Symbol"),alias:"Go to Any Symbol",precondition:ry.and(l1.notInPeekEditor,dI.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,n){return _2(this,void 0,void 0,(function*(){return new S1(this._references,$m(0,"Locations"))}))}_getNoResultFoundMessage(e){return e&&$m(0,"No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return null!==(t=this._gotoMultipleBehaviour)&&void 0!==t?t:e.getOption(51).multipleReferences}_getAlternativeCommand(){return""}}ny.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Ps},{name:"position",description:"The position at which to start",constraint:er.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(e,t,i,n,o,s,r)=>_2(void 0,void 0,void 0,(function*(){Js(Ps.isUri(t)),Js(er.isIPosition(i)),Js(Array.isArray(n)),Js(void 0===o||"string"==typeof o),Js(void 0===r||"boolean"==typeof r);const a=e.get(r_),l=yield a.openCodeEditor({resource:t},a.getFocusedCodeEditor());if(rX(l))return l.setPosition(i),l.revealPositionInCenterIfOutsideViewport(i,0),l.invokeWithinContext((e=>{const t=new class extends E2{_getNoResultFoundMessage(e){return s||super._getNoResultFoundMessage(e)}}({muteMessage:!Boolean(s),openInPeek:Boolean(r),openToSide:!1},n,o);e.get(n_).invokeFunction(t.run.bind(t),l)}))}))}),ny.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Ps},{name:"position",description:"The position at which to start",constraint:er.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(e,t,i,n,o)=>_2(void 0,void 0,void 0,(function*(){e.get(iy).executeCommand("editor.action.goToLocations",t,i,n,o,void 0,!0)}))}),ny.registerCommand({id:"editor.action.findReferences",handler:(e,t,i)=>{Js(Ps.isUri(t)),Js(er.isIPosition(i));const n=e.get(lb),o=e.get(r_);return o.openCodeEditor({resource:t},o.getFocusedCodeEditor()).then((e=>{if(!rX(e)||!e.hasModel())return;const t=q1.get(e);if(!t)return;const o=Iv((t=>a2(n.referenceProvider,e.getModel(),er.lift(i),!1,t).then((e=>new S1(e,$m(0,"References")))))),s=new qo(i.lineNumber,i.column,i.lineNumber,i.column);return Promise.resolve(t.toggleWidget(s,o,!1))}))}}),ny.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations"),Zy.appendMenuItems([{id:qy.MenubarGoMenu,item:{command:{id:"editor.action.revealDefinition",title:$m(0,"Go to &&Definition")},group:"4_symbol_nav",order:2}},{id:qy.MenubarGoMenu,item:{command:{id:"editor.action.revealDeclaration",title:$m(0,"Go to &&Declaration")},group:"4_symbol_nav",order:3}},{id:qy.MenubarGoMenu,item:{command:{id:"editor.action.goToTypeDefinition",title:$m(0,"Go to &&Type Definition")},group:"4_symbol_nav",order:3}},{id:qy.MenubarGoMenu,item:{command:{id:"editor.action.goToImplementation",title:$m(0,"Go to &&Implementations")},group:"4_symbol_nav",order:4}},{id:qy.MenubarGoMenu,item:{command:{id:"editor.action.goToReferences",title:$m(0,"Go to &&References")},group:"4_symbol_nav",order:5}}]);var N2=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},I2=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};let T2=class e{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new Cs,this.toUnhookForKeyboard=new Cs,this.linkDecorations=[],this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e;let o=new V0(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown((([e,t])=>{this.startFindDefinitionFromMouse(e,Qs(t))}))),this.toUnhook.add(o.onExecute((e=>{this.isEnabled(e)&&this.gotoDefinition(e.target.position,e.hasSideBySideModifier).then((()=>{this.removeLinkDecorations()}),(e=>{this.removeLinkDecorations(),Jo(e)}))}))),this.toUnhook.add(o.onCancel((()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null})))}static get(t){return t.getContribution(e.ID)}startFindDefinitionFromCursor(e){return this.startFindDefinition(e).then((()=>{this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition((()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()}))),this.toUnhookForKeyboard.add(this.editor.onKeyDown((e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())})))}))}startFindDefinitionFromMouse(e,t){if(9===e.target.type&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordAtPosition=null,void this.removeLinkDecorations();const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const i=e?null===(t=this.editor.getModel())||void 0===t?void 0:t.getWordAtPosition(e):null;if(!i)return this.currentWordAtPosition=null,this.removeLinkDecorations(),Promise.resolve(0);if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return Promise.resolve(0);this.currentWordAtPosition=i;let n=new nX(this.editor,15);return this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Iv((t=>this.findDefinition(e,t))),this.previousPromise.then((t=>{if(t&&t.length&&n.validate(this.editor))if(t.length>1)this.addDecoration(new qo(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),(new CU).appendText($m(0,"Click to show {0} definitions.",t.length)));else{let n=t[0];if(!n.uri)return;this.textModelResolverService.createModelReference(n.uri).then((t=>{if(!t.object||!t.object.textEditorModel)return void t.dispose();const{object:{textEditorModel:o}}=t,{startLineNumber:s}=n.range;if(s<1||s>o.getLineCount())return void t.dispose();const r=this.getPreviewValue(o,s,n);let a;a=n.originSelectionRange?qo.lift(n.originSelectionRange):new qo(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);const l=this.languageService.guessLanguageIdByFilepathOrFirstLine(o.uri);this.addDecoration(a,(new CU).appendCodeblock(l||"",r)),t.dispose()}))}else this.removeLinkDecorations()})).then(void 0,Jo)}getPreviewValue(t,i,n){let o=n.targetSelectionRange?n.range:this.getPreviewRangeBasedOnBrackets(t,i);o.endLineNumber-o.startLineNumber>=e.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(t,i));return this.stripIndentationFromPreviewRange(t,i,o)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);for(let o=t+1;on)return new qo(i,1,n+1,1);r=t.bracketPairs.findNextBracket(new er(a,l))}return new qo(i,1,n+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[i])}removeLinkDecorations(){this.linkDecorations.length>0&&(this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[]))}isEnabled(e,t){return this.editor.hasModel()&&e.isNoneOrSingleMouseDown&&6===e.target.type&&(e.hasTriggerModifier||!!t&&t.keyCodeIsTriggerKey)&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?n2(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext((e=>{const i=!t&&this.editor.getOption(78)&&!this.isInPeekEditor(e);return new y2({openToSide:t,openInPeek:i,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(e,this.editor)}))}isInPeekEditor(e){const t=e.get(Dy);return l1.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose()}};T2.ID="editor.contrib.gotodefinitionatposition",T2.MAX_SOURCE_PREVIEW_LINES=8,T2=N2([I2(1,Zw),I2(2,rv),I2(3,lb)],T2),gS(T2.ID,T2),zy(((e,t)=>{const i=e.getColor(Mk);i&&t.addRule(`.monaco-editor .goto-definition-link { color: ${i} !important; }`)}));const M2=Mw;class O2 extends Uo{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new sT(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class A2 extends Uo{constructor(e,t,i){super(),this.actionContainer=Lw(e,M2("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Lw(this.actionContainer,M2("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Lw(this.action,M2(`span.icon.${t.iconClass}`));Lw(this.action,M2("span")).textContent=i?`${t.label} (${i})`:t.label,this._register(BC(this.actionContainer,yw.CLICK,(e=>{e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer)}))),this._register(BC(this.actionContainer,yw.KEY_UP,(e=>{new SC(e).equals(3)&&(e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer))}))),this.setEnabled(!0)}static render(e,t,i){return new A2(e,t,i)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}var R2=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},P2=globalThis&&globalThis.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,o){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,o,(t=e[i](t)).done,t.value)}))}}};class F2{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}}class B2 extends Uo{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new $o),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Hv((()=>this._triggerAsyncComputation()),0)),this._secondWaitScheduler=this._register(new Hv((()=>this._triggerSyncComputation()),0)),this._loadingMessageScheduler=this._register(new Hv((()=>this._triggerLoadingMessage()),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(53).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=function(e){const t=new as,i=e(t.token);return new Zv(t,(e=>Ev(this,void 0,void 0,(function*(){var n,o;const s=t.token.onCancellationRequested((()=>{s.dispose(),t.dispose(),e.reject(new ls)}));try{try{for(var r,a=Nv(i);!(r=yield a.next()).done;){const i=r.value;if(t.token.isCancellationRequested)return;e.emitOne(i)}}catch(l){n={error:l}}finally{try{r&&!r.done&&(o=a.return)&&(yield o.call(a))}finally{if(n)throw n.error}}s.dispose(),t.dispose()}catch(d){s.dispose(),t.dispose(),e.reject(d)}}))))}((e=>this._computer.computeAsync(e))),(()=>{R2(this,void 0,void 0,(function*(){var e,t;try{try{for(var i,n=P2(this._asyncIterable);!(i=yield n.next()).done;){const e=i.value;e&&(this._result.push(e),this._fireResult())}}catch(o){e={error:o}}finally{try{i&&!i.done&&(t=n.return)&&(yield t.call(n))}finally{if(e)throw e.error}}this._asyncIterableDone=!0,3!==this._state&&4!==this._state||this._setState(0)}catch(s){Jo(s)}}))})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){3===this._state&&this._setState(4)}_fireResult(){if(1===this._state||2===this._state)return;const e=0===this._state,t=4===this._state;this._onResult.fire(new F2(this._result.slice(0),e,t))}start(e){if(0===e)0===this._state&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation()}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class V2{constructor(e,t){this.priority=e,this.range=t,this.type=1}equals(e){return 1===e.type&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return 1===e.type&&t.lineNumber===this.range.startLineNumber}}class W2{constructor(e,t,i){this.priority=e,this.owner=t,this.range=i,this.type=2}equals(e){return 2===e.type&&this.owner===e.owner}canAdoptVisibleHover(e,t){return 2===e.type&&this.owner===e.owner}}const H2=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class z2{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e,t=this.pos,i=0,n=this.value.charCodeAt(t);if(e=z2._table[n],"number"==typeof e)return this.pos+=1,{type:e,pos:t,len:1};if(z2.isDigitCharacter(n)){e=8;do{i+=1,n=this.value.charCodeAt(t+i)}while(z2.isDigitCharacter(n));return this.pos+=i,{type:e,pos:t,len:i}}if(z2.isVariableCharacter(n)){e=9;do{n=this.value.charCodeAt(t+ ++i)}while(z2.isVariableCharacter(n)||z2.isDigitCharacter(n));return this.pos+=i,{type:e,pos:t,len:i}}e=10;do{i+=1,n=this.value.charCodeAt(t+i)}while(!isNaN(n)&&void 0===z2._table[n]&&!z2.isDigitCharacter(n)&&!z2.isVariableCharacter(n));return this.pos+=i,{type:e,pos:t,len:i}}}z2._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class j2{constructor(){this._children=[]}appendChild(e){return e instanceof U2&&this._children[this._children.length-1]instanceof U2?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function e(t,i){for(const n of t)n.parent=i,e(n.children,n)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof Q2)return e;e=e.parent}}toString(){return this.children.reduce(((e,t)=>e+t.toString()),"")}len(){return 0}}class U2 extends j2{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new U2(this.value)}}class $2 extends j2{}class K2 extends $2{constructor(e){super(),this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}get isFinalTabstop(){return 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof q2?this._children[0]:void 0}clone(){let e=new K2(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}class q2 extends j2{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof U2&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new q2;return this.options.forEach(e.appendChild,e),e}}class G2 extends j2{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,(function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))}));return!i&&this._children.some((e=>e instanceof Z2&&Boolean(e.elseValue)))&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Z2){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){let e=new G2;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map((e=>e.clone())),e}}class Z2 extends j2{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":"camelcase"===this.shorthandName?e?this._toCamelCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase())).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(((e,t)=>0===t?e.toLowerCase():e.charAt(0).toUpperCase()+e.substr(1).toLowerCase())).join(""):e}clone(){return new Z2(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Y2 extends $2{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new U2(t)],!0)}clone(){const e=new Y2(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}function X2(e,t){const i=[...e];for(;i.length>0;){const e=i.shift();if(!t(e))break;i.unshift(...e.children)}}class Q2 extends j2{get placeholderInfo(){if(!this._placeholders){let e,t=[];this.walk((function(i){return i instanceof K2&&(t.push(i),e=!e||e.indexn===e?(i=!0,!1):(t+=n.len(),!0))),i?t:-1}fullLen(e){let t=0;return X2([e],(e=>(t+=e.len(),!0))),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof K2&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk((t=>(t instanceof Y2&&t.resolve(e)&&(this._placeholders=void 0),!0))),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let e=new Q2;return this._children=this.children.map((e=>e.clone())),e}walk(e){X2(this.children,e)}}class J2{constructor(){this._scanner=new z2,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){this._scanner.text(e),this._token=this._scanner.next();const n=new Q2;for(;this._parse(n););const o=new Map,s=[];let r=0;n.walk((e=>(e instanceof K2&&(r+=1,e.isFinalTabstop?o.set(0,void 0):!o.has(e.index)&&e.children.length>0?o.set(e.index,e.children):s.push(e)),!0)));for(const a of s){const e=o.get(a.index);if(e){const t=new K2(a.index);t.transform=a.transform;for(const i of e)t.appendChild(i.clone());n.replace(a,[t])}}return i||(i=r>0&&t),!o.has(0)&&i&&n.appendChild(new K2(0)),n}_accept(e,t){if(void 0===e||this._token.type===e){let e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return!!(t=this._accept(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new U2(t)),!0)}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new K2(Number(t)):new Y2(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const n=new K2(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new U2("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else{if(!(n.index>0&&this._accept(7)))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);{const t=new q2;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(t),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}}}_parseChoiceElement(e){const t=this._token,i=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;i.push(e)}return 0===i.length?(this._backTo(t),!1):(e.appendChild(new U2(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const n=new Y2(t);if(!this._accept(1))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new U2("${"+t+":")),n.children.forEach(e.appendChild,e),!0}}_parseTransform(e){let t=new G2,i="",n="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,i+=e;else{if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new U2(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}try{t.regexp=new RegExp(i,n)}catch(o){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let n=this._accept(8,!0);if(!n)return this._backTo(t),!1;if(!i)return e.appendChild(new Z2(Number(n))),!0;if(this._accept(4))return e.appendChild(new Z2(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let i=this._accept(9,!0);return i&&this._accept(4)?(e.appendChild(new Z2(Number(n),i)),!0):(this._backTo(t),!1)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new Z2(Number(n),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new Z2(Number(n),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let i=this._until(4);if(i)return e.appendChild(new Z2(Number(n),void 0,t,i)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new Z2(Number(n),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new U2(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}}const e3={inputActiveOptionBorder:QS.fromHex("#007ACC00"),inputActiveOptionForeground:QS.fromHex("#FFFFFF"),inputActiveOptionBackground:QS.fromHex("#0E639C50")};class t3 extends zI{constructor(e){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=Object.assign(Object.assign({},e3),e),this._checked=this._opts.isChecked;const t=["monaco-custom-checkbox"];this._opts.icon&&t.push(...Ys.asClassNameArray(this._opts.icon)),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,(e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())})),this.ignoreGesture(this.domNode),this.onkeydown(this.domNode,(e=>{if(10===e.keyCode||3===e.keyCode)return this.checked=!this._checked,this._onChange.fire(!0),void e.preventDefault();this._onKeyDown.fire(e)}))}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}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}style(e){e.inputActiveOptionBorder&&(this._opts.inputActiveOptionBorder=e.inputActiveOptionBorder),e.inputActiveOptionForeground&&(this._opts.inputActiveOptionForeground=e.inputActiveOptionForeground),e.inputActiveOptionBackground&&(this._opts.inputActiveOptionBackground=e.inputActiveOptionBackground),this.applyStyles()}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder?this._opts.inputActiveOptionBorder.toString():"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground?this._opts.inputActiveOptionForeground.toString():"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground?this._opts.inputActiveOptionBackground.toString():"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const i3=$m(0,"Match Case"),n3=$m(0,"Match Whole Word"),o3=$m(0,"Use Regular Expression");class s3 extends t3{constructor(e){super({icon:br.caseSensitive,title:i3+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class r3 extends t3{constructor(e){super({icon:br.wholeWord,title:n3+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class a3 extends t3{constructor(e){super({icon:br.regex,title:o3+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}const l3=$m(0,"input");class d3 extends zI{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,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.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||l3,this.inputActiveOptionBorder=n.inputActiveOptionBorder,this.inputActiveOptionForeground=n.inputActiveOptionForeground,this.inputActiveOptionBackground=n.inputActiveOptionBackground,this.inputBackground=n.inputBackground,this.inputForeground=n.inputForeground,this.inputBorder=n.inputBorder,this.inputValidationInfoBorder=n.inputValidationInfoBorder,this.inputValidationInfoBackground=n.inputValidationInfoBackground,this.inputValidationInfoForeground=n.inputValidationInfoForeground,this.inputValidationWarningBorder=n.inputValidationWarningBorder,this.inputValidationWarningBackground=n.inputValidationWarningBackground,this.inputValidationWarningForeground=n.inputValidationWarningForeground,this.inputValidationErrorBorder=n.inputValidationErrorBorder,this.inputValidationErrorBackground=n.inputValidationErrorBackground,this.inputValidationErrorForeground=n.inputValidationErrorForeground;const o=n.appendCaseSensitiveLabel||"",s=n.appendWholeWordsLabel||"",r=n.appendRegexLabel||"",a=n.history||[],l=!!n.flexibleHeight,d=!!n.flexibleWidth,h=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new fU(this.domNode,this.contextViewProvider,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:a,showHistoryHint:n.showHistoryHint,flexibleHeight:l,flexibleWidth:d,flexibleMaxHeight:h})),this.regex=this._register(new a3({appendTitle:r,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.regex.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.regex.onKeyDown((e=>{this._onRegexKeyDown.fire(e)}))),this.wholeWords=this._register(new r3({appendTitle:s,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.wholeWords.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this.caseSensitive=this._register(new s3({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.caseSensitive.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.caseSensitive.onKeyDown((e=>{this._onCaseSensitiveKeyDown.fire(e)}))),this._showOptionButtons&&(this.inputBox.paddingRight=this.caseSensitive.width()+this.wholeWords.width()+this.regex.width());let c=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,(e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){let t=c.indexOf(document.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%c.length:e.equals(15)&&(i=0===t?c.length-1:t-1),e.equals(9)?(c[t].blur(),this.inputBox.focus()):i>=0&&c[i].focus(),Sw(e,!0)}}})),this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this._showOptionButtons?"block":"none",this.controls.appendChild(this.caseSensitive.domNode),this.controls.appendChild(this.wholeWords.domNode),this.controls.appendChild(this.regex.domNode),this.domNode.appendChild(this.controls),e&&e.appendChild(this.domNode),this._register(BC(this.inputBox.inputElement,"compositionstart",(e=>{this.imeSessionInProgress=!0}))),this._register(BC(this.inputBox.inputElement,"compositionend",(e=>{this.imeSessionInProgress=!1,this._onInput.fire()}))),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive.checked}setCaseSensitive(e){this.caseSensitive.checked=e}getWholeWords(){return this.wholeWords.checked}setWholeWords(e){this.wholeWords.checked=e}getRegex(){return this.regex.checked}setRegex(e){this.regex.checked=e,this.validate()}focusOnCaseSensitive(){this.caseSensitive.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}clearMessage(){this.inputBox.hideMessage()}}const h3=$m(0,"input"),c3=$m(0,"Preserve Case");class u3 extends t3{constructor(e){super({icon:br.preserveCase,title:c3+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class g3 extends zI{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,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._onInput=this._register(new $o),this._onKeyUp=this._register(new $o),this._onPreserveCaseKeyDown=this._register(new $o),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||h3,this.inputActiveOptionBorder=n.inputActiveOptionBorder,this.inputActiveOptionForeground=n.inputActiveOptionForeground,this.inputActiveOptionBackground=n.inputActiveOptionBackground,this.inputBackground=n.inputBackground,this.inputForeground=n.inputForeground,this.inputBorder=n.inputBorder,this.inputValidationInfoBorder=n.inputValidationInfoBorder,this.inputValidationInfoBackground=n.inputValidationInfoBackground,this.inputValidationInfoForeground=n.inputValidationInfoForeground,this.inputValidationWarningBorder=n.inputValidationWarningBorder,this.inputValidationWarningBackground=n.inputValidationWarningBackground,this.inputValidationWarningForeground=n.inputValidationWarningForeground,this.inputValidationErrorBorder=n.inputValidationErrorBorder,this.inputValidationErrorBackground=n.inputValidationErrorBackground,this.inputValidationErrorForeground=n.inputValidationErrorForeground;const o=n.appendPreserveCaseLabel||"",s=n.history||[],r=!!n.flexibleHeight,a=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new fU(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder,history:s,showHistoryHint:n.showHistoryHint,flexibleHeight:r,flexibleWidth:a,flexibleMaxHeight:l})),this.preserveCase=this._register(new u3({appendTitle:o,isChecked:!1,inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground})),this._register(this.preserveCase.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.preserveCase.onKeyDown((e=>{this._onPreserveCaseKeyDown.fire(e)}))),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;let d=[this.preserveCase.domNode];this.onkeydown(this.domNode,(e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){let t=d.indexOf(document.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%d.length:e.equals(15)&&(i=0===t?d.length-1:t-1),e.equals(9)?(d[t].blur(),this.inputBox.focus()):i>=0&&d[i].focus(),Sw(e,!0)}}}));let h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e&&e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}style(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputActiveOptionForeground=e.inputActiveOptionForeground,this.inputActiveOptionBackground=e.inputActiveOptionBackground,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){if(this.domNode){const e={inputActiveOptionBorder:this.inputActiveOptionBorder,inputActiveOptionForeground:this.inputActiveOptionForeground,inputActiveOptionBackground:this.inputActiveOptionBackground};this.preserveCase.style(e);const t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoForeground:this.inputValidationInfoForeground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningForeground:this.inputValidationWarningForeground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorForeground:this.inputValidationErrorForeground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox&&this.inputBox.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.inputBox.width=e,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var p3=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},m3=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};const f3=new Ly("suggestWidgetVisible",!1,$m(0,"Whether suggestion are visible"));function _3(e,t){return e.getContext(document.activeElement).getValue(t)}function v3(e,t){const i=function(e,t){return e.createScoped(t.target)}(e,t);!function(e,t,i){new Ly(i,t).bindTo(e)}(i,t,"historyNavigationWidget");return{scopedContextKeyService:i,historyNavigationForwardsEnablement:new Ly("historyNavigationForwardsEnabled",!0).bindTo(i),historyNavigationBackwardsEnablement:new Ly("historyNavigationBackwardsEnabled",!0).bindTo(i)}}let b3=class extends d3{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(v3(n,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};b3=p3([m3(3,Dy)],b3);let C3=class extends g3{constructor(e,t,i,n,o=!1){super(e,t,o,i),this._register(v3(n,{target:this.inputBox.element,historyNavigator:this.inputBox}).scopedContextKeyService)}};C3=p3([m3(3,Dy)],C3),Jy.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:ry.and(ry.has("historyNavigationWidget"),ry.equals("historyNavigationBackwardsEnabled",!0),f3.isEqualTo(!1)),primary:16,secondary:[528],handler:e=>{const t=_3(e.get(Dy),"historyNavigationWidget");if(t){t.historyNavigator.showPreviousValue()}}}),Jy.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:ry.and(ry.has("historyNavigationWidget"),ry.equals("historyNavigationForwardsEnabled",!0),f3.isEqualTo(!1)),primary:18,secondary:[530],handler:e=>{const t=_3(e.get(Dy),"historyNavigationWidget");if(t){t.historyNavigator.showNextValue()}}});var w3=globalThis&&globalThis.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const y3={Visible:f3,DetailsVisible:new Ly("suggestWidgetDetailsVisible",!1,$m(0,"Whether suggestion details are visible")),MultipleSuggestions:new Ly("suggestWidgetMultipleSuggestions",!1,$m(0,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Ly("suggestionMakesTextEdit",!0,$m(0,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Ly("acceptSuggestionOnEnter",!0,$m(0,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Ly("suggestionHasInsertAndReplaceRange",!1,$m(0,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Ly("suggestionInsertMode",void 0,{type:"string",description:$m(0,"Whether the default behaviour is to insert or replace")}),CanResolve:new Ly("suggestionCanResolve",!1,$m(0,"Whether the current suggestion supports to resolve further details"))},S3=new qy("suggestWidgetStatusBar");class x3{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=lz.Default,this.distance=0,this.textLabel="string"==typeof t.label?t.label:t.label.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),qo.isIRange(t.range)?(this.editStart=new er(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new er(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new er(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||qo.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new er(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new er(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new er(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||qo.spansMultipleLines(t.range.insert)||qo.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),"function"!=typeof n.resolveCompletionItem&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return w3(this,void 0,void 0,(function*(){if(!this._resolveCache){const t=e.onCancellationRequested((()=>{this._resolveCache=void 0,this._isResolved=!1}));this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then((e=>{Object.assign(this.completion,e),this._isResolved=!0,t.dispose()}),(e=>{Na(e)&&(this._resolveCache=void 0,this._isResolved=!1)}))}return this._resolveCache}))}}class k3{constructor(e=2,t=new Set,i=new Set,n=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.showDeprecated=n}}k3.default=new k3;class L3{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}function D3(e,t,i,n=k3.default,o={triggerKind:0},s=Ia.None){return w3(this,void 0,void 0,(function*(){const r=new ps(!0);i=i.clone();const a=t.getWordAtPosition(i),l=a?new qo(i.lineNumber,a.startColumn,i.lineNumber,a.endColumn):qo.fromPositions(i),d={replace:l,insert:l.setEndPosition(i.lineNumber,i.column)},h=[],c=new Cs,u=[];let g=!1;const p=(e,t,o)=>{var s,r,a;let l=!1;if(!t)return l;for(let c of t.suggestions)if(!n.kindFilter.has(c.kind)){if(!n.showDeprecated&&(null===(s=null==c?void 0:c.tags)||void 0===s?void 0:s.includes(1)))continue;c.range||(c.range=d),c.sortText||(c.sortText="string"==typeof c.label?c.label:c.label.label),!g&&c.insertTextRules&&4&c.insertTextRules&&(g=J2.guessNeedsClipboard(c.insertText)),h.push(new x3(i,c,t,e)),l=!0}return ga(t)&&c.add(t),u.push({providerName:null!==(r=e._debugDisplayName)&&void 0!==r?r:"unknown_provider",elapsedProvider:null!==(a=t.duration)&&void 0!==a?a:-1,elapsedOverall:o.elapsed()}),l},m=(()=>w3(this,void 0,void 0,(function*(){})))();for(let f of e.orderedGroups(t)){let e=!1;if(yield Promise.all(f.map((r=>w3(this,void 0,void 0,(function*(){if(!(n.providerFilter.size>0)||n.providerFilter.has(r))try{const n=new ps(!0),a=yield r.provideCompletionItems(t,i,o,s);e=p(r,a,n)||e}catch(a){Ta(a)}}))))),e||s.isCancellationRequested)break}return yield m,s.isCancellationRequested?(c.dispose(),Promise.reject(_s())):new L3(h.sort(I3(n.snippetSortOrder)),g,{entries:u,elapsed:r.elapsed()},c)}))}function E3(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLowt.sortTextLow)return 1}return e.completion.labelt.completion.label?1:e.completion.kind-t.completion.kind}const N3=new Map;function I3(e){return N3.get(e)}let T3;N3.set(0,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return E3(e,t)})),N3.set(2,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return E3(e,t)})),N3.set(1,E3),ny.registerCommand("_executeCompletionItemProvider",((e,...t)=>w3(void 0,void 0,void 0,(function*(){const[i,n,o,s]=t;Js(Ps.isUri(i)),Js(er.isIPosition(n)),Js("string"==typeof o||!o),Js("number"==typeof s||!s);const{completionProvider:r}=e.get(lb),a=yield e.get(Zw).createModelReference(i);try{const e={incomplete:!1,suggestions:[]},t=[],i=yield D3(r,a.object.textEditorModel,er.lift(n),void 0,{triggerCharacter:o,triggerKind:o?1:0});for(const n of i.items)t.length<(null!=s?s:0)&&t.push(n.resolve(Ia.None)),e.incomplete=e.incomplete||n.container.incomplete,e.suggestions.push(n.completion);try{return yield Promise.all(t),e}finally{setTimeout((()=>i.disposable.dispose()),100)}}finally{a.dispose()}}))));let M3=[];function O3(e,t,i){const{completionProvider:n}=e.get(lb);T3||(T3=new class{provideCompletionItems(){let e={suggestions:M3.slice(0)};return M3.length=0,e}},n.register("*",T3)),setTimeout((()=>{var e;M3.push(...i),null===(e=t.getContribution("editor.contrib.suggestController"))||void 0===e||e.triggerSuggest((new Set).add(T3))}),0)}var A3=globalThis&&globalThis.__decorate||function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},R3=globalThis&&globalThis.__param||function(e,t){return function(i,n){t(i,n,e)}};const P3=Mw;let F3=class e extends Uo{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._widget=this._register(this._instantiationService.createInstance(W3,this._editor)),this._decorationsChangerListener=this._register(new B3(this._editor)),this._messages=[],this._messagesAreComplete=!1,this._participants=[];for(const n of H2.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort(((e,t)=>e.hoverOrdinal-t.hoverOrdinal)),this._computer=new z3(this._editor,this._participants),this._hoverOperation=this._register(new B2(this._editor,this._computer)),this._register(this._hoverOperation.onResult((e=>{this._withResult(e.value,e.isComplete,e.hasLoadingMessage)}))),this._register(this._decorationsChangerListener.onDidChangeModelDecorations((()=>this._onModelDecorationsChanged()))),this._register(WC(this._widget.getDomNode(),"keydown",(e=>{e.equals(9)&&this.hide()}))),this._register(Es.onDidChange((()=>{this._widget.position&&this._computer.anchor&&this._messages.length>0&&(this._widget.clear(),this._renderMessages(this._computer.anchor,this._messages))})))}_onModelDecorationsChanged(){this._widget.position&&(this._hoverOperation.cancel(),this._widget.isColorPickerVisible||this._hoverOperation.start(0))}maybeShowAt(e){const t=[];for(const n of this._participants)if(n.suggestHoverAnchor){const i=n.suggestHoverAnchor(e);i&&t.push(i)}const i=e.target;if(6===i.type&&t.push(new V2(0,i.range)),7===i.type){const e=this._editor.getOption(44).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&"number"==typeof i.detail.horizontalDistanceToText&&i.detail.horizontalDistanceToTextt.priority-e.priority)),this._startShowingAt(t[0],0,!1),!0)}startShowingAtRange(e,t,i){this._startShowingAt(new V2(0,e),t,i)}_startShowingAt(e,t,i){if(!this._computer.anchor||!this._computer.anchor.equals(e)){if(this._hoverOperation.cancel(),this._widget.position)if(this._computer.anchor&&e.canAdoptVisibleHover(this._computer.anchor,this._widget.position)){const t=this._messages.filter((t=>t.isValidForHoverAnchor(e)));if(0===t.length)this.hide();else{if(t.length===this._messages.length&&this._messagesAreComplete)return;this._renderMessages(e,t)}}else this.hide();this._computer.anchor=e,this._computer.shouldFocus=i,this._hoverOperation.start(t)}}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._widget.hide()}isColorPickerVisible(){return this._widget.isColorPickerVisible}_addLoadingMessage(e){if(this._computer.anchor)for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}return e}_withResult(e,t,i){this._messages=i?this._addLoadingMessage(e):e,this._messagesAreComplete=t,this._computer.anchor&&this._messages.length>0?this._renderMessages(this._computer.anchor,this._messages):t&&this.hide()}_renderMessages(t,i){let n=1073741824,o=i[0].range,s=null;for(const e of i)n=Math.min(n,e.range.startColumn),o=qo.plusRange(o,e.range),e.forceShowAtRange&&(s=e.range);const r=new Cs,a=r.add(new H3(this._keybindingService)),l=document.createDocumentFragment();let d=null;const h={fragment:l,statusBar:a,setColorPicker:e=>d=e,onContentsChanged:()=>this._widget.onContentsChanged(),hide:()=>this.hide()};for(const e of this._participants){const t=i.filter((t=>t.owner===e));t.length>0&&r.add(e.renderHoverParts(h,t))}if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const t=this._decorationsChangerListener.deltaDecorations([],[{range:o,options:e._DECORATION_OPTIONS}]);r.add(es((()=>{this._decorationsChangerListener.deltaDecorations(t,[])})))}this._widget.showAt(l,new V3(d,s?s.getStartPosition():new er(t.range.startLineNumber,n),s||o,this._editor.getOption(53).above,this._computer.shouldFocus,r))}else r.dispose()}};F3._DECORATION_OPTIONS=RP.register({description:"content-hover-highlight",className:"hoverHighlight"}),F3=A3([R3(1,n_),R3(2,uW)],F3);class B3 extends Uo{constructor(e){super(),this._editor=e,this._onDidChangeModelDecorations=this._register(new $o),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._isChangingDecorations=!1,this._register(this._editor.onDidChangeModelDecorations((e=>{this._isChangingDecorations||this._onDidChangeModelDecorations.fire(e)})))}deltaDecorations(e,t){try{return this._isChangingDecorations=!0,this._editor.deltaDecorations(e,t)}finally{this._isChangingDecorations=!1}}}class V3{constructor(e,t,i,n,o,s){this.colorPicker=e,this.showAtPosition=t,this.showAtRange=i,this.preferAbove=n,this.stoleFocus=o,this.disposables=s}}let W3=class e extends Uo{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this.allowEditorOverflow=!0,this._hoverVisibleKey=dI.hoverVisible.bindTo(this._contextKeyService),this._hover=this._register(new O2),this._visibleData=null,this._register(this._editor.onDidLayoutChange((()=>this._layout()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(44)&&this._updateFont()}))),this._setVisibleData(null),this._layout(),this._editor.addContentWidget(this)}get position(){var e,t;return null!==(t=null===(e=this._visibleData)||void 0===e?void 0:e.showAtPosition)&&void 0!==t?t:null}get isColorPickerVisible(){var e;return Boolean(null===(e=this._visibleData)||void 0===e?void 0:e.colorPicker)}dispose(){this._editor.removeContentWidget(this),this._visibleData&&this._visibleData.disposables.dispose(),super.dispose()}getId(){return e.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){if(!this._visibleData)return null;let e=this._visibleData.preferAbove;return!e&&this._contextKeyService.getContextKeyValue(y3.Visible.key)&&(e=!0),{position:this._visibleData.showAtPosition,range:this._visibleData.showAtRange,preference:e?[1,2]:[2,1]}}_setVisibleData(e){this._visibleData&&this._visibleData.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!this._visibleData),this._hover.containerDomNode.classList.toggle("hidden",!this._visibleData)}_layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:i}=this._editor.getOption(44);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=""+i/t,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(.66*this._editor.getLayoutInfo().width,500)}px`}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}showAt(e,t){this._setVisibleData(t),this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._hover.contentsDomNode.style.paddingBottom="",this._updateFont(),this._editor.layoutContentWidget(this),this.onContentsChanged(),this._editor.render(),this._editor.layoutContentWidget(this),this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),t.colorPicker&&t.colorPicker.layout()}hide(){if(this._visibleData){const e=this._visibleData.stoleFocus;this._setVisibleData(null),this._editor.layoutContentWidget(this),e&&this._editor.focus()}}onContentsChanged(){this._hover.onContentsChanged();const e=this._hover.scrollbar.getScrollDimensions();if(e.scrollWidth>e.width){const e=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;this._hover.contentsDomNode.style.paddingBottom!==e&&(this._hover.contentsDomNode.style.paddingBottom=e,this._editor.layoutContentWidget(this),this._hover.onContentsChanged())}}clear(){this._hover.contentsDomNode.textContent=""}};W3.ID="editor.contrib.contentHoverWidget",W3=A3([R3(1,Dy)],W3);let H3=class extends Uo{constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=P3("div.hover-row.status-bar"),this.actionsElement=Lw(this.hoverElement,P3("div.actions"))}get hasContent(){return this._hasContent}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(A2.render(this.actionsElement,e,i))}append(e){const t=Lw(this.actionsElement,e);return this._hasContent=!0,t}};H3=A3([R3(0,uW)],H3);class z3{constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1}get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}static _getLineDecorations(e,t){if(1!==t.type)return[];const i=e.getModel(),n=t.range.startLineNumber,o=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter((e=>{if(e.options.isWholeLine)return!0;const i=e.range.startLineNumber===n?e.range.startColumn:1,s=e.range.endLineNumber===n?e.range.endColumn:o;if(e.options.showIfCollapsed){if(i>t.range.startColumn+1||t.range.endColumn-1>s)return!1}else if(i>t.range.startColumn||t.range.endColumn>s)return!1;return!0}))}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Gv.EMPTY;const i=z3._getLineDecorations(this._editor,t);return Gv.merge(this._participants.map((n=>n.computeAsync?n.computeAsync(t,i,e):Gv.EMPTY)))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=z3._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return xa(t)}} /*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */var j3=Object.hasOwnProperty,U3=Object.setPrototypeOf,$3=Object.isFrozen,K3=Object.getPrototypeOf,q3=Object.getOwnPropertyDescriptor,G3=Object.freeze,Z3=Object.seal,Y3=Object.create,X3="undefined"!=typeof Reflect&&Reflect,Q3=X3.apply,J3=X3.construct;Q3||(Q3=function(e,t,i){return e.apply(t,i)}),G3||(G3=function(e){return e}),Z3||(Z3=function(e){return e}),J3||(J3=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t1?i-1:0),o=1;o/gm),E5=Z3(/^data-[\-\w.\u00B7-\uFFFF]/),N5=Z3(/^aria-[\-\w]+$/),I5=Z3(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),T5=Z3(/^(?:\w+script|data):/i),M5=Z3(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),O5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function A5(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:R5(),i=function(t){return e(t)};if(i.version="2.3.1",i.removed=[],!t||!t.document||9!==t.document.nodeType)return i.isSupported=!1,i;var n=t.document,o=t.document,s=t.DocumentFragment,r=t.HTMLTemplateElement,a=t.Node,l=t.Element,d=t.NodeFilter,h=t.NamedNodeMap,c=void 0===h?t.NamedNodeMap||t.MozNamedAttrMap:h,u=t.Text,g=t.Comment,p=t.DOMParser,m=t.trustedTypes,f=l.prototype,_=p5(f,"cloneNode"),v=p5(f,"nextSibling"),b=p5(f,"childNodes"),C=p5(f,"parentNode");if("function"==typeof r){var w=o.createElement("template");w.content&&w.content.ownerDocument&&(o=w.content.ownerDocument)}var y=P5(m,n),S=y&&te?y.createHTML(""):"",x=o,k=x.implementation,L=x.createNodeIterator,D=x.createDocumentFragment,E=x.getElementsByTagName,N=n.importNode,I={};try{I=g5(o).documentMode?o.documentMode:{}}catch(Pe){}var T={};i.isSupported="function"==typeof C&&k&&void 0!==k.createHTMLDocument&&9!==I;var M=L5,O=D5,A=E5,R=N5,P=T5,F=M5,B=I5,V=null,W=u5({},[].concat(A5(m5),A5(f5),A5(_5),A5(b5),A5(w5))),H=null,z=u5({},[].concat(A5(y5),A5(S5),A5(x5),A5(k5))),j=null,U=null,$=!0,K=!0,q=!1,G=!1,Z=!1,Y=!1,X=!1,Q=!1,J=!1,ee=!0,te=!1,ie=!0,ne=!0,oe=!1,se={},re=null,ae=u5({},["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"]),le=null,de=u5({},["audio","video","img","source","image","track"]),he=null,ce=u5({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",me=pe,fe=!1,_e=null,ve=o.createElement("form"),be=function(e){_e&&_e===e||(e&&"object"===(void 0===e?"undefined":O5(e))||(e={}),e=g5(e),V="ALLOWED_TAGS"in e?u5({},e.ALLOWED_TAGS):W,H="ALLOWED_ATTR"in e?u5({},e.ALLOWED_ATTR):z,he="ADD_URI_SAFE_ATTR"in e?u5(g5(ce),e.ADD_URI_SAFE_ATTR):ce,le="ADD_DATA_URI_TAGS"in e?u5(g5(de),e.ADD_DATA_URI_TAGS):de,re="FORBID_CONTENTS"in e?u5({},e.FORBID_CONTENTS):ae,j="FORBID_TAGS"in e?u5({},e.FORBID_TAGS):{},U="FORBID_ATTR"in e?u5({},e.FORBID_ATTR):{},se="USE_PROFILES"in e&&e.USE_PROFILES,$=!1!==e.ALLOW_ARIA_ATTR,K=!1!==e.ALLOW_DATA_ATTR,q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=e.SAFE_FOR_TEMPLATES||!1,Z=e.WHOLE_DOCUMENT||!1,Q=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,ee=!1!==e.RETURN_DOM_IMPORT,te=e.RETURN_TRUSTED_TYPE||!1,X=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,oe=e.IN_PLACE||!1,B=e.ALLOWED_URI_REGEXP||B,me=e.NAMESPACE||pe,G&&(K=!1),J&&(Q=!0),se&&(V=u5({},[].concat(A5(w5))),H=[],!0===se.html&&(u5(V,m5),u5(H,y5)),!0===se.svg&&(u5(V,f5),u5(H,S5),u5(H,k5)),!0===se.svgFilters&&(u5(V,_5),u5(H,S5),u5(H,k5)),!0===se.mathMl&&(u5(V,b5),u5(H,x5),u5(H,k5))),e.ADD_TAGS&&(V===W&&(V=g5(V)),u5(V,e.ADD_TAGS)),e.ADD_ATTR&&(H===z&&(H=g5(H)),u5(H,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&u5(he,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(re===ae&&(re=g5(re)),u5(re,e.FORBID_CONTENTS)),ne&&(V["#text"]=!0),Z&&u5(V,["html","head","body"]),V.table&&(u5(V,["tbody"]),delete j.tbody),G3&&G3(e),_e=e)},Ce=u5({},["mi","mo","mn","ms","mtext"]),we=u5({},["foreignobject","desc","title","annotation-xml"]),ye=u5({},f5);u5(ye,_5),u5(ye,v5);var Se=u5({},b5);u5(Se,C5);var xe=function(e){var t=C(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});var i=o5(e.tagName),n=o5(t.tagName);if(e.namespaceURI===ge)return t.namespaceURI===pe?"svg"===i:t.namespaceURI===ue?"svg"===i&&("annotation-xml"===n||Ce[n]):Boolean(ye[i]);if(e.namespaceURI===ue)return t.namespaceURI===pe?"math"===i:t.namespaceURI===ge?"math"===i&&we[n]:Boolean(Se[i]);if(e.namespaceURI===pe){if(t.namespaceURI===ge&&!we[n])return!1;if(t.namespaceURI===ue&&!Ce[n])return!1;var o=u5({},["title","style","font","a","script"]);return!Se[i]&&(o[i]||!ye[i])}return!1},ke=function(e){n5(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Pe){try{e.outerHTML=S}catch(t){e.remove()}}},Le=function(e,t){try{n5(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(Pe){n5(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!H[e])if(Q||J)try{ke(t)}catch(Pe){}else try{t.setAttribute(e,"")}catch(Pe){}},De=function(e){var t=void 0,i=void 0;if(X)e=""+e;else{var n=s5(e,/^[\r\n\t ]+/);i=n&&n[0]}var s=y?y.createHTML(e):e;if(me===pe)try{t=(new p).parseFromString(s,"text/html")}catch(Pe){}if(!t||!t.documentElement){t=k.createDocument(me,"template",null);try{t.documentElement.innerHTML=fe?"":s}catch(Pe){}}var r=t.body||t.documentElement;return e&&i&&r.insertBefore(o.createTextNode(i),r.childNodes[0]||null),me===pe?E.call(t,Z?"html":"body")[0]:Z?t.documentElement:r},Ee=function(e){return L.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Ne=function(e){return!(e instanceof u||e instanceof g)&&!("string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof c&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},Ie=function(e){return"object"===(void 0===a?"undefined":O5(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":O5(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Te=function(e,t,n){T[e]&&t5(T[e],(function(e){e.call(i,t,n,_e)}))},Me=function(e){var t=void 0;if(Te("beforeSanitizeElements",e,null),Ne(e))return ke(e),!0;if(s5(e.nodeName,/[\u0080-\uFFFF]/))return ke(e),!0;var n=o5(e.nodeName);if(Te("uponSanitizeElement",e,{tagName:n,allowedTags:V}),!Ie(e.firstElementChild)&&(!Ie(e.content)||!Ie(e.content.firstElementChild))&&d5(/<[/\w]/g,e.innerHTML)&&d5(/<[/\w]/g,e.textContent))return ke(e),!0;if("select"===n&&d5(/